Skip to content

create_view_version

create_view_version(
    instance_id: ViewsInstanceId,
    view_id: ViewId,
    *,
    config_overrides: Optional[ConnectClientConfig] = None,
    version_description: Optional[ViewDescription] = None,
    view_content_sha256: Optional[ViewContentSha256] = None,
) -> CreateViewVersionResponse

Publishes a new version of the view identifier.

Versions are immutable and monotonically increasing.

It returns the highest version if there is no change in content compared to that version. An error is displayed if the supplied ViewContentSha256 is different from the ViewContentSha256 of the $LATEST alias.

Parameters:

  • instance_id (ViewsInstanceId) –

    The identifier of the Connect Customer instance. You can find the instanceId in the ARN of the instance.

  • view_id (ViewId) –

    The identifier of the view. Both ViewArn and ViewId can be used.

  • version_description (Optional[ViewDescription], default: None ) –

    The description for the version being published.

  • view_content_sha256 (Optional[ViewContentSha256], default: None ) –

    Indicates the checksum value of the latest published view content.

Raises:

Source code in docs_src/capo_connect/_services/connect.py
def create_view_version(
    self,
    instance_id: "capo_connect.types.views_instance_id.ViewsInstanceId",
    view_id: "capo_connect.types.view_id.ViewId",
    *,
    config_overrides: Optional[ConnectClientConfig] = None,
    version_description: Optional[
        "capo_connect.types.view_description.ViewDescription"
    ] = None,
    view_content_sha256: Optional[
        "capo_connect.types.view_content_sha256.ViewContentSha256"
    ] = None,
) -> "capo_connect.types.create_view_version_response.CreateViewVersionResponse":
    """<p>Publishes a new version of the view identifier.</p> <p>Versions are immutable and monotonically increasing.</p> <p>It returns the highest version if there is no change in content compared to that version. An error is displayed if the supplied ViewContentSha256 is different from the ViewContentSha256 of the <code>$LATEST</code> alias.</p>

    Args:
        instance_id: <p>The identifier of the Connect Customer instance. You can find the instanceId in the ARN of the instance.</p>
        view_id: <p>The identifier of the view. Both <code>ViewArn</code> and <code>ViewId</code> can be used.</p>
        version_description: <p>The description for the version being published.</p>
        view_content_sha256: <p>Indicates the checksum value of the latest published view content.</p>

    Raises:
        capo_connect.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient permissions to perform this action.</p>
        capo_connect.errors.internal_service_exception.InternalServiceException: <p>Request processing failed because of an error or failure with the service.</p>
        capo_connect.errors.invalid_parameter_exception.InvalidParameterException: <p>One or more of the specified parameters are not valid.</p>
        capo_connect.errors.invalid_request_exception.InvalidRequestException: <p>The request is not valid.</p>
        capo_connect.errors.resource_in_use_exception.ResourceInUseException: <p>That resource is already in use (for example, you're trying to add a record with the same name as an existing record). If you are trying to delete a resource (for example, DeleteHoursOfOperation or DeletePredefinedAttribute), remove its reference from related resources and then try again.</p>
        capo_connect.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
        capo_connect.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The service quota has been exceeded.</p>
        capo_connect.errors.too_many_requests_exception.TooManyRequestsException: <p>Displayed when rate-related API limits are exceeded.</p>
        capo_connect.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_connect.types.create_view_version_request.CreateViewVersionRequest]",
    ) -> OperationResponse[
        "capo_connect.types.create_view_version_response.CreateViewVersionResponse"
    ]:
        import capo_connect._operations.amazon_connect_service.create_view_version

        output, http_response = (
            capo_connect._operations.amazon_connect_service.create_view_version.create_view_version(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_connect.types.create_view_version_response.CreateViewVersionResponse",
    ) -> dict[str, Any]:
        import capo_connect.types.create_view_version_response

        return capo_connect.types.create_view_version_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("CreateViewVersion", redact_output=_redact_output),
    )
    input_: capo_connect.types.create_view_version_request.CreateViewVersionRequest = {
        "instance_id": instance_id,
        "view_id": view_id,
    }
    if version_description is not None:
        input_["version_description"] = version_description
    if view_content_sha256 is not None:
        input_["view_content_sha256"] = view_content_sha256

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