-
Notifications
You must be signed in to change notification settings - Fork 1
/
labor.go
155 lines (136 loc) · 4.29 KB
/
labor.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
// This file was auto-generated by Fern from our API Definition.
package square
import (
json "encoding/json"
fmt "fmt"
internal "github.com/square/square-go-sdk/internal"
)
type CreateBreakTypeRequest struct {
// A unique string value to ensure the idempotency of the operation.
IdempotencyKey *string `json:"idempotency_key,omitempty" url:"-"`
// The `BreakType` to be created.
BreakType *BreakType `json:"break_type,omitempty" url:"-"`
}
type LaborListRequest struct {
// Filter the returned `BreakType` results to only those that are associated with the
// specified location.
LocationID *string `json:"-" url:"location_id,omitempty"`
// The maximum number of `BreakType` results to return per page. The number can range between 1
// and 200. The default is 200.
Limit *int `json:"-" url:"limit,omitempty"`
// A pointer to the next page of `BreakType` results to fetch.
Cursor *string `json:"-" url:"cursor,omitempty"`
}
// The response to the request to create a `BreakType`. The response contains
// the created `BreakType` object and might contain a set of `Error` objects if
// the request resulted in errors.
type CreateBreakTypeResponse struct {
// The `BreakType` that was created by the request.
BreakType *BreakType `json:"break_type,omitempty" url:"break_type,omitempty"`
// Any errors that occurred during the request.
Errors []*Error `json:"errors,omitempty" url:"errors,omitempty"`
extraProperties map[string]interface{}
rawJSON json.RawMessage
}
func (c *CreateBreakTypeResponse) GetBreakType() *BreakType {
if c == nil {
return nil
}
return c.BreakType
}
func (c *CreateBreakTypeResponse) GetErrors() []*Error {
if c == nil {
return nil
}
return c.Errors
}
func (c *CreateBreakTypeResponse) GetExtraProperties() map[string]interface{} {
return c.extraProperties
}
func (c *CreateBreakTypeResponse) UnmarshalJSON(data []byte) error {
type unmarshaler CreateBreakTypeResponse
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*c = CreateBreakTypeResponse(value)
extraProperties, err := internal.ExtractExtraProperties(data, *c)
if err != nil {
return err
}
c.extraProperties = extraProperties
c.rawJSON = json.RawMessage(data)
return nil
}
func (c *CreateBreakTypeResponse) String() string {
if len(c.rawJSON) > 0 {
if value, err := internal.StringifyJSON(c.rawJSON); err == nil {
return value
}
}
if value, err := internal.StringifyJSON(c); err == nil {
return value
}
return fmt.Sprintf("%#v", c)
}
// The response to a request for a set of `BreakType` objects. The response contains
// the requested `BreakType` objects and might contain a set of `Error` objects if
// the request resulted in errors.
type ListBreakTypesResponse struct {
// A page of `BreakType` results.
BreakTypes []*BreakType `json:"break_types,omitempty" url:"break_types,omitempty"`
// The value supplied in the subsequent request to fetch the next page
// of `BreakType` results.
Cursor *string `json:"cursor,omitempty" url:"cursor,omitempty"`
// Any errors that occurred during the request.
Errors []*Error `json:"errors,omitempty" url:"errors,omitempty"`
extraProperties map[string]interface{}
rawJSON json.RawMessage
}
func (l *ListBreakTypesResponse) GetBreakTypes() []*BreakType {
if l == nil {
return nil
}
return l.BreakTypes
}
func (l *ListBreakTypesResponse) GetCursor() *string {
if l == nil {
return nil
}
return l.Cursor
}
func (l *ListBreakTypesResponse) GetErrors() []*Error {
if l == nil {
return nil
}
return l.Errors
}
func (l *ListBreakTypesResponse) GetExtraProperties() map[string]interface{} {
return l.extraProperties
}
func (l *ListBreakTypesResponse) UnmarshalJSON(data []byte) error {
type unmarshaler ListBreakTypesResponse
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*l = ListBreakTypesResponse(value)
extraProperties, err := internal.ExtractExtraProperties(data, *l)
if err != nil {
return err
}
l.extraProperties = extraProperties
l.rawJSON = json.RawMessage(data)
return nil
}
func (l *ListBreakTypesResponse) String() string {
if len(l.rawJSON) > 0 {
if value, err := internal.StringifyJSON(l.rawJSON); err == nil {
return value
}
}
if value, err := internal.StringifyJSON(l); err == nil {
return value
}
return fmt.Sprintf("%#v", l)
}