Skip to content

list_licenses async

list_licenses(
    *,
    config_overrides: Optional[AsyncLicenseManagerClientConfig] = None,
    license_arns: Optional[ArnList] = None,
    filters: Optional[FilterList] = None,
    next_token: Optional[String] = None,
    max_results: Optional[MaxSize100] = None,
) -> ListLicensesResponse

Lists the licenses for your account.

Parameters:

  • license_arns (Optional[ArnList], default: None ) –

    Amazon Resource Names (ARNs) of the licenses.

  • filters (Optional[FilterList], default: None ) –

    Filters to scope the results. The following filters are supported:

    • Beneficiary

    • ProductSKU

    • Fingerprint

    • Status

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

    Token for the next set of results.

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

    Maximum number of results to return in a single call.

Raises:

Source code in docs_src/capo_license_manager/_services/async_license_manager.py
async def list_licenses(
    self,
    *,
    config_overrides: Optional[AsyncLicenseManagerClientConfig] = None,
    license_arns: Optional["capo_license_manager.types.arn_list.ArnList"] = None,
    filters: Optional["capo_license_manager.types.filter_list.FilterList"] = None,
    next_token: Optional["capo_license_manager.types.string.String"] = None,
    max_results: Optional[
        "capo_license_manager.types.max_size100.MaxSize100"
    ] = None,
) -> "capo_license_manager.types.list_licenses_response.ListLicensesResponse":
    """<p>Lists the licenses for your account.</p>

    Args:
        license_arns: <p>Amazon Resource Names (ARNs) of the licenses.</p>
        filters: <p>Filters to scope the results. The following filters are supported:</p> <ul> <li> <p> <code>Beneficiary</code> </p> </li> <li> <p> <code>ProductSKU</code> </p> </li> <li> <p> <code>Fingerprint</code> </p> </li> <li> <p> <code>Status</code> </p> </li> </ul>
        next_token: <p>Token for the next set of results.</p>
        max_results: <p>Maximum number of results to return in a single call.</p>

    Raises:
        capo_license_manager.errors.access_denied_exception.AccessDeniedException: <p>Access to resource denied.</p>
        capo_license_manager.errors.authorization_exception.AuthorizationException: <p>The Amazon Web Services user account does not have permission to perform the action. Check the IAM policy associated with this account.</p>
        capo_license_manager.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>One or more parameter values are not valid.</p>
        capo_license_manager.errors.rate_limit_exceeded_exception.RateLimitExceededException: <p>Too many requests have been submitted. Try again after a brief wait.</p>
        capo_license_manager.errors.server_internal_exception.ServerInternalException: <p>The server experienced an internal error. Try again.</p>
        capo_license_manager.errors.validation_exception.ValidationException: <p>The provided input is not valid. Try your request again.</p>
        capo_license_manager.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_license_manager.types.list_licenses_request.ListLicensesRequest]",
    ) -> AsyncOperationResponse[
        "capo_license_manager.types.list_licenses_response.ListLicensesResponse"
    ]:
        import capo_license_manager._operations.aws_license_manager.list_licenses

        (
            output,
            http_response,
        ) = await capo_license_manager._operations.aws_license_manager.list_licenses.async_list_licenses(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListLicenses")
    )
    input_: capo_license_manager.types.list_licenses_request.ListLicensesRequest = {}
    if license_arns is not None:
        input_["license_arns"] = license_arns
    if filters is not None:
        input_["filters"] = filters
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

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