-
Notifications
You must be signed in to change notification settings - Fork 2
/
paypalexpressurl.go
46 lines (35 loc) · 1.11 KB
/
paypalexpressurl.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package files_sdk
import (
"encoding/json"
lib "github.com/Files-com/files-sdk-go/v2/lib"
)
type PaypalExpressUrl struct {
RedirectTo string `json:"redirect_to,omitempty" path:"redirect_to,omitempty" url:"redirect_to,omitempty"`
}
// Identifier no path or id
type PaypalExpressUrlCollection []PaypalExpressUrl
func (p *PaypalExpressUrl) UnmarshalJSON(data []byte) error {
type paypalExpressUrl PaypalExpressUrl
var v paypalExpressUrl
if err := json.Unmarshal(data, &v); err != nil {
return lib.ErrorWithOriginalResponse{}.ProcessError(data, err, map[string]interface{}{})
}
*p = PaypalExpressUrl(v)
return nil
}
func (p *PaypalExpressUrlCollection) UnmarshalJSON(data []byte) error {
type paypalExpressUrls PaypalExpressUrlCollection
var v paypalExpressUrls
if err := json.Unmarshal(data, &v); err != nil {
return lib.ErrorWithOriginalResponse{}.ProcessError(data, err, []map[string]interface{}{})
}
*p = PaypalExpressUrlCollection(v)
return nil
}
func (p *PaypalExpressUrlCollection) ToSlice() *[]interface{} {
ret := make([]interface{}, len(*p))
for i, v := range *p {
ret[i] = v
}
return &ret
}