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

// HelpGetPeerProfileColorsRequest represents TL type `help.getPeerProfileColors#abcfa9fd`.
// Get the set of accent color palettes »¹ that can be used in profile page backgrounds.
//
// Links:
//  1. https://core.telegram.org/api/colors
//
// See https://core.telegram.org/method/help.getPeerProfileColors for reference.
type HelpGetPeerProfileColorsRequest struct {
	// Hash for pagination, for more info click here¹
	//
	// Links:
	//  1) https://core.telegram.org/api/offsets#hash-generation
	Hash int
}

// HelpGetPeerProfileColorsRequestTypeID is TL type id of HelpGetPeerProfileColorsRequest.
const HelpGetPeerProfileColorsRequestTypeID = 0xabcfa9fd

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

func ( *HelpGetPeerProfileColorsRequest) () bool {
	if  == nil {
		return true
	}
	if !(.Hash == 0) {
		return false
	}

	return true
}

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

// FillFrom fills HelpGetPeerProfileColorsRequest from given interface.
func ( *HelpGetPeerProfileColorsRequest) ( interface {
	() ( int)
}) {
	.Hash = .()
}

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

// TypeName returns name of type in TL schema.
func (*HelpGetPeerProfileColorsRequest) () string {
	return "help.getPeerProfileColors"
}

// TypeInfo returns info about TL type.
func ( *HelpGetPeerProfileColorsRequest) () tdp.Type {
	 := tdp.Type{
		Name: "help.getPeerProfileColors",
		ID:   HelpGetPeerProfileColorsRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Hash",
			SchemaName: "hash",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *HelpGetPeerProfileColorsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode help.getPeerProfileColors#abcfa9fd as nil")
	}
	.PutID(HelpGetPeerProfileColorsRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *HelpGetPeerProfileColorsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode help.getPeerProfileColors#abcfa9fd as nil")
	}
	.PutInt(.Hash)
	return nil
}

// Decode implements bin.Decoder.
func ( *HelpGetPeerProfileColorsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode help.getPeerProfileColors#abcfa9fd to nil")
	}
	if  := .ConsumeID(HelpGetPeerProfileColorsRequestTypeID);  != nil {
		return fmt.Errorf("unable to decode help.getPeerProfileColors#abcfa9fd: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *HelpGetPeerProfileColorsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode help.getPeerProfileColors#abcfa9fd to nil")
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode help.getPeerProfileColors#abcfa9fd: field hash: %w", )
		}
		.Hash = 
	}
	return nil
}

// GetHash returns value of Hash field.
func ( *HelpGetPeerProfileColorsRequest) () ( int) {
	if  == nil {
		return
	}
	return .Hash
}

// HelpGetPeerProfileColors invokes method help.getPeerProfileColors#abcfa9fd returning error if any.
// Get the set of accent color palettes »¹ that can be used in profile page backgrounds.
//
// Links:
//  1. https://core.telegram.org/api/colors
//
// See https://core.telegram.org/method/help.getPeerProfileColors for reference.
func ( *Client) ( context.Context,  int) (HelpPeerColorsClass, error) {
	var  HelpPeerColorsBox

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