Class: Io::Flow::V0::Models::ShippingConfigurationSummary

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

Returns a new instance of ShippingConfigurationSummary.



49661
49662
49663
49664
49665
49666
49667
49668
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49661

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:id, :name, :key, :type], 'ShippingConfigurationSummary')
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
  @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
  @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String)
  @type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::ShippingConfigurationType) ? x : ::Io::Flow::V0::Models::ShippingConfigurationType.apply(x))
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



49659
49660
49661
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49659

def id
  @id
end

#keyObject (readonly)

Returns the value of attribute key.



49659
49660
49661
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49659

def key
  @key
end

#nameObject (readonly)

Returns the value of attribute name.



49659
49660
49661
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49659

def name
  @name
end

#typeObject (readonly)

Returns the value of attribute type.



49659
49660
49661
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49659

def type
  @type
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



49674
49675
49676
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49674

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

#to_hashObject



49678
49679
49680
49681
49682
49683
49684
49685
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49678

def to_hash
  {
    :id => id,
    :name => name,
    :key => key,
    :type => type.value
  }
end

#to_jsonObject



49670
49671
49672
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49670

def to_json
  JSON.dump(to_hash)
end