Class: LaunchDarklyApi::FeatureFlag
- Inherits:
-
Object
- Object
- LaunchDarklyApi::FeatureFlag
- Defined in:
- lib/launchdarkly_api/models/feature_flag.rb
Instance Attribute Summary collapse
-
#_links ⇒ Object
Returns the value of attribute _links.
-
#_maintainer ⇒ Object
Returns the value of attribute _maintainer.
-
#_version ⇒ Object
Returns the value of attribute _version.
-
#archived ⇒ Object
Whether or not this flag is archived.
-
#archived_date ⇒ Object
A unix epoch time in milliseconds specifying the archived time of this flag.
-
#creation_date ⇒ Object
A unix epoch time in milliseconds specifying the creation time of this flag.
-
#custom_properties ⇒ Object
A mapping of keys to CustomProperty entries.
-
#defaults ⇒ Object
Returns the value of attribute defaults.
-
#description ⇒ Object
Description of the feature flag.
-
#environments ⇒ Object
Returns the value of attribute environments.
-
#goal_ids ⇒ Object
An array goals from all environments associated with this feature flag.
-
#include_in_snippet ⇒ Object
Returns the value of attribute include_in_snippet.
-
#key ⇒ Object
Returns the value of attribute key.
-
#kind ⇒ Object
Whether the feature flag is a boolean flag or multivariate.
-
#maintainer_id ⇒ Object
The ID of the member that should maintain this flag.
-
#name ⇒ Object
Name of the feature flag.
-
#tags ⇒ Object
An array of tags for this feature flag.
-
#temporary ⇒ Object
Whether or not this flag is temporary.
-
#variations ⇒ Object
The variations for this feature flag.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ FeatureFlag
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 = {}) ⇒ FeatureFlag
Initializes the object
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 |
# File 'lib/launchdarkly_api/models/feature_flag.rb', line 119 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'key') self.key = attributes[:'key'] end if attributes.has_key?(:'name') self.name = attributes[:'name'] end if attributes.has_key?(:'description') self.description = attributes[:'description'] end if attributes.has_key?(:'kind') self.kind = attributes[:'kind'] end if attributes.has_key?(:'creationDate') self.creation_date = attributes[:'creationDate'] end if attributes.has_key?(:'includeInSnippet') self.include_in_snippet = attributes[:'includeInSnippet'] end if attributes.has_key?(:'temporary') self.temporary = attributes[:'temporary'] end if attributes.has_key?(:'maintainerId') self.maintainer_id = attributes[:'maintainerId'] end if attributes.has_key?(:'tags') if (value = attributes[:'tags']).is_a?(Array) self. = value end end if attributes.has_key?(:'variations') if (value = attributes[:'variations']).is_a?(Array) self.variations = value end end if attributes.has_key?(:'goalIds') if (value = attributes[:'goalIds']).is_a?(Array) self.goal_ids = value end end if attributes.has_key?(:'_version') self._version = attributes[:'_version'] end if attributes.has_key?(:'customProperties') if (value = attributes[:'customProperties']).is_a?(Hash) self.custom_properties = value end end if attributes.has_key?(:'_links') self._links = attributes[:'_links'] end if attributes.has_key?(:'_maintainer') self._maintainer = attributes[:'_maintainer'] end if attributes.has_key?(:'environments') if (value = attributes[:'environments']).is_a?(Hash) self.environments = value end end if attributes.has_key?(:'archivedDate') self.archived_date = attributes[:'archivedDate'] end if attributes.has_key?(:'archived') self.archived = attributes[:'archived'] end if attributes.has_key?(:'defaults') self.defaults = attributes[:'defaults'] end end |
Instance Attribute Details
#_links ⇒ Object
Returns the value of attribute _links.
53 54 55 |
# File 'lib/launchdarkly_api/models/feature_flag.rb', line 53 def _links @_links end |
#_maintainer ⇒ Object
Returns the value of attribute _maintainer.
55 56 57 |
# File 'lib/launchdarkly_api/models/feature_flag.rb', line 55 def _maintainer @_maintainer end |
#_version ⇒ Object
Returns the value of attribute _version.
48 49 50 |
# File 'lib/launchdarkly_api/models/feature_flag.rb', line 48 def _version @_version end |
#archived ⇒ Object
Whether or not this flag is archived.
63 64 65 |
# File 'lib/launchdarkly_api/models/feature_flag.rb', line 63 def archived @archived end |
#archived_date ⇒ Object
A unix epoch time in milliseconds specifying the archived time of this flag.
60 61 62 |
# File 'lib/launchdarkly_api/models/feature_flag.rb', line 60 def archived_date @archived_date end |
#creation_date ⇒ Object
A unix epoch time in milliseconds specifying the creation time of this flag.
29 30 31 |
# File 'lib/launchdarkly_api/models/feature_flag.rb', line 29 def creation_date @creation_date end |
#custom_properties ⇒ Object
A mapping of keys to CustomProperty entries.
51 52 53 |
# File 'lib/launchdarkly_api/models/feature_flag.rb', line 51 def custom_properties @custom_properties end |
#defaults ⇒ Object
Returns the value of attribute defaults.
65 66 67 |
# File 'lib/launchdarkly_api/models/feature_flag.rb', line 65 def defaults @defaults end |
#description ⇒ Object
Description of the feature flag.
23 24 25 |
# File 'lib/launchdarkly_api/models/feature_flag.rb', line 23 def description @description end |
#environments ⇒ Object
Returns the value of attribute environments.
57 58 59 |
# File 'lib/launchdarkly_api/models/feature_flag.rb', line 57 def environments @environments end |
#goal_ids ⇒ Object
An array goals from all environments associated with this feature flag
46 47 48 |
# File 'lib/launchdarkly_api/models/feature_flag.rb', line 46 def goal_ids @goal_ids end |
#include_in_snippet ⇒ Object
Returns the value of attribute include_in_snippet.
31 32 33 |
# File 'lib/launchdarkly_api/models/feature_flag.rb', line 31 def include_in_snippet @include_in_snippet end |
#key ⇒ Object
Returns the value of attribute key.
17 18 19 |
# File 'lib/launchdarkly_api/models/feature_flag.rb', line 17 def key @key end |
#kind ⇒ Object
Whether the feature flag is a boolean flag or multivariate.
26 27 28 |
# File 'lib/launchdarkly_api/models/feature_flag.rb', line 26 def kind @kind end |
#maintainer_id ⇒ Object
The ID of the member that should maintain this flag.
37 38 39 |
# File 'lib/launchdarkly_api/models/feature_flag.rb', line 37 def maintainer_id @maintainer_id end |
#name ⇒ Object
Name of the feature flag.
20 21 22 |
# File 'lib/launchdarkly_api/models/feature_flag.rb', line 20 def name @name end |
#tags ⇒ Object
An array of tags for this feature flag.
40 41 42 |
# File 'lib/launchdarkly_api/models/feature_flag.rb', line 40 def @tags end |
#temporary ⇒ Object
Whether or not this flag is temporary.
34 35 36 |
# File 'lib/launchdarkly_api/models/feature_flag.rb', line 34 def temporary @temporary end |
#variations ⇒ Object
The variations for this feature flag.
43 44 45 |
# File 'lib/launchdarkly_api/models/feature_flag.rb', line 43 def variations @variations end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/launchdarkly_api/models/feature_flag.rb', line 68 def self.attribute_map { :'key' => :'key', :'name' => :'name', :'description' => :'description', :'kind' => :'kind', :'creation_date' => :'creationDate', :'include_in_snippet' => :'includeInSnippet', :'temporary' => :'temporary', :'maintainer_id' => :'maintainerId', :'tags' => :'tags', :'variations' => :'variations', :'goal_ids' => :'goalIds', :'_version' => :'_version', :'custom_properties' => :'customProperties', :'_links' => :'_links', :'_maintainer' => :'_maintainer', :'environments' => :'environments', :'archived_date' => :'archivedDate', :'archived' => :'archived', :'defaults' => :'defaults' } end |
.swagger_types ⇒ Object
Attribute type mapping.
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
# File 'lib/launchdarkly_api/models/feature_flag.rb', line 93 def self.swagger_types { :'key' => :'String', :'name' => :'String', :'description' => :'String', :'kind' => :'String', :'creation_date' => :'Float', :'include_in_snippet' => :'BOOLEAN', :'temporary' => :'BOOLEAN', :'maintainer_id' => :'String', :'tags' => :'Array<String>', :'variations' => :'Array<Variation>', :'goal_ids' => :'Array<String>', :'_version' => :'Integer', :'custom_properties' => :'Hash<String, CustomProperty>', :'_links' => :'Links', :'_maintainer' => :'Member', :'environments' => :'Hash<String, FeatureFlagConfig>', :'archived_date' => :'Float', :'archived' => :'BOOLEAN', :'defaults' => :'Defaults' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 |
# File 'lib/launchdarkly_api/models/feature_flag.rb', line 227 def ==(o) return true if self.equal?(o) self.class == o.class && key == o.key && name == o.name && description == o.description && kind == o.kind && creation_date == o.creation_date && include_in_snippet == o.include_in_snippet && temporary == o.temporary && maintainer_id == o.maintainer_id && == o. && variations == o.variations && goal_ids == o.goal_ids && _version == o._version && custom_properties == o.custom_properties && _links == o._links && _maintainer == o._maintainer && environments == o.environments && archived_date == o.archived_date && archived == o.archived && defaults == o.defaults end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
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 |
# File 'lib/launchdarkly_api/models/feature_flag.rb', line 287 def _deserialize(type, value) case type.to_sym when :DateTime DateTime.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 temp_model = LaunchDarklyApi.const_get(type).new temp_model.build_from_hash(value) end end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
353 354 355 356 357 358 359 360 361 362 363 364 365 |
# File 'lib/launchdarkly_api/models/feature_flag.rb', line 353 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 |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 |
# File 'lib/launchdarkly_api/models/feature_flag.rb', line 266 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(o) ⇒ Boolean
253 254 255 |
# File 'lib/launchdarkly_api/models/feature_flag.rb', line 253 def eql?(o) self == o end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
259 260 261 |
# File 'lib/launchdarkly_api/models/feature_flag.rb', line 259 def hash [key, name, description, kind, creation_date, include_in_snippet, temporary, maintainer_id, , variations, goal_ids, _version, custom_properties, _links, _maintainer, environments, archived_date, archived, defaults].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
214 215 216 217 |
# File 'lib/launchdarkly_api/models/feature_flag.rb', line 214 def list_invalid_properties invalid_properties = Array.new invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
333 334 335 |
# File 'lib/launchdarkly_api/models/feature_flag.rb', line 333 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
339 340 341 342 343 344 345 346 347 |
# File 'lib/launchdarkly_api/models/feature_flag.rb', line 339 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) next if value.nil? hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
327 328 329 |
# File 'lib/launchdarkly_api/models/feature_flag.rb', line 327 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
221 222 223 |
# File 'lib/launchdarkly_api/models/feature_flag.rb', line 221 def valid? true end |