class ESI::GetCorporationsCorporationIdCustomsOffices200Ok

200 ok object

Attributes

alliance_tax_rate[RW]

Only present if alliance access is allowed

allow_access_with_standings[RW]

standing_level and any standing related tax rate only present when this is true

allow_alliance_access[RW]
bad_standing_tax_rate[RW]
corporation_tax_rate[RW]
excellent_standing_tax_rate[RW]

Tax rate for entities with excellent level of standing, only present if this level is allowed, same for all other standing related tax rates

good_standing_tax_rate[RW]
neutral_standing_tax_rate[RW]
office_id[RW]

unique ID of this customs office

reinforce_exit_end[RW]
reinforce_exit_start[RW]

Together with reinforce_exit_end, marks a 2-hour period where this customs office could exit reinforcement mode during the day after initial attack

standing_level[RW]

Access is allowed only for entities with this level of standing or better

system_id[RW]

ID of the solar system this customs office is located in

terrible_standing_tax_rate[RW]

Public Class Methods

attribute_map() click to toggle source

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

# File lib/ruby-esi/models/get_corporations_corporation_id_customs_offices_200_ok.rb, line 83
def self.attribute_map
  {
    :'alliance_tax_rate' => :'alliance_tax_rate',
    :'allow_access_with_standings' => :'allow_access_with_standings',
    :'allow_alliance_access' => :'allow_alliance_access',
    :'bad_standing_tax_rate' => :'bad_standing_tax_rate',
    :'corporation_tax_rate' => :'corporation_tax_rate',
    :'excellent_standing_tax_rate' => :'excellent_standing_tax_rate',
    :'good_standing_tax_rate' => :'good_standing_tax_rate',
    :'neutral_standing_tax_rate' => :'neutral_standing_tax_rate',
    :'office_id' => :'office_id',
    :'reinforce_exit_end' => :'reinforce_exit_end',
    :'reinforce_exit_start' => :'reinforce_exit_start',
    :'standing_level' => :'standing_level',
    :'system_id' => :'system_id',
    :'terrible_standing_tax_rate' => :'terrible_standing_tax_rate'
  }
end
new(attributes = {}) click to toggle source

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

# File lib/ruby-esi/models/get_corporations_corporation_id_customs_offices_200_ok.rb, line 124
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?(:'alliance_tax_rate')
    self.alliance_tax_rate = attributes[:'alliance_tax_rate']
  end

  if attributes.has_key?(:'allow_access_with_standings')
    self.allow_access_with_standings = attributes[:'allow_access_with_standings']
  end

  if attributes.has_key?(:'allow_alliance_access')
    self.allow_alliance_access = attributes[:'allow_alliance_access']
  end

  if attributes.has_key?(:'bad_standing_tax_rate')
    self.bad_standing_tax_rate = attributes[:'bad_standing_tax_rate']
  end

  if attributes.has_key?(:'corporation_tax_rate')
    self.corporation_tax_rate = attributes[:'corporation_tax_rate']
  end

  if attributes.has_key?(:'excellent_standing_tax_rate')
    self.excellent_standing_tax_rate = attributes[:'excellent_standing_tax_rate']
  end

  if attributes.has_key?(:'good_standing_tax_rate')
    self.good_standing_tax_rate = attributes[:'good_standing_tax_rate']
  end

  if attributes.has_key?(:'neutral_standing_tax_rate')
    self.neutral_standing_tax_rate = attributes[:'neutral_standing_tax_rate']
  end

  if attributes.has_key?(:'office_id')
    self.office_id = attributes[:'office_id']
  end

  if attributes.has_key?(:'reinforce_exit_end')
    self.reinforce_exit_end = attributes[:'reinforce_exit_end']
  end

  if attributes.has_key?(:'reinforce_exit_start')
    self.reinforce_exit_start = attributes[:'reinforce_exit_start']
  end

  if attributes.has_key?(:'standing_level')
    self.standing_level = attributes[:'standing_level']
  end

  if attributes.has_key?(:'system_id')
    self.system_id = attributes[:'system_id']
  end

  if attributes.has_key?(:'terrible_standing_tax_rate')
    self.terrible_standing_tax_rate = attributes[:'terrible_standing_tax_rate']
  end
end
swagger_types() click to toggle source

Attribute type mapping.

# File lib/ruby-esi/models/get_corporations_corporation_id_customs_offices_200_ok.rb, line 103
def self.swagger_types
  {
    :'alliance_tax_rate' => :'Float',
    :'allow_access_with_standings' => :'BOOLEAN',
    :'allow_alliance_access' => :'BOOLEAN',
    :'bad_standing_tax_rate' => :'Float',
    :'corporation_tax_rate' => :'Float',
    :'excellent_standing_tax_rate' => :'Float',
    :'good_standing_tax_rate' => :'Float',
    :'neutral_standing_tax_rate' => :'Float',
    :'office_id' => :'Integer',
    :'reinforce_exit_end' => :'Integer',
    :'reinforce_exit_start' => :'Integer',
    :'standing_level' => :'String',
    :'system_id' => :'Integer',
    :'terrible_standing_tax_rate' => :'Float'
  }
end

Public Instance Methods

==(o) click to toggle source

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

