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

// PremiumGetUserBoostsRequest represents TL type `premium.getUserBoosts#39854d1f`.
// Returns the lists of boost that were applied to a channel by a specific user (admins
// only)
//
// See https://core.telegram.org/method/premium.getUserBoosts for reference.
type PremiumGetUserBoostsRequest struct {
	// The channel
	Peer InputPeerClass
	// The user
	UserID InputUserClass
}

// PremiumGetUserBoostsRequestTypeID is TL type id of PremiumGetUserBoostsRequest.
const PremiumGetUserBoostsRequestTypeID = 0x39854d1f

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

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

	return true
}

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

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

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

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

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

// Encode implements bin.Encoder.
func ( *PremiumGetUserBoostsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode premium.getUserBoosts#39854d1f as nil")
	}
	.PutID(PremiumGetUserBoostsRequestTypeID)
	return .EncodeBare()
}

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

// Decode implements bin.Decoder.
func ( *PremiumGetUserBoostsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode premium.getUserBoosts#39854d1f to nil")
	}
	if  := .ConsumeID(PremiumGetUserBoostsRequestTypeID);  != nil {
		return fmt.Errorf("unable to decode premium.getUserBoosts#39854d1f: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *PremiumGetUserBoostsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode premium.getUserBoosts#39854d1f to nil")
	}
	{
		,  := DecodeInputPeer()
		if  != nil {
			return fmt.Errorf("unable to decode premium.getUserBoosts#39854d1f: field peer: %w", )
		}
		.Peer = 
	}
	{
		,  := DecodeInputUser()
		if  != nil {
			return fmt.Errorf("unable to decode premium.getUserBoosts#39854d1f: field user_id: %w", )
		}
		.UserID = 
	}
	return nil
}

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

// GetUserID returns value of UserID field.
func ( *PremiumGetUserBoostsRequest) () ( InputUserClass) {
	if  == nil {
		return
	}
	return .UserID
}

// PremiumGetUserBoosts invokes method premium.getUserBoosts#39854d1f returning error if any.
// Returns the lists of boost that were applied to a channel by a specific user (admins
// only)
//
// Possible errors:
//
//	400 PEER_ID_INVALID: The provided peer id is invalid.
//
// See https://core.telegram.org/method/premium.getUserBoosts for reference.
// Can be used by bots.
func ( *Client) ( context.Context,  *PremiumGetUserBoostsRequest) (*PremiumBoostsList, error) {
	var  PremiumBoostsList

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