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

// UpdatesGetStateRequest represents TL type `updates.getState#edd4882a`.
// Returns a current state of updates.
//
// See https://core.telegram.org/method/updates.getState for reference.
type UpdatesGetStateRequest struct {
}

// UpdatesGetStateRequestTypeID is TL type id of UpdatesGetStateRequest.
const UpdatesGetStateRequestTypeID = 0xedd4882a

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

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

	return true
}

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

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

// TypeName returns name of type in TL schema.
func (*UpdatesGetStateRequest) () string {
	return "updates.getState"
}

// TypeInfo returns info about TL type.
func ( *UpdatesGetStateRequest) () tdp.Type {
	 := tdp.Type{
		Name: "updates.getState",
		ID:   UpdatesGetStateRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{}
	return 
}

// Encode implements bin.Encoder.
func ( *UpdatesGetStateRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updates.getState#edd4882a as nil")
	}
	.PutID(UpdatesGetStateRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *UpdatesGetStateRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode updates.getState#edd4882a as nil")
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *UpdatesGetStateRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updates.getState#edd4882a to nil")
	}
	if  := .ConsumeID(UpdatesGetStateRequestTypeID);  != nil {
		return fmt.Errorf("unable to decode updates.getState#edd4882a: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *UpdatesGetStateRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode updates.getState#edd4882a to nil")
	}
	return nil
}

// UpdatesGetState invokes method updates.getState#edd4882a returning error if any.
// Returns a current state of updates.
//
// See https://core.telegram.org/method/updates.getState for reference.
// Can be used by bots.
func ( *Client) ( context.Context) (*UpdatesState, error) {
	var  UpdatesState

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