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.



44459
44460
44461
44462
44463
44464
44465
44466
44467
44468
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44459

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

#destination ⇒ Object (readonly)

Returns the value of attribute destination.



44457
44458
44459
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44457

def destination
  @destination
end

#has_codes ⇒ Object (readonly)

Returns the value of attribute has_codes.



44457
44458
44459
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44457

def has_codes
  @has_codes
end

#has_origins ⇒ Object (readonly)

Returns the value of attribute has_origins.



44457
44458
44459
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44457

def has_origins
  @has_origins
end

#numbers ⇒ Object (readonly)

Returns the value of attribute numbers.



44457
44458
44459
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44457

def numbers
  @numbers
end

#origin ⇒ Object (readonly)

Returns the value of attribute origin.



44457
44458
44459
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44457

def origin
  @origin
end

#sort ⇒ Object (readonly)

Returns the value of attribute sort.



44457
44458
44459
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44457

def sort
  @sort
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



44474
44475
44476
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44474

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

#subtype_to_hash ⇒ Object



44478
44479
44480
44481
44482
44483
44484
44485
44486
44487
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44478

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_json ⇒ Object



44470
44471
44472
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44470

def to_json
  JSON.dump(to_hash)
end