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

// PremiumGetBoostsStatusRequest represents TL type `premium.getBoostsStatus#42f1f61`.
// Gets the current number of boosts¹ of a channel.
//
// Links:
//  1. https://core.telegram.org/api/boost
//
// See https://core.telegram.org/method/premium.getBoostsStatus for reference.
type PremiumGetBoostsStatusRequest struct {
	// The peer.
	Peer InputPeerClass
}

// PremiumGetBoostsStatusRequestTypeID is TL type id of PremiumGetBoostsStatusRequest.
const PremiumGetBoostsStatusRequestTypeID = 0x42f1f61

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

func ( *PremiumGetBoostsStatusRequest) () bool {
	if  == nil {
		return true
	}
	if !(.Peer == nil) {
		return false
	}

	return true
}

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

// FillFrom fills PremiumGetBoostsStatusRequest from given interface.
func ( *PremiumGetBoostsStatusRequest) ( interface {
	() ( InputPeerClass)
}) {
	.Peer = .()
}

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

// TypeName returns name of type in TL schema.
func (*PremiumGetBoostsStatusRequest) () string {
	return "premium.getBoostsStatus"
}

// TypeInfo returns info about TL type.
func ( *PremiumGetBoostsStatusRequest) () tdp.Type {
	 := tdp.Type{
		Name: "premium.getBoostsStatus",
		ID:   PremiumGetBoostsStatusRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Peer",
			SchemaName: "peer",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *PremiumGetBoostsStatusRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode premium.getBoostsStatus#42f1f61 as nil")
	}
	.PutID(PremiumGetBoostsStatusRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *PremiumGetBoostsStatusRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode premium.getBoostsStatus#42f1f61 as nil")
	}
	if .Peer == nil {
		return fmt.Errorf("unable to encode premium.getBoostsStatus#42f1f61: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode premium.getBoostsStatus#42f1f61: field peer: %w", )
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *PremiumGetBoostsStatusRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode premium.getBoostsStatus#42f1f61 to nil")
	}
	if  := .ConsumeID(PremiumGetBoostsStatusRequestTypeID);  != nil {
		return fmt.Errorf("unable to decode premium.getBoostsStatus#42f1f61: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *PremiumGetBoostsStatusRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode premium.getBoostsStatus#42f1f61 to nil")
	}
	{
		,  := DecodeInputPeer()
		if  != nil {
			return fmt.Errorf("unable to decode premium.getBoostsStatus#42f1f61: field peer: %w", )
		}
		.Peer = 
	}
	return nil
}

// GetPeer returns value of Peer field.
func ( *PremiumGetBoostsStatusRequest) () ( InputPeerClass) {
	if  == nil {
		return
	}
	return .Peer
}

// PremiumGetBoostsStatus invokes method premium.getBoostsStatus#42f1f61 returning error if any.
// Gets the current number of boosts¹ of a channel.
//
// Links:
//  1. https://core.telegram.org/api/boost
//
// Possible errors:
//
//	400 PEER_ID_INVALID: The provided peer id is invalid.
//
// See https://core.telegram.org/method/premium.getBoostsStatus for reference.
func ( *Client) ( context.Context,  InputPeerClass) (*PremiumBoostsStatus, error) {
	var  PremiumBoostsStatus

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