Disassociates agentic contexts from the specified WorkSpace. The operation ignores contexts that aren't associated with the WorkSpace. If the WorkSpace is in a state that doesn't allow the change, the operation returns ConflictException.
Parameters:
Raises:
-
AccessDeniedException
–
The user is not authorized to access a resource.
-
ConflictException
–
The request conflicts with the current state of a resource, for example because a name is already in use or the resource is still in use. Resolve the conflict, and then retry your request.
-
ResourceNotFoundException
–
The resource could not be found.
-
ThrottlingException
–
The request was throttled. Retry the request with exponential backoff.
-
ValidationException
–
Your request failed validation. Check the error message for the parameter that isn't valid.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Examples:
Example – Removing a context from a WorkSpace
The following example removes a context from an agentic WorkSpace.
>>> await client.disassociate_workspace_agentic_contexts(workspace_id='ws-dk1example1', agentic_context_ids=['wsactx-e5f6g7h8'])
Source code in docs_src/capo_workspaces/_services/async_work_spaces.py
| async def disassociate_workspace_agentic_contexts(
self,
workspace_id: "capo_workspaces.types.workspace_id.WorkspaceId",
agentic_context_ids: "capo_workspaces.types.workspace_agentic_context_id_list.WorkspaceAgenticContextIdList",
*,
config_overrides: Optional[AsyncWorkSpacesClientConfig] = None,
) -> "capo_workspaces.types.disassociate_workspace_agentic_contexts_result.DisassociateWorkspaceAgenticContextsResult":
"""<p>Disassociates agentic contexts from the specified WorkSpace. The operation ignores contexts that aren't associated with the WorkSpace. If the WorkSpace is in a state that doesn't allow the change, the operation returns <code>ConflictException</code>.</p>
Args:
workspace_id: <p>The identifier of the WorkSpace.</p>
agentic_context_ids: <p>The identifiers of the contexts to disassociate.</p>
Raises:
capo_workspaces.errors.access_denied_exception.AccessDeniedException: <p>The user is not authorized to access a resource.</p>
capo_workspaces.errors.conflict_exception.ConflictException: <p>The request conflicts with the current state of a resource, for example because a name is already in use or the resource is still in use. Resolve the conflict, and then retry your request.</p>
capo_workspaces.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource could not be found.</p>
capo_workspaces.errors.throttling_exception.ThrottlingException: <p>The request was throttled. Retry the request with exponential backoff.</p>
capo_workspaces.errors.validation_exception.ValidationException: <p>Your request failed validation. Check the error message for the parameter that isn't valid.</p>
capo_workspaces.errors.UnknownServiceError: The service returned an error code this client does not model.
Examples:
Example – Removing a context from a WorkSpace
The following example removes a context from an agentic WorkSpace.
>>> await client.disassociate_workspace_agentic_contexts(workspace_id='ws-dk1example1', agentic_context_ids=['wsactx-e5f6g7h8'])
"""
async def _handler(
req: "AsyncOperationRequest[capo_workspaces.types.disassociate_workspace_agentic_contexts_request.DisassociateWorkspaceAgenticContextsRequest]",
) -> AsyncOperationResponse[
"capo_workspaces.types.disassociate_workspace_agentic_contexts_result.DisassociateWorkspaceAgenticContextsResult"
]:
if req.options.protocol == "awsJson1_1":
import capo_workspaces._operations.workspaces_service.aws_json1_1.disassociate_workspace_agentic_contexts
(
output,
http_response,
) = await capo_workspaces._operations.workspaces_service.aws_json1_1.disassociate_workspace_agentic_contexts.async_disassociate_workspace_agentic_contexts(
req.options, req.input
)
elif req.options.protocol == "rpcv2Cbor":
import capo_workspaces._operations.workspaces_service.rpcv2_cbor.disassociate_workspace_agentic_contexts
(
output,
http_response,
) = await capo_workspaces._operations.workspaces_service.rpcv2_cbor.disassociate_workspace_agentic_contexts.async_disassociate_workspace_agentic_contexts(
req.options, req.input
)
else:
raise ValueError(f"unknown protocol {req.options.protocol!r}")
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DisassociateWorkspaceAgenticContexts")
)
input_: capo_workspaces.types.disassociate_workspace_agentic_contexts_request.DisassociateWorkspaceAgenticContextsRequest = {
"workspace_id": workspace_id,
"agentic_context_ids": agentic_context_ids,
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|