Skip to content

create_portal async

create_portal(
    portal_content: PortalContent,
    endpoint_configuration: EndpointConfigurationRequest,
    authorization: Authorization,
    *,
    config_overrides: Optional[AsyncAPIPortalClientConfig] = None,
    included_product_arns: Optional[IncludedProductArns] = None,
    logo_uri: Optional[LogoUri] = None,
    rum_app_monitor_name: Optional[RUMAppMonitorName] = None,
    tags: Optional[Tags] = None,
) -> CreatePortalResponse

Creates a portal that publishes documentation for the products it includes. Use UpdatePortalPublishStatus to publish it.

Parameters:

  • portal_content (PortalContent) –

    The portal's display name, description, and theme.

  • authorization (Authorization) –

    How readers sign in to the portal, and whether fine-grained access control is on.

  • included_product_arns (Optional[IncludedProductArns], default: None ) –

    The ARNs of the products the portal includes, up to 200.

  • logo_uri (Optional[LogoUri], default: None ) –

    The S3 location of the portal logo, in the form s3://bucket/key.

  • rum_app_monitor_name (Optional[RUMAppMonitorName], default: None ) –

    The name of the CloudWatch RUM app monitor that collects reader telemetry for the portal.

Raises:

  • AccessDeniedException –

    You do not have permission to perform this operation.

  • BadRequestException –

    The request is not valid. The message identifies the field or value that failed validation.

  • LimitExceededException –

    The request rate or a service quota was exceeded. Reduce the request rate or the number of resources and try again.

  • UnknownServiceError –

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

Source code in docs_src/capo_apiportal/_services/async_api_portal.py
async def create_portal(
    self,
    portal_content: "capo_apiportal.types.portal_content.PortalContent",
    endpoint_configuration: "capo_apiportal.types.endpoint_configuration_request.EndpointConfigurationRequest",
    authorization: "capo_apiportal.types.authorization.Authorization",
    *,
    config_overrides: Optional[AsyncAPIPortalClientConfig] = None,
    included_product_arns: Optional[
        "capo_apiportal.types.included_product_arns.IncludedProductArns"
    ] = None,
    logo_uri: Optional["capo_apiportal.types.logo_uri.LogoUri"] = None,
    rum_app_monitor_name: Optional[
        "capo_apiportal.types.rum_app_monitor_name.RUMAppMonitorName"
    ] = None,
    tags: Optional["capo_apiportal.types.tags.Tags"] = None,
) -> "capo_apiportal.types.create_portal_response.CreatePortalResponse":
    """Creates a portal that publishes documentation for the products it includes. Use UpdatePortalPublishStatus to publish it.

    Args:
        portal_content: The portal's display name, description, and theme.
        authorization: How readers sign in to the portal, and whether fine-grained access control is on.
        included_product_arns: The ARNs of the products the portal includes, up to 200.
        logo_uri: The S3 location of the portal logo, in the form `s3://bucket/key`.
        rum_app_monitor_name: The name of the CloudWatch RUM app monitor that collects reader telemetry for the portal.

    Raises:
        capo_apiportal.errors.access_denied_exception.AccessDeniedException: You do not have permission to perform this operation.
        capo_apiportal.errors.bad_request_exception.BadRequestException: The request is not valid. The message identifies the field or value that failed validation.
        capo_apiportal.errors.limit_exceeded_exception.LimitExceededException: The request rate or a service quota was exceeded. Reduce the request rate or the number of resources and try again.
        capo_apiportal.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_apiportal.types.create_portal_request.CreatePortalRequest]",
    ) -> AsyncOperationResponse[
        "capo_apiportal.types.create_portal_response.CreatePortalResponse"
    ]:
        import capo_apiportal._operations.api_portal_control_service.create_portal

        (
            output,
            http_response,
        ) = await capo_apiportal._operations.api_portal_control_service.create_portal.async_create_portal(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreatePortal")
    )
    input_: capo_apiportal.types.create_portal_request.CreatePortalRequest = {
        "portal_content": portal_content,
        "endpoint_configuration": endpoint_configuration,
        "authorization": authorization,
    }
    if included_product_arns is not None:
        input_["included_product_arns"] = included_product_arns
    if logo_uri is not None:
        input_["logo_uri"] = logo_uri
    if rum_app_monitor_name is not None:
        input_["rum_app_monitor_name"] = rum_app_monitor_name
    if tags is not None:
        input_["tags"] = tags

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