Class: Io::Flow::V0::Models::MerchantApplicationsSummary

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

Defined Under Namespace

Modules: Types

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#discriminatorObject (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_hashObject



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_hashObject



12870
12871
12872
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12870

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