Class: Io::Flow::V0::Models::ShippingLabelSummary

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

Returns a new instance of ShippingLabelSummary.



66644
66645
66646
66647
66648
66649
66650
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66644

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:id, :flow_tracking_number, :carrier_tracking_number], 'ShippingLabelSummary')
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
  @flow_tracking_number = HttpClient::Preconditions.assert_class('flow_tracking_number', opts.delete(:flow_tracking_number), String)
  @carrier_tracking_number = HttpClient::Preconditions.assert_class('carrier_tracking_number', opts.delete(:carrier_tracking_number), String)
end

Instance Attribute Details

#carrier_tracking_numberObject (readonly)

Returns the value of attribute carrier_tracking_number.



66642
66643
66644
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66642

def carrier_tracking_number
  @carrier_tracking_number
end

#flow_tracking_numberObject (readonly)

Returns the value of attribute flow_tracking_number.



66642
66643
66644
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66642

def flow_tracking_number
  @flow_tracking_number
end

#idObject (readonly)

Returns the value of attribute id.



66642
66643
66644
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66642

def id
  @id
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



66656
66657
66658
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66656

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

#to_hashObject



66660
66661
66662
66663
66664
66665
66666
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66660

def to_hash
  {
    :id => id,
    :flow_tracking_number => flow_tracking_number,
    :carrier_tracking_number => carrier_tracking_number
  }
end

#to_jsonObject



66652
66653
66654
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66652

def to_json
  JSON.dump(to_hash)
end