This is a paginated call to list linked accounts that are linked to the payer account for the specified time period. If no information is provided, the current billing period is used. The response will optionally include the billing group that's associated with the linked account.
Parameters:
-
billing_period
(Optional[BillingPeriod], default:
None
)
–
The preferred billing period to get account associations.
-
filters
(Optional[ListAccountAssociationsFilter], default:
None
)
–
The filter on the account ID of the linked account, or any of the following:
MONITORED: linked accounts that are associated to billing groups.
UNMONITORED: linked accounts that aren't associated to billing groups.
Billing Group Arn: linked accounts that are associated to the provided billing group Arn.
-
next_token
(Optional[Token], default:
None
)
–
The pagination token that's used on subsequent calls to retrieve accounts.
Raises:
Source code in docs_src/capo_billingconductor/_services/billingconductor.py
| def list_account_associations(
self,
*,
config_overrides: Optional[billingconductorClientConfig] = None,
billing_period: Optional[
"capo_billingconductor.types.billing_period.BillingPeriod"
] = None,
filters: Optional[
"capo_billingconductor.types.list_account_associations_filter.ListAccountAssociationsFilter"
] = None,
next_token: Optional["capo_billingconductor.types.token.Token"] = None,
) -> "capo_billingconductor.types.list_account_associations_output.ListAccountAssociationsOutput":
"""<p> This is a paginated call to list linked accounts that are linked to the payer account for the specified time period. If no information is provided, the current billing period is used. The response will optionally include the billing group that's associated with the linked account.</p>
Args:
billing_period: <p> The preferred billing period to get account associations. </p>
filters: <p>The filter on the account ID of the linked account, or any of the following:</p> <p> <code>MONITORED</code>: linked accounts that are associated to billing groups.</p> <p> <code>UNMONITORED</code>: linked accounts that aren't associated to billing groups.</p> <p> <code>Billing Group Arn</code>: linked accounts that are associated to the provided billing group Arn. </p>
next_token: <p> The pagination token that's used on subsequent calls to retrieve accounts. </p>
Raises:
capo_billingconductor.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action. </p>
capo_billingconductor.errors.internal_server_exception.InternalServerException: <p>An unexpected error occurred while processing a request. </p>
capo_billingconductor.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request references a resource that doesn't exist. </p>
capo_billingconductor.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling. </p>
capo_billingconductor.errors.validation_exception.ValidationException: <p>The input doesn't match with the constraints specified by Amazon Web Services services.</p>
capo_billingconductor.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_billingconductor.types.list_account_associations_input.ListAccountAssociationsInput]",
) -> OperationResponse[
"capo_billingconductor.types.list_account_associations_output.ListAccountAssociationsOutput"
]:
import capo_billingconductor._operations.aws_billing_conductor.list_account_associations
output, http_response = (
capo_billingconductor._operations.aws_billing_conductor.list_account_associations.list_account_associations(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
def _redact_output(
output: "capo_billingconductor.types.list_account_associations_output.ListAccountAssociationsOutput",
) -> dict[str, Any]:
import capo_billingconductor.types.list_account_associations_output
return capo_billingconductor.types.list_account_associations_output.redact_sensitive(
output
)
interceptors_, options_ = self.operation_options(
config_overrides,
OperationLogging("ListAccountAssociations", redact_output=_redact_output),
)
input_: capo_billingconductor.types.list_account_associations_input.ListAccountAssociationsInput = {}
if billing_period is not None:
input_["billing_period"] = billing_period
if filters is not None:
input_["filters"] = filters
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
|