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 InputPaymentCredentialsClassArray []InputPaymentCredentialsClass
func (s InputPaymentCredentialsClassArray ) Sort (less func (a , b InputPaymentCredentialsClass ) bool ) InputPaymentCredentialsClassArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s InputPaymentCredentialsClassArray ) SortStable (less func (a , b InputPaymentCredentialsClass ) bool ) InputPaymentCredentialsClassArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s InputPaymentCredentialsClassArray ) Retain (keep func (x InputPaymentCredentialsClass ) bool ) InputPaymentCredentialsClassArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s InputPaymentCredentialsClassArray ) First () (v InputPaymentCredentialsClass , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s InputPaymentCredentialsClassArray ) Last () (v InputPaymentCredentialsClass , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *InputPaymentCredentialsClassArray ) PopFirst () (v InputPaymentCredentialsClass , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero InputPaymentCredentialsClass
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *InputPaymentCredentialsClassArray ) Pop () (v InputPaymentCredentialsClass , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s InputPaymentCredentialsClassArray ) AsInputPaymentCredentialsSaved () (to InputPaymentCredentialsSavedArray ) {
for _ , elem := range s {
value , ok := elem .(*InputPaymentCredentialsSaved )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s InputPaymentCredentialsClassArray ) AsInputPaymentCredentials () (to InputPaymentCredentialsArray ) {
for _ , elem := range s {
value , ok := elem .(*InputPaymentCredentials )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s InputPaymentCredentialsClassArray ) AsInputPaymentCredentialsApplePay () (to InputPaymentCredentialsApplePayArray ) {
for _ , elem := range s {
value , ok := elem .(*InputPaymentCredentialsApplePay )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s InputPaymentCredentialsClassArray ) AsInputPaymentCredentialsGooglePay () (to InputPaymentCredentialsGooglePayArray ) {
for _ , elem := range s {
value , ok := elem .(*InputPaymentCredentialsGooglePay )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
type InputPaymentCredentialsSavedArray []InputPaymentCredentialsSaved
func (s InputPaymentCredentialsSavedArray ) Sort (less func (a , b InputPaymentCredentialsSaved ) bool ) InputPaymentCredentialsSavedArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s InputPaymentCredentialsSavedArray ) SortStable (less func (a , b InputPaymentCredentialsSaved ) bool ) InputPaymentCredentialsSavedArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s InputPaymentCredentialsSavedArray ) Retain (keep func (x InputPaymentCredentialsSaved ) bool ) InputPaymentCredentialsSavedArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s InputPaymentCredentialsSavedArray ) First () (v InputPaymentCredentialsSaved , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s InputPaymentCredentialsSavedArray ) Last () (v InputPaymentCredentialsSaved , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *InputPaymentCredentialsSavedArray ) PopFirst () (v InputPaymentCredentialsSaved , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero InputPaymentCredentialsSaved
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *InputPaymentCredentialsSavedArray ) Pop () (v InputPaymentCredentialsSaved , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type InputPaymentCredentialsArray []InputPaymentCredentials
func (s InputPaymentCredentialsArray ) Sort (less func (a , b InputPaymentCredentials ) bool ) InputPaymentCredentialsArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s InputPaymentCredentialsArray ) SortStable (less func (a , b InputPaymentCredentials ) bool ) InputPaymentCredentialsArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s InputPaymentCredentialsArray ) Retain (keep func (x InputPaymentCredentials ) bool ) InputPaymentCredentialsArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s InputPaymentCredentialsArray ) First () (v InputPaymentCredentials , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s InputPaymentCredentialsArray ) Last () (v InputPaymentCredentials , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *InputPaymentCredentialsArray ) PopFirst () (v InputPaymentCredentials , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero InputPaymentCredentials
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *InputPaymentCredentialsArray ) Pop () (v InputPaymentCredentials , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type InputPaymentCredentialsApplePayArray []InputPaymentCredentialsApplePay
func (s InputPaymentCredentialsApplePayArray ) Sort (less func (a , b InputPaymentCredentialsApplePay ) bool ) InputPaymentCredentialsApplePayArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s InputPaymentCredentialsApplePayArray ) SortStable (less func (a , b InputPaymentCredentialsApplePay ) bool ) InputPaymentCredentialsApplePayArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s InputPaymentCredentialsApplePayArray ) Retain (keep func (x InputPaymentCredentialsApplePay ) bool ) InputPaymentCredentialsApplePayArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s InputPaymentCredentialsApplePayArray ) First () (v InputPaymentCredentialsApplePay , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s InputPaymentCredentialsApplePayArray ) Last () (v InputPaymentCredentialsApplePay , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *InputPaymentCredentialsApplePayArray ) PopFirst () (v InputPaymentCredentialsApplePay , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero InputPaymentCredentialsApplePay
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *InputPaymentCredentialsApplePayArray ) Pop () (v InputPaymentCredentialsApplePay , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type InputPaymentCredentialsGooglePayArray []InputPaymentCredentialsGooglePay
func (s InputPaymentCredentialsGooglePayArray ) Sort (less func (a , b InputPaymentCredentialsGooglePay ) bool ) InputPaymentCredentialsGooglePayArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s InputPaymentCredentialsGooglePayArray ) SortStable (less func (a , b InputPaymentCredentialsGooglePay ) bool ) InputPaymentCredentialsGooglePayArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s InputPaymentCredentialsGooglePayArray ) Retain (keep func (x InputPaymentCredentialsGooglePay ) bool ) InputPaymentCredentialsGooglePayArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s InputPaymentCredentialsGooglePayArray ) First () (v InputPaymentCredentialsGooglePay , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s InputPaymentCredentialsGooglePayArray ) Last () (v InputPaymentCredentialsGooglePay , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *InputPaymentCredentialsGooglePayArray ) PopFirst () (v InputPaymentCredentialsGooglePay , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero InputPaymentCredentialsGooglePay
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *InputPaymentCredentialsGooglePayArray ) Pop () (v InputPaymentCredentialsGooglePay , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
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 .