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

// AccountGetWebBrowserSettingsRequest represents TL type `account.getWebBrowserSettings#56655768`.
//
// See https://core.telegram.org/method/account.getWebBrowserSettings for reference.
type AccountGetWebBrowserSettingsRequest struct {
	// Hash field of AccountGetWebBrowserSettingsRequest.
	Hash int64
}

// AccountGetWebBrowserSettingsRequestTypeID is TL type id of AccountGetWebBrowserSettingsRequest.
const AccountGetWebBrowserSettingsRequestTypeID = 0x56655768

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

func ( *AccountGetWebBrowserSettingsRequest) () bool {
	if  == nil {
		return true
	}
	if !(.Hash == 0) {
		return false
	}

	return true
}

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

// FillFrom fills AccountGetWebBrowserSettingsRequest from given interface.
func ( *AccountGetWebBrowserSettingsRequest) ( interface {
	() ( int64)
}) {
	.Hash = .()
}

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

// TypeName returns name of type in TL schema.
func (*AccountGetWebBrowserSettingsRequest) () string {
	return "account.getWebBrowserSettings"
}

// TypeInfo returns info about TL type.
func ( *AccountGetWebBrowserSettingsRequest) () tdp.Type {
	 := tdp.Type{
		Name: "account.getWebBrowserSettings",
		ID:   AccountGetWebBrowserSettingsRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Hash",
			SchemaName: "hash",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *AccountGetWebBrowserSettingsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode account.getWebBrowserSettings#56655768 as nil")
	}
	.PutID(AccountGetWebBrowserSettingsRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *AccountGetWebBrowserSettingsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode account.getWebBrowserSettings#56655768 as nil")
	}
	.PutLong(.Hash)
	return nil
}

// Decode implements bin.Decoder.
func ( *AccountGetWebBrowserSettingsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode account.getWebBrowserSettings#56655768 to nil")
	}
	if  := .ConsumeID(AccountGetWebBrowserSettingsRequestTypeID);  != nil {
		return fmt.Errorf("unable to decode account.getWebBrowserSettings#56655768: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *AccountGetWebBrowserSettingsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode account.getWebBrowserSettings#56655768 to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode account.getWebBrowserSettings#56655768: field hash: %w", )
		}
		.Hash = 
	}
	return nil
}

// GetHash returns value of Hash field.
func ( *AccountGetWebBrowserSettingsRequest) () ( int64) {
	if  == nil {
		return
	}
	return .Hash
}

// AccountGetWebBrowserSettings invokes method account.getWebBrowserSettings#56655768 returning error if any.
//
// See https://core.telegram.org/method/account.getWebBrowserSettings for reference.
func ( *Client) ( context.Context,  int64) (AccountWebBrowserSettingsClass, error) {
	var  AccountWebBrowserSettingsBox

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