Class: Io::Flow::V0::Models::HarmonizationHs6ExportType

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

Overview

Exports HS6 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 = {}) ⇒ HarmonizationHs6ExportType

Returns a new instance of HarmonizationHs6ExportType.



44496
44497
44498
44499
44500
44501
44502
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44496

def initialize(incoming={})
  super(:discriminator => ExportType::Types::HARMONIZATION_HS6_EXPORT_TYPE)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  @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))
  @sort = (x = opts.delete(:sort); x.nil? ? nil : HttpClient::Preconditions.assert_class('sort', x, String))
end

Instance Attribute Details

#has_codes ⇒ Object (readonly)

Returns the value of attribute has_codes.



44494
44495
44496
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44494

def has_codes
  @has_codes
end

#numbers ⇒ Object (readonly)

Returns the value of attribute numbers.



44494
44495
44496
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44494

def numbers
  @numbers
end

#sort ⇒ Object (readonly)

Returns the value of attribute sort.



44494
44495
44496
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44494

def sort
  @sort
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



44508
44509
44510
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44508

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

#subtype_to_hash ⇒ Object



44512
44513
44514
44515
44516
44517
44518
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44512

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

#to_json ⇒ Object



44504
44505
44506
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44504

def to_json
  JSON.dump(to_hash)
end