Class: Io::Flow::V0::Models::ServiceUnknown

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

Overview

Describes a service used to perform logistic activity outside of our integration.

Instance Attribute Summary collapse

Attributes inherited from ServiceDescription

#discriminator

Instance Method Summary collapse

Methods inherited from ServiceDescription

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ ServiceUnknown

Returns a new instance of ServiceUnknown.



65234
65235
65236
65237
65238
65239
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65234

def initialize(incoming={})
  super(:discriminator => ServiceDescription::Types::SERVICE_UNKNOWN)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:name], 'ServiceUnknown')
  @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



65232
65233
65234
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65232

def name
  @name
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



65245
65246
65247
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65245

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

#subtype_to_hashObject



65249
65250
65251
65252
65253
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65249

def subtype_to_hash
  {
    :name => name
  }
end

#to_jsonObject



65241
65242
65243
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65241

def to_json
  JSON.dump(to_hash)
end