Class: LaunchDarklyApi::View

Inherits:
ApiModelBase show all
Defined in:
lib/launchdarkly_api/models/view.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ApiModelBase

_deserialize, #_to_hash, #to_body, #to_s

Constructor Details

#initialize(attributes = {}) ⇒ View

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



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
# File 'lib/launchdarkly_api/models/view.rb', line 181

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `LaunchDarklyApi::View` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  acceptable_attribute_map = self.class.acceptable_attribute_map
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!acceptable_attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `LaunchDarklyApi::View`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'_access')
    self._access = attributes[:'_access']
  end

  if attributes.key?(:'_links')
    self._links = attributes[:'_links']
  end

  if attributes.key?(:'id')
    self.id = attributes[:'id']
  else
    self.id = nil
  end

  if attributes.key?(:'account_id')
    self. = attributes[:'account_id']
  else
    self. = nil
  end

  if attributes.key?(:'project_id')
    self.project_id = attributes[:'project_id']
  else
    self.project_id = nil
  end

  if attributes.key?(:'project_key')
    self.project_key = attributes[:'project_key']
  else
    self.project_key = nil
  end

  if attributes.key?(:'key')
    self.key = attributes[:'key']
  else
    self.key = nil
  end

  if attributes.key?(:'name')
    self.name = attributes[:'name']
  else
    self.name = nil
  end

  if attributes.key?(:'description')
    self.description = attributes[:'description']
  else
    self.description = nil
  end

  if attributes.key?(:'_affects_sdk_payload')
    self._affects_sdk_payload = attributes[:'_affects_sdk_payload']
  else
    self._affects_sdk_payload = nil
  end

  if attributes.key?(:'generate_sdk_keys')
    self.generate_sdk_keys = attributes[:'generate_sdk_keys']
  end

  if attributes.key?(:'version')
    self.version = attributes[:'version']
  else
    self.version = nil
  end

  if attributes.key?(:'tags')
    if (value = attributes[:'tags']).is_a?(Array)
      self.tags = value
    end
  else
    self.tags = nil
  end

  if attributes.key?(:'created_at')
    self.created_at = attributes[:'created_at']
  else
    self.created_at = nil
  end

  if attributes.key?(:'updated_at')
    self.updated_at = attributes[:'updated_at']
  else
    self.updated_at = nil
  end

  if attributes.key?(:'archived')
    self.archived = attributes[:'archived']
  else
    self.archived = false
  end

  if attributes.key?(:'archived_at')
    self.archived_at = attributes[:'archived_at']
  end

  if attributes.key?(:'deleted_at')
    self.deleted_at = attributes[:'deleted_at']
  end

  if attributes.key?(:'deleted')
    self.deleted = attributes[:'deleted']
  else
    self.deleted = false
  end

  if attributes.key?(:'maintainer')
    self.maintainer = attributes[:'maintainer']
  end

  if attributes.key?(:'flags_summary')
    self.flags_summary = attributes[:'flags_summary']
  end

  if attributes.key?(:'segments_summary')
    self.segments_summary = attributes[:'segments_summary']
  end

  if attributes.key?(:'metrics_summary')
    self.metrics_summary = attributes[:'metrics_summary']
  end

  if attributes.key?(:'ai_configs_summary')
    self.ai_configs_summary = attributes[:'ai_configs_summary']
  end

  if attributes.key?(:'resource_summary')
    self.resource_summary = attributes[:'resource_summary']
  end

  if attributes.key?(:'flags_expanded')
    self.flags_expanded = attributes[:'flags_expanded']
  end

  if attributes.key?(:'segments_expanded')
    self.segments_expanded = attributes[:'segments_expanded']
  end

  if attributes.key?(:'metrics_expanded')
    self.metrics_expanded = attributes[:'metrics_expanded']
  end

  if attributes.key?(:'ai_configs_expanded')
    self.ai_configs_expanded = attributes[:'ai_configs_expanded']
  end

  if attributes.key?(:'resources_expanded')
    self.resources_expanded = attributes[:'resources_expanded']
  end
end

Instance Attribute Details

#_accessObject

Returns the value of attribute _access.



18
19
20
# File 'lib/launchdarkly_api/models/view.rb', line 18

def _access
  @_access
end

#_affects_sdk_payloadObject

