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.



59201
59202
59203
59204
59205
59206
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59201

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



59199
59200
59201
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59199

def id
  @id
end

#ratecard_ownerObject (readonly)

Returns the value of attribute ratecard_owner.



59199
59200
59201
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59199

def ratecard_owner
  @ratecard_owner
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



59212
59213
59214
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59212

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

#to_hashObject



59216
59217
59218
59219
59220
59221
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59216

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

#to_jsonObject



59208
59209
59210
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59208

def to_json
  JSON.dump(to_hash)
end