Class: NewStoreApi::CashboxCreatedV1Dto
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- NewStoreApi::CashboxCreatedV1Dto
- Defined in:
- lib/new_store_api/models/cashbox_created_v1_dto.rb
Overview
CashboxCreatedV1Dto Model.
Instance Attribute Summary collapse
-
#activated_at ⇒ DateTime
Timestamp of the cashbox activation.
-
#config ⇒ Object
Fiscal provider configuration.
-
#deactivated_at ⇒ DateTime
Timestamp of the cashbox deactivation.
-
#fiscal_provider_id ⇒ FiscalProviderIdEnum
Timestamp of the cashbox deactivation.
-
#id ⇒ String
Cashbox identifier.
-
#state ⇒ CashboxStateEnum
Cashbox identifier.
-
#store_id ⇒ String
Store identifier that the cashbox belongs to.
-
#tenant ⇒ String
Tenant identifier.
-
#warning_codes ⇒ Array[F11nWarningCodeEnum]
List of warning codes that were indicated by the fiscal provider during fiscal activation.
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.
-
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
Instance Method Summary collapse
-
#initialize(activated_at = nil, config = nil, fiscal_provider_id = nil, id = nil, state = nil, store_id = nil, tenant = nil, deactivated_at = SKIP, warning_codes = SKIP) ⇒ CashboxCreatedV1Dto
constructor
A new instance of CashboxCreatedV1Dto.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_activated_at ⇒ Object
- #to_custom_deactivated_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(activated_at = nil, config = nil, fiscal_provider_id = nil, id = nil, state = nil, store_id = nil, tenant = nil, deactivated_at = SKIP, warning_codes = SKIP) ⇒ CashboxCreatedV1Dto
Returns a new instance of CashboxCreatedV1Dto.
78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/new_store_api/models/cashbox_created_v1_dto.rb', line 78 def initialize(activated_at = nil, config = nil, fiscal_provider_id = nil, id = nil, state = nil, store_id = nil, tenant = nil, deactivated_at = SKIP, warning_codes = SKIP) @activated_at = activated_at @config = config @deactivated_at = deactivated_at unless deactivated_at == SKIP @fiscal_provider_id = fiscal_provider_id @id = id @state = state @store_id = store_id @tenant = tenant @warning_codes = warning_codes unless warning_codes == SKIP end |
Instance Attribute Details
#activated_at ⇒ DateTime
Timestamp of the cashbox activation.
15 16 17 |
# File 'lib/new_store_api/models/cashbox_created_v1_dto.rb', line 15 def activated_at @activated_at end |
#config ⇒ Object
Fiscal provider configuration.
19 20 21 |
# File 'lib/new_store_api/models/cashbox_created_v1_dto.rb', line 19 def config @config end |
#deactivated_at ⇒ DateTime
Timestamp of the cashbox deactivation.
23 24 25 |
# File 'lib/new_store_api/models/cashbox_created_v1_dto.rb', line 23 def deactivated_at @deactivated_at end |
#fiscal_provider_id ⇒ FiscalProviderIdEnum
Timestamp of the cashbox deactivation.
27 28 29 |
# File 'lib/new_store_api/models/cashbox_created_v1_dto.rb', line 27 def fiscal_provider_id @fiscal_provider_id end |
#id ⇒ String
Cashbox identifier.
31 32 33 |
# File 'lib/new_store_api/models/cashbox_created_v1_dto.rb', line 31 def id @id end |
#state ⇒ CashboxStateEnum
Cashbox identifier.
35 36 37 |
# File 'lib/new_store_api/models/cashbox_created_v1_dto.rb', line 35 def state @state end |
#store_id ⇒ String
Store identifier that the cashbox belongs to.
39 40 41 |
# File 'lib/new_store_api/models/cashbox_created_v1_dto.rb', line 39 def store_id @store_id end |
#tenant ⇒ String
Tenant identifier.
43 44 45 |
# File 'lib/new_store_api/models/cashbox_created_v1_dto.rb', line 43 def tenant @tenant end |
#warning_codes ⇒ Array[F11nWarningCodeEnum]
List of warning codes that were indicated by the fiscal provider during fiscal activation.
48 49 50 |
# File 'lib/new_store_api/models/cashbox_created_v1_dto.rb', line 48 def warning_codes @warning_codes end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
# File 'lib/new_store_api/models/cashbox_created_v1_dto.rb', line 93 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. activated_at = if hash.key?('activated_at') (DateTimeHelper.from_rfc3339(hash['activated_at']) if hash['activated_at']) end config = hash.key?('config') ? APIHelper.deserialize_union_type( UnionTypeLookUp.get(:CashboxCreatedV1DtoConfig), hash['config'] ) : nil fiscal_provider_id = hash.key?('fiscal_provider_id') ? hash['fiscal_provider_id'] : nil id = hash.key?('id') ? hash['id'] : nil state = hash.key?('state') ? hash['state'] : nil store_id = hash.key?('store_id') ? hash['store_id'] : nil tenant = hash.key?('tenant') ? hash['tenant'] : nil deactivated_at = if hash.key?('deactivated_at') (DateTimeHelper.from_rfc3339(hash['deactivated_at']) if hash['deactivated_at']) else SKIP end warning_codes = hash.key?('warning_codes') ? hash['warning_codes'] : SKIP # Create object from extracted values. CashboxCreatedV1Dto.new(activated_at, config, fiscal_provider_id, id, state, store_id, tenant, deactivated_at, warning_codes) end |
.names ⇒ Object
A mapping from model property names to API property names.
51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/new_store_api/models/cashbox_created_v1_dto.rb', line 51 def self.names @_hash = {} if @_hash.nil? @_hash['activated_at'] = 'activated_at' @_hash['config'] = 'config' @_hash['deactivated_at'] = 'deactivated_at' @_hash['fiscal_provider_id'] = 'fiscal_provider_id' @_hash['id'] = 'id' @_hash['state'] = 'state' @_hash['store_id'] = 'store_id' @_hash['tenant'] = 'tenant' @_hash['warning_codes'] = 'warning_codes' @_hash end |
.nullables ⇒ Object
An array for nullable fields
74 75 76 |
# File 'lib/new_store_api/models/cashbox_created_v1_dto.rb', line 74 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
66 67 68 69 70 71 |
# File 'lib/new_store_api/models/cashbox_created_v1_dto.rb', line 66 def self.optionals %w[ deactivated_at warning_codes ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 |
# File 'lib/new_store_api/models/cashbox_created_v1_dto.rb', line 138 def self.validate(value) if value.instance_of? self return ( APIHelper.valid_type?(value.activated_at, ->(val) { val.instance_of? DateTime }) and UnionTypeLookUp.get(:CashboxCreatedV1DtoConfig) .validate(value.config) and APIHelper.valid_type?(value.fiscal_provider_id, ->(val) { FiscalProviderIdEnum.validate(val) }) and APIHelper.valid_type?(value.id, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.state, ->(val) { CashboxStateEnum.validate(val) }) and APIHelper.valid_type?(value.store_id, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.tenant, ->(val) { val.instance_of? String }) ) end return false unless value.instance_of? Hash ( APIHelper.valid_type?(value['activated_at'], ->(val) { val.instance_of? String }) and UnionTypeLookUp.get(:CashboxCreatedV1DtoConfig) .validate(value['config']) and APIHelper.valid_type?(value['fiscal_provider_id'], ->(val) { FiscalProviderIdEnum.validate(val) }) and APIHelper.valid_type?(value['id'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['state'], ->(val) { CashboxStateEnum.validate(val) }) and APIHelper.valid_type?(value['store_id'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['tenant'], ->(val) { val.instance_of? String }) ) end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
187 188 189 190 191 192 193 194 |
# File 'lib/new_store_api/models/cashbox_created_v1_dto.rb', line 187 def inspect class_name = self.class.name.split('::').last "<#{class_name} activated_at: #{@activated_at.inspect}, config: #{@config.inspect},"\ " deactivated_at: #{@deactivated_at.inspect}, fiscal_provider_id:"\ " #{@fiscal_provider_id.inspect}, id: #{@id.inspect}, state: #{@state.inspect}, store_id:"\ " #{@store_id.inspect}, tenant: #{@tenant.inspect}, warning_codes:"\ " #{@warning_codes.inspect}>" end |
#to_custom_activated_at ⇒ Object
128 129 130 |
# File 'lib/new_store_api/models/cashbox_created_v1_dto.rb', line 128 def to_custom_activated_at DateTimeHelper.to_rfc3339(activated_at) end |
#to_custom_deactivated_at ⇒ Object
132 133 134 |
# File 'lib/new_store_api/models/cashbox_created_v1_dto.rb', line 132 def to_custom_deactivated_at DateTimeHelper.to_rfc3339(deactivated_at) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
179 180 181 182 183 184 |
# File 'lib/new_store_api/models/cashbox_created_v1_dto.rb', line 179 def to_s class_name = self.class.name.split('::').last "<#{class_name} activated_at: #{@activated_at}, config: #{@config}, deactivated_at:"\ " #{@deactivated_at}, fiscal_provider_id: #{@fiscal_provider_id}, id: #{@id}, state:"\ " #{@state}, store_id: #{@store_id}, tenant: #{@tenant}, warning_codes: #{@warning_codes}>" end |