class LaunchDarklyApi::FlagConfigApprovalRequestResponse

Attributes

_id[RW]
_version[RW]
all_reviews[RW]
applied_by_member_id[RW]
applied_date[RW]
conflicts[RW]
creation_date[RW]
description[RW]

A human-friendly name for the approval request

execution_date[RW]
instructions[RW]
integration_metadata[RW]
notify_member_ids[RW]

An array of member IDs. These members are notified to review the approval request.

operating_on_id[RW]

ID of scheduled change to edit or delete

requestor_id[RW]
review_status[RW]
service_kind[RW]
source[RW]
status[RW]

Public Class Methods

acceptable_attributes() click to toggle source

Returns all the JSON keys this model knows about

# File lib/launchdarkly_api/models/flag_config_approval_request_response.rb, line 85
def self.acceptable_attributes
  attribute_map.values
end
attribute_map() click to toggle source

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

# File lib/launchdarkly_api/models/flag_config_approval_request_response.rb, line 60
def self.attribute_map
  {
    :'_id' => :'_id',
    :'_version' => :'_version',
    :'creation_date' => :'creationDate',
    :'service_kind' => :'serviceKind',
    :'requestor_id' => :'requestorId',
    :'description' => :'description',
    :'review_status' => :'reviewStatus',
    :'all_reviews' => :'allReviews',
    :'notify_member_ids' => :'notifyMemberIds',
    :'applied_date' => :'appliedDate',
    :'applied_by_member_id' => :'appliedByMemberId',
    :'status' => :'status',
    :'instructions' => :'instructions',
    :'conflicts' => :'conflicts',
    :'_links' => :'_links',
    :'execution_date' => :'executionDate',
    :'operating_on_id' => :'operatingOnId',
    :'integration_metadata' => :'integrationMetadata',
    :'source' => :'source'
  }
end
build_from_hash(attributes) click to toggle source

Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Object] Returns the model itself

# File lib/launchdarkly_api/models/flag_config_approval_request_response.rb, line 331
def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end
new(attributes = {}) click to toggle source

Initializes the object @param [Hash] attributes Model attributes in the form of hash

# File lib/launchdarkly_api/models/flag_config_approval_request_response.rb, line 122
def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `LaunchDarklyApi::FlagConfigApprovalRequestResponse` initialize method"
  end

  # 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))
      fail ArgumentError, "`#{k}` is not a valid attribute in `LaunchDarklyApi::FlagConfigApprovalRequestResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  if attributes.key?(:'source')
    self.source = attributes[:'source']
  end
end
openapi_nullable() click to toggle source

List of attributes with nullable: true

# File lib/launchdarkly_api/models/flag_config_approval_request_response.rb, line 115
def self.openapi_nullable
  Set.new([
  ])
end
openapi_types() click to toggle source

Attribute type mapping.

# File lib/launchdarkly_api/models/flag_config_approval_request_response.rb, line 90
def self.openapi_types
  {
    :'_id' => :'String',
    :'_version' => :'Integer',
    :'creation_date' => :'Integer',
    :'service_kind' => :'String',
    :'requestor_id' => :'String',
    :'description' => :'String',
    :'review_status' => :'String',
    :'all_reviews' => :'Array<ReviewResponse>',
    :'notify_member_ids' => :'Array<String>',
    :'applied_date' => :'Integer',
    :'applied_by_member_id' => :'String',
    :'status' => :'String',
    :'instructions' => :'Array<Hash>',
    :'conflicts' => :'Array<Conflict>',
    :'_links' => :'Hash<String, Link>',
    :'execution_date' => :'Integer',
    :'operating_on_id' => :'String',
    :'integration_metadata' => :'IntegrationMetadata',
    :'source' => :'CopiedFromEnv'
  }
end

Public Instance Methods

==(o) click to toggle source

Checks equality by comparing each attribute. @param [Object] Object to be compared

