Skip to content

create_test_case

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

Creates a test case with its content and metadata for the specified Amazon Connect instance.

Parameters:

  • instance_id (InstanceIdOrArn) –

    The identifier of the Amazon Connect instance.

  • name (TestCaseName) –

    The name of the test.

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

    The description of the test.

  • content (TestCaseContent) –

    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 initial custom attributes for your test.

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

  • test_case_id (Optional[TestCaseId], default: None ) –

    Id of the test case if you want to create it in a replica region using Amazon Connect Global Resiliency

  • tags (Optional[TagMap], default: None ) –

    The tags used to organize, track, or control access for this resource.

  • 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/connect.py
def create_test_case(
    self,
    instance_id: "capo_connect.types.instance_id_or_arn.InstanceIdOrArn",
    name: "capo_connect.types.test_case_name.TestCaseName",
    content: "capo_connect.types.test_case_content.TestCaseContent",
    *,
    config_overrides: Optional[ConnectClientConfig] = None,
    description: Optional[
        "capo_connect.types.test_case_description.TestCaseDescription"
    ] = 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,
    status: Optional["capo_connect.types.test_case_status.TestCaseStatus"] = None,
    test_case_id: Optional["capo_connect.types.test_case_id.TestCaseId"] = None,
    tags: Optional["capo_connect.types.tag_map.TagMap"] = 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.create_test_case_response.CreateTestCaseResponse":
    """<p>Creates a test case with its content and metadata for the specified Amazon Connect instance.</p>

    Args:
        instance_id: <p>The identifier of the Amazon Connect instance.</p>
        name: <p>The name of the test.</p>
        description: <p>The description of the test.</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 initial custom attributes for your test.</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>
        test_case_id: <p>Id of the test case if you want to create it in a replica region using Amazon Connect Global Resiliency</p>
        tags: <p>The tags used to organize, track, or control access for this resource.</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.idempotency_exception.IdempotencyException: <p>An entity with the same 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.limit_exceeded_exception.LimitExceededException: <p>The allowed limit for the resource has been exceeded.</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.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.
    """

    def _handler(
        req: "OperationRequest[capo_connect.types.create_test_case_request.CreateTestCaseRequest]",
    ) -> OperationResponse[
        "capo_connect.types.create_test_case_response.CreateTestCaseResponse"
    ]:
        import capo_connect._operations.amazon_connect_service.create_test_case

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateTestCase")
    )
    input_: capo_connect.types.create_test_case_request.CreateTestCaseRequest = {
        "instance_id": instance_id,
        "name": name,
        "content": content,
    }
    if description is not None:
        input_["description"] = description
    if entry_point is not None:
        input_["entry_point"] = entry_point
    if initialization_data is not None:
        input_["initialization_data"] = initialization_data
    if status is not None:
        input_["status"] = status
    if test_case_id is not None:
        input_["test_case_id"] = test_case_id
    if tags is not None:
        input_["tags"] = tags
    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 = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output