Skip to content

create_assistant_association async

create_assistant_association(
    assistant_id: UuidOrArn,
    association_type: AssociationType,
    association: AssistantAssociationInputData,
    *,
    config_overrides: Optional[AsyncWisdomClientConfig] = None,
    client_token: Optional[ClientToken] = None,
    tags: Optional[Tags] = None,
) -> CreateAssistantAssociationResponse

Creates an association between an Amazon Connect Wisdom assistant and another resource. Currently, the only supported association is with a knowledge base. An assistant can have only a single association.

Parameters:

  • assistant_id (UuidOrArn) –

    The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.

  • association_type (AssociationType) –

    The type of association.

  • association (AssistantAssociationInputData) –

    The identifier of the associated resource.

  • client_token (Optional[ClientToken], default: None ) –

    A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see Making retries safe with idempotent APIs.

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

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

Raises:

  • AccessDeniedException –

    You do not have sufficient access to perform this action.

  • ConflictException –

    The request could not be processed because of conflict in the current state of the resource. For example, if you're using a Create API (such as CreateAssistant) that accepts name, a conflicting resource (usually with the same name) is being created or mutated.

  • ResourceNotFoundException –

    The specified resource does not exist.

  • ServiceQuotaExceededException –

    You've exceeded your service quota. To perform the requested action, remove some of the relevant resources, or use service quotas to request a service quota increase.

  • ValidationException –

    The input fails to satisfy the constraints specified by a service.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_wisdom/_services/async_wisdom.py
async def create_assistant_association(
    self,
    assistant_id: "capo_wisdom.types.uuid_or_arn.UuidOrArn",
    association_type: "capo_wisdom.types.association_type.AssociationType",
    association: "capo_wisdom.types.assistant_association_input_data.AssistantAssociationInputData",
    *,
    config_overrides: Optional[AsyncWisdomClientConfig] = None,
    client_token: Optional["capo_wisdom.types.client_token.ClientToken"] = None,
    tags: Optional["capo_wisdom.types.tags.Tags"] = None,
) -> "capo_wisdom.types.create_assistant_association_response.CreateAssistantAssociationResponse":
    """<p>Creates an association between an Amazon Connect Wisdom assistant and another resource. Currently, the only supported association is with a knowledge base. An assistant can have only a single association.</p>

    Args:
        assistant_id: <p>The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
        association_type: <p>The type of association.</p>
        association: <p>The identifier of the associated resource.</p>
        client_token: <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see <a href="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
        tags: <p>The tags used to organize, track, or control access for this resource.</p>

    Raises:
        capo_wisdom.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_wisdom.errors.conflict_exception.ConflictException: <p>The request could not be processed because of conflict in the current state of the resource. For example, if you're using a <code>Create</code> API (such as <code>CreateAssistant</code>) that accepts name, a conflicting resource (usually with the same name) is being created or mutated.</p>
        capo_wisdom.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
        capo_wisdom.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>You've exceeded your service quota. To perform the requested action, remove some of the relevant resources, or use service quotas to request a service quota increase.</p>
        capo_wisdom.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by a service.</p>
        capo_wisdom.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_wisdom.types.create_assistant_association_request.CreateAssistantAssociationRequest]",
    ) -> AsyncOperationResponse[
        "capo_wisdom.types.create_assistant_association_response.CreateAssistantAssociationResponse"
    ]:
        import capo_wisdom._operations.wisdom_service.create_assistant_association

        (
            output,
            http_response,
        ) = await capo_wisdom._operations.wisdom_service.create_assistant_association.async_create_assistant_association(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateAssistantAssociation")
    )
    input_: capo_wisdom.types.create_assistant_association_request.CreateAssistantAssociationRequest = {
        "assistant_id": assistant_id,
        "association_type": association_type,
        "association": association,
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    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