Class: Io::Flow::V0::Models::ExperiencePriceBookMappingUpserted

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

Returns a new instance of ExperiencePriceBookMappingUpserted.



32510
32511
32512
32513
32514
32515
32516
32517
32518
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32510

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

Instance Attribute Details

#event_idObject (readonly)

Returns the value of attribute event_id.



32508
32509
32510
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32508

def event_id
  @event_id
end

#experience_price_book_mappingObject (readonly)

Returns the value of attribute experience_price_book_mapping.



32508
32509
32510
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32508

def experience_price_book_mapping
  @experience_price_book_mapping
end

#organizationObject (readonly)

Returns the value of attribute organization.



32508
32509
32510
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32508

def organization
  @organization
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



32508
32509
32510
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32508

def timestamp
  @timestamp
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



32524
32525
32526
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32524

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

#subtype_to_hashObject



32528
32529
32530
32531
32532
32533
32534
32535
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32528

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

#to_jsonObject



32520
32521
32522
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32520

def to_json
  JSON.dump(to_hash)
end