Skip to content

list_free_trial_statuses_v2

list_free_trial_statuses_v2(
    *,
    config_overrides: Optional[SecurityHubClientConfig] = None,
    account_ids: Optional[FreeTrialAccountIdList] = None,
    statuses: Optional[FreeTrialStatusValueList] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> ListFreeTrialStatusesV2Response

Lists the free trial status of Security Hub features. A delegated Security Hub administrator can list the status for accounts in its organization. Any other account can list the status only for itself. Free trial status remains available after a feature is disabled.

Parameters:

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

    The Amazon Web Services account identifiers to list free trial status for. You can specify accounts other than your own only if you are a delegated Security Hub administrator.

  • statuses (Optional[FreeTrialStatusValueList], default: None ) –

    The free trial statuses to filter the results by. Valid values:

    • ACTIVE returns only features with an ongoing free trial period.

    • INACTIVE returns only features whose free trial period has ended, or that never started.

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

    The maximum number of results to return. If you don't specify a value, Security Hub returns up to 100 results.

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

    The pagination token to request the next page of results.

Raises:

Source code in docs_src/capo_securityhub/_services/security_hub.py
def list_free_trial_statuses_v2(
    self,
    *,
    config_overrides: Optional[SecurityHubClientConfig] = None,
    account_ids: Optional[
        "capo_securityhub.types.free_trial_account_id_list.FreeTrialAccountIdList"
    ] = None,
    statuses: Optional[
        "capo_securityhub.types.free_trial_status_value_list.FreeTrialStatusValueList"
    ] = None,
    max_results: Optional["capo_securityhub.types.max_results.MaxResults"] = None,
    next_token: Optional["capo_securityhub.types.next_token.NextToken"] = None,
) -> "capo_securityhub.types.list_free_trial_statuses_v2_response.ListFreeTrialStatusesV2Response":
    """<p>Lists the free trial status of Security Hub features. A delegated Security Hub administrator can list the status for accounts in its organization. Any other account can list the status only for itself. Free trial status remains available after a feature is disabled.</p>

    Args:
        account_ids: <p>The Amazon Web Services account identifiers to list free trial status for. You can specify accounts other than your own only if you are a delegated Security Hub administrator.</p>
        statuses: <p>The free trial statuses to filter the results by. Valid values:</p> <ul> <li> <p> <code>ACTIVE</code> returns only features with an ongoing free trial period.</p> </li> <li> <p> <code>INACTIVE</code> returns only features whose free trial period has ended, or that never started.</p> </li> </ul>
        max_results: <p>The maximum number of results to return. If you don't specify a value, Security Hub returns up to 100 results.</p>
        next_token: <p>The pagination token to request the next page of results.</p>

    Raises:
        capo_securityhub.errors.access_denied_exception.AccessDeniedException: <p>You don't have permission to perform the action specified in the request.</p>
        capo_securityhub.errors.internal_server_exception.InternalServerException: <p> The request has failed due to an internal failure of the service. </p>
        capo_securityhub.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request was rejected because we can't find the specified resource.</p>
        capo_securityhub.errors.throttling_exception.ThrottlingException: <p> The limit on the number of requests per second was exceeded. </p>
        capo_securityhub.errors.validation_exception.ValidationException: <p>The request has failed validation because it's missing required fields or has invalid inputs.</p>
        capo_securityhub.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_securityhub.types.list_free_trial_statuses_v2_request.ListFreeTrialStatusesV2Request]",
    ) -> OperationResponse[
        "capo_securityhub.types.list_free_trial_statuses_v2_response.ListFreeTrialStatusesV2Response"
    ]:
        import capo_securityhub._operations.security_hub_api_service.list_free_trial_statuses_v2

        output, http_response = (
            capo_securityhub._operations.security_hub_api_service.list_free_trial_statuses_v2.list_free_trial_statuses_v2(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListFreeTrialStatusesV2")
    )
    input_: capo_securityhub.types.list_free_trial_statuses_v2_request.ListFreeTrialStatusesV2Request = {}
    if account_ids is not None:
        input_["account_ids"] = account_ids
    if statuses is not None:
        input_["statuses"] = statuses
    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