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

// SMSJobsUpdateSettingsRequest represents TL type `smsjobs.updateSettings#93fa0bf`.
// Update SMS job settings (official clients only).
//
// See https://core.telegram.org/method/smsjobs.updateSettings for reference.
type SMSJobsUpdateSettingsRequest struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Allow international numbers?
	AllowInternational bool
}

// SMSJobsUpdateSettingsRequestTypeID is TL type id of SMSJobsUpdateSettingsRequest.
const SMSJobsUpdateSettingsRequestTypeID = 0x93fa0bf

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

func ( *SMSJobsUpdateSettingsRequest) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.AllowInternational == false) {
		return false
	}

	return true
}

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

// FillFrom fills SMSJobsUpdateSettingsRequest from given interface.
func ( *SMSJobsUpdateSettingsRequest) ( interface {
	() ( bool)
}) {
	.AllowInternational = .()
}

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

// TypeName returns name of type in TL schema.
func (*SMSJobsUpdateSettingsRequest) () string {
	return "smsjobs.updateSettings"
}

// TypeInfo returns info about TL type.
func ( *SMSJobsUpdateSettingsRequest) () tdp.Type {
	 := tdp.Type{
		Name: "smsjobs.updateSettings",
		ID:   SMSJobsUpdateSettingsRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "AllowInternational",
			SchemaName: "allow_international",
			Null:       !.Flags.Has(0),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *SMSJobsUpdateSettingsRequest) () {
	if !(.AllowInternational == false) {
		.Flags.Set(0)
	}
}

// Encode implements bin.Encoder.
func ( *SMSJobsUpdateSettingsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode smsjobs.updateSettings#93fa0bf as nil")
	}
	.PutID(SMSJobsUpdateSettingsRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *SMSJobsUpdateSettingsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode smsjobs.updateSettings#93fa0bf as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode smsjobs.updateSettings#93fa0bf: field flags: %w", )
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *SMSJobsUpdateSettingsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode smsjobs.updateSettings#93fa0bf to nil")
	}
	if  := .ConsumeID(SMSJobsUpdateSettingsRequestTypeID);  != nil {
		return fmt.Errorf("unable to decode smsjobs.updateSettings#93fa0bf: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *SMSJobsUpdateSettingsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode smsjobs.updateSettings#93fa0bf to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode smsjobs.updateSettings#93fa0bf: field flags: %w", )
		}
	}
	.AllowInternational = .Flags.Has(0)
	return nil
}

// SetAllowInternational sets value of AllowInternational conditional field.
func ( *SMSJobsUpdateSettingsRequest) ( bool) {
	if  {
		.Flags.Set(0)
		.AllowInternational = true
	} else {
		.Flags.Unset(0)
		.AllowInternational = false
	}
}

// GetAllowInternational returns value of AllowInternational conditional field.
func ( *SMSJobsUpdateSettingsRequest) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(0)
}

// SMSJobsUpdateSettings invokes method smsjobs.updateSettings#93fa0bf returning error if any.
// Update SMS job settings (official clients only).
//
// Possible errors:
//
//	400 NOT_JOINED: The current user hasn't joined the Peer-to-Peer Login Program.
//
// See https://core.telegram.org/method/smsjobs.updateSettings for reference.
func ( *Client) ( context.Context,  *SMSJobsUpdateSettingsRequest) (bool, error) {
	var  BoolBox

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