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

// MessagesGetDefaultHistoryTTLRequest represents TL type `messages.getDefaultHistoryTTL#658b7188`.
// Gets the default value of the Time-To-Live setting, applied to all new chats.
//
// See https://core.telegram.org/method/messages.getDefaultHistoryTTL for reference.
type MessagesGetDefaultHistoryTTLRequest struct {
}

// MessagesGetDefaultHistoryTTLRequestTypeID is TL type id of MessagesGetDefaultHistoryTTLRequest.
const MessagesGetDefaultHistoryTTLRequestTypeID = 0x658b7188

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

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

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func ( *MessagesGetDefaultHistoryTTLRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messages.getDefaultHistoryTTL#658b7188 as nil")
	}
	.PutID(MessagesGetDefaultHistoryTTLRequestTypeID)
	return .EncodeBare()
}

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

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

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

// MessagesGetDefaultHistoryTTL invokes method messages.getDefaultHistoryTTL#658b7188 returning error if any.
// Gets the default value of the Time-To-Live setting, applied to all new chats.
//
// See https://core.telegram.org/method/messages.getDefaultHistoryTTL for reference.
// Can be used by bots.
func ( *Client) ( context.Context) (*DefaultHistoryTTL, error) {
	var  DefaultHistoryTTL

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