-
Notifications
You must be signed in to change notification settings - Fork 3
/
workspaces.go
160 lines (137 loc) · 4.19 KB
/
workspaces.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
// This file was auto-generated by Fern from our API Definition.
package api
import (
json "encoding/json"
fmt "fmt"
core "github.com/seamapi/go/core"
)
type WorkspacesCreateRequest struct {
Name string `json:"name" url:"name"`
// The name shown inside the connect webview
ConnectPartnerName string `json:"connect_partner_name" url:"connect_partner_name"`
IsSandbox *bool `json:"is_sandbox,omitempty" url:"is_sandbox,omitempty"`
WebviewPrimaryButtonColor *string `json:"webview_primary_button_color,omitempty" url:"webview_primary_button_color,omitempty"`
WebviewLogoShape *WebviewLogoShape `json:"webview_logo_shape,omitempty" url:"webview_logo_shape,omitempty"`
}
type WorkspacesCreateResponse struct {
Workspace *Workspace `json:"workspace,omitempty" url:"workspace,omitempty"`
Ok bool `json:"ok" url:"ok"`
_rawJSON json.RawMessage
}
func (w *WorkspacesCreateResponse) UnmarshalJSON(data []byte) error {
type unmarshaler WorkspacesCreateResponse
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*w = WorkspacesCreateResponse(value)
w._rawJSON = json.RawMessage(data)
return nil
}
func (w *WorkspacesCreateResponse) String() string {
if len(w._rawJSON) > 0 {
if value, err := core.StringifyJSON(w._rawJSON); err == nil {
return value
}
}
if value, err := core.StringifyJSON(w); err == nil {
return value
}
return fmt.Sprintf("%#v", w)
}
type WorkspacesGetResponse struct {
Workspace *Workspace `json:"workspace,omitempty" url:"workspace,omitempty"`
Ok bool `json:"ok" url:"ok"`
_rawJSON json.RawMessage
}
func (w *WorkspacesGetResponse) UnmarshalJSON(data []byte) error {
type unmarshaler WorkspacesGetResponse
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*w = WorkspacesGetResponse(value)
w._rawJSON = json.RawMessage(data)
return nil
}
func (w *WorkspacesGetResponse) String() string {
if len(w._rawJSON) > 0 {
if value, err := core.StringifyJSON(w._rawJSON); err == nil {
return value
}
}
if value, err := core.StringifyJSON(w); err == nil {
return value
}
return fmt.Sprintf("%#v", w)
}
type WorkspacesListResponse struct {
Workspaces []*Workspace `json:"workspaces,omitempty" url:"workspaces,omitempty"`
Ok bool `json:"ok" url:"ok"`
_rawJSON json.RawMessage
}
func (w *WorkspacesListResponse) UnmarshalJSON(data []byte) error {
type unmarshaler WorkspacesListResponse
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*w = WorkspacesListResponse(value)
w._rawJSON = json.RawMessage(data)
return nil
}
func (w *WorkspacesListResponse) String() string {
if len(w._rawJSON) > 0 {
if value, err := core.StringifyJSON(w._rawJSON); err == nil {
return value
}
}
if value, err := core.StringifyJSON(w); err == nil {
return value
}
return fmt.Sprintf("%#v", w)
}
type WorkspacesResetSandboxResponse struct {
ActionAttempt *ActionAttempt `json:"action_attempt,omitempty" url:"action_attempt,omitempty"`
Ok bool `json:"ok" url:"ok"`
_rawJSON json.RawMessage
}
func (w *WorkspacesResetSandboxResponse) UnmarshalJSON(data []byte) error {
type unmarshaler WorkspacesResetSandboxResponse
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*w = WorkspacesResetSandboxResponse(value)
w._rawJSON = json.RawMessage(data)
return nil
}
func (w *WorkspacesResetSandboxResponse) String() string {
if len(w._rawJSON) > 0 {
if value, err := core.StringifyJSON(w._rawJSON); err == nil {
return value
}
}
if value, err := core.StringifyJSON(w); err == nil {
return value
}
return fmt.Sprintf("%#v", w)
}
type WebviewLogoShape string
const (
WebviewLogoShapeCircle WebviewLogoShape = "circle"
WebviewLogoShapeSquare WebviewLogoShape = "square"
)
func NewWebviewLogoShapeFromString(s string) (WebviewLogoShape, error) {
switch s {
case "circle":
return WebviewLogoShapeCircle, nil
case "square":
return WebviewLogoShapeSquare, nil
}
var t WebviewLogoShape
return "", fmt.Errorf("%s is not a valid %T", s, t)
}
func (w WebviewLogoShape) Ptr() *WebviewLogoShape {
return &w
}