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.



57210
57211
57212
57213
57214
57215
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57210

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.



57208
57209
57210
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57208

def key
  @key
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



57221
57222
57223
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57221

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

#subtype_to_hashObject



57225
57226
57227
57228
57229
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57225

def subtype_to_hash
  {
    :key => key
  }
end

#to_jsonObject



57217
57218
57219
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57217

def to_json
  JSON.dump(to_hash)
end