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

// AuthInitFirebasePnvLoginRequest represents TL type `auth.initFirebasePnvLogin#644f15c0`.
//
// See https://core.telegram.org/method/auth.initFirebasePnvLogin for reference.
type AuthInitFirebasePnvLoginRequest struct {
	// Flags field of AuthInitFirebasePnvLoginRequest.
	Flags bin.Fields
	// ExceptIDs field of AuthInitFirebasePnvLoginRequest.
	//
	// Use SetExceptIDs and GetExceptIDs helpers.
	ExceptIDs []int64
	// APIID field of AuthInitFirebasePnvLoginRequest.
	APIID int
	// APIHash field of AuthInitFirebasePnvLoginRequest.
	APIHash string
}

// AuthInitFirebasePnvLoginRequestTypeID is TL type id of AuthInitFirebasePnvLoginRequest.
const AuthInitFirebasePnvLoginRequestTypeID = 0x644f15c0

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

func ( *AuthInitFirebasePnvLoginRequest) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.ExceptIDs == nil) {
		return false
	}
	if !(.APIID == 0) {
		return false
	}
	if !(.APIHash == "") {
		return false
	}

	return true
}

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

// FillFrom fills AuthInitFirebasePnvLoginRequest from given interface.
func ( *AuthInitFirebasePnvLoginRequest) ( interface {
	() ( []int64,  bool)
	() ( int)
	() ( string)
}) {
	if ,  := .();  {
		.ExceptIDs = 
	}

	.APIID = .()
	.APIHash = .()
}

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

// TypeName returns name of type in TL schema.
func (*AuthInitFirebasePnvLoginRequest) () string {
	return "auth.initFirebasePnvLogin"
}

// TypeInfo returns info about TL type.
func ( *AuthInitFirebasePnvLoginRequest) () tdp.Type {
	 := tdp.Type{
		Name: "auth.initFirebasePnvLogin",
		ID:   AuthInitFirebasePnvLoginRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ExceptIDs",
			SchemaName: "except_ids",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "APIID",
			SchemaName: "api_id",
		},
		{
			Name:       "APIHash",
			SchemaName: "api_hash",
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *AuthInitFirebasePnvLoginRequest) () {
	if !(.ExceptIDs == nil) {
		.Flags.Set(0)
	}
}

// Encode implements bin.Encoder.
func ( *AuthInitFirebasePnvLoginRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode auth.initFirebasePnvLogin#644f15c0 as nil")
	}
	.PutID(AuthInitFirebasePnvLoginRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *AuthInitFirebasePnvLoginRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode auth.initFirebasePnvLogin#644f15c0 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode auth.initFirebasePnvLogin#644f15c0: field flags: %w", )
	}
	if .Flags.Has(0) {
		.PutVectorHeader(len(.ExceptIDs))
		for ,  := range .ExceptIDs {
			.PutLong()
		}
	}
	.PutInt(.APIID)
	.PutString(.APIHash)
	return nil
}

// Decode implements bin.Decoder.
func ( *AuthInitFirebasePnvLoginRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode auth.initFirebasePnvLogin#644f15c0 to nil")
	}
	if  := .ConsumeID(AuthInitFirebasePnvLoginRequestTypeID);  != nil {
		return fmt.Errorf("unable to decode auth.initFirebasePnvLogin#644f15c0: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *AuthInitFirebasePnvLoginRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode auth.initFirebasePnvLogin#644f15c0 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode auth.initFirebasePnvLogin#644f15c0: field flags: %w", )
		}
	}
	if .Flags.Has(0) {
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode auth.initFirebasePnvLogin#644f15c0: field except_ids: %w", )
		}

		if  > 0 {
			.ExceptIDs = make([]int64, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := .Long()
			if  != nil {
				return fmt.Errorf("unable to decode auth.initFirebasePnvLogin#644f15c0: field except_ids: %w", )
			}
			.ExceptIDs = append(.ExceptIDs, )
		}
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode auth.initFirebasePnvLogin#644f15c0: field api_id: %w", )
		}
		.APIID = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode auth.initFirebasePnvLogin#644f15c0: field api_hash: %w", )
		}
		.APIHash = 
	}
	return nil
}

// SetExceptIDs sets value of ExceptIDs conditional field.
func ( *AuthInitFirebasePnvLoginRequest) ( []int64) {
	.Flags.Set(0)
	.ExceptIDs = 
}

// GetExceptIDs returns value of ExceptIDs conditional field and
// boolean which is true if field was set.
func ( *AuthInitFirebasePnvLoginRequest) () ( []int64,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(0) {
		return , false
	}
	return .ExceptIDs, true
}

// GetAPIID returns value of APIID field.
func ( *AuthInitFirebasePnvLoginRequest) () ( int) {
	if  == nil {
		return
	}
	return .APIID
}

// GetAPIHash returns value of APIHash field.
func ( *AuthInitFirebasePnvLoginRequest) () ( string) {
	if  == nil {
		return
	}
	return .APIHash
}

// AuthInitFirebasePnvLogin invokes method auth.initFirebasePnvLogin#644f15c0 returning error if any.
//
// See https://core.telegram.org/method/auth.initFirebasePnvLogin for reference.
func ( *Client) ( context.Context,  *AuthInitFirebasePnvLoginRequest) (*AuthFirebasePnvIntent, error) {
	var  AuthFirebasePnvIntent

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