Class: LogaltyCertificateIssuanceApiCerty::CertificateRequestsApi
- Inherits:
-
BaseApi
- Object
- BaseApi
- LogaltyCertificateIssuanceApiCerty::CertificateRequestsApi
- Defined in:
- lib/logalty_certificate_issuance_api_certy/apis/certificate_requests_api.rb
Overview
CertificateRequestsApi
Constant Summary
Constants inherited from BaseApi
Instance Attribute Summary
Attributes inherited from BaseApi
Instance Method Summary collapse
-
#create_certificate_request(body) ⇒ ApiResponse
Registers a new certificate issuance request for an end-user.
-
#get_certificate_request_by_code(code) ⇒ ApiResponse
Returns the status and details of a certificate issuance transaction by its UUID.
-
#get_certificate_request_by_external_id(external_id) ⇒ ApiResponse
Returns a list of certificate issuance transactions matching the provided external identifier.
Methods inherited from BaseApi
#initialize, #new_parameter, #new_request_builder, #new_response_handler, user_agent, user_agent_parameters
Constructor Details
This class inherits a constructor from LogaltyCertificateIssuanceApiCerty::BaseApi
Instance Method Details
#create_certificate_request(body) ⇒ ApiResponse
Registers a new certificate issuance request for an end-user. A synchronous access URL (‘accessUrl`) is always returned in the response. An asynchronous access link is also generated and sent to the end-user when `noticeMethod` is set to `EMAIL` or `SMS`. description here
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/logalty_certificate_issuance_api_certy/apis/certificate_requests_api.rb', line 17 def create_certificate_request(body) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/lgt/signcloud/rest/api/v1/certificate/request', Server::DEFAULT) .header_param(new_parameter('application/json', key: 'Content-Type')) .body_param(new_parameter(body) .is_required(true)) .header_param(new_parameter('application/json', key: 'accept')) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('bearerAuth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(TransactionResponse.method(:from_hash)) .is_api_response(true) .local_error('400', 'Invalid request parameters.', ErrorResponseException)) .execute end |
#get_certificate_request_by_code(code) ⇒ ApiResponse
Returns the status and details of a certificate issuance transaction by its UUID. identifier in Logalty (UUIDv4 format).
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/logalty_certificate_issuance_api_certy/apis/certificate_requests_api.rb', line 43 def get_certificate_request_by_code(code) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/lgt/signcloud/rest/api/v1/certificate/request/{code}', Server::DEFAULT) .template_param(new_parameter(code, key: 'code') .is_required(true) .should_encode(true)) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('bearerAuth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(TransactionStatus.method(:from_hash)) .is_api_response(true) .local_error('404', 'Transaction not found.', ErrorResponseException)) .execute end |
#get_certificate_request_by_external_id(external_id) ⇒ ApiResponse
Returns a list of certificate issuance transactions matching the provided external identifier. Multiple transactions may share the same ‘externalId` if registered with the `duplicateKeyOff` flag. client system external to Logalty.
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/logalty_certificate_issuance_api_certy/apis/certificate_requests_api.rb', line 70 def get_certificate_request_by_external_id(external_id) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/lgt/signcloud/rest/api/v1/certificate/request/external-id/{external-id}', Server::DEFAULT) .template_param(new_parameter(external_id, key: 'external-id') .is_required(true) .should_encode(true)) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('bearerAuth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(TransactionStatus.method(:from_hash)) .is_api_response(true) .is_response_array(true)) .execute end |