// 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{}
)

// BotVerification represents TL type `botVerification#f93cd45c`.
// Describes a bot verification icon »¹.
//
// Links:
//  1. https://core.telegram.org/api/bots/verification
//
// See https://core.telegram.org/constructor/botVerification for reference.
type BotVerification struct {
	// ID of the bot that verified this peer
	BotID int64
	// Verification icon
	Icon int64
	// Verification description
	Description string
}

// BotVerificationTypeID is TL type id of BotVerification.
const BotVerificationTypeID = 0xf93cd45c

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

func ( *BotVerification) () bool {
	if  == nil {
		return true
	}
	if !(.BotID == 0) {
		return false
	}
	if !(.Icon == 0) {
		return false
	}
	if !(.Description == "") {
		return false
	}

	return true
}

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

// FillFrom fills BotVerification from given interface.
func ( *BotVerification) ( interface {
	() ( int64)
	() ( int64)
	() ( string)
}) {
	.BotID = .()
	.Icon = .()
	.Description = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *BotVerification) () tdp.Type {
	 := tdp.Type{
		Name: "botVerification",
		ID:   BotVerificationTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "BotID",
			SchemaName: "bot_id",
		},
		{
			Name:       "Icon",
			SchemaName: "icon",
		},
		{
			Name:       "Description",
			SchemaName: "description",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *BotVerification) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode botVerification#f93cd45c as nil")
	}
	.PutID(BotVerificationTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *BotVerification) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode botVerification#f93cd45c as nil")
	}
	.PutLong(.BotID)
	.PutLong(.Icon)
	.PutString(.Description)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *BotVerification) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode botVerification#f93cd45c to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode botVerification#f93cd45c: field bot_id: %w", )
		}
		.BotID = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode botVerification#f93cd45c: field icon: %w", )
		}
		.Icon = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode botVerification#f93cd45c: field description: %w", )
		}
		.Description = 
	}
	return nil
}

// GetBotID returns value of BotID field.
func ( *BotVerification) () ( int64) {
	if  == nil {
		return
	}
	return .BotID
}

// GetIcon returns value of Icon field.
func ( *BotVerification) () ( int64) {
	if  == nil {
		return
	}
	return .Icon
}

// GetDescription returns value of Description field.
func ( *BotVerification) () ( string) {
	if  == nil {
		return
	}
	return .Description
}