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

// AccountInitPasskeyRegistrationRequest represents TL type `account.initPasskeyRegistration#429547e8`.
// Initialize passkey registration for the current account, see here »¹ for more info
// on the full flow.
//
// Links:
//  1. https://core.telegram.org/api/passkeys#creating-a-passkey
//
// See https://core.telegram.org/method/account.initPasskeyRegistration for reference.
type AccountInitPasskeyRegistrationRequest struct {
}

// AccountInitPasskeyRegistrationRequestTypeID is TL type id of AccountInitPasskeyRegistrationRequest.
const AccountInitPasskeyRegistrationRequestTypeID = 0x429547e8

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

func ( *AccountInitPasskeyRegistrationRequest) () bool {
	if  == nil {
		return true
	}

	return true
}

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

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

// TypeName returns name of type in TL schema.
func (*AccountInitPasskeyRegistrationRequest) () string {
	return "account.initPasskeyRegistration"
}

// TypeInfo returns info about TL type.
func ( *AccountInitPasskeyRegistrationRequest) () tdp.Type {
	 := tdp.Type{
		Name: "account.initPasskeyRegistration",
		ID:   AccountInitPasskeyRegistrationRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{}
	return 
}

// Encode implements bin.Encoder.
func ( *AccountInitPasskeyRegistrationRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode account.initPasskeyRegistration#429547e8 as nil")
	}
	.PutID(AccountInitPasskeyRegistrationRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *AccountInitPasskeyRegistrationRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode account.initPasskeyRegistration#429547e8 as nil")
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *AccountInitPasskeyRegistrationRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode account.initPasskeyRegistration#429547e8 to nil")
	}
	if  := .ConsumeID(AccountInitPasskeyRegistrationRequestTypeID);  != nil {
		return fmt.Errorf("unable to decode account.initPasskeyRegistration#429547e8: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *AccountInitPasskeyRegistrationRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode account.initPasskeyRegistration#429547e8 to nil")
	}
	return nil
}

// AccountInitPasskeyRegistration invokes method account.initPasskeyRegistration#429547e8 returning error if any.
// Initialize passkey registration for the current account, see here »¹ for more info
// on the full flow.
//
// Links:
//  1. https://core.telegram.org/api/passkeys#creating-a-passkey
//
// Possible errors:
//
//	403 ACCESS_DENIED:
//
// See https://core.telegram.org/method/account.initPasskeyRegistration for reference.
func ( *Client) ( context.Context) (*AccountPasskeyRegistrationOptions, error) {
	var  AccountPasskeyRegistrationOptions

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