Skip to content

update_test_case async

update_test_case(
    instance_id: InstanceIdOrArn,
    test_case_id: TestCaseId,
    *,
    config_overrides: Optional[AsyncConnectClientConfig] = None,
    content: Optional[TestCaseContent] = None,
    entry_point: Optional[TestCaseEntryPoint] = None,
    initialization_data: Optional[TestCaseInitializationData] = None,
    name: Optional[TestCaseName] = None,
    description: Optional[TestCaseDescription] = None,
    status: Optional[TestCaseStatus] = None,
    last_modified_time: Optional[Timestamp] = None,
    last_modified_region: Optional[RegionName] = None,
) -> UpdateTestCaseResponse

Updates any of the metadata for a test case, such as the name, description, and status or content of an existing test case. This API doesn't allow customers to update the tags of the test case resource for the specified Amazon Connect instance.

Parameters:

  • instance_id (InstanceIdOrArn) –

    The identifier of the Amazon Connect instance.

  • test_case_id (TestCaseId) –

    The identifier of the test case to update.

  • content (Optional[TestCaseContent], default: None ) –

    The JSON string that represents the content of the test.

  • entry_point (Optional[TestCaseEntryPoint], default: None ) –

    Defines the starting point for your test.

  • initialization_data (Optional[TestCaseInitializationData], default: None ) –

    Defines the test attributes for precise data representation.

  • name (Optional[TestCaseName], default: None ) –

    The name of the test case.

  • description (Optional[TestCaseDescription], default: None ) –

    The description of the test case.

  • status (Optional[TestCaseStatus], default: None ) –

    Indicates the test status as either SAVED or PUBLISHED. The PUBLISHED status will initiate validation on the content. The SAVED status does not initiate validation of the content.

  • last_modified_time (Optional[Timestamp], default: None ) –

    The time at which the resource was last modified.

  • last_modified_region (Optional[RegionName], default: None ) –

    The region in which the resource was last modified

Raises:

Source code in docs_src/capo_connect/_services/async_connect.py
async def update_test_case(
    self,
    instance_id: "capo_connect.types.instance_id_or_arn.InstanceIdOrArn",
    test_case_id: "capo_connect.types.test_case_id.TestCaseId",
    *,
    config_overrides: Optional[AsyncConnectClientConfig] = None,
    content: Optional[
        "capo_connect.types.test_case_content.TestCaseContent"
    ] = None,
    entry_point: Optional[
        "capo_connect.types.test_case_entry_point.TestCaseEntryPoint"
    ] = None,
    initialization_data: Optional[
        "capo_connect.types.test_case_initialization_data.TestCaseInitializationData"
    ] = None,
    name: Optional["capo_connect.types.test_case_name.TestCaseName"] = None,
    description: Optional[
        "capo_connect.types.test_case_description.TestCaseDescription"
    ] = None,
    status: Optional["capo_connect.types.test_case_status.TestCaseStatus"] = None,
    last_modified_time: Optional["capo_connect.types.timestamp.Timestamp"] = None,
    last_modified_region: Optional[
        "capo_connect.types.region_name.RegionName"
    ] = None,
) -> "capo_connect.types.update_test_case_response.UpdateTestCaseResponse":
    """<p>Updates any of the metadata for a test case, such as the name, description, and status or content of an existing test case. This API doesn't allow customers to update the tags of the test case resource for the specified Amazon Connect instance.</p>

    Args:
        instance_id: <p>The identifier of the Amazon Connect instance.</p>
        test_case_id: <p>The identifier of the test case to update.</p>
        content: <p>The JSON string that represents the content of the test.</p>
        entry_point: <p>Defines the starting point for your test.</p>
        initialization_data: <p>Defines the test attributes for precise data representation.</p>
        name: <p>The name of the test case.</p>
        description: <p>The description of the test case.</p>
        status: <p>Indicates the test status as either SAVED or PUBLISHED. The PUBLISHED status will initiate validation on the content. The SAVED status does not initiate validation of the content.</p>
        last_modified_time: <p>The time at which the resource was last modified.</p>
        last_modified_region: <p>The region in which the resource was last modified</p>

    Raises:
        capo_connect.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient permissions to perform this action.</p>
        capo_connect.errors.duplicate_resource_exception.DuplicateResourceException: <p>A resource with the specified name already exists.</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.invalid_test_case_exception.InvalidTestCaseException: <p>The test is not valid.</p>
        capo_connect.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
        capo_connect.errors.throttling_exception.ThrottlingException: <p>The throttling limit has been exceeded.</p>
        capo_connect.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_connect.types.update_test_case_request.UpdateTestCaseRequest]",
    ) -> AsyncOperationResponse[
        "capo_connect.types.update_test_case_response.UpdateTestCaseResponse"
    ]:
        import capo_connect._operations.amazon_connect_service.update_test_case

        (
            output,
            http_response,
        ) = await capo_connect._operations.amazon_connect_service.update_test_case.async_update_test_case(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateTestCase")
    )
    input_: capo_connect.types.update_test_case_request.UpdateTestCaseRequest = {
        "instance_id": instance_id,
        "test_case_id": test_case_id,
    }
    if content is not None:
        input_["content"] = content
    if entry_point is not None:
        input_["entry_point"] = entry_point
    if initialization_data is not None:
        input_["initialization_data"] = initialization_data
    if name is not None:
        input_["name"] = name
    if description is not None:
        input_["description"] = description
    if status is not None:
        input_["status"] = status
    if last_modified_time is not None:
        input_["last_modified_time"] = last_modified_time
    if last_modified_region is not None:
        input_["last_modified_region"] = last_modified_region

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