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

// PaymentsGetStarsTopupOptionsRequest represents TL type `payments.getStarsTopupOptions#c00ec7d3`.
// Obtain a list of Telegram Stars topup options »¹ as starsTopupOption² constructors.
//
// Links:
//  1. https://core.telegram.org/api/stars#buying-or-gifting-stars
//  2. https://core.telegram.org/constructor/starsTopupOption
//
// See https://core.telegram.org/method/payments.getStarsTopupOptions for reference.
type PaymentsGetStarsTopupOptionsRequest struct {
}

// PaymentsGetStarsTopupOptionsRequestTypeID is TL type id of PaymentsGetStarsTopupOptionsRequest.
const PaymentsGetStarsTopupOptionsRequestTypeID = 0xc00ec7d3

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

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

	return true
}

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

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

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

// TypeInfo returns info about TL type.
func ( *PaymentsGetStarsTopupOptionsRequest) () tdp.Type {
	 := tdp.Type{
		Name: "payments.getStarsTopupOptions",
		ID:   PaymentsGetStarsTopupOptionsRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{}
	return 
}

// Encode implements bin.Encoder.
func ( *PaymentsGetStarsTopupOptionsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode payments.getStarsTopupOptions#c00ec7d3 as nil")
	}
	.PutID(PaymentsGetStarsTopupOptionsRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *PaymentsGetStarsTopupOptionsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode payments.getStarsTopupOptions#c00ec7d3 as nil")
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *PaymentsGetStarsTopupOptionsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode payments.getStarsTopupOptions#c00ec7d3 to nil")
	}
	return nil
}

// PaymentsGetStarsTopupOptions invokes method payments.getStarsTopupOptions#c00ec7d3 returning error if any.
// Obtain a list of Telegram Stars topup options »¹ as starsTopupOption² constructors.
//
// Links:
//  1. https://core.telegram.org/api/stars#buying-or-gifting-stars
//  2. https://core.telegram.org/constructor/starsTopupOption
//
// See https://core.telegram.org/method/payments.getStarsTopupOptions for reference.
func ( *Client) ( context.Context) ([]StarsTopupOption, error) {
	var  StarsTopupOptionVector

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