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

// HelpGetPassportConfigRequest represents TL type `help.getPassportConfig#c661ad08`.
// Get passportĀ¹ configuration
//
// Links:
//  1. https://core.telegram.org/passport
//
// See https://core.telegram.org/method/help.getPassportConfig for reference.
type HelpGetPassportConfigRequest struct {
	// Hash for pagination, for more info click hereĀ¹
	//
	// Links:
	//  1) https://core.telegram.org/api/offsets#hash-generation
	Hash int
}

// HelpGetPassportConfigRequestTypeID is TL type id of HelpGetPassportConfigRequest.
const HelpGetPassportConfigRequestTypeID = 0xc661ad08

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

func ( *HelpGetPassportConfigRequest) () bool {
	if  == nil {
		return true
	}
	if !(.Hash == 0) {
		return false
	}

	return true
}

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

// FillFrom fills HelpGetPassportConfigRequest from given interface.
func ( *HelpGetPassportConfigRequest) ( interface {
	() ( int)
}) {
	.Hash = .()
}

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

// TypeName returns name of type in TL schema.
func (*HelpGetPassportConfigRequest) () string {
	return "help.getPassportConfig"
}

// TypeInfo returns info about TL type.
func ( *HelpGetPassportConfigRequest) () tdp.Type {
	 := tdp.Type{
		Name: "help.getPassportConfig",
		ID:   HelpGetPassportConfigRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Hash",
			SchemaName: "hash",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *HelpGetPassportConfigRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode help.getPassportConfig#c661ad08 as nil")
	}
	.PutID(HelpGetPassportConfigRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *HelpGetPassportConfigRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode help.getPassportConfig#c661ad08 as nil")
	}
	.PutInt(.Hash)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *HelpGetPassportConfigRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode help.getPassportConfig#c661ad08 to nil")
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode help.getPassportConfig#c661ad08: field hash: %w", )
		}
		.Hash = 
	}
	return nil
}

// GetHash returns value of Hash field.
func ( *HelpGetPassportConfigRequest) () ( int) {
	if  == nil {
		return
	}
	return .Hash
}

// HelpGetPassportConfig invokes method help.getPassportConfig#c661ad08 returning error if any.
// Get passportĀ¹ configuration
//
// Links:
//  1. https://core.telegram.org/passport
//
// See https://core.telegram.org/method/help.getPassportConfig for reference.
func ( *Client) ( context.Context,  int) (HelpPassportConfigClass, error) {
	var  HelpPassportConfigBox

	 := &HelpGetPassportConfigRequest{
		Hash: ,
	}
	if  := .rpc.Invoke(, , &);  != nil {
		return nil, 
	}
	return .PassportConfig, nil
}