Class: Io::Flow::V0::Models::ReadyToFulfillV2

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

Overview

Sent when an order is assigned to a fulfillment center in whole or in part. All assigned fulfillments for all centers will be included on the message.

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

Returns a new instance of ReadyToFulfillV2.



55602
55603
55604
55605
55606
55607
55608
55609
55610
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55602

def initialize(incoming={})
  super(:discriminator => Event::Types::READY_TO_FULFILL_V2)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :ready_to_fulfill], 'ReadyToFulfillV2')
  @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)
  @ready_to_fulfill = (x = opts.delete(:ready_to_fulfill); x.is_a?(::Io::Flow::V0::Models::ReadyToFulfillDetails) ? x : ::Io::Flow::V0::Models::ReadyToFulfillDetails.new(x))
end

Instance Attribute Details

#event_idObject (readonly)

Returns the value of attribute event_id.



55600
55601
55602
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55600

def event_id
  @event_id
end

#organizationObject (readonly)

Returns the value of attribute organization.



55600
55601
55602
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55600

def organization
  @organization
end

#ready_to_fulfillObject (readonly)

Returns the value of attribute ready_to_fulfill.



55600
55601
55602
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55600

def ready_to_fulfill
  @ready_to_fulfill
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



55600
55601
55602
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55600

def timestamp
  @timestamp
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



55616
55617
55618
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55616

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

#subtype_to_hashObject



55620
55621
55622
55623
55624
55625
55626
55627
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55620

def subtype_to_hash
  {
    :event_id => event_id,
    :timestamp => timestamp,
    :organization => organization,
    :ready_to_fulfill => ready_to_fulfill.to_hash
  }
end

#to_jsonObject



55612
55613
55614
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55612

def to_json
  JSON.dump(to_hash)
end