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.



62807
62808
62809
62810
62811
62812
62813
62814
62815
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 62807

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.



62805
62806
62807
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 62805

def event_id
  @event_id
end

#organizationObject (readonly)

Returns the value of attribute organization.



62805
62806
62807
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 62805

def organization
  @organization
end

#ready_to_fulfillObject (readonly)

Returns the value of attribute ready_to_fulfill.



62805
62806
62807
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 62805

def ready_to_fulfill
  @ready_to_fulfill
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



62805
62806
62807
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 62805

def timestamp
  @timestamp
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



62821
62822
62823
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 62821

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

#subtype_to_hashObject



62825
62826
62827
62828
62829
62830
62831
62832
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 62825

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

#to_jsonObject



62817
62818
62819
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 62817

def to_json
  JSON.dump(to_hash)
end