Class: Io::Flow::V0::Models::HarmonizationHs10ExportType

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

Overview

Exports harmonization HS10 codes

Instance Attribute Summary collapse

Attributes inherited from ExportType

#discriminator

Instance Method Summary collapse

Methods inherited from ExportType

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ HarmonizationHs10ExportType

Returns a new instance of HarmonizationHs10ExportType.



41240
41241
41242
41243
41244
41245
41246
41247
41248
41249
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41240

def initialize(incoming={})
  super(:discriminator => ExportType::Types::HARMONIZATION_HS10_EXPORT_TYPE)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  @origin = (x = opts.delete(:origin); x.nil? ? nil : HttpClient::Preconditions.assert_class('origin', x, String))
  @destination = (x = opts.delete(:destination); x.nil? ? nil : HttpClient::Preconditions.assert_class('destination', x, String))
  @numbers = (x = opts.delete(:numbers); x.nil? ? nil : HttpClient::Preconditions.assert_class('numbers', x, Array).map { |v| HttpClient::Preconditions.assert_class('numbers', v, String) })
  @has_codes = (x = opts.delete(:has_codes); x.nil? ? nil : HttpClient::Preconditions.assert_boolean('has_codes', x))
  @has_origins = (x = opts.delete(:has_origins); x.nil? ? nil : HttpClient::Preconditions.assert_boolean('has_origins', x))
  @sort = (x = opts.delete(:sort); x.nil? ? nil : HttpClient::Preconditions.assert_class('sort', x, String))
end

Instance Attribute Details

#destinationObject (readonly)

Returns the value of attribute destination.



41238
41239
41240
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41238

def destination
  @destination
end

#has_codesObject (readonly)

Returns the value of attribute has_codes.



41238
41239
41240
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41238

def has_codes
  @has_codes
end

#has_originsObject (readonly)

Returns the value of attribute has_origins.



41238
41239
41240
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41238

def has_origins
  @has_origins
end

#numbersObject (readonly)

Returns the value of attribute numbers.



41238
41239
41240
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41238

def numbers
  @numbers
end

#originObject (readonly)

Returns the value of attribute origin.



41238
41239
41240
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41238

def origin
  @origin
end

#sortObject (readonly)

Returns the value of attribute sort.



41238
41239
41240
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41238

def sort
  @sort
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



41255
41256
41257
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41255

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

#subtype_to_hashObject



41259
41260
41261
41262
41263
41264
41265
41266
41267
41268
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41259

def subtype_to_hash
  {
    :origin => origin,
    :destination => destination,
    :numbers => numbers.nil? ? nil : numbers,
    :has_codes => has_codes,
    :has_origins => has_origins,
    :sort => sort
  }
end

#to_jsonObject



41251
41252
41253
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41251

def to_json
  JSON.dump(to_hash)
end