Class: Io::Flow::V0::Models::LabelUpsertedV2

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

Returns a new instance of LabelUpsertedV2.



22190
22191
22192
22193
22194
22195
22196
22197
22198
22199
22200
22201
22202
22203
22204
22205
22206
22207
22208
22209
22210
22211
22212
22213
22214
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22190

def initialize(incoming={})
  super(:discriminator => Event::Types::LABEL_UPSERTED_V2)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :label_id, :carrier_tracking_number, :flow_tracking_number, :destination, :origin, :carrier, :service], 'LabelUpsertedV2')
  @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)
  @label_id = HttpClient::Preconditions.assert_class('label_id', opts.delete(:label_id), String)
  @carrier_tracking_number = HttpClient::Preconditions.assert_class('carrier_tracking_number', opts.delete(:carrier_tracking_number), String)
  @flow_tracking_number = HttpClient::Preconditions.assert_class('flow_tracking_number', opts.delete(:flow_tracking_number), String)
  @destination = HttpClient::Preconditions.assert_class('destination', HttpClient::Helper.to_object(opts.delete(:destination)), Hash)
  @origin = HttpClient::Preconditions.assert_class('origin', HttpClient::Helper.to_object(opts.delete(:origin)), Hash)
  @carrier = HttpClient::Preconditions.assert_class('carrier', opts.delete(:carrier), String)
  @service = HttpClient::Preconditions.assert_class('service', opts.delete(:service), String)
  @order = (x = opts.delete(:order); x.nil? ? nil : HttpClient::Preconditions.assert_class('order', x, String))
  @carrier_tracking_number_url = (x = opts.delete(:carrier_tracking_number_url); x.nil? ? nil : HttpClient::Preconditions.assert_class('carrier_tracking_number_url', x, String))
  @flow_tracking_number_url = (x = opts.delete(:flow_tracking_number_url); x.nil? ? nil : HttpClient::Preconditions.assert_class('flow_tracking_number_url', x, String))
  @center_key = (x = opts.delete(:center_key); x.nil? ? nil : HttpClient::Preconditions.assert_class('center_key', x, String))
  @direction = (x = opts.delete(:direction); x.nil? ? nil : HttpClient::Preconditions.assert_class('direction', x, String))
  @package = (x = opts.delete(:package); x.nil? ? nil : HttpClient::Preconditions.assert_class('package', HttpClient::Helper.to_object(x), Hash))
  @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))
  @label = (x = opts.delete(:label); x.nil? ? nil : HttpClient::Preconditions.assert_class('label', HttpClient::Helper.to_object(x), Hash))
  @return_ = (x = opts.delete(:return); x.nil? ? nil : HttpClient::Preconditions.assert_class('return', HttpClient::Helper.to_object(x), Hash))
end

Instance Attribute Details

#carrierObject (readonly)

Returns the value of attribute carrier.



22188
22189
22190
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22188

def carrier
  @carrier
end

#carrier_tracking_numberObject (readonly)

Returns the value of attribute carrier_tracking_number.



22188
22189
22190
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22188

def carrier_tracking_number
  @carrier_tracking_number
end

#carrier_tracking_number_urlObject (readonly)

Returns the value of attribute carrier_tracking_number_url.



22188
22189
22190
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22188

def carrier_tracking_number_url
  @carrier_tracking_number_url
end

#center_keyObject (readonly)

Returns the value of attribute center_key.



22188
22189
22190
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22188

def center_key
  @center_key
end

#destinationObject (readonly)

Returns the value of attribute destination.



22188
22189
22190
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22188

def destination
  @destination
end

#directionObject (readonly)

Returns the value of attribute direction.



22188
22189
22190
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22188

def direction
  @direction
end

#event_idObject (readonly)

Returns the value of attribute event_id.



22188
22189
22190
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22188

def event_id
  @event_id
end

#flow_tracking_numberObject (readonly)

Returns the value of attribute flow_tracking_number.



22188
22189
22190
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22188

def flow_tracking_number
  @flow_tracking_number
end

#flow_tracking_number_urlObject (readonly)

Returns the value of attribute flow_tracking_number_url.



22188
22189
22190
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22188

def flow_tracking_number_url
  @flow_tracking_number_url
end

#fulfillment_keyObject (readonly)

Returns the value of attribute fulfillment_key.



22188
22189
22190
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22188

def fulfillment_key
  @fulfillment_key
end

#labelObject (readonly)

Returns the value of attribute label.



22188
22189
22190
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22188

def label
  @label
end

#label_idObject (readonly)

Returns the value of attribute label_id.



22188
22189
22190
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22188

def label_id
  @label_id
end

#orderObject (readonly)

Returns the value of attribute order.



22188
22189
22190
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22188

def order
  @order
end

#order_identifierObject (readonly)

Returns the value of attribute order_identifier.



22188
22189
22190
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22188

def order_identifier
  @order_identifier
end

#organizationObject (readonly)

Returns the value of attribute organization.



22188
22189
22190
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22188

def organization
  @organization
end

#originObject (readonly)

Returns the value of attribute origin.



22188
22189
22190
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22188

def origin
  @origin
end

#packageObject (readonly)

Returns the value of attribute package.



22188
22189
22190
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22188

def package
  @package
end

#return_Object (readonly)

Returns the value of attribute return_.



22188
22189
22190
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22188

def return_
  @return_
end

#serviceObject (readonly)

Returns the value of attribute service.



22188
22189
22190
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22188

def service
  @service
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



22188
22189
22190
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22188

def timestamp
  @timestamp
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



22220
22221
22222
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22220

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

#subtype_to_hashObject



22224
22225
22226
22227
22228
22229
22230
22231
22232
22233
22234
22235
22236
22237
22238
22239
22240
22241
22242
22243
22244
22245
22246
22247
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22224

def subtype_to_hash
  {
    :event_id => event_id,
    :timestamp => timestamp,
    :organization => organization,
    :label_id => label_id,
    :carrier_tracking_number => carrier_tracking_number,
    :flow_tracking_number => flow_tracking_number,
    :destination => destination,
    :origin => origin,
    :carrier => carrier,
    :service => service,
    :order => order,
    :carrier_tracking_number_url => carrier_tracking_number_url,
    :flow_tracking_number_url => flow_tracking_number_url,
    :center_key => center_key,
    :direction => direction,
    :package => package,
    :order_identifier => order_identifier,
    :fulfillment_key => fulfillment_key,
    :label => label,
    :return => return_
  }
end

#to_jsonObject



22216
22217
22218
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22216

def to_json
  JSON.dump(to_hash)
end