Class: NewStoreApi::VertexExemptionClassItemUpdateDto
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- NewStoreApi::VertexExemptionClassItemUpdateDto
- Defined in:
- lib/new_store_api/models/vertex_exemption_class_item_update_dto.rb
Overview
VertexExemptionClassItemUpdateDto Model.
Instance Attribute Summary collapse
-
#display_text ⇒ Hash[String, Object]
Display text to be used in Associate App while rendering the exemption class.
-
#exemption_class ⇒ ExemptionClassEnum
Display text to be used in Associate App while rendering the exemption class.
-
#valid_countries ⇒ Array[TaxExemptionCountryCodeEnum]
The list of countries where this tax exemption class is valid.
-
#vertex_class_code ⇒ String
Vertex class code.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(exemption_class = nil, valid_countries = nil, vertex_class_code = nil, display_text = SKIP) ⇒ VertexExemptionClassItemUpdateDto
constructor
A new instance of VertexExemptionClassItemUpdateDto.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(exemption_class = nil, valid_countries = nil, vertex_class_code = nil, display_text = SKIP) ⇒ VertexExemptionClassItemUpdateDto
Returns a new instance of VertexExemptionClassItemUpdateDto.
62 63 64 65 66 67 68 |
# File 'lib/new_store_api/models/vertex_exemption_class_item_update_dto.rb', line 62 def initialize(exemption_class = nil, valid_countries = nil, vertex_class_code = nil, display_text = SKIP) @display_text = display_text unless display_text == SKIP @exemption_class = exemption_class @valid_countries = valid_countries @vertex_class_code = vertex_class_code end |
Instance Attribute Details
#display_text ⇒ Hash[String, Object]
Display text to be used in Associate App while rendering the exemption class.
- Required for custom tax exemption classes.
- Optional for pre-defined tax exemption classes.
- Keys must be a valid ISO 639-1 language code.
- Must include English translation by default.
19 20 21 |
# File 'lib/new_store_api/models/vertex_exemption_class_item_update_dto.rb', line 19 def display_text @display_text end |
#exemption_class ⇒ ExemptionClassEnum
Display text to be used in Associate App while rendering the exemption class.
- Required for custom tax exemption classes.
- Optional for pre-defined tax exemption classes.
- Keys must be a valid ISO 639-1 language code.
- Must include English translation by default.
28 29 30 |
# File 'lib/new_store_api/models/vertex_exemption_class_item_update_dto.rb', line 28 def exemption_class @exemption_class end |
#valid_countries ⇒ Array[TaxExemptionCountryCodeEnum]
The list of countries where this tax exemption class is valid.
32 33 34 |
# File 'lib/new_store_api/models/vertex_exemption_class_item_update_dto.rb', line 32 def valid_countries @valid_countries end |
#vertex_class_code ⇒ String
Vertex class code.
- A code used to represent groups of customers, vendors, dispatchers, or recipients who have similar taxability.
38 39 40 |
# File 'lib/new_store_api/models/vertex_exemption_class_item_update_dto.rb', line 38 def vertex_class_code @vertex_class_code end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/new_store_api/models/vertex_exemption_class_item_update_dto.rb', line 71 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. exemption_class = hash.key?('exemption_class') ? hash['exemption_class'] : nil valid_countries = hash.key?('valid_countries') ? hash['valid_countries'] : nil vertex_class_code = hash.key?('vertex_class_code') ? hash['vertex_class_code'] : nil display_text = hash.key?('display_text') ? hash['display_text'] : SKIP # Create object from extracted values. VertexExemptionClassItemUpdateDto.new(exemption_class, valid_countries, vertex_class_code, display_text) end |
.names ⇒ Object
A mapping from model property names to API property names.
41 42 43 44 45 46 47 48 |
# File 'lib/new_store_api/models/vertex_exemption_class_item_update_dto.rb', line 41 def self.names @_hash = {} if @_hash.nil? @_hash['display_text'] = 'display_text' @_hash['exemption_class'] = 'exemption_class' @_hash['valid_countries'] = 'valid_countries' @_hash['vertex_class_code'] = 'vertex_class_code' @_hash end |
.nullables ⇒ Object
An array for nullable fields
58 59 60 |
# File 'lib/new_store_api/models/vertex_exemption_class_item_update_dto.rb', line 58 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
51 52 53 54 55 |
# File 'lib/new_store_api/models/vertex_exemption_class_item_update_dto.rb', line 51 def self.optionals %w[ display_text ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
98 99 100 101 102 103 |
# File 'lib/new_store_api/models/vertex_exemption_class_item_update_dto.rb', line 98 def inspect class_name = self.class.name.split('::').last "<#{class_name} display_text: #{@display_text.inspect}, exemption_class:"\ " #{@exemption_class.inspect}, valid_countries: #{@valid_countries.inspect},"\ " vertex_class_code: #{@vertex_class_code.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
91 92 93 94 95 |
# File 'lib/new_store_api/models/vertex_exemption_class_item_update_dto.rb', line 91 def to_s class_name = self.class.name.split('::').last "<#{class_name} display_text: #{@display_text}, exemption_class: #{@exemption_class},"\ " valid_countries: #{@valid_countries}, vertex_class_code: #{@vertex_class_code}>" end |