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

// AttachMenuBotIconColor represents TL type `attachMenuBotIconColor#4576f3f0`.
// Represents an attachment menu icon color for bot mini apps »¹
//
// Links:
//  1. https://core.telegram.org/api/bots/attach
//
// See https://core.telegram.org/constructor/attachMenuBotIconColor for reference.
type AttachMenuBotIconColor struct {
	// One of the following values: light_icon - Color of the attachment menu icon (light
	// mode) light_text - Color of the attachment menu label, once selected (light mode)
	// dark_icon - Color of the attachment menu icon (dark mode) dark_text - Color of the
	// attachment menu label, once selected (dark mode)
	Name string
	// Color in RGB24 format
	Color int
}

// AttachMenuBotIconColorTypeID is TL type id of AttachMenuBotIconColor.
const AttachMenuBotIconColorTypeID = 0x4576f3f0

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

func ( *AttachMenuBotIconColor) () bool {
	if  == nil {
		return true
	}
	if !(.Name == "") {
		return false
	}
	if !(.Color == 0) {
		return false
	}

	return true
}

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

// FillFrom fills AttachMenuBotIconColor from given interface.
func ( *AttachMenuBotIconColor) ( interface {
	() ( string)
	() ( int)
}) {
	.Name = .()
	.Color = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *AttachMenuBotIconColor) () tdp.Type {
	 := tdp.Type{
		Name: "attachMenuBotIconColor",
		ID:   AttachMenuBotIconColorTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Name",
			SchemaName: "name",
		},
		{
			Name:       "Color",
			SchemaName: "color",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *AttachMenuBotIconColor) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode attachMenuBotIconColor#4576f3f0 as nil")
	}
	.PutID(AttachMenuBotIconColorTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *AttachMenuBotIconColor) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode attachMenuBotIconColor#4576f3f0 as nil")
	}
	.PutString(.Name)
	.PutInt(.Color)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *AttachMenuBotIconColor) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode attachMenuBotIconColor#4576f3f0 to nil")
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode attachMenuBotIconColor#4576f3f0: field name: %w", )
		}
		.Name = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode attachMenuBotIconColor#4576f3f0: field color: %w", )
		}
		.Color = 
	}
	return nil
}

// GetName returns value of Name field.
func ( *AttachMenuBotIconColor) () ( string) {
	if  == nil {
		return
	}
	return .Name
}

// GetColor returns value of Color field.
func ( *AttachMenuBotIconColor) () ( int) {
	if  == nil {
		return
	}
	return .Color
}