# File lib/launchdarkly_api/models/flag_config_approval_request_response.rb, line 292
def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      _id == o._id &&
      _version == o._version &&
      creation_date == o.creation_date &&
      service_kind == o.service_kind &&
      requestor_id == o.requestor_id &&
      description == o.description &&
      review_status == o.review_status &&
      all_reviews == o.all_reviews &&
      notify_member_ids == o.notify_member_ids &&
      applied_date == o.applied_date &&
      applied_by_member_id == o.applied_by_member_id &&
      status == o.status &&
      instructions == o.instructions &&
      conflicts == o.conflicts &&
      _links == o._links &&
      execution_date == o.execution_date &&
      operating_on_id == o.operating_on_id &&
      integration_metadata == o.integration_metadata &&
      source == o.source
end
_deserialize(type, value) click to toggle source

Deserializes the data based on type @param string type Data type @param string value Value to be deserialized @return [Object] Deserialized data

# File lib/launchdarkly_api/models/flag_config_approval_request_response.rb, line 361
def _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_one_of) ? klass.build(value) : klass.build_from_hash(value)
  end
end
_to_hash(value) click to toggle source

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value @param [Object] value Any valid value @return [Hash] Returns the value in the form of hash

# File lib/launchdarkly_api/models/flag_config_approval_request_response.rb, line 432
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) click to toggle source

Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Object] Returns the model itself

# File lib/launchdarkly_api/models/flag_config_approval_request_response.rb, line 338
def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.openapi_types.each_pair do |key, type|
    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
      self.send("#{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[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
  end

  self
end
eql?(o) click to toggle source

@see the `==` method @param [Object] Object to be compared

# File lib/launchdarkly_api/models/flag_config_approval_request_response.rb, line 318
def eql?(o)
  self == o
end
hash() click to toggle source

Calculates hash code according to all attributes. @return [Integer] Hash code

# File lib/launchdarkly_api/models/flag_config_approval_request_response.rb, line 324
def hash
  [_id, _version, creation_date, service_kind, requestor_id, description, review_status, all_reviews, notify_member_ids, applied_date, applied_by_member_id, status, instructions, conflicts, _links, execution_date, operating_on_id, integration_metadata, source].hash
end
list_invalid_properties() click to toggle source

Show invalid properties with the reasons. Usually used together with valid? @return Array for valid properties with the reasons

# File lib/launchdarkly_api/models/flag_config_approval_request_response.rb, line 224
def list_invalid_properties
  invalid_properties = Array.new
  if @_id.nil?
    invalid_properties.push('invalid value for "_id", _id cannot be nil.')
  end

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

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

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

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

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

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

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

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

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

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

  invalid_properties
end
to_body() click to toggle source

to_body is an alias to to_hash (backward compatibility) @return [Hash] Returns the object in the form of hash

# File lib/launchdarkly_api/models/flag_config_approval_request_response.rb, line 408
def to_body
  to_hash
end
to_hash() click to toggle source

Returns the object in the form of hash @return [Hash] Returns the object in the form of hash

# File lib/launchdarkly_api/models/flag_config_approval_request_response.rb, line 414
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() click to toggle source

Returns the string representation of the object @return [String] String presentation of the object

# File lib/launchdarkly_api/models/flag_config_approval_request_response.rb, line 402
def to_s
  to_hash.to_s
end
valid?() click to toggle source

Check to see if the all the properties in the model are valid @return true if the model is valid

# File lib/launchdarkly_api/models/flag_config_approval_request_response.rb, line 275
def valid?
  return false if @_id.nil?
  return false if @_version.nil?
  return false if @creation_date.nil?
  return false if @service_kind.nil?
  return false if @review_status.nil?
  return false if @all_reviews.nil?
  return false if @notify_member_ids.nil?
  return false if @status.nil?
  return false if @instructions.nil?
  return false if @conflicts.nil?
  return false if @_links.nil?
  true
end