Skip to content

list_automated_discovery_accounts

list_automated_discovery_accounts(
    *,
    config_overrides: Optional[Macie2ClientConfig] = None,
    account_ids: Optional[__listOf__string] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[__string] = None,
) -> ListAutomatedDiscoveryAccountsResponse

Retrieves the status of automated sensitive data discovery for one or more accounts.

Parameters:

  • account_ids (Optional[__listOf__string], default: None ) –

    The Amazon Web Services account ID for each account, for as many as 50 accounts. To retrieve the status for multiple accounts, append the accountIds parameter and argument for each account, separated by an ampersand (&). To retrieve the status for all the accounts in an organization, omit this parameter.

  • max_results (Optional[MaxResults], default: None ) –

    The maximum number of items to include in each page of a paginated response.

  • next_token (Optional[__string], default: None ) –

    The nextToken string that specifies which page of results to return in a paginated response.

Raises:

  • AccessDeniedException –

    Provides information about an error that occurred due to insufficient access to a specified resource.

  • InternalServerException –

    Provides information about an error that occurred due to an unknown internal server error, exception, or failure.

  • ResourceNotFoundException –

    Provides information about an error that occurred because a specified resource wasn't found.

  • ThrottlingException –

    Provides information about an error that occurred because too many requests were sent during a certain amount of time.

  • ValidationException –

    Provides information about an error that occurred due to a syntax error in a request.

  • UnknownServiceError –

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

Source code in docs_src/capo_macie2/_services/macie2.py
def list_automated_discovery_accounts(
    self,
    *,
    config_overrides: Optional[Macie2ClientConfig] = None,
    account_ids: Optional[
        "capo_macie2.types.__list_of__string.__listOf__string"
    ] = None,
    max_results: Optional["capo_macie2.types.max_results.MaxResults"] = None,
    next_token: Optional["capo_macie2.types.__string.__string"] = None,
) -> "capo_macie2.types.list_automated_discovery_accounts_response.ListAutomatedDiscoveryAccountsResponse":
    """<p>Retrieves the status of automated sensitive data discovery for one or more accounts.</p>

    Args:
        account_ids: <p>The Amazon Web Services account ID for each account, for as many as 50 accounts. To retrieve the status for multiple accounts, append the accountIds parameter and argument for each account, separated by an ampersand (&amp;). To retrieve the status for all the accounts in an organization, omit this parameter.</p>
        max_results: <p>The maximum number of items to include in each page of a paginated response.</p>
        next_token: <p>The nextToken string that specifies which page of results to return in a paginated response.</p>

    Raises:
        capo_macie2.errors.access_denied_exception.AccessDeniedException: <p>Provides information about an error that occurred due to insufficient access to a specified resource.</p>
        capo_macie2.errors.internal_server_exception.InternalServerException: <p>Provides information about an error that occurred due to an unknown internal server error, exception, or failure.</p>
        capo_macie2.errors.resource_not_found_exception.ResourceNotFoundException: <p>Provides information about an error that occurred because a specified resource wasn't found.</p>
        capo_macie2.errors.throttling_exception.ThrottlingException: <p>Provides information about an error that occurred because too many requests were sent during a certain amount of time.</p>
        capo_macie2.errors.validation_exception.ValidationException: <p>Provides information about an error that occurred due to a syntax error in a request.</p>
        capo_macie2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_macie2.types.list_automated_discovery_accounts_request.ListAutomatedDiscoveryAccountsRequest]",
    ) -> OperationResponse[
        "capo_macie2.types.list_automated_discovery_accounts_response.ListAutomatedDiscoveryAccountsResponse"
    ]:
        import capo_macie2._operations.macie2.list_automated_discovery_accounts

        output, http_response = (
            capo_macie2._operations.macie2.list_automated_discovery_accounts.list_automated_discovery_accounts(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListAutomatedDiscoveryAccounts")
    )
    input_: capo_macie2.types.list_automated_discovery_accounts_request.ListAutomatedDiscoveryAccountsRequest = {}
    if account_ids is not None:
        input_["account_ids"] = account_ids
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output