Repository navigation
Expand file tree
/
Copy pathmodel_access_users_create_token_request.go
More file actions
266 lines (205 loc) · 7.04 KB
/
Copy pathmodel_access_users_create_token_request.go
File metadata and controls
266 lines (205 loc) · 7.04 KB
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
262
263
264
/*
Proxmox Datacenter Manager API
Generated from apidoc.js. NOT an official Proxmox specification. See https://pdm.proxmox.com/docs/api-viewer/ for the upstream documentation.
API version: 9.x
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
)
// checks if the AccessUsersCreateTokenRequest type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AccessUsersCreateTokenRequest{}
// AccessUsersCreateTokenRequest struct for AccessUsersCreateTokenRequest
type AccessUsersCreateTokenRequest struct {
// Comment.
Comment *string `json:"comment,omitempty" validate:"regexp=^[[:^cntrl:]]*$"`
// Prevent changes if current configuration file has different SHA256 digest. This can be used to prevent concurrent modifications.
Digest *string `json:"digest,omitempty" validate:"regexp=^[a-f0-9]{64}$"`
// Enable the account (default). You can set this to '0' to disable the account.
Enable *bool `json:"enable,omitempty"`
// Account expiration date (seconds since epoch). '0' means no expiration date.
Expire *int64 `json:"expire,omitempty"`
}
// NewAccessUsersCreateTokenRequest instantiates a new AccessUsersCreateTokenRequest 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 NewAccessUsersCreateTokenRequest() *AccessUsersCreateTokenRequest {
this := AccessUsersCreateTokenRequest{}
var enable bool = true
this.Enable = &enable
var expire int64 = 0
this.Expire = &expire
return &this
}
// NewAccessUsersCreateTokenRequestWithDefaults instantiates a new AccessUsersCreateTokenRequest 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 NewAccessUsersCreateTokenRequestWithDefaults() *AccessUsersCreateTokenRequest {
this := AccessUsersCreateTokenRequest{}
var enable bool = true
this.Enable = &enable
var expire int64 = 0
this.Expire = &expire
return &this
}
// GetComment returns the Comment field value if set, zero value otherwise.
func (o *AccessUsersCreateTokenRequest) GetComment() string {
if o == nil || IsNil(o.Comment) {
var ret string
return ret
}
return *o.Comment
}
// GetCommentOk returns a tuple with the Comment field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AccessUsersCreateTokenRequest) GetCommentOk() (*string, bool) {
if o == nil || IsNil(o.Comment) {
return nil, false
}
return o.Comment, true
}
// HasComment returns a boolean if a field has been set.
func (o *AccessUsersCreateTokenRequest) HasComment() bool {
if o != nil && !IsNil(o.Comment) {
return true
}
return false
}
// SetComment gets a reference to the given string and assigns it to the Comment field.
func (o *AccessUsersCreateTokenRequest) SetComment(v string) {
o.Comment = &v
}
// GetDigest returns the Digest field value if set, zero value otherwise.
func (o *AccessUsersCreateTokenRequest) GetDigest() string {
if o == nil || IsNil(o.Digest) {
var ret string
return ret
}
return *o.Digest
}
// GetDigestOk returns a tuple with the Digest field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AccessUsersCreateTokenRequest) GetDigestOk() (*string, bool) {
if o == nil || IsNil(o.Digest) {
return nil, false
}
return o.Digest, true
}
// HasDigest returns a boolean if a field has been set.
func (o *AccessUsersCreateTokenRequest) HasDigest() bool {
if o != nil && !IsNil(o.Digest) {
return true
}
return false
}
// SetDigest gets a reference to the given string and assigns it to the Digest field.
func (o *AccessUsersCreateTokenRequest) SetDigest(v string) {
o.Digest = &v
}
// GetEnable returns the Enable field value if set, zero value otherwise.
func (o *AccessUsersCreateTokenRequest) GetEnable() bool {
if o == nil || IsNil(o.Enable) {
var ret bool
return ret
}
return *o.Enable
}
// GetEnableOk returns a tuple with the Enable field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AccessUsersCreateTokenRequest) GetEnableOk() (*bool, bool) {
if o == nil || IsNil(o.Enable) {
return nil, false
}
return o.Enable, true
}
// HasEnable returns a boolean if a field has been set.
func (o *AccessUsersCreateTokenRequest) HasEnable() bool {
if o != nil && !IsNil(o.Enable) {
return true
}
return false
}
// SetEnable gets a reference to the given bool and assigns it to the Enable field.
func (o *AccessUsersCreateTokenRequest) SetEnable(v bool) {
o.Enable = &v
}
// GetExpire returns the Expire field value if set, zero value otherwise.
func (o *AccessUsersCreateTokenRequest) GetExpire() int64 {
if o == nil || IsNil(o.Expire) {
var ret int64
return ret
}
return *o.Expire
}
// GetExpireOk returns a tuple with the Expire field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AccessUsersCreateTokenRequest) GetExpireOk() (*int64, bool) {
if o == nil || IsNil(o.Expire) {
return nil, false
}
return o.Expire, true
}
// HasExpire returns a boolean if a field has been set.
func (o *AccessUsersCreateTokenRequest) HasExpire() bool {
if o != nil && !IsNil(o.Expire) {
return true
}
return false
}
// SetExpire gets a reference to the given int64 and assigns it to the Expire field.
func (o *AccessUsersCreateTokenRequest) SetExpire(v int64) {
o.Expire = &v
}
func (o AccessUsersCreateTokenRequest) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AccessUsersCreateTokenRequest) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Comment) {
toSerialize["comment"] = o.Comment
}
if !IsNil(o.Digest) {
toSerialize["digest"] = o.Digest
}
if !IsNil(o.Enable) {
toSerialize["enable"] = o.Enable
}
if !IsNil(o.Expire) {
toSerialize["expire"] = o.Expire
}
return toSerialize, nil
}
type NullableAccessUsersCreateTokenRequest struct {
value *AccessUsersCreateTokenRequest
isSet bool
}
func (v NullableAccessUsersCreateTokenRequest) Get() *AccessUsersCreateTokenRequest {
return v.value
}
func (v *NullableAccessUsersCreateTokenRequest) Set(val *AccessUsersCreateTokenRequest) {
v.value = val
v.isSet = true
}
func (v NullableAccessUsersCreateTokenRequest) IsSet() bool {
return v.isSet
}
func (v *NullableAccessUsersCreateTokenRequest) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAccessUsersCreateTokenRequest(val *AccessUsersCreateTokenRequest) *NullableAccessUsersCreateTokenRequest {
return &NullableAccessUsersCreateTokenRequest{value: val, isSet: true}
}
func (v NullableAccessUsersCreateTokenRequest) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAccessUsersCreateTokenRequest) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}