Class: Io::Flow::V0::Models::CheckoutOptinResponsesUpserted

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

Returns a new instance of CheckoutOptinResponsesUpserted.



26825
26826
26827
26828
26829
26830
26831
26832
26833
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26825

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

Instance Attribute Details

#checkout_optin_responsesObject (readonly)

Returns the value of attribute checkout_optin_responses.



26823
26824
26825
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26823

def checkout_optin_responses
  @checkout_optin_responses
end

#event_idObject (readonly)

Returns the value of attribute event_id.



26823
26824
26825
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26823

def event_id
  @event_id
end

#organizationObject (readonly)

Returns the value of attribute organization.



26823
26824
26825
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26823

def organization
  @organization
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



26823
26824
26825
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26823

def timestamp
  @timestamp
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



26839
26840
26841
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26839

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

#subtype_to_hashObject



26843
26844
26845
26846
26847
26848
26849
26850
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26843

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

#to_jsonObject



26835
26836
26837
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26835

def to_json
  JSON.dump(to_hash)
end