Class: LogaltyCertificateIssuanceApiCerty::TransactionRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- LogaltyCertificateIssuanceApiCerty::TransactionRequest
- Defined in:
- lib/logalty_certificate_issuance_api_certy/models/transaction_request.rb
Overview
TransactionRequest Model.
Instance Attribute Summary collapse
-
#duplicate_key_off ⇒ TrueClass | FalseClass
When combined with ‘externalId`, allows two transactions with the same external identifier to be registered.
-
#duration_data ⇒ Duration
Certificate model: - ‘personal-hsm-fortress-qes`: Qualified personal certificate (QES) hosted in the cloud (FirmaCloud).
-
#external_id ⇒ String
Unique identifier in the client system external to Logalty.
-
#id_model ⇒ CertificateModel
Certificate model: - ‘personal-hsm-fortress-qes`: Qualified personal certificate (QES) hosted in the cloud (FirmaCloud).
-
#locale ⇒ String
Language of the transaction in IETF format.
-
#notice_method ⇒ NoticeMethod
Notification channel used to give the end-user access to the system: - ‘NONE`: No notification is sent; only a synchronous access URL is returned.
-
#profile_data ⇒ Profile
Certificate model: - ‘personal-hsm-fortress-qes`: Qualified personal certificate (QES) hosted in the cloud (FirmaCloud).
-
#support_data ⇒ Support
Certificate model: - ‘personal-hsm-fortress-qes`: Qualified personal certificate (QES) hosted in the cloud (FirmaCloud).
-
#time2close ⇒ String
Validity period of the transaction.
-
#url_back ⇒ String
Redirect URL where the end-user will be redirected after process completion (GET method).
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(id_model:, profile_data:, duration_data: SKIP, support_data: SKIP, external_id: SKIP, duplicate_key_off: false, url_back: SKIP, notice_method: SKIP, time2close: '30d', locale: 'es-ES', additional_properties: nil) ⇒ TransactionRequest
constructor
A new instance of TransactionRequest.
-
#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(id_model:, profile_data:, duration_data: SKIP, support_data: SKIP, external_id: SKIP, duplicate_key_off: false, url_back: SKIP, notice_method: SKIP, time2close: '30d', locale: 'es-ES', additional_properties: nil) ⇒ TransactionRequest
Returns a new instance of TransactionRequest.
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 |
# File 'lib/logalty_certificate_issuance_api_certy/models/transaction_request.rb', line 134 def initialize(id_model:, profile_data:, duration_data: SKIP, support_data: SKIP, external_id: SKIP, duplicate_key_off: false, url_back: SKIP, notice_method: SKIP, time2close: '30d', locale: 'es-ES', additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @id_model = id_model @profile_data = profile_data @duration_data = duration_data unless duration_data == SKIP @support_data = support_data unless support_data == SKIP @external_id = external_id unless external_id == SKIP @duplicate_key_off = duplicate_key_off unless duplicate_key_off == SKIP @url_back = url_back unless url_back == SKIP @notice_method = notice_method unless notice_method == SKIP @time2close = time2close unless time2close == SKIP @locale = locale unless locale == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#duplicate_key_off ⇒ TrueClass | FalseClass
When combined with ‘externalId`, allows two transactions with the same external identifier to be registered. By default the external identifier is unique and duplicate use is not allowed.
66 67 68 |
# File 'lib/logalty_certificate_issuance_api_certy/models/transaction_request.rb', line 66 def duplicate_key_off @duplicate_key_off end |
#duration_data ⇒ Duration
Certificate model:
-
‘personal-hsm-fortress-qes`: Qualified personal certificate (QES) hosted
in the cloud (FirmaCloud).
-
‘personal-sw`: Qualified personal certificate (AES) in software support.
-
‘personal-sw-identity`: Qualified personal certificate (AES) hosted in
the cloud (FirmaCloud).
-
‘personal-sw-identity-sc`: Qualified personal certificate (AES) hosted
in Client System (SC) in cloud. Does not require end-user activation.
43 44 45 |
# File 'lib/logalty_certificate_issuance_api_certy/models/transaction_request.rb', line 43 def duration_data @duration_data end |
#external_id ⇒ String
Unique identifier in the client system external to Logalty. Can be used to search transactions.
59 60 61 |
# File 'lib/logalty_certificate_issuance_api_certy/models/transaction_request.rb', line 59 def external_id @external_id end |
#id_model ⇒ CertificateModel
Certificate model:
-
‘personal-hsm-fortress-qes`: Qualified personal certificate (QES) hosted
in the cloud (FirmaCloud).
-
‘personal-sw`: Qualified personal certificate (AES) in software support.
-
‘personal-sw-identity`: Qualified personal certificate (AES) hosted in
the cloud (FirmaCloud).
-
‘personal-sw-identity-sc`: Qualified personal certificate (AES) hosted
in Client System (SC) in cloud. Does not require end-user activation.
21 22 23 |
# File 'lib/logalty_certificate_issuance_api_certy/models/transaction_request.rb', line 21 def id_model @id_model end |
#locale ⇒ String
Language of the transaction in IETF format. Default is ‘es-ES`.
97 98 99 |
# File 'lib/logalty_certificate_issuance_api_certy/models/transaction_request.rb', line 97 def locale @locale end |
#notice_method ⇒ NoticeMethod
Notification channel used to give the end-user access to the system:
-
‘NONE`: No notification is sent; only a synchronous access URL is
returned.
-
‘EMAIL`: An asynchronous access link is sent by e-mail.
-
‘SMS`: An asynchronous access link is sent by SMS.
85 86 87 |
# File 'lib/logalty_certificate_issuance_api_certy/models/transaction_request.rb', line 85 def notice_method @notice_method end |
#profile_data ⇒ Profile
Certificate model:
-
‘personal-hsm-fortress-qes`: Qualified personal certificate (QES) hosted
in the cloud (FirmaCloud).
-
‘personal-sw`: Qualified personal certificate (AES) in software support.
-
‘personal-sw-identity`: Qualified personal certificate (AES) hosted in
the cloud (FirmaCloud).
-
‘personal-sw-identity-sc`: Qualified personal certificate (AES) hosted
in Client System (SC) in cloud. Does not require end-user activation.
32 33 34 |
# File 'lib/logalty_certificate_issuance_api_certy/models/transaction_request.rb', line 32 def profile_data @profile_data end |
#support_data ⇒ Support
Certificate model:
-
‘personal-hsm-fortress-qes`: Qualified personal certificate (QES) hosted
in the cloud (FirmaCloud).
-
‘personal-sw`: Qualified personal certificate (AES) in software support.
-
‘personal-sw-identity`: Qualified personal certificate (AES) hosted in
the cloud (FirmaCloud).
-
‘personal-sw-identity-sc`: Qualified personal certificate (AES) hosted
in Client System (SC) in cloud. Does not require end-user activation.
54 55 56 |
# File 'lib/logalty_certificate_issuance_api_certy/models/transaction_request.rb', line 54 def support_data @support_data end |
#time2close ⇒ String
Validity period of the transaction. Accepts a numeric value followed by a unit: ‘m` (minutes), `h` (hours), `d` (days). After this period the transaction is automatically closed with result `TIME_EXPIRED`. Default: `30d`.
93 94 95 |
# File 'lib/logalty_certificate_issuance_api_certy/models/transaction_request.rb', line 93 def time2close @time2close end |
#url_back ⇒ String
Redirect URL where the end-user will be redirected after process completion (GET method). The following query parameters are appended automatically:
-
‘code`: Unique transaction identifier in Logalty.
-
‘externalid`: External identifier (URL-encoded), if provided.
-
‘process`: `issuing` (certificate issuance flow) or `activation`
(certificate activation flow).
-
‘status`: `ok`, `cancelled`, `error`, or `exit`.
77 78 79 |
# File 'lib/logalty_certificate_issuance_api_certy/models/transaction_request.rb', line 77 def url_back @url_back end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 |
# File 'lib/logalty_certificate_issuance_api_certy/models/transaction_request.rb', line 156 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. id_model = hash.key?('idModel') ? hash['idModel'] : nil profile_data = Profile.from_hash(hash['profileData']) if hash['profileData'] duration_data = Duration.from_hash(hash['durationData']) if hash['durationData'] support_data = Support.from_hash(hash['supportData']) if hash['supportData'] external_id = hash.key?('externalId') ? hash['externalId'] : SKIP duplicate_key_off = hash['duplicateKeyOff'] ||= false url_back = hash.key?('urlBack') ? hash['urlBack'] : SKIP notice_method = hash.key?('noticeMethod') ? hash['noticeMethod'] : SKIP time2close = hash['time2close'] ||= '30d' locale = hash['locale'] ||= 'es-ES' # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. TransactionRequest.new(id_model: id_model, profile_data: profile_data, duration_data: duration_data, support_data: support_data, external_id: external_id, duplicate_key_off: duplicate_key_off, url_back: url_back, notice_method: notice_method, time2close: time2close, locale: locale, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/logalty_certificate_issuance_api_certy/models/transaction_request.rb', line 100 def self.names @_hash = {} if @_hash.nil? @_hash['id_model'] = 'idModel' @_hash['profile_data'] = 'profileData' @_hash['duration_data'] = 'durationData' @_hash['support_data'] = 'supportData' @_hash['external_id'] = 'externalId' @_hash['duplicate_key_off'] = 'duplicateKeyOff' @_hash['url_back'] = 'urlBack' @_hash['notice_method'] = 'noticeMethod' @_hash['time2close'] = 'time2close' @_hash['locale'] = 'locale' @_hash end |
.nullables ⇒ Object
An array for nullable fields
130 131 132 |
# File 'lib/logalty_certificate_issuance_api_certy/models/transaction_request.rb', line 130 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
116 117 118 119 120 121 122 123 124 125 126 127 |
# File 'lib/logalty_certificate_issuance_api_certy/models/transaction_request.rb', line 116 def self.optionals %w[ duration_data support_data external_id duplicate_key_off url_back notice_method time2close locale ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
203 204 205 206 207 208 209 210 211 |
# File 'lib/logalty_certificate_issuance_api_certy/models/transaction_request.rb', line 203 def inspect class_name = self.class.name.split('::').last "<#{class_name} id_model: #{@id_model.inspect}, profile_data: #{@profile_data.inspect},"\ " duration_data: #{@duration_data.inspect}, support_data: #{@support_data.inspect},"\ " external_id: #{@external_id.inspect}, duplicate_key_off: #{@duplicate_key_off.inspect},"\ " url_back: #{@url_back.inspect}, notice_method: #{@notice_method.inspect}, time2close:"\ " #{@time2close.inspect}, locale: #{@locale.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
193 194 195 196 197 198 199 200 |
# File 'lib/logalty_certificate_issuance_api_certy/models/transaction_request.rb', line 193 def to_s class_name = self.class.name.split('::').last "<#{class_name} id_model: #{@id_model}, profile_data: #{@profile_data}, duration_data:"\ " #{@duration_data}, support_data: #{@support_data}, external_id: #{@external_id},"\ " duplicate_key_off: #{@duplicate_key_off}, url_back: #{@url_back}, notice_method:"\ " #{@notice_method}, time2close: #{@time2close}, locale: #{@locale}, additional_properties:"\ " #{@additional_properties}>" end |