-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathrum_application_attributes.rb
More file actions
346 lines (294 loc) · 10.8 KB
/
Copy pathrum_application_attributes.rb
File metadata and controls
346 lines (294 loc) · 10.8 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
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
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
=begin
#Datadog API V2 Collection
#Collection of all Datadog Public endpoints.
The version of the OpenAPI document: 1.0
Contact: support@datadoghq.com
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
This product includes software developed at Datadog (https://www.datadoghq.com/).
Copyright 2020-Present Datadog, Inc.
=end
require 'date'
require 'time'
module DatadogAPIClient::V2
# RUM application attributes.
class RUMApplicationAttributes
include BaseGenericModel
# ID of the API key associated with the application.
attr_reader :api_key_id
# ID of the RUM application.
attr_reader :application_id
# Client token of the RUM application.
attr_reader :client_token
# Timestamp in ms of the creation date.
attr_reader :created_at
# Handle of the creator user.
attr_reader :created_by_handle
# Hash of the RUM application. Optional.
attr_accessor :_hash
# Indicates if the RUM application is active.
attr_accessor :is_active
# Name of the RUM application.
attr_reader :name
# Org ID of the RUM application.
attr_reader :org_id
# Product Scales configuration for the RUM application.
attr_accessor :product_scales
# Type of the RUM application. Supported values are `browser`, `ios`, `android`, `react-native`, `flutter`, `roku`, `electron`, `unity`, `kotlin-multiplatform`.
attr_reader :type
# Timestamp in ms of the last update date.
attr_reader :updated_at
# Handle of the updater user.
attr_reader :updated_by_handle
attr_accessor :additional_properties
# Attribute mapping from ruby-style variable name to JSON key.
# @!visibility private
def self.attribute_map
{
:'api_key_id' => :'api_key_id',
:'application_id' => :'application_id',
:'client_token' => :'client_token',
:'created_at' => :'created_at',
:'created_by_handle' => :'created_by_handle',
:'_hash' => :'hash',
:'is_active' => :'is_active',
:'name' => :'name',
:'org_id' => :'org_id',
:'product_scales' => :'product_scales',
:'type' => :'type',
:'updated_at' => :'updated_at',
:'updated_by_handle' => :'updated_by_handle'
}
end
# Attribute type mapping.
# @!visibility private
def self.openapi_types
{
:'api_key_id' => :'Integer',
:'application_id' => :'String',
:'client_token' => :'String',
:'created_at' => :'Integer',
:'created_by_handle' => :'String',
:'_hash' => :'String',
:'is_active' => :'Boolean',
:'name' => :'String',
:'org_id' => :'Integer',
:'product_scales' => :'RUMProductScales',
:'type' => :'String',
:'updated_at' => :'Integer',
:'updated_by_handle' => :'String'
}
end
# Initializes the object
# @param attributes [Hash] Model attributes in the form of hash
# @!visibility private
def initialize(attributes = {})
if (!attributes.is_a?(Hash))
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RUMApplicationAttributes` initialize method"
end
self.additional_properties = {}
# check to see if the attribute exists and convert string to symbol for hash key
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
self.additional_properties[k.to_sym] = v
else
h[k.to_sym] = v
end
}
if attributes.key?(:'api_key_id')
self.api_key_id = attributes[:'api_key_id']
end
if attributes.key?(:'application_id')
self.application_id = attributes[:'application_id']
end
if attributes.key?(:'client_token')
self.client_token = attributes[:'client_token']
end
if attributes.key?(:'created_at')
self.created_at = attributes[:'created_at']
end
if attributes.key?(:'created_by_handle')
self.created_by_handle = attributes[:'created_by_handle']
end
if attributes.key?(:'_hash')
self._hash = attributes[:'_hash']
end
if attributes.key?(:'is_active')
self.is_active = attributes[:'is_active']
end
if attributes.key?(:'name')
self.name = attributes[:'name']
end
if attributes.key?(:'org_id')
self.org_id = attributes[:'org_id']
end
if attributes.key?(:'product_scales')
self.product_scales = attributes[:'product_scales']
end
if attributes.key?(:'type')
self.type = attributes[:'type']
end
if attributes.key?(:'updated_at')
self.updated_at = attributes[:'updated_at']
end
if attributes.key?(:'updated_by_handle')
self.updated_by_handle = attributes[:'updated_by_handle']
end
end
# Check to see if the all the properties in the model are valid
# @return true if the model is valid
# @!visibility private
def valid?
return false if !@api_key_id.nil? && @api_key_id > 2147483647
return false if @application_id.nil?
return false if @client_token.nil?
return false if @created_at.nil?
return false if @created_by_handle.nil?
return false if @name.nil?
return false if @org_id.nil?
return false if @org_id > 2147483647
return false if @type.nil?
return false if @updated_at.nil?
return false if @updated_by_handle.nil?
true
end
# Custom attribute writer method with validation
# @param api_key_id [Object] Object to be assigned
# @!visibility private
def api_key_id=(api_key_id)
if !api_key_id.nil? && api_key_id > 2147483647
fail ArgumentError, 'invalid value for "api_key_id", must be smaller than or equal to 2147483647.'
end
@api_key_id = api_key_id
end
# Custom attribute writer method with validation
# @param application_id [Object] Object to be assigned
# @!visibility private
def application_id=(application_id)
if application_id.nil?
fail ArgumentError, 'invalid value for "application_id", application_id cannot be nil.'
end
@application_id = application_id
end
# Custom attribute writer method with validation
# @param client_token [Object] Object to be assigned
# @!visibility private
def client_token=(client_token)
if client_token.nil?
fail ArgumentError, 'invalid value for "client_token", client_token cannot be nil.'
end
@client_token = client_token
end
# Custom attribute writer method with validation
# @param created_at [Object] Object to be assigned
# @!visibility private
def created_at=(created_at)
if created_at.nil?
fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.'
end
@created_at = created_at
end
# Custom attribute writer method with validation
# @param created_by_handle [Object] Object to be assigned
# @!visibility private
def created_by_handle=(created_by_handle)
if created_by_handle.nil?
fail ArgumentError, 'invalid value for "created_by_handle", created_by_handle cannot be nil.'
end
@created_by_handle = created_by_handle
end
# Custom attribute writer method with validation
# @param name [Object] Object to be assigned
# @!visibility private
def name=(name)
if name.nil?
fail ArgumentError, 'invalid value for "name", name cannot be nil.'
end
@name = name
end
# Custom attribute writer method with validation
# @param org_id [Object] Object to be assigned
# @!visibility private
def org_id=(org_id)
if org_id.nil?
fail ArgumentError, 'invalid value for "org_id", org_id cannot be nil.'
end
if org_id > 2147483647
fail ArgumentError, 'invalid value for "org_id", must be smaller than or equal to 2147483647.'
end
@org_id = org_id
end
# Custom attribute writer method with validation
# @param type [Object] Object to be assigned
# @!visibility private
def type=(type)
if type.nil?
fail ArgumentError, 'invalid value for "type", type cannot be nil.'
end
@type = type
end
# Custom attribute writer method with validation
# @param updated_at [Object] Object to be assigned
# @!visibility private
def updated_at=(updated_at)
if updated_at.nil?
fail ArgumentError, 'invalid value for "updated_at", updated_at cannot be nil.'
end
@updated_at = updated_at
end
# Custom attribute writer method with validation
# @param updated_by_handle [Object] Object to be assigned
# @!visibility private
def updated_by_handle=(updated_by_handle)
if updated_by_handle.nil?
fail ArgumentError, 'invalid value for "updated_by_handle", updated_by_handle cannot be nil.'
end
@updated_by_handle = updated_by_handle
end
# Returns the object in the form of hash, with additionalProperties support.
# @return [Hash] Returns the object in the form of hash
# @!visibility private
def to_hash
hash = {}
self.class.attribute_map.each_pair do |attr, param|
value = self.send(attr)
if value.nil?
is_nullable = self.class.openapi_nullable.include?(attr)
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
end
hash[param] = _to_hash(value)
end
self.additional_properties.each_pair do |attr, value|
hash[attr] = value
end
hash
end
# Checks equality by comparing each attribute.
# @param o [Object] Object to be compared
# @!visibility private
def ==(o)
return true if self.equal?(o)
self.class == o.class &&
api_key_id == o.api_key_id &&
application_id == o.application_id &&
client_token == o.client_token &&
created_at == o.created_at &&
created_by_handle == o.created_by_handle &&
_hash == o._hash &&
is_active == o.is_active &&
name == o.name &&
org_id == o.org_id &&
product_scales == o.product_scales &&
type == o.type &&
updated_at == o.updated_at &&
updated_by_handle == o.updated_by_handle &&
additional_properties == o.additional_properties
end
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
# @!visibility private
def hash
[api_key_id, application_id, client_token, created_at, created_by_handle, _hash, is_active, name, org_id, product_scales, type, updated_at, updated_by_handle, additional_properties].hash
end
end
end