Class: ApimaticApi::DocsPortalManagementController

Inherits:
BaseController show all
Defined in:
lib/apimatic_api/controllers/docs_portal_management_controller.rb

Overview

DocsPortalManagementController

Constant Summary

Constants inherited from BaseController

BaseController::GLOBAL_ERRORS

Instance Attribute Summary

Attributes inherited from BaseController

#config, #http_call_back

Instance Method Summary collapse

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

#generate_on_prem_portal_via_build_input(content_type, file, _query_parameters: nil) ⇒ ApiResponse

Generate an On-premise Documentation Portal by uploading a Portal Build Input. This endpoint generates all artifacts for the Portal and packages them together into a zip file along with the required HTML, CSS and JS files. The generated artifacts include:

  1. SDKs
  2. Docs
  3. API Specification files The endpoint returns a zip file that contains a static Site and can be hosted on any Web Server. Portal Generator. Must contain the build file. supported by this endpoint.

Parameters:

  • content_type (ContentType)

    Required parameter: Example:

  • file (File | UploadIO)

    Required parameter: The input file to the

  • _query_parameters (Hash) (defaults to: nil)

    Additional optional query parameters are

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/apimatic_api/controllers/docs_portal_management_controller.rb', line 24

def generate_on_prem_portal_via_build_input(content_type,
                                            file,
                                            _query_parameters: nil)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/portal',
                                 Server::DEFAULT)
               .multipart_param(new_parameter(file, key: 'file')
                                 .is_required(true)
                                 .default_content_type('application/octet-stream'))
               .additional_query_params(_query_parameters)
               .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('403',
                             'Subscription Issue',
                             ProblemDetailsException)
                .local_error('422',
                             'Unprocessable Entity - Contains error.zip for build issues',
                             APIException)
                .local_error('500',
                             'Internal Server Error',
                             InternalServerErrorResponseException))
    .execute
end