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

// BotsGetAccessSettingsRequest represents TL type `bots.getAccessSettings#213853a3`.
//
// See https://core.telegram.org/method/bots.getAccessSettings for reference.
type BotsGetAccessSettingsRequest struct {
	// Bot field of BotsGetAccessSettingsRequest.
	Bot InputUserClass
}

// BotsGetAccessSettingsRequestTypeID is TL type id of BotsGetAccessSettingsRequest.
const BotsGetAccessSettingsRequestTypeID = 0x213853a3

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

func ( *BotsGetAccessSettingsRequest) () bool {
	if  == nil {
		return true
	}
	if !(.Bot == nil) {
		return false
	}

	return true
}

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

// FillFrom fills BotsGetAccessSettingsRequest from given interface.
func ( *BotsGetAccessSettingsRequest) ( interface {
	() ( InputUserClass)
}) {
	.Bot = .()
}

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

// TypeName returns name of type in TL schema.
func (*BotsGetAccessSettingsRequest) () string {
	return "bots.getAccessSettings"
}

// TypeInfo returns info about TL type.
func ( *BotsGetAccessSettingsRequest) () tdp.Type {
	 := tdp.Type{
		Name: "bots.getAccessSettings",
		ID:   BotsGetAccessSettingsRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Bot",
			SchemaName: "bot",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *BotsGetAccessSettingsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode bots.getAccessSettings#213853a3 as nil")
	}
	.PutID(BotsGetAccessSettingsRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *BotsGetAccessSettingsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode bots.getAccessSettings#213853a3 as nil")
	}
	if .Bot == nil {
		return fmt.Errorf("unable to encode bots.getAccessSettings#213853a3: field bot is nil")
	}
	if  := .Bot.Encode();  != nil {
		return fmt.Errorf("unable to encode bots.getAccessSettings#213853a3: field bot: %w", )
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *BotsGetAccessSettingsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode bots.getAccessSettings#213853a3 to nil")
	}
	if  := .ConsumeID(BotsGetAccessSettingsRequestTypeID);  != nil {
		return fmt.Errorf("unable to decode bots.getAccessSettings#213853a3: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *BotsGetAccessSettingsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode bots.getAccessSettings#213853a3 to nil")
	}
	{
		,  := DecodeInputUser()
		if  != nil {
			return fmt.Errorf("unable to decode bots.getAccessSettings#213853a3: field bot: %w", )
		}
		.Bot = 
	}
	return nil
}

// GetBot returns value of Bot field.
func ( *BotsGetAccessSettingsRequest) () ( InputUserClass) {
	if  == nil {
		return
	}
	return .Bot
}

// BotsGetAccessSettings invokes method bots.getAccessSettings#213853a3 returning error if any.
//
// See https://core.telegram.org/method/bots.getAccessSettings for reference.
func ( *Client) ( context.Context,  InputUserClass) (*BotsAccessSettings, error) {
	var  BotsAccessSettings

	 := &BotsGetAccessSettingsRequest{
		Bot: ,
	}
	if  := .rpc.Invoke(, , &);  != nil {
		return nil, 
	}
	return &, nil
}