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

// StoriesGetChatsToSendRequest represents TL type `stories.getChatsToSend#a56a8b60`.
// Obtain a list of channels where the user can post storiesĀ¹
//
// Links:
//  1. https://core.telegram.org/api/stories
//
// See https://core.telegram.org/method/stories.getChatsToSend for reference.
type StoriesGetChatsToSendRequest struct {
}

// StoriesGetChatsToSendRequestTypeID is TL type id of StoriesGetChatsToSendRequest.
const StoriesGetChatsToSendRequestTypeID = 0xa56a8b60

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

func ( *StoriesGetChatsToSendRequest) () bool {
	if  == nil {
		return true
	}

	return true
}

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

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

// TypeName returns name of type in TL schema.
func (*StoriesGetChatsToSendRequest) () string {
	return "stories.getChatsToSend"
}

// TypeInfo returns info about TL type.
func ( *StoriesGetChatsToSendRequest) () tdp.Type {
	 := tdp.Type{
		Name: "stories.getChatsToSend",
		ID:   StoriesGetChatsToSendRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{}
	return 
}

// Encode implements bin.Encoder.
func ( *StoriesGetChatsToSendRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode stories.getChatsToSend#a56a8b60 as nil")
	}
	.PutID(StoriesGetChatsToSendRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *StoriesGetChatsToSendRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode stories.getChatsToSend#a56a8b60 as nil")
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *StoriesGetChatsToSendRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode stories.getChatsToSend#a56a8b60 to nil")
	}
	if  := .ConsumeID(StoriesGetChatsToSendRequestTypeID);  != nil {
		return fmt.Errorf("unable to decode stories.getChatsToSend#a56a8b60: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *StoriesGetChatsToSendRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode stories.getChatsToSend#a56a8b60 to nil")
	}
	return nil
}

// StoriesGetChatsToSend invokes method stories.getChatsToSend#a56a8b60 returning error if any.
// Obtain a list of channels where the user can post storiesĀ¹
//
// Links:
//  1. https://core.telegram.org/api/stories
//
// See https://core.telegram.org/method/stories.getChatsToSend for reference.
func ( *Client) ( context.Context) (MessagesChatsClass, error) {
	var  MessagesChatsBox

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