Whether this view is used to filter SDK payloads



44
45
46
# File 'lib/launchdarkly_api/models/view.rb', line 44

def _affects_sdk_payload
  @_affects_sdk_payload
end

Returns the value of attribute _links.



20
21
22
# File 'lib/launchdarkly_api/models/view.rb', line 20

def _links
  @_links
end

#account_idObject

ID of the account that owns this view



26
27
28
# File 'lib/launchdarkly_api/models/view.rb', line 26

def 
  @account_id
end

#ai_configs_expandedObject

Returns the value of attribute ai_configs_expanded.



87
88
89
# File 'lib/launchdarkly_api/models/view.rb', line 87

def ai_configs_expanded
  @ai_configs_expanded
end

#ai_configs_summaryObject

Returns the value of attribute ai_configs_summary.



77
78
79
# File 'lib/launchdarkly_api/models/view.rb', line 77

def ai_configs_summary
  @ai_configs_summary
end

#archivedObject

Whether this view is archived



60
61
62
# File 'lib/launchdarkly_api/models/view.rb', line 60

def archived
  @archived
end

#archived_atObject

Returns the value of attribute archived_at.



62
63
64
# File 'lib/launchdarkly_api/models/view.rb', line 62

def archived_at
  @archived_at
end

#created_atObject

Returns the value of attribute created_at.



55
56
57
# File 'lib/launchdarkly_api/models/view.rb', line 55

def created_at
  @created_at
end

#deletedObject

Whether this view is deleted



67
68
69
# File 'lib/launchdarkly_api/models/view.rb', line 67

def deleted
  @deleted
end

#deleted_atObject

Returns the value of attribute deleted_at.



64
65
66
# File 'lib/launchdarkly_api/models/view.rb', line 64

def deleted_at
  @deleted_at
end

#descriptionObject

Optional detailed description of the view



41
42
43
# File 'lib/launchdarkly_api/models/view.rb', line 41

def description
  @description
end

#flags_expandedObject

Returns the value of attribute flags_expanded.



81
82
83
# File 'lib/launchdarkly_api/models/view.rb', line 81

def flags_expanded
  @flags_expanded
end

#flags_summaryObject

Returns the value of attribute flags_summary.



71
72
73
# File 'lib/launchdarkly_api/models/view.rb', line 71

def flags_summary
  @flags_summary
end

#generate_sdk_keysObject

Deprecated compatibility field. Mirrors _affectsSdkPayload during rollout.



47
48
49
# File 'lib/launchdarkly_api/models/view.rb', line 47

def generate_sdk_keys
  @generate_sdk_keys
end

#idObject

Unique ID of this view



23
24
25
# File 'lib/launchdarkly_api/models/view.rb', line 23

def id
  @id
end

#keyObject

Unique key for the view within the account/project



35
36
37
# File 'lib/launchdarkly_api/models/view.rb', line 35

def key
  @key
end

#maintainerObject

Returns the value of attribute maintainer.



69
70
71
# File 'lib/launchdarkly_api/models/view.rb', line 69

def maintainer
  @maintainer
end

#metrics_expandedObject

Returns the value of attribute metrics_expanded.



85
86
87
# File 'lib/launchdarkly_api/models/view.rb', line 85

def metrics_expanded
  @metrics_expanded
end

#metrics_summaryObject

Returns the value of attribute metrics_summary.



75
76
77
# File 'lib/launchdarkly_api/models/view.rb', line 75

def metrics_summary
  @metrics_summary
end

#nameObject

Human-readable name for the view



38
39
40
# File 'lib/launchdarkly_api/models/view.rb', line 38

def name
  @name
end

#project_idObject

ID of the project this view belongs to



29
30
31
# File 'lib/launchdarkly_api/models/view.rb', line 29

def project_id
  @project_id
end

#project_keyObject

Key of the project this view belongs to



32
33
34
# File 'lib/launchdarkly_api/models/view.rb', line 32

def project_key
  @project_key
end

#resource_summaryObject

Returns the value of attribute resource_summary.



79
80
81
# File 'lib/launchdarkly_api/models/view.rb', line 79

def resource_summary
  @resource_summary
end

#resources_expandedObject

Returns the value of attribute resources_expanded.



