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

// AccountGetNotifyExceptionsRequest represents TL type `account.getNotifyExceptions#53577479`.
// Returns list of chats with non-default notification settings
//
// See https://core.telegram.org/method/account.getNotifyExceptions for reference.
type AccountGetNotifyExceptionsRequest struct {
	// Flags, see TL conditional fieldsĀ¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// If set, chats with non-default sound will be returned
	CompareSound bool
	// If set, chats with non-default notification settings for stories will be returned
	CompareStories bool
	// If specified, only chats of the specified category will be returned
	//
	// Use SetPeer and GetPeer helpers.
	Peer InputNotifyPeerClass
}

// AccountGetNotifyExceptionsRequestTypeID is TL type id of AccountGetNotifyExceptionsRequest.
const AccountGetNotifyExceptionsRequestTypeID = 0x53577479

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

func ( *AccountGetNotifyExceptionsRequest) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.CompareSound == false) {
		return false
	}
	if !(.CompareStories == false) {
		return false
	}
	if !(.Peer == nil) {
		return false
	}

	return true
}

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

// FillFrom fills AccountGetNotifyExceptionsRequest from given interface.
func ( *AccountGetNotifyExceptionsRequest) ( interface {
	() ( bool)
	() ( bool)
	() ( InputNotifyPeerClass,  bool)
}) {
	.CompareSound = .()
	.CompareStories = .()
	if ,  := .();  {
		.Peer = 
	}

}

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

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

// TypeInfo returns info about TL type.
func ( *AccountGetNotifyExceptionsRequest) () tdp.Type {
	 := tdp.Type{
		Name: "account.getNotifyExceptions",
		ID:   AccountGetNotifyExceptionsRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "CompareSound",
			SchemaName: "compare_sound",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "CompareStories",
			SchemaName: "compare_stories",
			Null:       !.Flags.Has(2),
		},
		{
			Name:       "Peer",
			SchemaName: "peer",
			Null:       !.Flags.Has(0),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *AccountGetNotifyExceptionsRequest) () {
	if !(.CompareSound == false) {
		.Flags.Set(1)
	}
	if !(.CompareStories == false) {
		.Flags.Set(2)
	}
	if !(.Peer == nil) {
		.Flags.Set(0)
	}
}

// Encode implements bin.Encoder.
func ( *AccountGetNotifyExceptionsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode account.getNotifyExceptions#53577479 as nil")
	}
	.PutID(AccountGetNotifyExceptionsRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *AccountGetNotifyExceptionsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode account.getNotifyExceptions#53577479 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode account.getNotifyExceptions#53577479: field flags: %w", )
	}
	if .Flags.Has(0) {
		if .Peer == nil {
			return fmt.Errorf("unable to encode account.getNotifyExceptions#53577479: field peer is nil")
		}
		if  := .Peer.Encode();  != nil {
			return fmt.Errorf("unable to encode account.getNotifyExceptions#53577479: field peer: %w", )
		}
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *AccountGetNotifyExceptionsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode account.getNotifyExceptions#53577479 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode account.getNotifyExceptions#53577479: field flags: %w", )
		}
	}
	.CompareSound = .Flags.Has(1)
	.CompareStories = .Flags.Has(2)
	if .Flags.Has(0) {
		,  := DecodeInputNotifyPeer()
		if  != nil {
			return fmt.Errorf("unable to decode account.getNotifyExceptions#53577479: field peer: %w", )
		}
		.Peer = 
	}
	return nil
}

// SetCompareSound sets value of CompareSound conditional field.
func ( *AccountGetNotifyExceptionsRequest) ( bool) {
	if  {
		.Flags.Set(1)
		.CompareSound = true
	} else {
		.Flags.Unset(1)
		.CompareSound = false
	}
}

// GetCompareSound returns value of CompareSound conditional field.
func ( *AccountGetNotifyExceptionsRequest) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(1)
}

// SetCompareStories sets value of CompareStories conditional field.
func ( *AccountGetNotifyExceptionsRequest) ( bool) {
	if  {
		.Flags.Set(2)
		.CompareStories = true
	} else {
		.Flags.Unset(2)
		.CompareStories = false
	}
}

// GetCompareStories returns value of CompareStories conditional field.
func ( *AccountGetNotifyExceptionsRequest) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(2)
}

// SetPeer sets value of Peer conditional field.
func ( *AccountGetNotifyExceptionsRequest) ( InputNotifyPeerClass) {
	.Flags.Set(0)
	.Peer = 
}

// GetPeer returns value of Peer conditional field and
// boolean which is true if field was set.
func ( *AccountGetNotifyExceptionsRequest) () ( InputNotifyPeerClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(0) {
		return , false
	}
	return .Peer, true
}

// AccountGetNotifyExceptions invokes method account.getNotifyExceptions#53577479 returning error if any.
// Returns list of chats with non-default notification settings
//
// See https://core.telegram.org/method/account.getNotifyExceptions for reference.
func ( *Client) ( context.Context,  *AccountGetNotifyExceptionsRequest) (UpdatesClass, error) {
	var  UpdatesBox

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