Skip to content

update_product_page

update_product_page(
    product_id: ProductId,
    product_page_id: ProductPageId,
    *,
    config_overrides: Optional[APIPortalClientConfig] = None,
    display_content: Optional[DisplayContent] = None,
) -> UpdateProductPageResponse

Updates a product page.

Parameters:

  • product_id (ProductId) –

    The identifier of the product.

  • product_page_id (ProductPageId) –

    The identifier of the product page.

  • display_content (Optional[DisplayContent], default: None ) –

    The new title and body of the page. Omit it to keep the current content.

Raises:

Source code in docs_src/capo_apiportal/_services/api_portal.py
def update_product_page(
    self,
    product_id: "capo_apiportal.types.product_id.ProductId",
    product_page_id: "capo_apiportal.types.product_page_id.ProductPageId",
    *,
    config_overrides: Optional[APIPortalClientConfig] = None,
    display_content: Optional[
        "capo_apiportal.types.display_content.DisplayContent"
    ] = None,
) -> "capo_apiportal.types.update_product_page_response.UpdateProductPageResponse":
    """Updates a product page.

    Args:
        product_id: The identifier of the product.
        product_page_id: The identifier of the product page.
        display_content: The new title and body of the page. Omit it to keep the current content.

    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.
    """

    def _handler(
        req: "OperationRequest[capo_apiportal.types.update_product_page_request.UpdateProductPageRequest]",
    ) -> OperationResponse[
        "capo_apiportal.types.update_product_page_response.UpdateProductPageResponse"
    ]:
        import capo_apiportal._operations.api_portal_control_service.update_product_page

        output, http_response = (
            capo_apiportal._operations.api_portal_control_service.update_product_page.update_product_page(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateProductPage")
    )
    input_: capo_apiportal.types.update_product_page_request.UpdateProductPageRequest = {
        "product_id": product_id,
        "product_page_id": product_page_id,
    }
    if display_content is not None:
        input_["display_content"] = display_content

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output