// Code generated by gotdgen, DO NOT EDIT.

package tg

import (
	
	
	
	
	

	

	
	
	
	
)

// No-op definition for keeping imports.
var (
	_ = bin.Buffer{}
	_ = context.Background()
	_ = fmt.Stringer(nil)
	_ = strings.Builder{}
	_ = errors.Is
	_ = multierr.AppendInto
	_ = sort.Ints
	_ = tdp.Format
	_ = tgerr.Error{}
	_ = tdjson.Encoder{}
)

// AiComposeToneExample represents TL type `aiComposeToneExample#f1d628ec`.
//
// See https://core.telegram.org/constructor/aiComposeToneExample for reference.
type AiComposeToneExample struct {
	// From field of AiComposeToneExample.
	From TextWithEntities
	// To field of AiComposeToneExample.
	To TextWithEntities
}

// AiComposeToneExampleTypeID is TL type id of AiComposeToneExample.
const AiComposeToneExampleTypeID = 0xf1d628ec

// Ensuring interfaces in compile-time for AiComposeToneExample.
var (
	_ bin.Encoder     = &AiComposeToneExample{}
	_ bin.Decoder     = &AiComposeToneExample{}
	_ bin.BareEncoder = &AiComposeToneExample{}
	_ bin.BareDecoder = &AiComposeToneExample{}
)

func ( *AiComposeToneExample) () bool {
	if  == nil {
		return true
	}
	if !(.From.Zero()) {
		return false
	}
	if !(.To.Zero()) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *AiComposeToneExample) () string {
	if  == nil {
		return "AiComposeToneExample(nil)"
	}
	type  AiComposeToneExample
	return fmt.Sprintf("AiComposeToneExample%+v", (*))
}

// FillFrom fills AiComposeToneExample from given interface.
func ( *AiComposeToneExample) ( interface {
	() ( TextWithEntities)
	() ( TextWithEntities)
}) {
	.From = .()
	.To = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*AiComposeToneExample) () uint32 {
	return AiComposeToneExampleTypeID
}

// TypeName returns name of type in TL schema.
func (*AiComposeToneExample) () string {
	return "aiComposeToneExample"
}

// TypeInfo returns info about TL type.
func ( *AiComposeToneExample) () tdp.Type {
	 := tdp.Type{
		Name: "aiComposeToneExample",
		ID:   AiComposeToneExampleTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "From",
			SchemaName: "from",
		},
		{
			Name:       "To",
			SchemaName: "to",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *AiComposeToneExample) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode aiComposeToneExample#f1d628ec as nil")
	}
	.PutID(AiComposeToneExampleTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *AiComposeToneExample) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode aiComposeToneExample#f1d628ec as nil")
	}
	if  := .From.Encode();  != nil {
		return fmt.Errorf("unable to encode aiComposeToneExample#f1d628ec: field from: %w", )
	}
	if  := .To.Encode();  != nil {
		return fmt.Errorf("unable to encode aiComposeToneExample#f1d628ec: field to: %w", )
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *AiComposeToneExample) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode aiComposeToneExample#f1d628ec to nil")
	}
	if  := .ConsumeID(AiComposeToneExampleTypeID);  != nil {
		return fmt.Errorf("unable to decode aiComposeToneExample#f1d628ec: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *AiComposeToneExample) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode aiComposeToneExample#f1d628ec to nil")
	}
	{
		if  := .From.Decode();  != nil {
			return fmt.Errorf("unable to decode aiComposeToneExample#f1d628ec: field from: %w", )
		}
	}
	{
		if  := .To.Decode();  != nil {
			return fmt.Errorf("unable to decode aiComposeToneExample#f1d628ec: field to: %w", )
		}
	}
	return nil
}

// GetFrom returns value of From field.
func ( *AiComposeToneExample) () ( TextWithEntities) {
	if  == nil {
		return
	}
	return .From
}

// GetTo returns value of To field.
func ( *AiComposeToneExample) () ( TextWithEntities) {
	if  == nil {
		return
	}
	return .To
}