Class: Io::Flow::V0::Models::ManifestedLabelUpserted

Inherits:
Event
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Attributes inherited from Event

#discriminator

Instance Method Summary collapse

Methods inherited from Event

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ ManifestedLabelUpserted

Returns a new instance of ManifestedLabelUpserted.



20694
20695
20696
20697
20698
20699
20700
20701
20702
20703
20704
20705
20706
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20694

def initialize(incoming={})
  super(:discriminator => Event::Types::MANIFESTED_LABEL_UPSERTED)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :id, :manifest_id, :label_id, :flow_tracking_number, :carrier_tracking_number], 'ManifestedLabelUpserted')
  @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String)
  @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
  @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
  @manifest_id = HttpClient::Preconditions.assert_class('manifest_id', opts.delete(:manifest_id), String)
  @label_id = HttpClient::Preconditions.assert_class('label_id', opts.delete(:label_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.



20692
20693
20694
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20692

def carrier_tracking_number
  @carrier_tracking_number
end

#event_idObject (readonly)

Returns the value of attribute event_id.



20692
20693
20694
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20692

def event_id
  @event_id
end

#flow_tracking_numberObject (readonly)

Returns the value of attribute flow_tracking_number.



20692
20693
20694
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20692

def flow_tracking_number
  @flow_tracking_number
end

#idObject (readonly)

Returns the value of attribute id.



20692
20693
20694
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20692

def id
  @id
end

#label_idObject (readonly)

Returns the value of attribute label_id.



20692
20693
20694
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20692

def label_id
  @label_id
end

#manifest_idObject (readonly)

Returns the value of attribute manifest_id.



20692
20693
20694
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20692

def manifest_id
  @manifest_id
end

#organizationObject (readonly)

Returns the value of attribute organization.



20692
20693
20694
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20692

def organization
  @organization
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



20692
20693
20694
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20692

def timestamp
  @timestamp
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



20712
20713
20714
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20712

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

#subtype_to_hashObject



20716
20717
20718
20719
20720
20721
20722
20723
20724
20725
20726
20727
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20716

def subtype_to_hash
  {
    :event_id => event_id,
    :timestamp => timestamp,
    :organization => organization,
    :id => id,
    :manifest_id => manifest_id,
    :label_id => label_id,
    :flow_tracking_number => flow_tracking_number,
    :carrier_tracking_number => carrier_tracking_number
  }
end

#to_jsonObject



20708
20709
20710
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20708

def to_json
  JSON.dump(to_hash)
end