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.



58114
58115
58116
58117
58118
58119
58120
58121
58122
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58114

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.



58112
58113
58114
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58112

def event_id
  @event_id
end

#organizationObject (readonly)

Returns the value of attribute organization.



58112
58113
58114
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58112

def organization
  @organization
end

#ready_to_fulfillObject (readonly)

Returns the value of attribute ready_to_fulfill.



58112
58113
58114
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58112

def ready_to_fulfill
  @ready_to_fulfill
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



58112
58113
58114
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58112

def timestamp
  @timestamp
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



58128
58129
58130
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58128

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

#subtype_to_hashObject



58132
58133
58134
58135
58136
58137
58138
58139
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58132

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

#to_jsonObject



58124
58125
58126
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58124

def to_json
  JSON.dump(to_hash)
end