Class: LaunchDarklyApi::ApprovalRequest
- Inherits:
-
Object
- Object
- LaunchDarklyApi::ApprovalRequest
- Defined in:
- lib/launchdarkly_api/models/approval_request.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#_id ⇒ Object
Returns the value of attribute _id.
-
#_version ⇒ Object
Returns the value of attribute _version.
-
#all_reviews ⇒ Object
Returns the value of attribute all_reviews.
-
#applied_by_member_id ⇒ Object
The id of the member that applied the approval request.
-
#applied_date ⇒ Object
A unix epoch time in milliseconds specifying the date the approval request was applied.
-
#creation_date ⇒ Object
A unix epoch time in milliseconds specifying the date the approval request was requested.
-
#execution_date ⇒ Object
Timestamp for when instructions will be executed.
-
#instructions ⇒ Object
Returns the value of attribute instructions.
-
#notify_member_ids ⇒ Object
Returns the value of attribute notify_member_ids.
-
#operating_on_id ⇒ Object
ID of scheduled change to edit or delete.
-
#requestor_id ⇒ Object
The id of the member that requested the change.
-
#review_status ⇒ Object
Returns the value of attribute review_status.
-
#source ⇒ Object
Returns the value of attribute source.
-
#status ⇒ Object
| Name | Description | | ———:| ———– | | pending | the approval request has not been applied yet | | completed | the approval request has been applied successfully | | scheduled | the approval request for a scheduled change has been applied successfully | | failed | the approval request has been applied but the changes were not applied successfully |.
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 = {}) ⇒ ApprovalRequest
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 = {}) ⇒ ApprovalRequest
Initializes the object
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 |
# File 'lib/launchdarkly_api/models/approval_request.rb', line 116 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?(:'_id') self._id = attributes[:'_id'] end if attributes.has_key?(:'_version') self._version = attributes[:'_version'] end if attributes.has_key?(:'creationDate') self.creation_date = attributes[:'creationDate'] end if attributes.has_key?(:'requestorId') self.requestor_id = attributes[:'requestorId'] end if attributes.has_key?(:'reviewStatus') self.review_status = attributes[:'reviewStatus'] end if attributes.has_key?(:'status') self.status = attributes[:'status'] end if attributes.has_key?(:'appliedByMemberID') self.applied_by_member_id = attributes[:'appliedByMemberID'] end if attributes.has_key?(:'appliedDate') self.applied_date = attributes[:'appliedDate'] end if attributes.has_key?(:'allReviews') if (value = attributes[:'allReviews']).is_a?(Array) self.all_reviews = value end end if attributes.has_key?(:'notifyMemberIds') if (value = attributes[:'notifyMemberIds']).is_a?(Array) self.notify_member_ids = value end end if attributes.has_key?(:'instructions') self.instructions = attributes[:'instructions'] end if attributes.has_key?(:'executionDate') self.execution_date = attributes[:'executionDate'] end if attributes.has_key?(:'operatingOnId') self. = attributes[:'operatingOnId'] end if attributes.has_key?(:'source') self.source = attributes[:'source'] end end |
Instance Attribute Details
#_id ⇒ Object
Returns the value of attribute _id.
17 18 19 |
# File 'lib/launchdarkly_api/models/approval_request.rb', line 17 def _id @_id end |
#_version ⇒ Object
Returns the value of attribute _version.
19 20 21 |
# File 'lib/launchdarkly_api/models/approval_request.rb', line 19 def _version @_version end |
#all_reviews ⇒ Object
Returns the value of attribute all_reviews.
38 39 40 |
# File 'lib/launchdarkly_api/models/approval_request.rb', line 38 def all_reviews @all_reviews end |
#applied_by_member_id ⇒ Object
The id of the member that applied the approval request
33 34 35 |
# File 'lib/launchdarkly_api/models/approval_request.rb', line 33 def applied_by_member_id @applied_by_member_id end |
#applied_date ⇒ Object
A unix epoch time in milliseconds specifying the date the approval request was applied
36 37 38 |
# File 'lib/launchdarkly_api/models/approval_request.rb', line 36 def applied_date @applied_date end |
#creation_date ⇒ Object
A unix epoch time in milliseconds specifying the date the approval request was requested
22 23 24 |
# File 'lib/launchdarkly_api/models/approval_request.rb', line 22 def creation_date @creation_date end |
#execution_date ⇒ Object
Timestamp for when instructions will be executed
45 46 47 |
# File 'lib/launchdarkly_api/models/approval_request.rb', line 45 def execution_date @execution_date end |
#instructions ⇒ Object
Returns the value of attribute instructions.
42 43 44 |
# File 'lib/launchdarkly_api/models/approval_request.rb', line 42 def instructions @instructions end |
#notify_member_ids ⇒ Object
Returns the value of attribute notify_member_ids.
40 41 42 |
# File 'lib/launchdarkly_api/models/approval_request.rb', line 40 def notify_member_ids @notify_member_ids end |
#operating_on_id ⇒ Object
ID of scheduled change to edit or delete
48 49 50 |
# File 'lib/launchdarkly_api/models/approval_request.rb', line 48 def end |
#requestor_id ⇒ Object
The id of the member that requested the change
25 26 27 |
# File 'lib/launchdarkly_api/models/approval_request.rb', line 25 def requestor_id @requestor_id end |
#review_status ⇒ Object
Returns the value of attribute review_status.
27 28 29 |
# File 'lib/launchdarkly_api/models/approval_request.rb', line 27 def review_status @review_status end |
#source ⇒ Object
Returns the value of attribute source.
50 51 52 |
# File 'lib/launchdarkly_api/models/approval_request.rb', line 50 def source @source end |
#status ⇒ Object
| Name | Description | | ———:| ———– | | pending | the approval request has not been applied yet | | completed | the approval request has been applied successfully | | scheduled | the approval request for a scheduled change has been applied successfully | | failed | the approval request has been applied but the changes were not applied successfully |
30 31 32 |
# File 'lib/launchdarkly_api/models/approval_request.rb', line 30 def status @status end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/launchdarkly_api/models/approval_request.rb', line 75 def self.attribute_map { :'_id' => :'_id', :'_version' => :'_version', :'creation_date' => :'creationDate', :'requestor_id' => :'requestorId', :'review_status' => :'reviewStatus', :'status' => :'status', :'applied_by_member_id' => :'appliedByMemberID', :'applied_date' => :'appliedDate', :'all_reviews' => :'allReviews', :'notify_member_ids' => :'notifyMemberIds', :'instructions' => :'instructions', :'execution_date' => :'executionDate', :'operating_on_id' => :'operatingOnId', :'source' => :'source' } end |
.swagger_types ⇒ Object
Attribute type mapping.
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/launchdarkly_api/models/approval_request.rb', line 95 def self.swagger_types { :'_id' => :'Id', :'_version' => :'Integer', :'creation_date' => :'Integer', :'requestor_id' => :'String', :'review_status' => :'ApprovalRequestReviewStatus', :'status' => :'String', :'applied_by_member_id' => :'String', :'applied_date' => :'Integer', :'all_reviews' => :'Array<ApprovalRequestReview>', :'notify_member_ids' => :'Array<String>', :'instructions' => :'SemanticPatchInstruction', :'execution_date' => :'Integer', :'operating_on_id' => :'String', :'source' => :'Source' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 |
# File 'lib/launchdarkly_api/models/approval_request.rb', line 210 def ==(o) return true if self.equal?(o) self.class == o.class && _id == o._id && _version == o._version && creation_date == o.creation_date && requestor_id == o.requestor_id && review_status == o.review_status && status == o.status && applied_by_member_id == o.applied_by_member_id && applied_date == o.applied_date && all_reviews == o.all_reviews && notify_member_ids == o.notify_member_ids && instructions == o.instructions && execution_date == o.execution_date && == o. && source == o.source end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
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 |
# File 'lib/launchdarkly_api/models/approval_request.rb', line 265 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
331 332 333 334 335 336 337 338 339 340 341 342 343 |
# File 'lib/launchdarkly_api/models/approval_request.rb', line 331 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
244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 |
# File 'lib/launchdarkly_api/models/approval_request.rb', line 244 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 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
231 232 233 |
# File 'lib/launchdarkly_api/models/approval_request.rb', line 231 def eql?(o) self == o end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
237 238 239 |
# File 'lib/launchdarkly_api/models/approval_request.rb', line 237 def hash [_id, _version, creation_date, requestor_id, review_status, status, applied_by_member_id, applied_date, all_reviews, notify_member_ids, instructions, execution_date, , source].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
185 186 187 188 |
# File 'lib/launchdarkly_api/models/approval_request.rb', line 185 def list_invalid_properties invalid_properties = Array.new invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
311 312 313 |
# File 'lib/launchdarkly_api/models/approval_request.rb', line 311 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
317 318 319 320 321 322 323 324 325 |
# File 'lib/launchdarkly_api/models/approval_request.rb', line 317 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
305 306 307 |
# File 'lib/launchdarkly_api/models/approval_request.rb', line 305 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
192 193 194 195 196 |
# File 'lib/launchdarkly_api/models/approval_request.rb', line 192 def valid? status_validator = EnumAttributeValidator.new('String', ['pending', 'completed', 'scheduled', 'failed']) return false unless status_validator.valid?(@status) true end |