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

// AccountSetContactSignUpNotificationRequest represents TL type `account.setContactSignUpNotification#cff43f61`.
// Toggle contact sign up notifications
//
// See https://core.telegram.org/method/account.setContactSignUpNotification for reference.
type AccountSetContactSignUpNotificationRequest struct {
	// Whether to disable contact sign up notifications
	Silent bool
}

// AccountSetContactSignUpNotificationRequestTypeID is TL type id of AccountSetContactSignUpNotificationRequest.
const AccountSetContactSignUpNotificationRequestTypeID = 0xcff43f61

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

func ( *AccountSetContactSignUpNotificationRequest) () bool {
	if  == nil {
		return true
	}
	if !(.Silent == false) {
		return false
	}

	return true
}

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

// FillFrom fills AccountSetContactSignUpNotificationRequest from given interface.
func ( *AccountSetContactSignUpNotificationRequest) ( interface {
	() ( bool)
}) {
	.Silent = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *AccountSetContactSignUpNotificationRequest) () tdp.Type {
	 := tdp.Type{
		Name: "account.setContactSignUpNotification",
		ID:   AccountSetContactSignUpNotificationRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Silent",
			SchemaName: "silent",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *AccountSetContactSignUpNotificationRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode account.setContactSignUpNotification#cff43f61 as nil")
	}
	.PutID(AccountSetContactSignUpNotificationRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *AccountSetContactSignUpNotificationRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode account.setContactSignUpNotification#cff43f61 as nil")
	}
	.PutBool(.Silent)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *AccountSetContactSignUpNotificationRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode account.setContactSignUpNotification#cff43f61 to nil")
	}
	{
		,  := .Bool()
		if  != nil {
			return fmt.Errorf("unable to decode account.setContactSignUpNotification#cff43f61: field silent: %w", )
		}
		.Silent = 
	}
	return nil
}

// GetSilent returns value of Silent field.
func ( *AccountSetContactSignUpNotificationRequest) () ( bool) {
	if  == nil {
		return
	}
	return .Silent
}

// AccountSetContactSignUpNotification invokes method account.setContactSignUpNotification#cff43f61 returning error if any.
// Toggle contact sign up notifications
//
// See https://core.telegram.org/method/account.setContactSignUpNotification for reference.
func ( *Client) ( context.Context,  bool) (bool, error) {
	var  BoolBox

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