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

// SMSJob represents TL type `smsJob#e6a1eeb8`.
// Info about an SMS job.
//
// See https://core.telegram.org/constructor/smsJob for reference.
type SMSJob struct {
	// Job ID
	JobID string
	// Destination phone number
	PhoneNumber string
	// Text
	Text string
}

// SMSJobTypeID is TL type id of SMSJob.
const SMSJobTypeID = 0xe6a1eeb8

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

func ( *SMSJob) () bool {
	if  == nil {
		return true
	}
	if !(.JobID == "") {
		return false
	}
	if !(.PhoneNumber == "") {
		return false
	}
	if !(.Text == "") {
		return false
	}

	return true
}

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

// FillFrom fills SMSJob from given interface.
func ( *SMSJob) ( interface {
	() ( string)
	() ( string)
	() ( string)
}) {
	.JobID = .()
	.PhoneNumber = .()
	.Text = .()
}

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

// TypeName returns name of type in TL schema.
func (*SMSJob) () string {
	return "smsJob"
}

// TypeInfo returns info about TL type.
func ( *SMSJob) () tdp.Type {
	 := tdp.Type{
		Name: "smsJob",
		ID:   SMSJobTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "JobID",
			SchemaName: "job_id",
		},
		{
			Name:       "PhoneNumber",
			SchemaName: "phone_number",
		},
		{
			Name:       "Text",
			SchemaName: "text",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *SMSJob) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode smsJob#e6a1eeb8 as nil")
	}
	.PutID(SMSJobTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *SMSJob) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode smsJob#e6a1eeb8 as nil")
	}
	.PutString(.JobID)
	.PutString(.PhoneNumber)
	.PutString(.Text)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *SMSJob) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode smsJob#e6a1eeb8 to nil")
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode smsJob#e6a1eeb8: field job_id: %w", )
		}
		.JobID = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode smsJob#e6a1eeb8: field phone_number: %w", )
		}
		.PhoneNumber = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode smsJob#e6a1eeb8: field text: %w", )
		}
		.Text = 
	}
	return nil
}

// GetJobID returns value of JobID field.
func ( *SMSJob) () ( string) {
	if  == nil {
		return
	}
	return .JobID
}

// GetPhoneNumber returns value of PhoneNumber field.
func ( *SMSJob) () ( string) {
	if  == nil {
		return
	}
	return .PhoneNumber
}

// GetText returns value of Text field.
func ( *SMSJob) () ( string) {
	if  == nil {
		return
	}
	return .Text
}