Class: Io::Flow::V0::Models::MerchantApplicationsSummary
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::MerchantApplicationsSummary
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Direct Known Subclasses
MerchantApplicationsSummaryUndefinedType, ShopifyMerchantApplicationsSummary
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 = {}) ⇒ MerchantApplicationsSummary
constructor
A new instance of MerchantApplicationsSummary.
- #subtype_to_hash ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ MerchantApplicationsSummary
Returns a new instance of MerchantApplicationsSummary.
12860 12861 12862 12863 12864 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12860 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:discriminator], 'MerchantApplicationsSummary') @discriminator = HttpClient::Preconditions.assert_class('discriminator', opts.delete(:discriminator), String) end |
Instance Attribute Details
#discriminator ⇒ Object (readonly)
Returns the value of attribute discriminator.
12858 12859 12860 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12858 def discriminator @discriminator end |
Class Method Details
.from_json(hash) ⇒ Object
12874 12875 12876 12877 12878 12879 12880 12881 12882 12883 12884 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12874 def MerchantApplicationsSummary.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[merchant_applications_summary] requires a field named 'discriminator'" end case discriminator when Types::SHOPIFY_MERCHANT_APPLICATIONS_SUMMARY; ShopifyMerchantApplicationsSummary.new(hash) else MerchantApplicationsSummaryUndefinedType.new(:discriminator => discriminator) end end |
Instance Method Details
#subtype_to_hash ⇒ Object
12866 12867 12868 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12866 def subtype_to_hash raise 'Cannot serialize an instance of merchant_applications_summary directly - must use one of the specific types: shopify_merchant_applications_summary' end |
#to_hash ⇒ Object
12870 12871 12872 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12870 def to_hash subtype_to_hash.merge(:discriminator => @discriminator) end |