89
90
91
# File 'lib/launchdarkly_api/models/view.rb', line 89

def resources_expanded
  @resources_expanded
end

#segments_expandedObject

Returns the value of attribute segments_expanded.



83
84
85
# File 'lib/launchdarkly_api/models/view.rb', line 83

def segments_expanded
  @segments_expanded
end

#segments_summaryObject

Returns the value of attribute segments_summary.



73
74
75
# File 'lib/launchdarkly_api/models/view.rb', line 73

def segments_summary
  @segments_summary
end

#tagsObject

Tags associated with this view



53
54
55
# File 'lib/launchdarkly_api/models/view.rb', line 53

def tags
  @tags
end

#updated_atObject

Returns the value of attribute updated_at.



57
58
59
# File 'lib/launchdarkly_api/models/view.rb', line 57

def updated_at
  @updated_at
end

#versionObject

Version number for tracking changes



50
51
52
# File 'lib/launchdarkly_api/models/view.rb', line 50

def version
  @version
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



128
129
130
# File 'lib/launchdarkly_api/models/view.rb', line 128

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



133
134
135
# File 'lib/launchdarkly_api/models/view.rb', line 133

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



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
# File 'lib/launchdarkly_api/models/view.rb', line 92

def self.attribute_map
  {
    :'_access' => :'_access',
    :'_links' => :'_links',
    :'id' => :'id',
    :'account_id' => :'accountId',
    :'project_id' => :'projectId',
    :'project_key' => :'projectKey',
    :'key' => :'key',
    :'name' => :'name',
    :'description' => :'description',
    :'_affects_sdk_payload' => :'_affectsSdkPayload',
    :'generate_sdk_keys' => :'generateSdkKeys',
    :'version' => :'version',
    :'tags' => :'tags',
    :'created_at' => :'createdAt',
    :'updated_at' => :'updatedAt',
    :'archived' => :'archived',
    :'archived_at' => :'archivedAt',
    :'deleted_at' => :'deletedAt',
    :'deleted' => :'deleted',
    :'maintainer' => :'maintainer',
    :'flags_summary' => :'flagsSummary',
    :'segments_summary' => :'segmentsSummary',
    :'metrics_summary' => :'metricsSummary',
    :'ai_configs_summary' => :'aiConfigsSummary',
    :'resource_summary' => :'resourceSummary',
    :'flags_expanded' => :'flagsExpanded',
    :'segments_expanded' => :'segmentsExpanded',
    :'metrics_expanded' => :'metricsExpanded',
    :'ai_configs_expanded' => :'aiConfigsExpanded',
    :'resources_expanded' => :'resourcesExpanded'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
# File 'lib/launchdarkly_api/models/view.rb', line 623

def self.build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  transformed_hash = {}
  openapi_types.each_pair do |key, type|
    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = nil
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[attribute_map[key]].is_a?(Array)
        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
      end
    elsif !attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
    end
  end
  new(transformed_hash)
end

.openapi_nullableObject

List of attributes with nullable: true



174
175
176
177
# File 'lib/launchdarkly_api/models/view.rb', line 174

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



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
# File 'lib/launchdarkly_api/models/view.rb', line 138

def self.openapi_types
  {
    :'_access' => :'ViewsAccessRep',
    :'_links' => :'ParentAndSelfLinks',
    :'id' => :'String',
    :'account_id' => :'String',
    :'project_id' => :'String',
    :'project_key' => :'String',
    :'key' => :'String',
    :'name' => :'String',
    :'description' => :'String',
    :'_affects_sdk_payload' => :'Boolean',
    :'generate_sdk_keys' => :'Boolean',
    :'version' => :'Integer',
    :'tags' => :'Array<String>',
    :'created_at' => :'Integer',
    :'updated_at' => :'Integer',
    :'archived' => :'Boolean',
    :'archived_at' => :'Integer',
    :'deleted_at' => :'Integer',
    :'deleted' => :'Boolean',
    :'maintainer' => :'Maintainer',
    :'flags_summary' => :'FlagsSummary',
    :'segments_summary' => :'SegmentsSummary',
    :'metrics_summary' => :'MetricsSummary',
    :'ai_configs_summary' => :'AIConfigsSummary',
    :'resource_summary' => :'ResourceSummary',
    :'flags_expanded' => :'ExpandedLinkedFlags',
    :'segments_expanded' => :'ExpandedLinkedSegments',
    :'metrics_expanded' => :'ExpandedLinkedMetrics',
    :'ai_configs_expanded' => :'ExpandedLinkedAIConfigs',
    :'resources_expanded' => :'ExpandedLinkedResources'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
# File 'lib/launchdarkly_api/models/view.rb', line 573

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      _access == o._access &&
      _links == o._links &&
      id == o.id &&
       == o. &&
      project_id == o.project_id &&
      project_key == o.project_key &&
      key == o.key &&
      name == o.name &&
      description == o.description &&
      _affects_sdk_payload == o._affects_sdk_payload &&
      generate_sdk_keys == o.generate_sdk_keys &&
      version == o.version &&
      tags == o.tags &&
      created_at == o.created_at &&
      updated_at == o.updated_at &&
      archived == o.archived &&
      archived_at == o.archived_at &&
      deleted_at == o.deleted_at &&
      deleted == o.deleted &&
      maintainer == o.maintainer &&
      flags_summary == o.flags_summary &&
      segments_summary == o.segments_summary &&
      metrics_summary == o.metrics_summary &&
      ai_configs_summary == o.ai_configs_summary &&
      resource_summary == o.resource_summary &&
      flags_expanded == o.flags_expanded &&
      segments_expanded == o.segments_expanded &&
      metrics_expanded == o.metrics_expanded &&
      ai_configs_expanded == o.ai_configs_expanded &&
      resources_expanded == o.resources_expanded
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


610
611
612
# File 'lib/launchdarkly_api/models/view.rb', line 610

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



616
617
618
# File 'lib/launchdarkly_api/models/view.rb', line 616

def hash
  [_access, _links, id, , project_id, project_key, key, name, description, _affects_sdk_payload, generate_sdk_keys, version, tags, created_at, updated_at, archived, archived_at, deleted_at, deleted, maintainer, flags_summary, segments_summary, metrics_summary, ai_configs_summary, resource_summary, flags_expanded, segments_expanded, metrics_expanded, ai_configs_expanded, resources_expanded].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
# File 'lib/launchdarkly_api/models/view.rb', line 348

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  if @id.nil?
    invalid_properties.push('invalid value for "id", id cannot be nil.')
  end

  if @account_id.nil?
    invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
  end

  if @project_id.nil?
    invalid_properties.push('invalid value for "project_id", project_id cannot be nil.')
  end

  if @project_key.nil?
    invalid_properties.push('invalid value for "project_key", project_key cannot be nil.')
  end

  if @key.nil?
    invalid_properties.push('invalid value for "key", key cannot be nil.')
  end

  if @name.nil?
    invalid_properties.push('invalid value for "name", name cannot be nil.')
  end

  if @description.nil?
    invalid_properties.push('invalid value for "description", description cannot be nil.')
  end

  if @_affects_sdk_payload.nil?
    invalid_properties.push('invalid value for "_affects_sdk_payload", _affects_sdk_payload cannot be nil.')
  end

  if @version.nil?
    invalid_properties.push('invalid value for "version", version cannot be nil.')
  end

  if @tags.nil?
    invalid_properties.push('invalid value for "tags", tags cannot be nil.')
  end

  if @created_at.nil?
    invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
  end

  if @updated_at.nil?
    invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
  end

  if @archived.nil?
    invalid_properties.push('invalid value for "archived", archived cannot be nil.')
  end

  if @deleted.nil?
    invalid_properties.push('invalid value for "deleted", deleted cannot be nil.')
  end

  invalid_properties
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



645
646
647
648
649
650
651
652
653
654
655
656
657
# File 'lib/launchdarkly_api/models/view.rb', line 645

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
  hash
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
# File 'lib/launchdarkly_api/models/view.rb', line 412

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if @id.nil?
  return false if @account_id.nil?
  return false if @project_id.nil?
  return false if @project_key.nil?
  return false if @key.nil?
  return false if @name.nil?
  return false if @description.nil?
  return false if @_affects_sdk_payload.nil?
  return false if @version.nil?
  return false if @tags.nil?
  return false if @created_at.nil?
  return false if @updated_at.nil?
  return false if @archived.nil?
  return false if @deleted.nil?
  true
end