Class: NewStoreApi::CustomConfigAdditionalDto

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/new_store_api/models/custom_config_additional_dto.rb

Overview

CustomConfigAdditionalDto Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(avalara = SKIP) ⇒ CustomConfigAdditionalDto

Returns a new instance of CustomConfigAdditionalDto.



38
39
40
# File 'lib/new_store_api/models/custom_config_additional_dto.rb', line 38

def initialize(avalara = SKIP)
  @avalara = avalara unless avalara == SKIP
end

Instance Attribute Details

#avalaraCustomV0AvalaraConfigDto

Avalara custom provider configuration.

  • Required if the api_version is set to v0-avalara.
  • If the tax calculation strategy is set to custom and api_version is set to v0-avalara, the given configuration will be used.


17
18
19
# File 'lib/new_store_api/models/custom_config_additional_dto.rb', line 17

def avalara
  @avalara
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



43
44
45
46
47
48
49
50
51
# File 'lib/new_store_api/models/custom_config_additional_dto.rb', line 43

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  avalara = CustomV0AvalaraConfigDto.from_hash(hash['avalara']) if hash['avalara']

  # Create object from extracted values.
  CustomConfigAdditionalDto.new(avalara)
end

.namesObject

A mapping from model property names to API property names.



20
21
22
23
24
# File 'lib/new_store_api/models/custom_config_additional_dto.rb', line 20

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['avalara'] = 'avalara'
  @_hash
end

.nullablesObject

An array for nullable fields



34
35
36
# File 'lib/new_store_api/models/custom_config_additional_dto.rb', line 34

def self.nullables
  []
end

.optionalsObject

An array for optional fields



27
28
29
30
31
# File 'lib/new_store_api/models/custom_config_additional_dto.rb', line 27

def self.optionals
  %w[
    avalara
  ]
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:



55
56
57
58
59
60
61
# File 'lib/new_store_api/models/custom_config_additional_dto.rb', line 55

def self.validate(value)
  return true if value.instance_of? self

  return false unless value.instance_of? Hash

  true
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



70
71
72
73
# File 'lib/new_store_api/models/custom_config_additional_dto.rb', line 70

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} avalara: #{@avalara.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



64
65
66
67
# File 'lib/new_store_api/models/custom_config_additional_dto.rb', line 64

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} avalara: #{@avalara}>"
end