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

// AuthResetAuthorizationsRequest represents TL type `auth.resetAuthorizations#9fab0d1a`.
// Terminates all user's authorized sessions except for the current one.
// After calling this method it is necessary to reregister the current device using the
// method account.registerDevice¹
//
// Links:
//  1. https://core.telegram.org/method/account.registerDevice
//
// See https://core.telegram.org/method/auth.resetAuthorizations for reference.
type AuthResetAuthorizationsRequest struct {
}

// AuthResetAuthorizationsRequestTypeID is TL type id of AuthResetAuthorizationsRequest.
const AuthResetAuthorizationsRequestTypeID = 0x9fab0d1a

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

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

	return true
}

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

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

// TypeName returns name of type in TL schema.
func (*AuthResetAuthorizationsRequest) () string {
	return "auth.resetAuthorizations"
}

// TypeInfo returns info about TL type.
func ( *AuthResetAuthorizationsRequest) () tdp.Type {
	 := tdp.Type{
		Name: "auth.resetAuthorizations",
		ID:   AuthResetAuthorizationsRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{}
	return 
}

// Encode implements bin.Encoder.
func ( *AuthResetAuthorizationsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode auth.resetAuthorizations#9fab0d1a as nil")
	}
	.PutID(AuthResetAuthorizationsRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *AuthResetAuthorizationsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode auth.resetAuthorizations#9fab0d1a as nil")
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *AuthResetAuthorizationsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode auth.resetAuthorizations#9fab0d1a to nil")
	}
	if  := .ConsumeID(AuthResetAuthorizationsRequestTypeID);  != nil {
		return fmt.Errorf("unable to decode auth.resetAuthorizations#9fab0d1a: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *AuthResetAuthorizationsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode auth.resetAuthorizations#9fab0d1a to nil")
	}
	return nil
}

// AuthResetAuthorizations invokes method auth.resetAuthorizations#9fab0d1a returning error if any.
// Terminates all user's authorized sessions except for the current one.
// After calling this method it is necessary to reregister the current device using the
// method account.registerDevice¹
//
// Links:
//  1. https://core.telegram.org/method/account.registerDevice
//
// Possible errors:
//
//	406 FRESH_RESET_AUTHORISATION_FORBIDDEN: You can't logout other sessions if less than 24 hours have passed since you logged on the current session.
//
// See https://core.telegram.org/method/auth.resetAuthorizations for reference.
func ( *Client) ( context.Context) (bool, error) {
	var  BoolBox

	 := &AuthResetAuthorizationsRequest{}
	if  := .rpc.Invoke(, , &);  != nil {
		return false, 
	}
	,  := .Bool.(*BoolTrue)
	return , nil
}