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

// MessagesGetPinnedSavedDialogsRequest represents TL type `messages.getPinnedSavedDialogs#d63d94e0`.
// Get pinned saved dialogs, see here »¹ for more info.
//
// Links:
//  1. https://core.telegram.org/api/saved-messages
//
// See https://core.telegram.org/method/messages.getPinnedSavedDialogs for reference.
type MessagesGetPinnedSavedDialogsRequest struct {
}

// MessagesGetPinnedSavedDialogsRequestTypeID is TL type id of MessagesGetPinnedSavedDialogsRequest.
const MessagesGetPinnedSavedDialogsRequestTypeID = 0xd63d94e0

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

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

	return true
}

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

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

// TypeName returns name of type in TL schema.
func (*MessagesGetPinnedSavedDialogsRequest) () string {
	return "messages.getPinnedSavedDialogs"
}

// TypeInfo returns info about TL type.
func ( *MessagesGetPinnedSavedDialogsRequest) () tdp.Type {
	 := tdp.Type{
		Name: "messages.getPinnedSavedDialogs",
		ID:   MessagesGetPinnedSavedDialogsRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{}
	return 
}

// Encode implements bin.Encoder.
func ( *MessagesGetPinnedSavedDialogsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messages.getPinnedSavedDialogs#d63d94e0 as nil")
	}
	.PutID(MessagesGetPinnedSavedDialogsRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessagesGetPinnedSavedDialogsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messages.getPinnedSavedDialogs#d63d94e0 as nil")
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *MessagesGetPinnedSavedDialogsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messages.getPinnedSavedDialogs#d63d94e0 to nil")
	}
	if  := .ConsumeID(MessagesGetPinnedSavedDialogsRequestTypeID);  != nil {
		return fmt.Errorf("unable to decode messages.getPinnedSavedDialogs#d63d94e0: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *MessagesGetPinnedSavedDialogsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messages.getPinnedSavedDialogs#d63d94e0 to nil")
	}
	return nil
}

// MessagesGetPinnedSavedDialogs invokes method messages.getPinnedSavedDialogs#d63d94e0 returning error if any.
// Get pinned saved dialogs, see here »¹ for more info.
//
// Links:
//  1. https://core.telegram.org/api/saved-messages
//
// See https://core.telegram.org/method/messages.getPinnedSavedDialogs for reference.
func ( *Client) ( context.Context) (MessagesSavedDialogsClass, error) {
	var  MessagesSavedDialogsBox

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