/
model_pagination_page_info.go
261 lines (222 loc) · 7.43 KB
/
model_pagination_page_info.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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
/*
* Web Application Firewall
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* API version: 1.0.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
package waf
import (
"encoding/json"
)
// PaginationPageInfo Information about a paginated response This is modeled after the GraphQL Relay spec to support both cursor based pagination and traditional offset based pagination.
type PaginationPageInfo struct {
// The total number of items in the dataset
TotalCount *string `json:"totalCount,omitempty"`
// Whether or not a previous page of data exists
HasPreviousPage *bool `json:"hasPreviousPage,omitempty"`
// Whether or not another page of data is available
HasNextPage *bool `json:"hasNextPage,omitempty"`
// The cursor for the first item in the set of data returned
StartCursor *string `json:"startCursor,omitempty"`
// The cursor for the last item in the set of data returned
EndCursor *string `json:"endCursor,omitempty"`
}
// NewPaginationPageInfo instantiates a new PaginationPageInfo object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewPaginationPageInfo() *PaginationPageInfo {
this := PaginationPageInfo{}
return &this
}
// NewPaginationPageInfoWithDefaults instantiates a new PaginationPageInfo object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewPaginationPageInfoWithDefaults() *PaginationPageInfo {
this := PaginationPageInfo{}
return &this
}
// GetTotalCount returns the TotalCount field value if set, zero value otherwise.
func (o *PaginationPageInfo) GetTotalCount() string {
if o == nil || o.TotalCount == nil {
var ret string
return ret
}
return *o.TotalCount
}
// GetTotalCountOk returns a tuple with the TotalCount field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PaginationPageInfo) GetTotalCountOk() (*string, bool) {
if o == nil || o.TotalCount == nil {
return nil, false
}
return o.TotalCount, true
}
// HasTotalCount returns a boolean if a field has been set.
func (o *PaginationPageInfo) HasTotalCount() bool {
if o != nil && o.TotalCount != nil {
return true
}
return false
}
// SetTotalCount gets a reference to the given string and assigns it to the TotalCount field.
func (o *PaginationPageInfo) SetTotalCount(v string) {
o.TotalCount = &v
}
// GetHasPreviousPage returns the HasPreviousPage field value if set, zero value otherwise.
func (o *PaginationPageInfo) GetHasPreviousPage() bool {
if o == nil || o.HasPreviousPage == nil {
var ret bool
return ret
}
return *o.HasPreviousPage
}
// GetHasPreviousPageOk returns a tuple with the HasPreviousPage field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PaginationPageInfo) GetHasPreviousPageOk() (*bool, bool) {
if o == nil || o.HasPreviousPage == nil {
return nil, false
}
return o.HasPreviousPage, true
}
// HasHasPreviousPage returns a boolean if a field has been set.
func (o *PaginationPageInfo) HasHasPreviousPage() bool {
if o != nil && o.HasPreviousPage != nil {
return true
}
return false
}
// SetHasPreviousPage gets a reference to the given bool and assigns it to the HasPreviousPage field.
func (o *PaginationPageInfo) SetHasPreviousPage(v bool) {
o.HasPreviousPage = &v
}
// GetHasNextPage returns the HasNextPage field value if set, zero value otherwise.
func (o *PaginationPageInfo) GetHasNextPage() bool {
if o == nil || o.HasNextPage == nil {
var ret bool
return ret
}
return *o.HasNextPage
}
// GetHasNextPageOk returns a tuple with the HasNextPage field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PaginationPageInfo) GetHasNextPageOk() (*bool, bool) {
if o == nil || o.HasNextPage == nil {
return nil, false
}
return o.HasNextPage, true
}
// HasHasNextPage returns a boolean if a field has been set.
func (o *PaginationPageInfo) HasHasNextPage() bool {
if o != nil && o.HasNextPage != nil {
return true
}
return false
}
// SetHasNextPage gets a reference to the given bool and assigns it to the HasNextPage field.
func (o *PaginationPageInfo) SetHasNextPage(v bool) {
o.HasNextPage = &v
}
// GetStartCursor returns the StartCursor field value if set, zero value otherwise.
func (o *PaginationPageInfo) GetStartCursor() string {
if o == nil || o.StartCursor == nil {
var ret string
return ret
}
return *o.StartCursor
}
// GetStartCursorOk returns a tuple with the StartCursor field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PaginationPageInfo) GetStartCursorOk() (*string, bool) {
if o == nil || o.StartCursor == nil {
return nil, false
}
return o.StartCursor, true
}
// HasStartCursor returns a boolean if a field has been set.
func (o *PaginationPageInfo) HasStartCursor() bool {
if o != nil && o.StartCursor != nil {
return true
}
return false
}
// SetStartCursor gets a reference to the given string and assigns it to the StartCursor field.
func (o *PaginationPageInfo) SetStartCursor(v string) {
o.StartCursor = &v
}
// GetEndCursor returns the EndCursor field value if set, zero value otherwise.
func (o *PaginationPageInfo) GetEndCursor() string {
if o == nil || o.EndCursor == nil {
var ret string
return ret
}
return *o.EndCursor
}
// GetEndCursorOk returns a tuple with the EndCursor field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PaginationPageInfo) GetEndCursorOk() (*string, bool) {
if o == nil || o.EndCursor == nil {
return nil, false
}
return o.EndCursor, true
}
// HasEndCursor returns a boolean if a field has been set.
func (o *PaginationPageInfo) HasEndCursor() bool {
if o != nil && o.EndCursor != nil {
return true
}
return false
}
// SetEndCursor gets a reference to the given string and assigns it to the EndCursor field.
func (o *PaginationPageInfo) SetEndCursor(v string) {
o.EndCursor = &v
}
func (o PaginationPageInfo) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.TotalCount != nil {
toSerialize["totalCount"] = o.TotalCount
}
if o.HasPreviousPage != nil {
toSerialize["hasPreviousPage"] = o.HasPreviousPage
}
if o.HasNextPage != nil {
toSerialize["hasNextPage"] = o.HasNextPage
}
if o.StartCursor != nil {
toSerialize["startCursor"] = o.StartCursor
}
if o.EndCursor != nil {
toSerialize["endCursor"] = o.EndCursor
}
return json.Marshal(toSerialize)
}
type NullablePaginationPageInfo struct {
value *PaginationPageInfo
isSet bool
}
func (v NullablePaginationPageInfo) Get() *PaginationPageInfo {
return v.value
}
func (v *NullablePaginationPageInfo) Set(val *PaginationPageInfo) {
v.value = val
v.isSet = true
}
func (v NullablePaginationPageInfo) IsSet() bool {
return v.isSet
}
func (v *NullablePaginationPageInfo) Unset() {
v.value = nil
v.isSet = false
}
func NewNullablePaginationPageInfo(val *PaginationPageInfo) *NullablePaginationPageInfo {
return &NullablePaginationPageInfo{value: val, isSet: true}
}
func (v NullablePaginationPageInfo) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullablePaginationPageInfo) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}