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

// HelpHidePromoDataRequest represents TL type `help.hidePromoData#1e251c95`.
// Hide MTProxy/Public Service Announcement information
//
// See https://core.telegram.org/method/help.hidePromoData for reference.
type HelpHidePromoDataRequest struct {
	// Peer to hide
	Peer InputPeerClass
}

// HelpHidePromoDataRequestTypeID is TL type id of HelpHidePromoDataRequest.
const HelpHidePromoDataRequestTypeID = 0x1e251c95

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

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

	return true
}

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

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

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

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

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

// Encode implements bin.Encoder.
func ( *HelpHidePromoDataRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode help.hidePromoData#1e251c95 as nil")
	}
	.PutID(HelpHidePromoDataRequestTypeID)
	return .EncodeBare()
}

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

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

// DecodeBare implements bin.BareDecoder.
func ( *HelpHidePromoDataRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode help.hidePromoData#1e251c95 to nil")
	}
	{
		,  := DecodeInputPeer()
		if  != nil {
			return fmt.Errorf("unable to decode help.hidePromoData#1e251c95: field peer: %w", )
		}
		.Peer = 
	}
	return nil
}

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

// HelpHidePromoData invokes method help.hidePromoData#1e251c95 returning error if any.
// Hide MTProxy/Public Service Announcement information
//
// See https://core.telegram.org/method/help.hidePromoData for reference.
func ( *Client) ( context.Context,  InputPeerClass) (bool, error) {
	var  BoolBox

	 := &HelpHidePromoDataRequest{
		Peer: ,
	}
	if  := .rpc.Invoke(, , &);  != nil {
		return false, 
	}
	,  := .Bool.(*BoolTrue)
	return , nil
}