package tg
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"github.com/gotd/td/bin"
"github.com/gotd/td/tdjson"
"github.com/gotd/td/tdp"
"github.com/gotd/td/tgerr"
)
var (
_ = bin .Buffer {}
_ = context .Background ()
_ = fmt .Stringer (nil )
_ = strings .Builder {}
_ = errors .Is
_ = multierr .AppendInto
_ = sort .Ints
_ = tdp .Format
_ = tgerr .Error {}
_ = tdjson .Encoder {}
)
type SMSJobsGetSMSJobRequest struct {
JobID string
}
const SMSJobsGetSMSJobRequestTypeID = 0x778d902f
var (
_ bin .Encoder = &SMSJobsGetSMSJobRequest {}
_ bin .Decoder = &SMSJobsGetSMSJobRequest {}
_ bin .BareEncoder = &SMSJobsGetSMSJobRequest {}
_ bin .BareDecoder = &SMSJobsGetSMSJobRequest {}
)
func (g *SMSJobsGetSMSJobRequest ) Zero () bool {
if g == nil {
return true
}
if !(g .JobID == "" ) {
return false
}
return true
}
func (g *SMSJobsGetSMSJobRequest ) String () string {
if g == nil {
return "SMSJobsGetSMSJobRequest(nil)"
}
type Alias SMSJobsGetSMSJobRequest
return fmt .Sprintf ("SMSJobsGetSMSJobRequest%+v" , Alias (*g ))
}
func (g *SMSJobsGetSMSJobRequest ) FillFrom (from interface {
GetJobID () (value string )
}) {
g .JobID = from .GetJobID ()
}
func (*SMSJobsGetSMSJobRequest ) TypeID () uint32 {
return SMSJobsGetSMSJobRequestTypeID
}
func (*SMSJobsGetSMSJobRequest ) TypeName () string {
return "smsjobs.getSmsJob"
}
func (g *SMSJobsGetSMSJobRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "smsjobs.getSmsJob" ,
ID : SMSJobsGetSMSJobRequestTypeID ,
}
if g == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "JobID" ,
SchemaName : "job_id" ,
},
}
return typ
}
func (g *SMSJobsGetSMSJobRequest ) Encode (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't encode smsjobs.getSmsJob#778d902f as nil" )
}
b .PutID (SMSJobsGetSMSJobRequestTypeID )
return g .EncodeBare (b )
}
func (g *SMSJobsGetSMSJobRequest ) EncodeBare (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't encode smsjobs.getSmsJob#778d902f as nil" )
}
b .PutString (g .JobID )
return nil
}
func (g *SMSJobsGetSMSJobRequest ) Decode (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't decode smsjobs.getSmsJob#778d902f to nil" )
}
if err := b .ConsumeID (SMSJobsGetSMSJobRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode smsjobs.getSmsJob#778d902f: %w" , err )
}
return g .DecodeBare (b )
}
func (g *SMSJobsGetSMSJobRequest ) DecodeBare (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't decode smsjobs.getSmsJob#778d902f to nil" )
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode smsjobs.getSmsJob#778d902f: field job_id: %w" , err )
}
g .JobID = value
}
return nil
}
func (g *SMSJobsGetSMSJobRequest ) GetJobID () (value string ) {
if g == nil {
return
}
return g .JobID
}
func (c *Client ) SMSJobsGetSMSJob (ctx context .Context , jobid string ) (*SMSJob , error ) {
var result SMSJob
request := &SMSJobsGetSMSJobRequest {
JobID : jobid ,
}
if err := c .rpc .Invoke (ctx , request , &result ); err != nil {
return nil , err
}
return &result , nil
}
The pages are generated with Golds v0.8.4 . (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu .
PR and bug reports are welcome and can be submitted to the issue list .
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds .