async def create_product_page(
self,
product_id: "capo_apiportal.types.product_id.ProductId",
display_content: "capo_apiportal.types.display_content.DisplayContent",
*,
config_overrides: Optional[AsyncAPIPortalClientConfig] = None,
tags: Optional["capo_apiportal.types.tags.Tags"] = None,
) -> "capo_apiportal.types.create_product_page_response.CreateProductPageResponse":
"""Creates a product page with free-form documentation. A product can have up to 40 pages.
Args:
product_id: The identifier of the product.
display_content: The title and body of the page.
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.resource_not_found_exception.ResourceNotFoundException: The requested resource does not exist, or you do not have access to it.
capo_apiportal.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_apiportal.types.create_product_page_request.CreateProductPageRequest]",
) -> AsyncOperationResponse[
"capo_apiportal.types.create_product_page_response.CreateProductPageResponse"
]:
import capo_apiportal._operations.api_portal_control_service.create_product_page
(
output,
http_response,
) = await capo_apiportal._operations.api_portal_control_service.create_product_page.async_create_product_page(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("CreateProductPage")
)
input_: capo_apiportal.types.create_product_page_request.CreateProductPageRequest = {
"product_id": product_id,
"display_content": display_content,
}
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