Class: Io::Flow::V0::Models::ShippingLabelRatecardSummary

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

Returns a new instance of ShippingLabelRatecardSummary.



66616
66617
66618
66619
66620
66621
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66616

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

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



66614
66615
66616
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66614

def id
  @id
end

#ratecard_ownerObject (readonly)

Returns the value of attribute ratecard_owner.



66614
66615
66616
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66614

def ratecard_owner
  @ratecard_owner
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



66627
66628
66629
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66627

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

#to_hashObject



66631
66632
66633
66634
66635
66636
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66631

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

#to_jsonObject



66623
66624
66625
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66623

def to_json
  JSON.dump(to_hash)
end