Class: Io::Flow::V0::Models::OrderServiceChangeRequest

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

Returns a new instance of OrderServiceChangeRequest.



41975
41976
41977
41978
41979
41980
41981
41982
41983
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41975

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

Instance Attribute Details

#event_idObject (readonly)

Returns the value of attribute event_id.



41973
41974
41975
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41973

def event_id
  @event_id
end

#organizationObject (readonly)

Returns the value of attribute organization.



41973
41974
41975
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41973

def organization
  @organization
end

#requestObject (readonly)

Returns the value of attribute request.



41973
41974
41975
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41973

def request
  @request
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



41973
41974
41975
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41973

def timestamp
  @timestamp
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



41989
41990
41991
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41989

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

#subtype_to_hashObject



41993
41994
41995
41996
41997
41998
41999
42000
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41993

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

#to_jsonObject



41985
41986
41987
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41985

def to_json
  JSON.dump(to_hash)
end