Skip to content

list_campaigns async

list_campaigns(
    *,
    config_overrides: Optional[AsyncIoTFleetWiseClientConfig] = None,
    next_token: Optional[nextToken] = None,
    max_results: Optional[maxResults] = None,
    status: Optional[statusStr] = None,
    list_response_scope: Optional[ListResponseScope] = None,
) -> ListCampaignsResponse

Lists information about created campaigns.

This API operation uses pagination. Specify the nextToken parameter in the request to return more results.

Parameters:

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

    A pagination token for the next set of results.

    If the results of a search are large, only a portion of the results are returned, and a nextToken pagination token is returned in the response. To retrieve the next set of results, reissue the search request and include the returned token. When all results have been returned, the response does not contain a pagination token value.

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

    The maximum number of items to return, between 1 and 100, inclusive.

  • status (Optional[statusStr], default: None ) –

    An optional parameter to filter the results by the status of each created campaign in your account. The status can be one of: CREATING, WAITING_FOR_APPROVAL, RUNNING, or SUSPENDED.

  • list_response_scope (Optional[ListResponseScope], default: None ) –

    When you set the listResponseScope parameter to METADATA_ONLY, the list response includes: campaign name, Amazon Resource Name (ARN), creation time, and last modification time.

Raises:

Source code in docs_src/capo_iotfleetwise/_services/async_io_t_fleet_wise.py
async def list_campaigns(
    self,
    *,
    config_overrides: Optional[AsyncIoTFleetWiseClientConfig] = None,
    next_token: Optional["capo_iotfleetwise.types.next_token.nextToken"] = None,
    max_results: Optional["capo_iotfleetwise.types.max_results.maxResults"] = None,
    status: Optional["capo_iotfleetwise.types.status_str.statusStr"] = None,
    list_response_scope: Optional[
        "capo_iotfleetwise.types.list_response_scope.ListResponseScope"
    ] = None,
) -> "capo_iotfleetwise.types.list_campaigns_response.ListCampaignsResponse":
    """<p> Lists information about created campaigns. </p> <note> <p>This API operation uses pagination. Specify the <code>nextToken</code> parameter in the request to return more results.</p> </note>

    Args:
        next_token: <p>A pagination token for the next set of results.</p> <p>If the results of a search are large, only a portion of the results are returned, and a <code>nextToken</code> pagination token is returned in the response. To retrieve the next set of results, reissue the search request and include the returned token. When all results have been returned, the response does not contain a pagination token value. </p>
        max_results: <p>The maximum number of items to return, between 1 and 100, inclusive.</p>
        status: <p>An optional parameter to filter the results by the status of each created campaign in your account. The status can be one of: <code>CREATING</code>, <code>WAITING_FOR_APPROVAL</code>, <code>RUNNING</code>, or <code>SUSPENDED</code>.</p>
        list_response_scope: <p>When you set the <code>listResponseScope</code> parameter to <code>METADATA_ONLY</code>, the list response includes: campaign name, Amazon Resource Name (ARN), creation time, and last modification time.</p>

    Raises:
        capo_iotfleetwise.errors.internal_server_exception.InternalServerException: <p>The request couldn't be completed because the server temporarily failed.</p>
        capo_iotfleetwise.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient permission to perform this action.</p>
        capo_iotfleetwise.errors.throttling_exception.ThrottlingException: <p>The request couldn't be completed due to throttling.</p>
        capo_iotfleetwise.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
        capo_iotfleetwise.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_iotfleetwise.types.list_campaigns_request.ListCampaignsRequest]",
    ) -> AsyncOperationResponse[
        "capo_iotfleetwise.types.list_campaigns_response.ListCampaignsResponse"
    ]:
        import capo_iotfleetwise._operations.io_t_autobahn_control_plane.list_campaigns

        (
            output,
            http_response,
        ) = await capo_iotfleetwise._operations.io_t_autobahn_control_plane.list_campaigns.async_list_campaigns(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListCampaigns")
    )
    input_: capo_iotfleetwise.types.list_campaigns_request.ListCampaignsRequest = {}
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results
    if status is not None:
        input_["status"] = status
    if list_response_scope is not None:
        input_["list_response_scope"] = list_response_scope

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