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

// AccountGetNotifySettingsRequest represents TL type `account.getNotifySettings#12b3ad31`.
// Gets current notification settings for a given user/group, from all users/all groups.
//
// See https://core.telegram.org/method/account.getNotifySettings for reference.
type AccountGetNotifySettingsRequest struct {
	// Notification source
	Peer InputNotifyPeerClass
}

// AccountGetNotifySettingsRequestTypeID is TL type id of AccountGetNotifySettingsRequest.
const AccountGetNotifySettingsRequestTypeID = 0x12b3ad31

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

func ( *AccountGetNotifySettingsRequest) () bool {
	if  == nil {
		return true
	}
	if !(.Peer == nil) {
		return false
	}

	return true
}

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

// FillFrom fills AccountGetNotifySettingsRequest from given interface.
func ( *AccountGetNotifySettingsRequest) ( interface {
	() ( InputNotifyPeerClass)
}) {
	.Peer = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *AccountGetNotifySettingsRequest) () tdp.Type {
	 := tdp.Type{
		Name: "account.getNotifySettings",
		ID:   AccountGetNotifySettingsRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Peer",
			SchemaName: "peer",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *AccountGetNotifySettingsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode account.getNotifySettings#12b3ad31 as nil")
	}
	.PutID(AccountGetNotifySettingsRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *AccountGetNotifySettingsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode account.getNotifySettings#12b3ad31 as nil")
	}
	if .Peer == nil {
		return fmt.Errorf("unable to encode account.getNotifySettings#12b3ad31: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode account.getNotifySettings#12b3ad31: field peer: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *AccountGetNotifySettingsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode account.getNotifySettings#12b3ad31 to nil")
	}
	{
		,  := DecodeInputNotifyPeer()
		if  != nil {
			return fmt.Errorf("unable to decode account.getNotifySettings#12b3ad31: field peer: %w", )
		}
		.Peer = 
	}
	return nil
}

// GetPeer returns value of Peer field.
func ( *AccountGetNotifySettingsRequest) () ( InputNotifyPeerClass) {
	if  == nil {
		return
	}
	return .Peer
}

// AccountGetNotifySettings invokes method account.getNotifySettings#12b3ad31 returning error if any.
// Gets current notification settings for a given user/group, from all users/all groups.
//
// Possible errors:
//
//	400 PEER_ID_INVALID: The provided peer id is invalid.
//
// See https://core.telegram.org/method/account.getNotifySettings for reference.
func ( *Client) ( context.Context,  InputNotifyPeerClass) (*PeerNotifySettings, error) {
	var  PeerNotifySettings

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