-
Notifications
You must be signed in to change notification settings - Fork 5
/
model_user_access_list.go
297 lines (249 loc) · 9.21 KB
/
model_user_access_list.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
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
// Code based on the AtlasAPI V2 OpenAPI file
package admin
import (
"encoding/json"
"time"
)
// UserAccessList struct for UserAccessList
type UserAccessList struct {
// Range of network addresses that you want to add to the access list for the API key. This parameter requires the range to be expressed in classless inter-domain routing (CIDR) notation of Internet Protocol version 4 or version 6 addresses. You can set a value for this parameter or **ipAddress** but not both in the same request.
CidrBlock *string `json:"cidrBlock,omitempty"`
// Total number of requests that have originated from the Internet Protocol (IP) address given as the value of the *lastUsedAddress* parameter.
// Read only field.
Count *int `json:"count,omitempty"`
// Date and time when someone added the network addresses to the specified API access list. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
// Read only field.
Created *time.Time `json:"created,omitempty"`
// Network address that you want to add to the access list for the API key. This parameter requires the address to be expressed as one Internet Protocol version 4 or version 6 address. You can set a value for this parameter or **cidrBlock** but not both in the same request.
IpAddress *string `json:"ipAddress,omitempty"`
// Date and time when MongoDB Cloud received the most recent request that originated from this Internet Protocol version 4 or version 6 address. The resource returns this parameter when at least one request has originated from this IP address. MongoDB Cloud updates this parameter each time a client accesses the permitted resource. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
// Read only field.
LastUsed *time.Time `json:"lastUsed,omitempty"`
// Network address that issued the most recent request to the API. This parameter requires the address to be expressed as one Internet Protocol version 4 or version 6 address. The resource returns this parameter after this IP address made at least one request.
// Read only field.
LastUsedAddress *string `json:"lastUsedAddress,omitempty"`
// List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships.
// Read only field.
Links *[]Link `json:"links,omitempty"`
}
// NewUserAccessList instantiates a new UserAccessList 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 NewUserAccessList() *UserAccessList {
this := UserAccessList{}
return &this
}
// NewUserAccessListWithDefaults instantiates a new UserAccessList 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 NewUserAccessListWithDefaults() *UserAccessList {
this := UserAccessList{}
return &this
}
// GetCidrBlock returns the CidrBlock field value if set, zero value otherwise
func (o *UserAccessList) GetCidrBlock() string {
if o == nil || IsNil(o.CidrBlock) {
var ret string
return ret
}
return *o.CidrBlock
}
// GetCidrBlockOk returns a tuple with the CidrBlock field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UserAccessList) GetCidrBlockOk() (*string, bool) {
if o == nil || IsNil(o.CidrBlock) {
return nil, false
}
return o.CidrBlock, true
}
// HasCidrBlock returns a boolean if a field has been set.
func (o *UserAccessList) HasCidrBlock() bool {
if o != nil && !IsNil(o.CidrBlock) {
return true
}
return false
}
// SetCidrBlock gets a reference to the given string and assigns it to the CidrBlock field.
func (o *UserAccessList) SetCidrBlock(v string) {
o.CidrBlock = &v
}
// GetCount returns the Count field value if set, zero value otherwise
func (o *UserAccessList) GetCount() int {
if o == nil || IsNil(o.Count) {
var ret int
return ret
}
return *o.Count
}
// GetCountOk returns a tuple with the Count field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UserAccessList) GetCountOk() (*int, bool) {
if o == nil || IsNil(o.Count) {
return nil, false
}
return o.Count, true
}
// HasCount returns a boolean if a field has been set.
func (o *UserAccessList) HasCount() bool {
if o != nil && !IsNil(o.Count) {
return true
}
return false
}
// SetCount gets a reference to the given int and assigns it to the Count field.
func (o *UserAccessList) SetCount(v int) {
o.Count = &v
}
// GetCreated returns the Created field value if set, zero value otherwise
func (o *UserAccessList) GetCreated() time.Time {
if o == nil || IsNil(o.Created) {
var ret time.Time
return ret
}
return *o.Created
}
// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UserAccessList) GetCreatedOk() (*time.Time, bool) {
if o == nil || IsNil(o.Created) {
return nil, false
}
return o.Created, true
}
// HasCreated returns a boolean if a field has been set.
func (o *UserAccessList) HasCreated() bool {
if o != nil && !IsNil(o.Created) {
return true
}
return false
}
// SetCreated gets a reference to the given time.Time and assigns it to the Created field.
func (o *UserAccessList) SetCreated(v time.Time) {
o.Created = &v
}
// GetIpAddress returns the IpAddress field value if set, zero value otherwise
func (o *UserAccessList) GetIpAddress() string {
if o == nil || IsNil(o.IpAddress) {
var ret string
return ret
}
return *o.IpAddress
}
// GetIpAddressOk returns a tuple with the IpAddress field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UserAccessList) GetIpAddressOk() (*string, bool) {
if o == nil || IsNil(o.IpAddress) {
return nil, false
}
return o.IpAddress, true
}
// HasIpAddress returns a boolean if a field has been set.
func (o *UserAccessList) HasIpAddress() bool {
if o != nil && !IsNil(o.IpAddress) {
return true
}
return false
}
// SetIpAddress gets a reference to the given string and assigns it to the IpAddress field.
func (o *UserAccessList) SetIpAddress(v string) {
o.IpAddress = &v
}
// GetLastUsed returns the LastUsed field value if set, zero value otherwise
func (o *UserAccessList) GetLastUsed() time.Time {
if o == nil || IsNil(o.LastUsed) {
var ret time.Time
return ret
}
return *o.LastUsed
}
// GetLastUsedOk returns a tuple with the LastUsed field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UserAccessList) GetLastUsedOk() (*time.Time, bool) {
if o == nil || IsNil(o.LastUsed) {
return nil, false
}
return o.LastUsed, true
}
// HasLastUsed returns a boolean if a field has been set.
func (o *UserAccessList) HasLastUsed() bool {
if o != nil && !IsNil(o.LastUsed) {
return true
}
return false
}
// SetLastUsed gets a reference to the given time.Time and assigns it to the LastUsed field.
func (o *UserAccessList) SetLastUsed(v time.Time) {
o.LastUsed = &v
}
// GetLastUsedAddress returns the LastUsedAddress field value if set, zero value otherwise
func (o *UserAccessList) GetLastUsedAddress() string {
if o == nil || IsNil(o.LastUsedAddress) {
var ret string
return ret
}
return *o.LastUsedAddress
}
// GetLastUsedAddressOk returns a tuple with the LastUsedAddress field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UserAccessList) GetLastUsedAddressOk() (*string, bool) {
if o == nil || IsNil(o.LastUsedAddress) {
return nil, false
}
return o.LastUsedAddress, true
}
// HasLastUsedAddress returns a boolean if a field has been set.
func (o *UserAccessList) HasLastUsedAddress() bool {
if o != nil && !IsNil(o.LastUsedAddress) {
return true
}
return false
}
// SetLastUsedAddress gets a reference to the given string and assigns it to the LastUsedAddress field.
func (o *UserAccessList) SetLastUsedAddress(v string) {
o.LastUsedAddress = &v
}
// GetLinks returns the Links field value if set, zero value otherwise
func (o *UserAccessList) GetLinks() []Link {
if o == nil || IsNil(o.Links) {
var ret []Link
return ret
}
return *o.Links
}
// GetLinksOk returns a tuple with the Links field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UserAccessList) GetLinksOk() (*[]Link, bool) {
if o == nil || IsNil(o.Links) {
return nil, false
}
return o.Links, true
}
// HasLinks returns a boolean if a field has been set.
func (o *UserAccessList) HasLinks() bool {
if o != nil && !IsNil(o.Links) {
return true
}
return false
}
// SetLinks gets a reference to the given []Link and assigns it to the Links field.
func (o *UserAccessList) SetLinks(v []Link) {
o.Links = &v
}
func (o UserAccessList) MarshalJSONWithoutReadOnly() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o UserAccessList) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.CidrBlock) {
toSerialize["cidrBlock"] = o.CidrBlock
}
if !IsNil(o.IpAddress) {
toSerialize["ipAddress"] = o.IpAddress
}
return toSerialize, nil
}