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.



41277
41278
41279
41280
41281
41282
41283
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41277

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_codesObject (readonly)

Returns the value of attribute has_codes.



41275
41276
41277
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41275

def has_codes
  @has_codes
end

#numbersObject (readonly)

Returns the value of attribute numbers.



41275
41276
41277
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41275

def numbers
  @numbers
end

#sortObject (readonly)

Returns the value of attribute sort.



41275
41276
41277
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41275

def sort
  @sort
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



41289
41290
41291
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41289

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

#subtype_to_hashObject



41293
41294
41295
41296
41297
41298
41299
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41293

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

#to_jsonObject



41285
41286
41287
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41285

def to_json
  JSON.dump(to_hash)
end