Source File
tl_payments_exported_invoice_gen.go
Belonging Package
github.com/gotd/td/tg
// 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{}
)
// PaymentsExportedInvoice represents TL type `payments.exportedInvoice#aed0cbd9`.
// Exported invoice deep linkĀ¹
//
// Links:
// 1. https://core.telegram.org/api/links#invoice-links
//
// See https://core.telegram.org/constructor/payments.exportedInvoice for reference.
type PaymentsExportedInvoice struct {
// Exported invoice deep linkĀ¹
//
// Links:
// 1) https://core.telegram.org/api/links#invoice-links
URL string
}
// PaymentsExportedInvoiceTypeID is TL type id of PaymentsExportedInvoice.
const PaymentsExportedInvoiceTypeID = 0xaed0cbd9
// Ensuring interfaces in compile-time for PaymentsExportedInvoice.
var (
_ bin.Encoder = &PaymentsExportedInvoice{}
_ bin.Decoder = &PaymentsExportedInvoice{}
_ bin.BareEncoder = &PaymentsExportedInvoice{}
_ bin.BareDecoder = &PaymentsExportedInvoice{}
)
func ( *PaymentsExportedInvoice) () bool {
if == nil {
return true
}
if !(.URL == "") {
return false
}
return true
}
// String implements fmt.Stringer.
func ( *PaymentsExportedInvoice) () string {
if == nil {
return "PaymentsExportedInvoice(nil)"
}
type PaymentsExportedInvoice
return fmt.Sprintf("PaymentsExportedInvoice%+v", (*))
}
// FillFrom fills PaymentsExportedInvoice from given interface.
func ( *PaymentsExportedInvoice) ( interface {
() ( string)
}) {
.URL = .()
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*PaymentsExportedInvoice) () uint32 {
return PaymentsExportedInvoiceTypeID
}
// TypeName returns name of type in TL schema.
func (*PaymentsExportedInvoice) () string {
return "payments.exportedInvoice"
}
// TypeInfo returns info about TL type.
func ( *PaymentsExportedInvoice) () tdp.Type {
:= tdp.Type{
Name: "payments.exportedInvoice",
ID: PaymentsExportedInvoiceTypeID,
}
if == nil {
.Null = true
return
}
.Fields = []tdp.Field{
{
Name: "URL",
SchemaName: "url",
},
}
return
}
// Encode implements bin.Encoder.
func ( *PaymentsExportedInvoice) ( *bin.Buffer) error {
if == nil {
return fmt.Errorf("can't encode payments.exportedInvoice#aed0cbd9 as nil")
}
.PutID(PaymentsExportedInvoiceTypeID)
return .EncodeBare()
}
// EncodeBare implements bin.BareEncoder.
func ( *PaymentsExportedInvoice) ( *bin.Buffer) error {
if == nil {
return fmt.Errorf("can't encode payments.exportedInvoice#aed0cbd9 as nil")
}
.PutString(.URL)
return nil
}
// Decode implements bin.Decoder.
func ( *PaymentsExportedInvoice) ( *bin.Buffer) error {
if == nil {
return fmt.Errorf("can't decode payments.exportedInvoice#aed0cbd9 to nil")
}
if := .ConsumeID(PaymentsExportedInvoiceTypeID); != nil {
return fmt.Errorf("unable to decode payments.exportedInvoice#aed0cbd9: %w", )
}
return .DecodeBare()
}
// DecodeBare implements bin.BareDecoder.
func ( *PaymentsExportedInvoice) ( *bin.Buffer) error {
if == nil {
return fmt.Errorf("can't decode payments.exportedInvoice#aed0cbd9 to nil")
}
{
, := .String()
if != nil {
return fmt.Errorf("unable to decode payments.exportedInvoice#aed0cbd9: field url: %w", )
}
.URL =
}
return nil
}
// GetURL returns value of URL field.
func ( *PaymentsExportedInvoice) () ( string) {
if == nil {
return
}
return .URL
}
The pages are generated with Golds v0.6.7. (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 @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |