Class: Io::Flow::V0::Models::RegionSetting

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ RegionSetting

Returns a new instance of RegionSetting.



47536
47537
47538
47539
47540
47541
47542
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47536

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:id, :region, :status], 'RegionSetting')
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
  @region = HttpClient::Preconditions.assert_class('region', opts.delete(:region), String)
  @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::AvailabilityStatus) ? x : ::Io::Flow::V0::Models::AvailabilityStatus.apply(x))
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



47534
47535
47536
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47534

def id
  @id
end

#regionObject (readonly)

Returns the value of attribute region.



47534
47535
47536
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47534

def region
  @region
end

#statusObject (readonly)

Returns the value of attribute status.



47534
47535
47536
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47534

def status
  @status
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



47548
47549
47550
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47548

def copy(incoming={})
  RegionSetting.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#to_hashObject



47552
47553
47554
47555
47556
47557
47558
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47552

def to_hash
  {
    :id => id,
    :region => region,
    :status => status.value
  }
end

#to_jsonObject



47544
47545
47546
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47544

def to_json
  JSON.dump(to_hash)
end