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.



38371
38372
38373
38374
38375
38376
38377
38378
38379
38380
38381
38382
38383
38384
38385
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38371

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)
  @order_identifier = (x = opts.delete(:order_identifier); x.nil? ? nil : HttpClient::Preconditions.assert_class('order_identifier', x, String))
  @fulfillment_key = (x = opts.delete(:fulfillment_key); x.nil? ? nil : HttpClient::Preconditions.assert_class('fulfillment_key', x, String))
end

Instance Attribute Details

#carrier_tracking_numberObject (readonly)

Returns the value of attribute carrier_tracking_number.



38369
38370
38371
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38369

def carrier_tracking_number
  @carrier_tracking_number
end

#event_idObject (readonly)

Returns the value of attribute event_id.



38369
38370
38371
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38369

def event_id
  @event_id
end

#flow_tracking_numberObject (readonly)

Returns the value of attribute flow_tracking_number.



38369
38370
38371
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38369

def flow_tracking_number
  @flow_tracking_number
end

#fulfillment_keyObject (readonly)

Returns the value of attribute fulfillment_key.



38369
38370
38371
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38369

def fulfillment_key
  @fulfillment_key
end

#idObject (readonly)

Returns the value of attribute id.



38369
38370
38371
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38369

def id
  @id
end

#label_idObject (readonly)

Returns the value of attribute label_id.



38369
38370
38371
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38369

def label_id
  @label_id
end

#manifest_idObject (readonly)

Returns the value of attribute manifest_id.



38369
38370
38371
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38369

def manifest_id
  @manifest_id
end

#order_identifierObject (readonly)

Returns the value of attribute order_identifier.



38369
38370
38371
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38369

def order_identifier
  @order_identifier
end

#organizationObject (readonly)

Returns the value of attribute organization.



38369
38370
38371
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38369

def organization
  @organization
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



38369
38370
38371
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38369

def timestamp
  @timestamp
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



38391
38392
38393
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38391

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

#subtype_to_hashObject



38395
38396
38397
38398
38399
38400
38401
38402
38403
38404
38405
38406
38407
38408
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38395

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,
    :order_identifier => order_identifier,
    :fulfillment_key => fulfillment_key
  }
end

#to_jsonObject



38387
38388
38389
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38387

def to_json
  JSON.dump(to_hash)
end