Class: NewStoreApi::SignatureIeV1Dto
- Defined in:
- lib/new_store_api/models/signature_ie_v1_dto.rb
Overview
SignatureIeV1Dto Model.
Instance Attribute Summary collapse
-
#company_number ⇒ String
Company Registration Number (CRO) number issued by the CRO (https://cro.ie).
-
#digital_signature ⇒ String
Locally generated signature, part of the chain maintained in the e-journal.
-
#digital_signature_qr_code ⇒ String
Digital signature in the QR code form.
-
#environment ⇒ FiscalEnvironmentEnum
Digital signature in the QR code form.
-
#key_version ⇒ String
The ES256 key version.
-
#signature_version ⇒ SignatureVersionIeEnum
The ES256 key version.
-
#vat_number ⇒ String
The VAT identification number of the legal entity.
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(company_number = nil, digital_signature = nil, digital_signature_qr_code = nil, environment = nil, key_version = nil, signature_version = nil, vat_number = nil) ⇒ SignatureIeV1Dto
constructor
A new instance of SignatureIeV1Dto.
-
#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(company_number = nil, digital_signature = nil, digital_signature_qr_code = nil, environment = nil, key_version = nil, signature_version = nil, vat_number = nil) ⇒ SignatureIeV1Dto
Returns a new instance of SignatureIeV1Dto.
65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/new_store_api/models/signature_ie_v1_dto.rb', line 65 def initialize(company_number = nil, digital_signature = nil, digital_signature_qr_code = nil, environment = nil, key_version = nil, signature_version = nil, vat_number = nil) @company_number = company_number @digital_signature = digital_signature @digital_signature_qr_code = digital_signature_qr_code @environment = environment @key_version = key_version @signature_version = signature_version @vat_number = vat_number end |
Instance Attribute Details
#company_number ⇒ String
Company Registration Number (CRO) number issued by the CRO (https://cro.ie).
15 16 17 |
# File 'lib/new_store_api/models/signature_ie_v1_dto.rb', line 15 def company_number @company_number end |
#digital_signature ⇒ String
Locally generated signature, part of the chain maintained in the e-journal.
20 21 22 |
# File 'lib/new_store_api/models/signature_ie_v1_dto.rb', line 20 def digital_signature @digital_signature end |
#digital_signature_qr_code ⇒ String
Digital signature in the QR code form.
24 25 26 |
# File 'lib/new_store_api/models/signature_ie_v1_dto.rb', line 24 def digital_signature_qr_code @digital_signature_qr_code end |
#environment ⇒ FiscalEnvironmentEnum
Digital signature in the QR code form.
28 29 30 |
# File 'lib/new_store_api/models/signature_ie_v1_dto.rb', line 28 def environment @environment end |
#key_version ⇒ String
The ES256 key version.
32 33 34 |
# File 'lib/new_store_api/models/signature_ie_v1_dto.rb', line 32 def key_version @key_version end |
#signature_version ⇒ SignatureVersionIeEnum
The ES256 key version.
36 37 38 |
# File 'lib/new_store_api/models/signature_ie_v1_dto.rb', line 36 def signature_version @signature_version end |
#vat_number ⇒ String
The VAT identification number of the legal entity.
40 41 42 |
# File 'lib/new_store_api/models/signature_ie_v1_dto.rb', line 40 def vat_number @vat_number end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 |
# File 'lib/new_store_api/models/signature_ie_v1_dto.rb', line 78 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. company_number = hash.key?('company_number') ? hash['company_number'] : nil digital_signature = hash.key?('digital_signature') ? hash['digital_signature'] : nil digital_signature_qr_code = hash.key?('digital_signature_qr_code') ? hash['digital_signature_qr_code'] : nil environment = hash.key?('environment') ? hash['environment'] : nil key_version = hash.key?('key_version') ? hash['key_version'] : nil signature_version = hash.key?('signature_version') ? hash['signature_version'] : nil vat_number = hash.key?('vat_number') ? hash['vat_number'] : nil # Create object from extracted values. SignatureIeV1Dto.new(company_number, digital_signature, digital_signature_qr_code, environment, key_version, signature_version, vat_number) end |
.names ⇒ Object
A mapping from model property names to API property names.
43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/new_store_api/models/signature_ie_v1_dto.rb', line 43 def self.names @_hash = {} if @_hash.nil? @_hash['company_number'] = 'company_number' @_hash['digital_signature'] = 'digital_signature' @_hash['digital_signature_qr_code'] = 'digital_signature_qr_code' @_hash['environment'] = 'environment' @_hash['key_version'] = 'key_version' @_hash['signature_version'] = 'signature_version' @_hash['vat_number'] = 'vat_number' @_hash end |
.nullables ⇒ Object
An array for nullable fields
61 62 63 |
# File 'lib/new_store_api/models/signature_ie_v1_dto.rb', line 61 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
56 57 58 |
# File 'lib/new_store_api/models/signature_ie_v1_dto.rb', line 56 def self.optionals [] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
# File 'lib/new_store_api/models/signature_ie_v1_dto.rb', line 106 def self.validate(value) if value.instance_of? self return ( APIHelper.valid_type?(value.company_number, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.digital_signature, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.digital_signature_qr_code, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.environment, ->(val) { FiscalEnvironmentEnum.validate(val) }) and APIHelper.valid_type?(value.key_version, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.signature_version, ->(val) { SignatureVersionIeEnum.validate(val) }) and APIHelper.valid_type?(value.vat_number, ->(val) { val.instance_of? String }) ) end return false unless value.instance_of? Hash ( APIHelper.valid_type?(value['company_number'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['digital_signature'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['digital_signature_qr_code'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['environment'], ->(val) { FiscalEnvironmentEnum.validate(val) }) and APIHelper.valid_type?(value['key_version'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['signature_version'], ->(val) { SignatureVersionIeEnum.validate(val) }) and APIHelper.valid_type?(value['vat_number'], ->(val) { val.instance_of? String }) ) end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
156 157 158 159 160 161 162 163 |
# File 'lib/new_store_api/models/signature_ie_v1_dto.rb', line 156 def inspect class_name = self.class.name.split('::').last "<#{class_name} company_number: #{@company_number.inspect}, digital_signature:"\ " #{@digital_signature.inspect}, digital_signature_qr_code:"\ " #{@digital_signature_qr_code.inspect}, environment: #{@environment.inspect}, key_version:"\ " #{@key_version.inspect}, signature_version: #{@signature_version.inspect}, vat_number:"\ " #{@vat_number.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
147 148 149 150 151 152 153 |
# File 'lib/new_store_api/models/signature_ie_v1_dto.rb', line 147 def to_s class_name = self.class.name.split('::').last "<#{class_name} company_number: #{@company_number}, digital_signature:"\ " #{@digital_signature}, digital_signature_qr_code: #{@digital_signature_qr_code},"\ " environment: #{@environment}, key_version: #{@key_version}, signature_version:"\ " #{@signature_version}, vat_number: #{@vat_number}>" end |