Class: Io::Flow::V0::Models::ReturnSourceExternalVendor

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

Instance Attribute Summary collapse

Attributes inherited from ReturnSource

#discriminator

Instance Method Summary collapse

Methods inherited from ReturnSource

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ ReturnSourceExternalVendor

Returns a new instance of ReturnSourceExternalVendor.



64413
64414
64415
64416
64417
64418
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 64413

def initialize(incoming={})
  super(:discriminator => ReturnSource::Types::RETURN_SOURCE_EXTERNAL_VENDOR)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:key], 'ReturnSourceExternalVendor')
  @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String)
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



64411
64412
64413
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 64411

def key
  @key
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



64424
64425
64426
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 64424

def copy(incoming={})
  ReturnSourceExternalVendor.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#subtype_to_hashObject



64428
64429
64430
64431
64432
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 64428

def subtype_to_hash
  {
    :key => key
  }
end

#to_jsonObject



64420
64421
64422
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 64420

def to_json
  JSON.dump(to_hash)
end