Class: NewStoreApi::TenantConfigV1Dto
- Defined in:
- lib/new_store_api/models/tenant_config_v1_dto.rb
Overview
TenantConfigV1Dto Model.
Instance Attribute Summary collapse
-
#created_at ⇒ DateTime
Creation date of the configuration.
-
#environment ⇒ FiscalEnvironmentEnum
Creation date of the configuration.
-
#offline_countries ⇒ OfflineCountriesConfigMetadataV1Dto
Offline mode configuration per country.
-
#updated_at ⇒ DateTime
Latest update date of the configuration.
-
#updated_by ⇒ String
User identifier who updated the current version of the configuration.
-
#version ⇒ Integer
Version number of the configuration.
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(environment = nil, offline_countries = nil, version = nil, created_at = SKIP, updated_at = SKIP, updated_by = SKIP) ⇒ TenantConfigV1Dto
constructor
A new instance of TenantConfigV1Dto.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_created_at ⇒ Object
- #to_custom_updated_at ⇒ Object
-
#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(environment = nil, offline_countries = nil, version = nil, created_at = SKIP, updated_at = SKIP, updated_by = SKIP) ⇒ TenantConfigV1Dto
Returns a new instance of TenantConfigV1Dto.
64 65 66 67 68 69 70 71 72 |
# File 'lib/new_store_api/models/tenant_config_v1_dto.rb', line 64 def initialize(environment = nil, offline_countries = nil, version = nil, created_at = SKIP, updated_at = SKIP, updated_by = SKIP) @created_at = created_at unless created_at == SKIP @environment = environment @offline_countries = offline_countries @updated_at = updated_at unless updated_at == SKIP @updated_by = updated_by unless updated_by == SKIP @version = version end |
Instance Attribute Details
#created_at ⇒ DateTime
Creation date of the configuration.
15 16 17 |
# File 'lib/new_store_api/models/tenant_config_v1_dto.rb', line 15 def created_at @created_at end |
#environment ⇒ FiscalEnvironmentEnum
Creation date of the configuration.
19 20 21 |
# File 'lib/new_store_api/models/tenant_config_v1_dto.rb', line 19 def environment @environment end |
#offline_countries ⇒ OfflineCountriesConfigMetadataV1Dto
Offline mode configuration per country.
23 24 25 |
# File 'lib/new_store_api/models/tenant_config_v1_dto.rb', line 23 def offline_countries @offline_countries end |
#updated_at ⇒ DateTime
Latest update date of the configuration.
27 28 29 |
# File 'lib/new_store_api/models/tenant_config_v1_dto.rb', line 27 def updated_at @updated_at end |
#updated_by ⇒ String
User identifier who updated the current version of the configuration.
31 32 33 |
# File 'lib/new_store_api/models/tenant_config_v1_dto.rb', line 31 def updated_by @updated_by end |
#version ⇒ Integer
Version number of the configuration.
- Version number
0represents the system defaults.
36 37 38 |
# File 'lib/new_store_api/models/tenant_config_v1_dto.rb', line 36 def version @version end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/new_store_api/models/tenant_config_v1_dto.rb', line 75 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. environment = hash.key?('environment') ? hash['environment'] : nil if hash['offline_countries'] offline_countries = OfflineCountriesConfigMetadataV1Dto.from_hash(hash['offline_countries']) end version = hash.key?('version') ? hash['version'] : nil created_at = if hash.key?('created_at') (DateTimeHelper.from_rfc3339(hash['created_at']) if hash['created_at']) else SKIP end updated_at = if hash.key?('updated_at') (DateTimeHelper.from_rfc3339(hash['updated_at']) if hash['updated_at']) else SKIP end updated_by = hash.key?('updated_by') ? hash['updated_by'] : SKIP # Create object from extracted values. TenantConfigV1Dto.new(environment, offline_countries, version, created_at, updated_at, updated_by) end |
.names ⇒ Object
A mapping from model property names to API property names.
39 40 41 42 43 44 45 46 47 48 |
# File 'lib/new_store_api/models/tenant_config_v1_dto.rb', line 39 def self.names @_hash = {} if @_hash.nil? @_hash['created_at'] = 'created_at' @_hash['environment'] = 'environment' @_hash['offline_countries'] = 'offline_countries' @_hash['updated_at'] = 'updated_at' @_hash['updated_by'] = 'updated_by' @_hash['version'] = 'version' @_hash end |
.nullables ⇒ Object
An array for nullable fields
60 61 62 |
# File 'lib/new_store_api/models/tenant_config_v1_dto.rb', line 60 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
51 52 53 54 55 56 57 |
# File 'lib/new_store_api/models/tenant_config_v1_dto.rb', line 51 def self.optionals %w[ created_at updated_at updated_by ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
122 123 124 125 126 127 |
# File 'lib/new_store_api/models/tenant_config_v1_dto.rb', line 122 def inspect class_name = self.class.name.split('::').last "<#{class_name} created_at: #{@created_at.inspect}, environment: #{@environment.inspect},"\ " offline_countries: #{@offline_countries.inspect}, updated_at: #{@updated_at.inspect},"\ " updated_by: #{@updated_by.inspect}, version: #{@version.inspect}>" end |
#to_custom_created_at ⇒ Object
105 106 107 |
# File 'lib/new_store_api/models/tenant_config_v1_dto.rb', line 105 def to_custom_created_at DateTimeHelper.to_rfc3339(created_at) end |
#to_custom_updated_at ⇒ Object
109 110 111 |
# File 'lib/new_store_api/models/tenant_config_v1_dto.rb', line 109 def to_custom_updated_at DateTimeHelper.to_rfc3339(updated_at) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
114 115 116 117 118 119 |
# File 'lib/new_store_api/models/tenant_config_v1_dto.rb', line 114 def to_s class_name = self.class.name.split('::').last "<#{class_name} created_at: #{@created_at}, environment: #{@environment},"\ " offline_countries: #{@offline_countries}, updated_at: #{@updated_at}, updated_by:"\ " #{@updated_by}, version: #{@version}>" end |