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

// ChannelsGetFullChannelRequest represents TL type `channels.getFullChannel#8736a09`.
// Get full info about a supergroup¹, gigagroup² or channel³
//
// Links:
//  1. https://core.telegram.org/api/channel#supergroups
//  2. https://core.telegram.org/api/channel#gigagroups
//  3. https://core.telegram.org/api/channel#channels
//
// See https://core.telegram.org/method/channels.getFullChannel for reference.
type ChannelsGetFullChannelRequest struct {
	// The channel¹, supergroup² or gigagroup³ to get info about
	//
	// Links:
	//  1) https://core.telegram.org/api/channel#channels
	//  2) https://core.telegram.org/api/channel#supergroups
	//  3) https://core.telegram.org/api/channel#gigagroups
	Channel InputChannelClass
}

// ChannelsGetFullChannelRequestTypeID is TL type id of ChannelsGetFullChannelRequest.
const ChannelsGetFullChannelRequestTypeID = 0x8736a09

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

func ( *ChannelsGetFullChannelRequest) () bool {
	if  == nil {
		return true
	}
	if !(.Channel == nil) {
		return false
	}

	return true
}

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

// FillFrom fills ChannelsGetFullChannelRequest from given interface.
func ( *ChannelsGetFullChannelRequest) ( interface {
	() ( InputChannelClass)
}) {
	.Channel = .()
}

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

// TypeName returns name of type in TL schema.
func (*ChannelsGetFullChannelRequest) () string {
	return "channels.getFullChannel"
}

// TypeInfo returns info about TL type.
func ( *ChannelsGetFullChannelRequest) () tdp.Type {
	 := tdp.Type{
		Name: "channels.getFullChannel",
		ID:   ChannelsGetFullChannelRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Channel",
			SchemaName: "channel",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *ChannelsGetFullChannelRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode channels.getFullChannel#8736a09 as nil")
	}
	.PutID(ChannelsGetFullChannelRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *ChannelsGetFullChannelRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode channels.getFullChannel#8736a09 as nil")
	}
	if .Channel == nil {
		return fmt.Errorf("unable to encode channels.getFullChannel#8736a09: field channel is nil")
	}
	if  := .Channel.Encode();  != nil {
		return fmt.Errorf("unable to encode channels.getFullChannel#8736a09: field channel: %w", )
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *ChannelsGetFullChannelRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode channels.getFullChannel#8736a09 to nil")
	}
	if  := .ConsumeID(ChannelsGetFullChannelRequestTypeID);  != nil {
		return fmt.Errorf("unable to decode channels.getFullChannel#8736a09: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *ChannelsGetFullChannelRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode channels.getFullChannel#8736a09 to nil")
	}
	{
		,  := DecodeInputChannel()
		if  != nil {
			return fmt.Errorf("unable to decode channels.getFullChannel#8736a09: field channel: %w", )
		}
		.Channel = 
	}
	return nil
}

// GetChannel returns value of Channel field.
func ( *ChannelsGetFullChannelRequest) () ( InputChannelClass) {
	if  == nil {
		return
	}
	return .Channel
}

// GetChannelAsNotEmpty returns mapped value of Channel field.
func ( *ChannelsGetFullChannelRequest) () (NotEmptyInputChannel, bool) {
	return .Channel.AsNotEmpty()
}

// ChannelsGetFullChannel invokes method channels.getFullChannel#8736a09 returning error if any.
// Get full info about a supergroup¹, gigagroup² or channel³
//
// Links:
//  1. https://core.telegram.org/api/channel#supergroups
//  2. https://core.telegram.org/api/channel#gigagroups
//  3. https://core.telegram.org/api/channel#channels
//
// Possible errors:
//
//	400 CHANNEL_INVALID: The provided channel is invalid.
//	406 CHANNEL_PRIVATE: You haven't joined this channel/supergroup.
//	403 CHANNEL_PUBLIC_GROUP_NA: channel/supergroup not available.
//	400 CHAT_NOT_MODIFIED: No changes were made to chat information because the new information you passed is identical to the current information.
//	400 MSG_ID_INVALID: Invalid message ID provided.
//
// See https://core.telegram.org/method/channels.getFullChannel for reference.
// Can be used by bots.
func ( *Client) ( context.Context,  InputChannelClass) (*MessagesChatFull, error) {
	var  MessagesChatFull

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