Class: Io::Flow::V0::Models::Event
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::Event
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Direct Known Subclasses
AllocationDeletedV2, AllocationUpsertedV2, AttributeDeleted, AttributeDeletedV2, AttributeUpserted, AttributeUpsertedV2, AuthorizationDeleted, AuthorizationDeletedV2, AuthorizationStatusChanged, AuthorizationUpserted, AvailablePromotionsDeleted, AvailablePromotionsUpserted, CaptureUpserted, CaptureUpsertedV2, CardAuthorizationUpserted, CardAuthorizationUpsertedV2, CardDeleted, CardUpserted, CardUpsertedV2, CatalogDeleted, CatalogItemDeleted, CatalogItemUpserted, CatalogUpserted, CrossdockShipmentUpserted, CurrencyFormatDeleted, CurrencyFormatUpserted, DeliveryOptionDeleted, DeliveryOptionUpserted, EventUndefinedType, ExperienceDeleted, ExperiencePriceBookMappingDeleted, ExperiencePriceBookMappingUpserted, ExperienceUpserted, FraudStatusChanged, FullyHarmonizedItemUpserted, HarmonizedItemDeleted, HarmonizedItemUpserted, HarmonizedLandedCostUpserted, Hs10CodeDeleted, Hs10CodeUpserted, Hs6CodeDeleted, Hs6CodeUpserted, ItemMarginDeleted, ItemMarginUpserted, ItemOriginDeleted, ItemOriginUpserted, ItemSalesMarginDeleted, ItemSalesMarginUpserted, LabelFormatDeleted, LabelFormatUpserted, LabelUpserted, LocalItemDeleted, LocalItemUpserted, ManifestedLabelDeleted, ManifestedLabelUpserted, MembershipDeleted, MembershipUpserted, NotificationDeleted, NotificationUpserted, OnlineAuthorizationUpserted, OnlineAuthorizationUpsertedV2, OrderDeleted, OrderIdentifierDeleted, OrderIdentifierDeletedV2, OrderIdentifierUpserted, OrderIdentifierUpsertedV2, OrderUpserted, OrganizationCountriesPublished, OrganizationDeleted, OrganizationRatecardTransitWindowsPublished, OrganizationRatesPublished, OrganizationUpserted, PaymentDeleted, PaymentUpserted, PriceBookDeleted, PriceBookItemDeleted, PriceBookItemUpserted, PriceBookUpserted, PricingDeleted, PricingUpserted, RateDeleted, RateUpserted, RefundCaptureUpsertedV2, RefundUpserted, RefundUpsertedV2, ReturnDeleted, ReturnUpserted, ReversalUpserted, RuleDeleted, RuleUpserted, SerialDeleted, SerialUpserted, SnapshotDeleted, SnapshotUpserted, SubcatalogDeleted, SubcatalogItemDeleted, SubcatalogItemUpserted, SubcatalogUpserted, TargetingItemDeleted, TargetingItemUpserted, TierDeleted, TierUpserted, TrackingLabelEventUpserted
Defined Under Namespace
Modules: Types
Instance Attribute Summary collapse
-
#discriminator ⇒ Object
readonly
Returns the value of attribute discriminator.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(incoming = {}) ⇒ Event
constructor
A new instance of Event.
- #subtype_to_hash ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ Event
Returns a new instance of Event.
6189 6190 6191 6192 6193 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6189 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.
6187 6188 6189 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6187 def discriminator @discriminator end |
Class Method Details
.from_json(hash) ⇒ Object
6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217 6218 6219 6220 6221 6222 6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 6237 6238 6239 6240 6241 6242 6243 6244 6245 6246 6247 6248 6249 6250 6251 6252 6253 6254 6255 6256 6257 6258 6259 6260 6261 6262 6263 6264 6265 6266 6267 6268 6269 6270 6271 6272 6273 6274 6275 6276 6277 6278 6279 6280 6281 6282 6283 6284 6285 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6300 6301 6302 6303 6304 6305 6306 6307 6308 6309 6310 6311 6312 6313 6314 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6203 def Event.from_json(hash) HttpClient::Preconditions.assert_class('hash', hash, Hash) discriminator = HttpClient::Helper.symbolize_keys(hash)[:discriminator].to_s.strip if discriminator.empty? raise "Union type[event] requires a field named 'discriminator'" end case discriminator when Types::ATTRIBUTE_UPSERTED; AttributeUpserted.new(hash) when Types::ATTRIBUTE_DELETED; AttributeDeleted.new(hash) when Types::ATTRIBUTE_UPSERTED_V2; AttributeUpsertedV2.new(hash) when Types::ATTRIBUTE_DELETED_V2; AttributeDeletedV2.new(hash) when Types::CATALOG_UPSERTED; CatalogUpserted.new(hash) when Types::CATALOG_DELETED; CatalogDeleted.new(hash) when Types::SUBCATALOG_UPSERTED; SubcatalogUpserted.new(hash) when Types::SUBCATALOG_DELETED; SubcatalogDeleted.new(hash) when Types::CATALOG_ITEM_UPSERTED; CatalogItemUpserted.new(hash) when Types::CATALOG_ITEM_DELETED; CatalogItemDeleted.new(hash) when Types::SUBCATALOG_ITEM_UPSERTED; SubcatalogItemUpserted.new(hash) when Types::SUBCATALOG_ITEM_DELETED; SubcatalogItemDeleted.new(hash) when Types::CROSSDOCK_SHIPMENT_UPSERTED; CrossdockShipmentUpserted.new(hash) when Types::RATE_DELETED; RateDeleted.new(hash) when Types::RATE_UPSERTED; RateUpserted.new(hash) when Types::AVAILABLE_PROMOTIONS_UPSERTED; AvailablePromotionsUpserted.new(hash) when Types::AVAILABLE_PROMOTIONS_DELETED; AvailablePromotionsDeleted.new(hash) when Types::ALLOCATION_DELETED_V2; AllocationDeletedV2.new(hash) when Types::ALLOCATION_UPSERTED_V2; AllocationUpsertedV2.new(hash) when Types::CURRENCY_FORMAT_DELETED; CurrencyFormatDeleted.new(hash) when Types::CURRENCY_FORMAT_UPSERTED; CurrencyFormatUpserted.new(hash) when Types::EXPERIENCE_DELETED; ExperienceDeleted.new(hash) when Types::EXPERIENCE_UPSERTED; ExperienceUpserted.new(hash) when Types::EXPERIENCE_PRICE_BOOK_MAPPING_DELETED; ExperiencePriceBookMappingDeleted.new(hash) when Types::EXPERIENCE_PRICE_BOOK_MAPPING_UPSERTED; ExperiencePriceBookMappingUpserted.new(hash) when Types::ITEM_MARGIN_DELETED; ItemMarginDeleted.new(hash) when Types::ITEM_MARGIN_UPSERTED; ItemMarginUpserted.new(hash) when Types::ITEM_SALES_MARGIN_DELETED; ItemSalesMarginDeleted.new(hash) when Types::ITEM_SALES_MARGIN_UPSERTED; ItemSalesMarginUpserted.new(hash) when Types::LABEL_FORMAT_DELETED; LabelFormatDeleted.new(hash) when Types::LABEL_FORMAT_UPSERTED; LabelFormatUpserted.new(hash) when Types::ORDER_DELETED; OrderDeleted.new(hash) when Types::ORDER_UPSERTED; OrderUpserted.new(hash) when Types::ORDER_IDENTIFIER_DELETED; OrderIdentifierDeleted.new(hash) when Types::ORDER_IDENTIFIER_UPSERTED; OrderIdentifierUpserted.new(hash) when Types::ORDER_IDENTIFIER_DELETED_V2; OrderIdentifierDeletedV2.new(hash) when Types::ORDER_IDENTIFIER_UPSERTED_V2; OrderIdentifierUpsertedV2.new(hash) when Types::PRICING_DELETED; PricingDeleted.new(hash) when Types::PRICING_UPSERTED; PricingUpserted.new(hash) when Types::FRAUD_STATUS_CHANGED; FraudStatusChanged.new(hash) when Types::TIER_UPSERTED; TierUpserted.new(hash) when Types::TIER_DELETED; TierDeleted.new(hash) when Types::DELIVERY_OPTION_UPSERTED; DeliveryOptionUpserted.new(hash) when Types::DELIVERY_OPTION_DELETED; DeliveryOptionDeleted.new(hash) when Types::HS6_CODE_UPSERTED; Hs6CodeUpserted.new(hash) when Types::HS6_CODE_DELETED; Hs6CodeDeleted.new(hash) when Types::HS10_CODE_UPSERTED; Hs10CodeUpserted.new(hash) when Types::HS10_CODE_DELETED; Hs10CodeDeleted.new(hash) when Types::ITEM_ORIGIN_UPSERTED; ItemOriginUpserted.new(hash) when Types::ITEM_ORIGIN_DELETED; ItemOriginDeleted.new(hash) when Types::HARMONIZED_ITEM_UPSERTED; HarmonizedItemUpserted.new(hash) when Types::HARMONIZED_ITEM_DELETED; HarmonizedItemDeleted.new(hash) when Types::HARMONIZED_LANDED_COST_UPSERTED; HarmonizedLandedCostUpserted.new(hash) when Types::FULLY_HARMONIZED_ITEM_UPSERTED; FullyHarmonizedItemUpserted.new(hash) when Types::RULE_UPSERTED; RuleUpserted.new(hash) when Types::RULE_DELETED; RuleDeleted.new(hash) when Types::SERIAL_UPSERTED; SerialUpserted.new(hash) when Types::SERIAL_DELETED; SerialDeleted.new(hash) when Types::SNAPSHOT_UPSERTED; SnapshotUpserted.new(hash) when Types::SNAPSHOT_DELETED; SnapshotDeleted.new(hash) when Types::LABEL_UPSERTED; LabelUpserted.new(hash) when Types::NOTIFICATION_UPSERTED; NotificationUpserted.new(hash) when Types::NOTIFICATION_DELETED; NotificationDeleted.new(hash) when Types::MANIFESTED_LABEL_UPSERTED; ManifestedLabelUpserted.new(hash) when Types::MANIFESTED_LABEL_DELETED; ManifestedLabelDeleted.new(hash) when Types::LOCAL_ITEM_UPSERTED; LocalItemUpserted.new(hash) when Types::LOCAL_ITEM_DELETED; LocalItemDeleted.new(hash) when Types::MEMBERSHIP_UPSERTED; MembershipUpserted.new(hash) when Types::MEMBERSHIP_DELETED; MembershipDeleted.new(hash) when Types::ORGANIZATION_UPSERTED; OrganizationUpserted.new(hash) when Types::ORGANIZATION_DELETED; OrganizationDeleted.new(hash) when Types::AUTHORIZATION_UPSERTED; AuthorizationUpserted.new(hash) when Types::AUTHORIZATION_DELETED; AuthorizationDeleted.new(hash) when Types::AUTHORIZATION_DELETED_V2; AuthorizationDeletedV2.new(hash) when Types::AUTHORIZATION_STATUS_CHANGED; AuthorizationStatusChanged.new(hash) when Types::CARD_AUTHORIZATION_UPSERTED; CardAuthorizationUpserted.new(hash) when Types::CARD_AUTHORIZATION_UPSERTED_V2; CardAuthorizationUpsertedV2.new(hash) when Types::ONLINE_AUTHORIZATION_UPSERTED; OnlineAuthorizationUpserted.new(hash) when Types::ONLINE_AUTHORIZATION_UPSERTED_V2; OnlineAuthorizationUpsertedV2.new(hash) when Types::CAPTURE_UPSERTED; CaptureUpserted.new(hash) when Types::CAPTURE_UPSERTED_V2; CaptureUpsertedV2.new(hash) when Types::CARD_UPSERTED; CardUpserted.new(hash) when Types::CARD_UPSERTED_V2; CardUpsertedV2.new(hash) when Types::CARD_DELETED; CardDeleted.new(hash) when Types::PAYMENT_UPSERTED; PaymentUpserted.new(hash) when Types::PAYMENT_DELETED; PaymentDeleted.new(hash) when Types::REFUND_UPSERTED; RefundUpserted.new(hash) when Types::REFUND_UPSERTED_V2; RefundUpsertedV2.new(hash) when Types::REFUND_CAPTURE_UPSERTED_V2; RefundCaptureUpsertedV2.new(hash) when Types::REVERSAL_UPSERTED; ReversalUpserted.new(hash) when Types::PRICE_BOOK_UPSERTED; PriceBookUpserted.new(hash) when Types::PRICE_BOOK_DELETED; PriceBookDeleted.new(hash) when Types::PRICE_BOOK_ITEM_UPSERTED; PriceBookItemUpserted.new(hash) when Types::PRICE_BOOK_ITEM_DELETED; PriceBookItemDeleted.new(hash) when Types::ORGANIZATION_RATES_PUBLISHED; OrganizationRatesPublished.new(hash) when Types::ORGANIZATION_COUNTRIES_PUBLISHED; OrganizationCountriesPublished.new(hash) when Types::ORGANIZATION_RATECARD_TRANSIT_WINDOWS_PUBLISHED; OrganizationRatecardTransitWindowsPublished.new(hash) when Types::RETURN_UPSERTED; ReturnUpserted.new(hash) when Types::RETURN_DELETED; ReturnDeleted.new(hash) when Types::TARGETING_ITEM_UPSERTED; TargetingItemUpserted.new(hash) when Types::TARGETING_ITEM_DELETED; TargetingItemDeleted.new(hash) when Types::TRACKING_LABEL_EVENT_UPSERTED; TrackingLabelEventUpserted.new(hash) else EventUndefinedType.new(:discriminator => discriminator) end end |
Instance Method Details
#subtype_to_hash ⇒ Object
6195 6196 6197 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6195 def subtype_to_hash raise 'Cannot serialize an instance of event directly - must use one of the specific types: attribute_upserted, attribute_deleted, attribute_upserted_v2, attribute_deleted_v2, catalog_upserted, catalog_deleted, subcatalog_upserted, subcatalog_deleted, catalog_item_upserted, catalog_item_deleted, subcatalog_item_upserted, subcatalog_item_deleted, crossdock_shipment_upserted, rate_deleted, rate_upserted, available_promotions_upserted, available_promotions_deleted, allocation_deleted_v2, allocation_upserted_v2, currency_format_deleted, currency_format_upserted, experience_deleted, experience_upserted, experience_price_book_mapping_deleted, experience_price_book_mapping_upserted, item_margin_deleted, item_margin_upserted, item_sales_margin_deleted, item_sales_margin_upserted, label_format_deleted, label_format_upserted, order_deleted, order_upserted, order_identifier_deleted, order_identifier_upserted, order_identifier_deleted_v2, order_identifier_upserted_v2, pricing_deleted, pricing_upserted, fraud_status_changed, tier_upserted, tier_deleted, delivery_option_upserted, delivery_option_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, harmonized_landed_cost_upserted, fully_harmonized_item_upserted, rule_upserted, rule_deleted, serial_upserted, serial_deleted, snapshot_upserted, snapshot_deleted, label_upserted, notification_upserted, notification_deleted, manifested_label_upserted, manifested_label_deleted, local_item_upserted, local_item_deleted, membership_upserted, membership_deleted, organization_upserted, organization_deleted, authorization_upserted, authorization_deleted, authorization_deleted_v2, authorization_status_changed, card_authorization_upserted, card_authorization_upserted_v2, online_authorization_upserted, online_authorization_upserted_v2, capture_upserted, capture_upserted_v2, card_upserted, card_upserted_v2, card_deleted, payment_upserted, payment_deleted, refund_upserted, refund_upserted_v2, refund_capture_upserted_v2, reversal_upserted, price_book_upserted, price_book_deleted, price_book_item_upserted, price_book_item_deleted, organization_rates_published, organization_countries_published, organization_ratecard_transit_windows_published, return_upserted, return_deleted, targeting_item_upserted, targeting_item_deleted, tracking_label_event_upserted' end |
#to_hash ⇒ Object
6199 6200 6201 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6199 def to_hash subtype_to_hash.merge(:discriminator => @discriminator) end |