Class: LogaltyCertificateIssuanceApiCerty::EvidenceApi

Inherits:
BaseApi
  • Object
show all
Defined in:
lib/logalty_certificate_issuance_api_certy/apis/evidence_api.rb

Overview

EvidenceApi

Constant Summary

Constants inherited from BaseApi

BaseApi::GLOBAL_ERRORS

Instance Attribute Summary

Attributes inherited from BaseApi

#config, #http_call_back

Instance Method Summary collapse

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

#download_images(code) ⇒ ApiResponse

Returns a list of images captured during the certificate issuance process. identifier in Logalty (UUIDv4 format).

Parameters:

  • code (UUID | String)

    Required parameter: Transaction’s unique

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/logalty_certificate_issuance_api_certy/apis/evidence_api.rb', line 13

def download_images(code)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/lgt/signcloud/rest/api/v1/certificate/request/images/{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(Image.method(:from_hash))
                .is_api_response(true)
                .is_response_array(true)
                .local_error('404',
                             'Transaction not found.',
                             ErrorResponseException))
    .execute
end

#get_ocr(code) ⇒ ApiResponse

Returns data extracted from the identity document along with validation results. identifier in Logalty (UUIDv4 format).

Parameters:

  • code (UUID | String)

    Required parameter: Transaction’s unique

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/logalty_certificate_issuance_api_certy/apis/evidence_api.rb', line 63

def get_ocr(code)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/lgt/signcloud/rest/api/v1/certificate/request/ocr/{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(OcrResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('404',
                             'Transaction not found.',
                             ErrorResponseException))
    .execute
end

TODO: type endpoint description here identifier in Logalty (UUIDv4 format).

Parameters:

  • code (UUID | String)

    Required parameter: Transaction’s unique

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/logalty_certificate_issuance_api_certy/apis/evidence_api.rb', line 38

def get_video_link(code)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/lgt/signcloud/rest/api/v1/certificate/request/video/{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(VideoResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('404',
                             'Transaction not found.',
                             ErrorResponseException))
    .execute
end