Skip to content

import_documentation_parts async

import_documentation_parts(
    rest_api_id: String,
    body: Blob,
    *,
    config_overrides: Optional[AsyncAPIGatewayClientConfig] = None,
    mode: Optional[PutMode] = None,
    fail_on_warnings: Optional[Boolean] = None,
) -> DocumentationPartIds

Imports documentation parts

Parameters:

  • rest_api_id (String) –

    The string identifier of the associated RestApi.

  • mode (Optional[PutMode], default: None ) –

    A query parameter to indicate whether to overwrite (overwrite) any existing DocumentationParts definition or to merge (merge) the new definition into the existing one. The default value is merge.

  • fail_on_warnings (Optional[Boolean], default: None ) –

    A query parameter to specify whether to rollback the documentation importation (true) or not (false) when a warning is encountered. The default value is false.

  • body (Blob) –

    Raw byte array representing the to-be-imported documentation parts. To import from an OpenAPI file, this is a JSON object.

Raises:

  • BadRequestException –

    The submitted request is not valid, for example, the input is incomplete or incorrect. See the accompanying error message for details.

  • ConflictException –

    The request configuration has conflicts. For details, see the accompanying error message.

  • LimitExceededException –

    The request exceeded the rate limit. Retry after the specified time period.

  • NotFoundException –

    The requested resource is not found. Make sure that the request URI is correct.

  • TooManyRequestsException –

    The request has reached its throttling limit. Retry after the specified time period.

  • UnauthorizedException –

    The request is denied because the caller has insufficient permissions.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_api_gateway/_services/async_api_gateway.py
async def import_documentation_parts(
    self,
    rest_api_id: "capo_api_gateway.types.string.String",
    body: "capo_api_gateway.types.blob.Blob",
    *,
    config_overrides: Optional[AsyncAPIGatewayClientConfig] = None,
    mode: Optional["capo_api_gateway.types.put_mode.PutMode"] = None,
    fail_on_warnings: Optional["capo_api_gateway.types.boolean.Boolean"] = None,
) -> "capo_api_gateway.types.documentation_part_ids.DocumentationPartIds":
    """<p>Imports documentation parts</p>

    Args:
        rest_api_id: <p>The string identifier of the associated RestApi.</p>
        mode: <p>A query parameter to indicate whether to overwrite (<code>overwrite</code>) any existing DocumentationParts definition or to merge (<code>merge</code>) the new definition into the existing one. The default value is <code>merge</code>.</p>
        fail_on_warnings: <p>A query parameter to specify whether to rollback the documentation importation (<code>true</code>) or not (<code>false</code>) when a warning is encountered. The default value is <code>false</code>.</p>
        body: <p>Raw byte array representing the to-be-imported documentation parts. To import from an OpenAPI file, this is a JSON object.</p>

    Raises:
        capo_api_gateway.errors.bad_request_exception.BadRequestException: <p>The submitted request is not valid, for example, the input is incomplete or incorrect. See the accompanying error message for details.</p>
        capo_api_gateway.errors.conflict_exception.ConflictException: <p>The request configuration has conflicts. For details, see the accompanying error message.</p>
        capo_api_gateway.errors.limit_exceeded_exception.LimitExceededException: <p>The request exceeded the rate limit. Retry after the specified time period.</p>
        capo_api_gateway.errors.not_found_exception.NotFoundException: <p>The requested resource is not found. Make sure that the request URI is correct.</p>
        capo_api_gateway.errors.too_many_requests_exception.TooManyRequestsException: <p>The request has reached its throttling limit. Retry after the specified time period.</p>
        capo_api_gateway.errors.unauthorized_exception.UnauthorizedException: <p>The request is denied because the caller has insufficient permissions.</p>
        capo_api_gateway.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_api_gateway.types.import_documentation_parts_request.ImportDocumentationPartsRequest]",
    ) -> AsyncOperationResponse[
        "capo_api_gateway.types.documentation_part_ids.DocumentationPartIds"
    ]:
        import capo_api_gateway._operations.backplane_control_service.import_documentation_parts

        (
            output,
            http_response,
        ) = await capo_api_gateway._operations.backplane_control_service.import_documentation_parts.async_import_documentation_parts(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ImportDocumentationParts")
    )
    input_: capo_api_gateway.types.import_documentation_parts_request.ImportDocumentationPartsRequest = {
        "rest_api_id": rest_api_id,
        "body": body,
    }
    if mode is not None:
        input_["mode"] = mode
    if fail_on_warnings is not None:
        input_["fail_on_warnings"] = fail_on_warnings

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output