# File lib/ruby-esi/models/get_corporations_corporation_id_customs_offices_200_ok.rb, line 300
def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      alliance_tax_rate == o.alliance_tax_rate &&
      allow_access_with_standings == o.allow_access_with_standings &&
      allow_alliance_access == o.allow_alliance_access &&
      bad_standing_tax_rate == o.bad_standing_tax_rate &&
      corporation_tax_rate == o.corporation_tax_rate &&
      excellent_standing_tax_rate == o.excellent_standing_tax_rate &&
      good_standing_tax_rate == o.good_standing_tax_rate &&
      neutral_standing_tax_rate == o.neutral_standing_tax_rate &&
      office_id == o.office_id &&
      reinforce_exit_end == o.reinforce_exit_end &&
      reinforce_exit_start == o.reinforce_exit_start &&
      standing_level == o.standing_level &&
      system_id == o.system_id &&
      terrible_standing_tax_rate == o.terrible_standing_tax_rate
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/ruby-esi/models/get_corporations_corporation_id_customs_offices_200_ok.rb, line 355
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 = ESI.const_get(type).new
    temp_model.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/ruby-esi/models/get_corporations_corporation_id_customs_offices_200_ok.rb, line 421
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/ruby-esi/models/get_corporations_corporation_id_customs_offices_200_ok.rb, line 334
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) click to toggle source

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

# File lib/ruby-esi/models/get_corporations_corporation_id_customs_offices_200_ok.rb, line 321
def eql?(o)
  self == o
end
hash() click to toggle source

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

# File lib/ruby-esi/models/get_corporations_corporation_id_customs_offices_200_ok.rb, line 327
def hash
  [alliance_tax_rate, allow_access_with_standings, allow_alliance_access, bad_standing_tax_rate, corporation_tax_rate, excellent_standing_tax_rate, good_standing_tax_rate, neutral_standing_tax_rate, office_id, reinforce_exit_end, reinforce_exit_start, standing_level, system_id, terrible_standing_tax_rate].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/ruby-esi/models/get_corporations_corporation_id_customs_offices_200_ok.rb, line 189
def list_invalid_properties
  invalid_properties = Array.new
  if @allow_access_with_standings.nil?
    invalid_properties.push('invalid value for "allow_access_with_standings", allow_access_with_standings cannot be nil.')
  end

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

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

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

  if @reinforce_exit_end > 23
    invalid_properties.push('invalid value for "reinforce_exit_end", must be smaller than or equal to 23.')
  end

  if @reinforce_exit_end < 0
    invalid_properties.push('invalid value for "reinforce_exit_end", must be greater than or equal to 0.')
  end

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

  if @reinforce_exit_start > 23
    invalid_properties.push('invalid value for "reinforce_exit_start", must be smaller than or equal to 23.')
  end

  if @reinforce_exit_start < 0
    invalid_properties.push('invalid value for "reinforce_exit_start", must be greater than or equal to 0.')
  end

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

  invalid_properties
end
reinforce_exit_end=(reinforce_exit_end) click to toggle source

Custom attribute writer method with validation @param [Object] reinforce_exit_end Value to be assigned

# File lib/ruby-esi/models/get_corporations_corporation_id_customs_offices_200_ok.rb, line 254
def reinforce_exit_end=(reinforce_exit_end)
  if reinforce_exit_end.nil?
    fail ArgumentError, 'reinforce_exit_end cannot be nil'
  end

  if reinforce_exit_end > 23
    fail ArgumentError, 'invalid value for "reinforce_exit_end", must be smaller than or equal to 23.'
  end

  if reinforce_exit_end < 0
    fail ArgumentError, 'invalid value for "reinforce_exit_end", must be greater than or equal to 0.'
  end

  @reinforce_exit_end = reinforce_exit_end
end
reinforce_exit_start=(reinforce_exit_start) click to toggle source

Custom attribute writer method with validation @param [Object] reinforce_exit_start Value to be assigned

# File lib/ruby-esi/models/get_corporations_corporation_id_customs_offices_200_ok.rb, line 272
def reinforce_exit_start=(reinforce_exit_start)
  if reinforce_exit_start.nil?
    fail ArgumentError, 'reinforce_exit_start cannot be nil'
  end

  if reinforce_exit_start > 23
    fail ArgumentError, 'invalid value for "reinforce_exit_start", must be smaller than or equal to 23.'
  end

  if reinforce_exit_start < 0
    fail ArgumentError, 'invalid value for "reinforce_exit_start", must be greater than or equal to 0.'
  end

  @reinforce_exit_start = reinforce_exit_start
end
standing_level=(standing_level) click to toggle source

Custom attribute writer method checking allowed values (enum). @param [Object] standing_level Object to be assigned

# File lib/ruby-esi/models/get_corporations_corporation_id_customs_offices_200_ok.rb, line 290
def standing_level=(standing_level)
  validator = EnumAttributeValidator.new('String', ['bad', 'excellent', 'good', 'neutral', 'terrible'])
  unless validator.valid?(standing_level)
    fail ArgumentError, 'invalid value for "standing_level", must be one of #{validator.allowable_values}.'
  end
  @standing_level = standing_level
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/ruby-esi/models/get_corporations_corporation_id_customs_offices_200_ok.rb, line 401
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/ruby-esi/models/get_corporations_corporation_id_customs_offices_200_ok.rb, line 407
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() click to toggle source

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

# File lib/ruby-esi/models/get_corporations_corporation_id_customs_offices_200_ok.rb, line 395
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/ruby-esi/models/get_corporations_corporation_id_customs_offices_200_ok.rb, line 236
def valid?
  return false if @allow_access_with_standings.nil?
  return false if @allow_alliance_access.nil?
  return false if @office_id.nil?
  return false if @reinforce_exit_end.nil?
  return false if @reinforce_exit_end > 23
  return false if @reinforce_exit_end < 0
  return false if @reinforce_exit_start.nil?
  return false if @reinforce_exit_start > 23
  return false if @reinforce_exit_start < 0
  standing_level_validator = EnumAttributeValidator.new('String', ['bad', 'excellent', 'good', 'neutral', 'terrible'])
  return false unless standing_level_validator.valid?(@standing_level)
  return false if @system_id.nil?
  true
end