Class: ApimaticApi::DocsPortalGenerationAsyncController
- Inherits:
-
BaseController
- Object
- BaseController
- ApimaticApi::DocsPortalGenerationAsyncController
- Defined in:
- lib/apimatic_api/controllers/docs_portal_generation_async_controller.rb
Overview
DocsPortalGenerationAsyncController
Constant Summary
Constants inherited from BaseController
Instance Attribute Summary
Attributes inherited from BaseController
Instance Method Summary collapse
-
#download_generated_portal(id) ⇒ ApiResponse
Downloads the portal artifacts.
-
#generate_on_prem_portal_via_build_input_async(content_type, file, x_api_matic_callback_url: nil) ⇒ ApiResponse
Create an async On-premise Documentation Portal Generation request by providing a Portal Build Input Portal Generator.
-
#get_portal_generation_status(id) ⇒ ApiResponse
Get the status of a portal generation request.
Methods inherited from BaseController
#initialize, #new_parameter, #new_request_builder, #new_response_handler
Constructor Details
This class inherits a constructor from ApimaticApi::BaseController
Instance Method Details
#download_generated_portal(id) ⇒ ApiResponse
Downloads the portal artifacts. The generated artifacts include:
- SDKs
- Docs
- API Specification files The endpoint returns a zip file that contains a static Site and can be hosted on any Web Server.
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/apimatic_api/controllers/docs_portal_generation_async_controller.rb', line 84 def download_generated_portal(id) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/portal/v2/{id}/download', Server::DEFAULT) .template_param(new_parameter(id, key: 'id') .is_required(true) .should_encode(true)) .auth(Single.new('Authorization'))) .response(new_response_handler .is_api_response(true) .local_error('400', 'Bad Request', ProblemDetailsException) .local_error('401', 'Unauthorized', UnauthorizedResponseException) .local_error('422', 'Unprocessable Entity - Contains error.zip for build issues', APIException) .local_error('500', 'Internal Server Error', InternalServerErrorResponseException)) .execute end |
#generate_on_prem_portal_via_build_input_async(content_type, file, x_api_matic_callback_url: nil) ⇒ ApiResponse
Create an async On-premise Documentation Portal Generation request by providing a Portal Build Input Portal Generator. Must contain the build file. header containing callback url. This url will be called by the server once the portal generation completes
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/apimatic_api/controllers/docs_portal_generation_async_controller.rb', line 18 def generate_on_prem_portal_via_build_input_async(content_type, file, x_api_matic_callback_url: nil) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/portal/v2', Server::DEFAULT) .multipart_param(new_parameter(file, key: 'file') .is_required(true) .default_content_type('application/octet-stream')) .header_param(new_parameter(x_api_matic_callback_url, key: 'X-APIMatic-CallbackUrl')) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('Authorization'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(PortalGenerationAsyncResponse.method(:from_hash)) .is_api_response(true) .local_error('400', 'Bad Request', ProblemDetailsException) .local_error('401', 'Unauthorized', UnauthorizedResponseException) .local_error('500', 'Internal Server Error', InternalServerErrorResponseException)) .execute end |
#get_portal_generation_status(id) ⇒ ApiResponse
Get the status of a portal generation request
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/apimatic_api/controllers/docs_portal_generation_async_controller.rb', line 50 def get_portal_generation_status(id) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/portal/v2/{id}/status', Server::DEFAULT) .template_param(new_parameter(id, key: 'id') .is_required(true) .should_encode(true)) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('Authorization'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(PortalGenerationStatusResponse.method(:from_hash)) .is_api_response(true) .local_error('400', 'Bad Request', ProblemDetailsException) .local_error('401', 'Unauthorized', UnauthorizedResponseException) .local_error('500', 'Internal Server Error', InternalServerErrorResponseException)) .execute end |