Class: Io::Flow::V0::Models::Event

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Defined Under Namespace

Modules: Types

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ Event

Returns a new instance of Event.



4502
4503
4504
4505
4506
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4502

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:discriminator], 'Event')
  @discriminator = HttpClient::Preconditions.assert_class('discriminator', opts.delete(:discriminator), String)
end

Instance Attribute Details

#discriminator ⇒ Object (readonly)

Returns the value of attribute discriminator.



4500
4501
4502
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4500

def discriminator
  @discriminator
end

Instance Method Details

#subtype_to_hash ⇒ Object



4508
4509
4510
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4508

def subtype_to_hash
  raise 'Cannot serialize an instance of event directly - must use one of the specific types: attribute_upserted, attribute_deleted, catalog_upserted, catalog_deleted, subcatalog_upserted, subcatalog_deleted, catalog_item_upserted, catalog_item_deleted, subcatalog_item_upserted, subcatalog_item_deleted, rate_deleted, rate_upserted, experience_deleted, experience_upserted, item_margin_deleted, item_margin_upserted, label_format_deleted, label_format_upserted, order_deleted, order_upserted, order_identifier_deleted, order_identifier_upserted, pricing_deleted, pricing_upserted, tier_upserted, tier_deleted, hs6_code_upserted, hs6_code_deleted, hs10_code_upserted, hs10_code_deleted, item_origin_upserted, item_origin_deleted, harmonized_item_upserted, harmonized_item_deleted, snapshot_upserted, snapshot_deleted, label_upserted, notification_upserted, notification_deleted, localized_item_upserted, localized_item_deleted, localized_item_snapshot, membership_upserted, membership_deleted, organization_upserted, organization_deleted, authorization_upserted, authorization_deleted, capture_upserted, card_upserted, card_deleted, refund_upserted, return_upserted, return_deleted, targeting_item_upserted, targeting_item_deleted, tracking_label_event_upserted'
end

#to_hash ⇒ Object



4512
4513
4514
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4512

def to_hash
  subtype_to_hash.merge(:discriminator => @discriminator)
end