Class: LaunchDarklyApi::View
- Inherits:
-
Object
- Object
- LaunchDarklyApi::View
- Defined in:
- lib/launchdarkly_api/models/view.rb
Instance Attribute Summary collapse
-
#_access ⇒ Object
Returns the value of attribute _access.
-
#_links ⇒ Object
Returns the value of attribute _links.
-
#account_id ⇒ Object
ID of the account that owns this view.
-
#ai_configs_expanded ⇒ Object
Returns the value of attribute ai_configs_expanded.
-
#ai_configs_summary ⇒ Object
Returns the value of attribute ai_configs_summary.
-
#archived ⇒ Object
Whether this view is archived.
-
#archived_at ⇒ Object
Returns the value of attribute archived_at.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#deleted ⇒ Object
Whether this view is deleted.
-
#deleted_at ⇒ Object
Returns the value of attribute deleted_at.
-
#description ⇒ Object
Optional detailed description of the view.
-
#flags_expanded ⇒ Object
Returns the value of attribute flags_expanded.
-
#flags_summary ⇒ Object
Returns the value of attribute flags_summary.
-
#generate_sdk_keys ⇒ Object
Whether to generate SDK keys for this view.
-
#id ⇒ Object
Unique ID of this view.
-
#key ⇒ Object
Unique key for the view within the account/project.
-
#maintainer ⇒ Object
Returns the value of attribute maintainer.
-
#metrics_expanded ⇒ Object
Returns the value of attribute metrics_expanded.
-
#metrics_summary ⇒ Object
Returns the value of attribute metrics_summary.
-
#name ⇒ Object
Human-readable name for the view.
-
#project_id ⇒ Object
ID of the project this view belongs to.
-
#project_key ⇒ Object
Key of the project this view belongs to.
-
#resource_summary ⇒ Object
Returns the value of attribute resource_summary.
-
#resources_expanded ⇒ Object
Returns the value of attribute resources_expanded.
-
#segments_expanded ⇒ Object
Returns the value of attribute segments_expanded.
-
#segments_summary ⇒ Object
Returns the value of attribute segments_summary.
-
#tags ⇒ Object
Tags associated with this view.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
-
#version ⇒ Object
Version number for tracking changes.
Class Method Summary collapse
-
._deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about.
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ View
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ View
Initializes the object
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 |
# File 'lib/launchdarkly_api/models/view.rb', line 176 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.account_id = attributes[:'account_id'] else self.account_id = 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?(:'generate_sdk_keys') self.generate_sdk_keys = attributes[:'generate_sdk_keys'] else self.generate_sdk_keys = nil 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. = value end else self. = 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. = attributes[:'flags_expanded'] end if attributes.key?(:'segments_expanded') self. = attributes[:'segments_expanded'] end if attributes.key?(:'metrics_expanded') self. = attributes[:'metrics_expanded'] end if attributes.key?(:'ai_configs_expanded') self. = attributes[:'ai_configs_expanded'] end if attributes.key?(:'resources_expanded') self. = attributes[:'resources_expanded'] end end |
Instance Attribute Details
#_access ⇒ Object
Returns the value of attribute _access.
18 19 20 |
# File 'lib/launchdarkly_api/models/view.rb', line 18 def _access @_access end |
#_links ⇒ Object
Returns the value of attribute _links.
20 21 22 |
# File 'lib/launchdarkly_api/models/view.rb', line 20 def _links @_links end |
#account_id ⇒ Object
ID of the account that owns this view
26 27 28 |
# File 'lib/launchdarkly_api/models/view.rb', line 26 def account_id @account_id end |
#ai_configs_expanded ⇒ Object
Returns the value of attribute ai_configs_expanded.
84 85 86 |
# File 'lib/launchdarkly_api/models/view.rb', line 84 def @ai_configs_expanded end |
#ai_configs_summary ⇒ Object
Returns the value of attribute ai_configs_summary.
74 75 76 |
# File 'lib/launchdarkly_api/models/view.rb', line 74 def ai_configs_summary @ai_configs_summary end |
#archived ⇒ Object
Whether this view is archived
57 58 59 |
# File 'lib/launchdarkly_api/models/view.rb', line 57 def archived @archived end |
#archived_at ⇒ Object
Returns the value of attribute archived_at.
59 60 61 |
# File 'lib/launchdarkly_api/models/view.rb', line 59 def archived_at @archived_at end |
#created_at ⇒ Object
Returns the value of attribute created_at.
52 53 54 |
# File 'lib/launchdarkly_api/models/view.rb', line 52 def created_at @created_at end |
#deleted ⇒ Object
Whether this view is deleted
64 65 66 |
# File 'lib/launchdarkly_api/models/view.rb', line 64 def deleted @deleted end |
#deleted_at ⇒ Object
Returns the value of attribute deleted_at.
61 62 63 |
# File 'lib/launchdarkly_api/models/view.rb', line 61 def deleted_at @deleted_at end |
#description ⇒ Object
Optional detailed description of the view
41 42 43 |
# File 'lib/launchdarkly_api/models/view.rb', line 41 def description @description end |
#flags_expanded ⇒ Object
Returns the value of attribute flags_expanded.
78 79 80 |
# File 'lib/launchdarkly_api/models/view.rb', line 78 def @flags_expanded end |
#flags_summary ⇒ Object
Returns the value of attribute flags_summary.
68 69 70 |
# File 'lib/launchdarkly_api/models/view.rb', line 68 def flags_summary @flags_summary end |
#generate_sdk_keys ⇒ Object
Whether to generate SDK keys for this view. Defaults to false.
44 45 46 |
# File 'lib/launchdarkly_api/models/view.rb', line 44 def generate_sdk_keys @generate_sdk_keys end |
#id ⇒ Object
Unique ID of this view
23 24 25 |
# File 'lib/launchdarkly_api/models/view.rb', line 23 def id @id end |
#key ⇒ Object
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 |
#maintainer ⇒ Object
Returns the value of attribute maintainer.
66 67 68 |
# File 'lib/launchdarkly_api/models/view.rb', line 66 def maintainer @maintainer end |
#metrics_expanded ⇒ Object
Returns the value of attribute metrics_expanded.
82 83 84 |
# File 'lib/launchdarkly_api/models/view.rb', line 82 def @metrics_expanded end |
#metrics_summary ⇒ Object
Returns the value of attribute metrics_summary.
72 73 74 |
# File 'lib/launchdarkly_api/models/view.rb', line 72 def metrics_summary @metrics_summary end |
#name ⇒ Object
Human-readable name for the view
38 39 40 |
# File 'lib/launchdarkly_api/models/view.rb', line 38 def name @name end |
#project_id ⇒ Object
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_key ⇒ Object
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_summary ⇒ Object
Returns the value of attribute resource_summary.
76 77 78 |
# File 'lib/launchdarkly_api/models/view.rb', line 76 def resource_summary @resource_summary end |
#resources_expanded ⇒ Object
Returns the value of attribute resources_expanded.
86 87 88 |
# File 'lib/launchdarkly_api/models/view.rb', line 86 def @resources_expanded end |
#segments_expanded ⇒ Object
Returns the value of attribute segments_expanded.
80 81 82 |
# File 'lib/launchdarkly_api/models/view.rb', line 80 def @segments_expanded end |
#segments_summary ⇒ Object
Returns the value of attribute segments_summary.
70 71 72 |
# File 'lib/launchdarkly_api/models/view.rb', line 70 def segments_summary @segments_summary end |
#tags ⇒ Object
Tags associated with this view
50 51 52 |
# File 'lib/launchdarkly_api/models/view.rb', line 50 def @tags end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
54 55 56 |
# File 'lib/launchdarkly_api/models/view.rb', line 54 def updated_at @updated_at end |
#version ⇒ Object
Version number for tracking changes
47 48 49 |
# File 'lib/launchdarkly_api/models/view.rb', line 47 def version @version end |
Class Method Details
._deserialize(type, value) ⇒ Object
Deserializes the data based on type
637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 |
# File 'lib/launchdarkly_api/models/view.rb', line 637 def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model # models (e.g. Pet) or oneOf klass = LaunchDarklyApi.const_get(type) klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end |
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
124 125 126 |
# File 'lib/launchdarkly_api/models/view.rb', line 124 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
129 130 131 |
# File 'lib/launchdarkly_api/models/view.rb', line 129 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
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 |
# File 'lib/launchdarkly_api/models/view.rb', line 89 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', :'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
613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 |
# File 'lib/launchdarkly_api/models/view.rb', line 613 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_nullable ⇒ Object
List of attributes with nullable: true
169 170 171 172 |
# File 'lib/launchdarkly_api/models/view.rb', line 169 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
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 |
# File 'lib/launchdarkly_api/models/view.rb', line 134 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', :'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.
564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 |
# File 'lib/launchdarkly_api/models/view.rb', line 564 def ==(o) return true if self.equal?(o) self.class == o.class && _access == o._access && _links == o._links && id == o.id && account_id == o.account_id && project_id == o.project_id && project_key == o.project_key && key == o.key && name == o.name && description == o.description && generate_sdk_keys == o.generate_sdk_keys && version == o.version && == o. && 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 && == o. && == o. && == o. && == o. && == o. end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
708 709 710 711 712 713 714 715 716 717 718 719 720 |
# File 'lib/launchdarkly_api/models/view.rb', line 708 def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end |
#eql?(o) ⇒ Boolean
600 601 602 |
# File 'lib/launchdarkly_api/models/view.rb', line 600 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
606 607 608 |
# File 'lib/launchdarkly_api/models/view.rb', line 606 def hash [_access, _links, id, account_id, project_id, project_key, key, name, description, generate_sdk_keys, version, , created_at, updated_at, archived, archived_at, deleted_at, deleted, maintainer, flags_summary, segments_summary, metrics_summary, ai_configs_summary, resource_summary, , , , , ].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
339 340 341 342 343 344 345 346 347 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 |
# File 'lib/launchdarkly_api/models/view.rb', line 339 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 @generate_sdk_keys.nil? invalid_properties.push('invalid value for "generate_sdk_keys", generate_sdk_keys 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_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
684 685 686 |
# File 'lib/launchdarkly_api/models/view.rb', line 684 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
690 691 692 693 694 695 696 697 698 699 700 701 702 |
# File 'lib/launchdarkly_api/models/view.rb', line 690 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 |
#to_s ⇒ String
Returns the string representation of the object
678 679 680 |
# File 'lib/launchdarkly_api/models/view.rb', line 678 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 |
# File 'lib/launchdarkly_api/models/view.rb', line 403 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 @generate_sdk_keys.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 |