Skip to content

get_account_link async

get_account_link(
    *,
    config_overrides: Optional[AsyncWorkSpacesClientConfig] = None,
    link_id: Optional[LinkId] = None,
    linked_account_id: Optional[AwsAccount] = None,
) -> GetAccountLinkResult

Retrieves account link information.

Parameters:

  • link_id (Optional[LinkId], default: None ) –

    The identifier of the account to link.

  • linked_account_id (Optional[AwsAccount], default: None ) –

    The identifier of the account link

Raises:

Source code in docs_src/capo_workspaces/_services/async_work_spaces.py
async def get_account_link(
    self,
    *,
    config_overrides: Optional[AsyncWorkSpacesClientConfig] = None,
    link_id: Optional["capo_workspaces.types.link_id.LinkId"] = None,
    linked_account_id: Optional[
        "capo_workspaces.types.aws_account.AwsAccount"
    ] = None,
) -> "capo_workspaces.types.get_account_link_result.GetAccountLinkResult":
    """<p>Retrieves account link information.</p>

    Args:
        link_id: <p>The identifier of the account to link.</p>
        linked_account_id: <p>The identifier of the account link</p>

    Raises:
        capo_workspaces.errors.access_denied_exception.AccessDeniedException: <p>The user is not authorized to access a resource.</p>
        capo_workspaces.errors.internal_server_exception.InternalServerException: <p>Unexpected server error occured.</p>
        capo_workspaces.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource could not be found.</p>
        capo_workspaces.errors.validation_exception.ValidationException: <p>You either haven't provided a <code>TargetAccountId</code> or are using the same value for <code>TargetAccountId</code> and <code>SourceAccountId</code>.</p>
        capo_workspaces.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_workspaces.types.get_account_link_request.GetAccountLinkRequest]",
    ) -> AsyncOperationResponse[
        "capo_workspaces.types.get_account_link_result.GetAccountLinkResult"
    ]:
        import capo_workspaces._operations.workspaces_service.get_account_link

        (
            output,
            http_response,
        ) = await capo_workspaces._operations.workspaces_service.get_account_link.async_get_account_link(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetAccountLink")
    )
    input_: capo_workspaces.types.get_account_link_request.GetAccountLinkRequest = {}
    if link_id is not None:
        input_["link_id"] = link_id
    if linked_account_id is not None:
        input_["linked_account_id"] = linked_account_id

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