class Io::Flow::V0::Models::ExportType
Defines the specific export data that defines which records are exported and into which format
Attributes
discriminator[R]
Public Class Methods
from_json(hash)
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 12034 def ExportType.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[export_type] requires a field named 'discriminator'" end case discriminator when Types::ACCOUNT_TRANSACTIONS_EXPORT_TYPE; AccountTransactionsExportType.new(hash) when Types::ACCOUNT_ORDERS_EXPORT_TYPE; AccountOrdersExportType.new(hash) when Types::ANALYTICS_EXPORT_TYPE; AnalyticsExportType.new(hash) when Types::CATALOG_ITEM_EXPORT_TYPE; CatalogItemExportType.new(hash) when Types::EXPERIENCE_EXPORT_TYPE; ExperienceExportType.new(hash) when Types::HARMONIZATION_OVERVIEW_EXPORT_TYPE; HarmonizationOverviewExportType.new(hash) when Types::HARMONIZATION_HS6_EXPORT_TYPE; HarmonizationHs6ExportType.new(hash) when Types::HARMONIZATION_HS10_EXPORT_TYPE; HarmonizationHs10ExportType.new(hash) when Types::HARMONIZATION_TARIFF_CODES_EXPORT_TYPE; HarmonizationTariffCodesExportType.new(hash) when Types::UNHARMONIZED_ITEM_EXPORT_TYPE; UnharmonizedItemExportType.new(hash) when Types::ORDER_EXPORT_TYPE; OrderExportType.new(hash) when Types::PRICE_BOOK_ITEM_EXPORT_TYPE; PriceBookItemExportType.new(hash) when Types::SOLIDUS_PRODUCT_EXPORT_TYPE; SolidusProductExportType.new(hash) when Types::SOLIDUS_VARIANT_EXPORT_TYPE; SolidusVariantExportType.new(hash) when Types::LOCALIZED_ITEM_PRICES_EXPORT_TYPE; LocalizedItemPricesExportType.new(hash) when Types::MARKETING_FEEDS_EXPORT_TYPE; MarketingFeedsExportType.new(hash) when Types::EXCLUSION_RULES_EXPORT_TYPE; ExclusionRulesExportType.new(hash) else ExportTypeUndefinedType.new(:discriminator => discriminator) end end
new(incoming={})
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 12020 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:discriminator], 'ExportType') @discriminator = HttpClient::Preconditions.assert_class('discriminator', opts.delete(:discriminator), String) end
Public Instance Methods
subtype_to_hash()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 12026 def subtype_to_hash raise 'Cannot serialize an instance of export_type directly - must use one of the specific types: account_transactions_export_type, account_orders_export_type, analytics_export_type, catalog_item_export_type, experience_export_type, harmonization_overview_export_type, harmonization_hs6_export_type, harmonization_hs10_export_type, harmonization_tariff_codes_export_type, unharmonized_item_export_type, order_export_type, price_book_item_export_type, solidus_product_export_type, solidus_variant_export_type, localized_item_prices_export_type, marketing_feeds_export_type, exclusion_rules_export_type' end
to_hash()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 12030 def to_hash subtype_to_hash.merge(:discriminator => @discriminator) end