-
Notifications
You must be signed in to change notification settings - Fork 14
/
auth_tokens.go
43 lines (36 loc) · 973 Bytes
/
auth_tokens.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
// This file was auto-generated by Fern from our API Definition.
package api
import (
json "encoding/json"
fmt "fmt"
core "github.com/trycourier/courier-go/v3/core"
)
type IssueTokenParams struct {
Scope string `json:"scope" url:"scope"`
ExpiresIn string `json:"expires_in" url:"expires_in"`
}
type IssueTokenResponse struct {
Token *string `json:"token,omitempty" url:"token,omitempty"`
_rawJSON json.RawMessage
}
func (i *IssueTokenResponse) UnmarshalJSON(data []byte) error {
type unmarshaler IssueTokenResponse
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*i = IssueTokenResponse(value)
i._rawJSON = json.RawMessage(data)
return nil
}
func (i *IssueTokenResponse) String() string {
if len(i._rawJSON) > 0 {
if value, err := core.StringifyJSON(i._rawJSON); err == nil {
return value
}
}
if value, err := core.StringifyJSON(i); err == nil {
return value
}
return fmt.Sprintf("%#v", i)
}