Class: Io::Flow::V0::Models::RegionSettingForm

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 = {}) ⇒ RegionSettingForm

Returns a new instance of RegionSettingForm.



24598
24599
24600
24601
24602
24603
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24598

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:region_id, :status], 'RegionSettingForm')
  @region_id = HttpClient::Preconditions.assert_class('region_id', opts.delete(:region_id), 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

#region_idObject (readonly)

Returns the value of attribute region_id.



24596
24597
24598
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24596

def region_id
  @region_id
end

#statusObject (readonly)

Returns the value of attribute status.



24596
24597
24598
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24596

def status
  @status
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



24609
24610
24611
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24609

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

#to_hashObject



24613
24614
24615
24616
24617
24618
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24613

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

#to_jsonObject



24605
24606
24607
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24605

def to_json
  JSON.dump(to_hash)
end