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

// PaymentsGetOnrampBaseCurrenciesRequest represents TL type `payments.getOnrampBaseCurrencies#1c8bedf3`.
//
// See https://core.telegram.org/method/payments.getOnrampBaseCurrencies for reference.
type PaymentsGetOnrampBaseCurrenciesRequest struct {
	// Provider field of PaymentsGetOnrampBaseCurrenciesRequest.
	Provider string
	// CryptoCurrency field of PaymentsGetOnrampBaseCurrenciesRequest.
	CryptoCurrency string
}

// PaymentsGetOnrampBaseCurrenciesRequestTypeID is TL type id of PaymentsGetOnrampBaseCurrenciesRequest.
const PaymentsGetOnrampBaseCurrenciesRequestTypeID = 0x1c8bedf3

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

func ( *PaymentsGetOnrampBaseCurrenciesRequest) () bool {
	if  == nil {
		return true
	}
	if !(.Provider == "") {
		return false
	}
	if !(.CryptoCurrency == "") {
		return false
	}

	return true
}

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

// FillFrom fills PaymentsGetOnrampBaseCurrenciesRequest from given interface.
func ( *PaymentsGetOnrampBaseCurrenciesRequest) ( interface {
	() ( string)
	() ( string)
}) {
	.Provider = .()
	.CryptoCurrency = .()
}

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

// TypeName returns name of type in TL schema.
func (*PaymentsGetOnrampBaseCurrenciesRequest) () string {
	return "payments.getOnrampBaseCurrencies"
}

// TypeInfo returns info about TL type.
func ( *PaymentsGetOnrampBaseCurrenciesRequest) () tdp.Type {
	 := tdp.Type{
		Name: "payments.getOnrampBaseCurrencies",
		ID:   PaymentsGetOnrampBaseCurrenciesRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Provider",
			SchemaName: "provider",
		},
		{
			Name:       "CryptoCurrency",
			SchemaName: "crypto_currency",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *PaymentsGetOnrampBaseCurrenciesRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode payments.getOnrampBaseCurrencies#1c8bedf3 as nil")
	}
	.PutID(PaymentsGetOnrampBaseCurrenciesRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *PaymentsGetOnrampBaseCurrenciesRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode payments.getOnrampBaseCurrencies#1c8bedf3 as nil")
	}
	.PutString(.Provider)
	.PutString(.CryptoCurrency)
	return nil
}

// Decode implements bin.Decoder.
func ( *PaymentsGetOnrampBaseCurrenciesRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode payments.getOnrampBaseCurrencies#1c8bedf3 to nil")
	}
	if  := .ConsumeID(PaymentsGetOnrampBaseCurrenciesRequestTypeID);  != nil {
		return fmt.Errorf("unable to decode payments.getOnrampBaseCurrencies#1c8bedf3: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *PaymentsGetOnrampBaseCurrenciesRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode payments.getOnrampBaseCurrencies#1c8bedf3 to nil")
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode payments.getOnrampBaseCurrencies#1c8bedf3: field provider: %w", )
		}
		.Provider = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode payments.getOnrampBaseCurrencies#1c8bedf3: field crypto_currency: %w", )
		}
		.CryptoCurrency = 
	}
	return nil
}

// GetProvider returns value of Provider field.
func ( *PaymentsGetOnrampBaseCurrenciesRequest) () ( string) {
	if  == nil {
		return
	}
	return .Provider
}

// GetCryptoCurrency returns value of CryptoCurrency field.
func ( *PaymentsGetOnrampBaseCurrenciesRequest) () ( string) {
	if  == nil {
		return
	}
	return .CryptoCurrency
}

// PaymentsGetOnrampBaseCurrencies invokes method payments.getOnrampBaseCurrencies#1c8bedf3 returning error if any.
//
// See https://core.telegram.org/method/payments.getOnrampBaseCurrencies for reference.
func ( *Client) ( context.Context,  *PaymentsGetOnrampBaseCurrenciesRequest) ([]string, error) {
	var  StringVector

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