Class: Io::Flow::V0::Models::BrowseOptinResponsesUpserted

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

Returns a new instance of BrowseOptinResponsesUpserted.



24008
24009
24010
24011
24012
24013
24014
24015
24016
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24008

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

Instance Attribute Details

#browse_optin_responsesObject (readonly)

Returns the value of attribute browse_optin_responses.



24006
24007
24008
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24006

def browse_optin_responses
  @browse_optin_responses
end

#event_idObject (readonly)

Returns the value of attribute event_id.



24006
24007
24008
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24006

def event_id
  @event_id
end

#organizationObject (readonly)

Returns the value of attribute organization.



24006
24007
24008
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24006

def organization
  @organization
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



24006
24007
24008
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24006

def timestamp
  @timestamp
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



24022
24023
24024
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24022

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

#subtype_to_hashObject



24026
24027
24028
24029
24030
24031
24032
24033
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24026

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

#to_jsonObject



24018
24019
24020
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24018

def to_json
  JSON.dump(to_hash)
end