Skip to content

list_geofences async

list_geofences(
    collection_name: ResourceName,
    *,
    config_overrides: Optional[AsyncLocationClientConfig] = None,
    next_token: Optional[LargeToken] = None,
    max_results: Optional[int] = None,
) -> ListGeofencesResponse

Lists geofences stored in a given geofence collection.

Parameters:

  • collection_name (ResourceName) –

    The name of the geofence collection storing the list of geofences.

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

    The pagination token specifying which page of results to return in the response. If no token is provided, the default page is the first page.

    Default value: null

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

    An optional limit for the number of geofences returned in a single call.

    Default value: 100

Raises:

  • AccessDeniedException –

    The request was denied because of insufficient access or permissions. Check with an administrator to verify your permissions.

  • InternalServerException –

    The request has failed to process because of an unknown server error, exception, or failure.

  • ResourceNotFoundException –

    The resource that you've entered was not found in your AWS account.

  • ThrottlingException –

    The request was denied because of request throttling.

  • ValidationException –

    The input failed to meet the constraints specified by the AWS service.

  • UnknownServiceError –

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

Source code in docs_src/capo_location/_services/async_location.py
async def list_geofences(
    self,
    collection_name: "capo_location.types.resource_name.ResourceName",
    *,
    config_overrides: Optional[AsyncLocationClientConfig] = None,
    next_token: Optional["capo_location.types.large_token.LargeToken"] = None,
    max_results: Optional[int] = None,
) -> "capo_location.types.list_geofences_response.ListGeofencesResponse":
    """<p>Lists geofences stored in a given geofence collection.</p>

    Args:
        collection_name: <p>The name of the geofence collection storing the list of geofences.</p>
        next_token: <p>The pagination token specifying which page of results to return in the response. If no token is provided, the default page is the first page. </p> <p>Default value: <code>null</code> </p>
        max_results: <p>An optional limit for the number of geofences returned in a single call. </p> <p>Default value: <code>100</code> </p>

    Raises:
        capo_location.errors.access_denied_exception.AccessDeniedException: <p>The request was denied because of insufficient access or permissions. Check with an administrator to verify your permissions.</p>
        capo_location.errors.internal_server_exception.InternalServerException: <p>The request has failed to process because of an unknown server error, exception, or failure.</p>
        capo_location.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource that you've entered was not found in your AWS account.</p>
        capo_location.errors.throttling_exception.ThrottlingException: <p>The request was denied because of request throttling.</p>
        capo_location.errors.validation_exception.ValidationException: <p>The input failed to meet the constraints specified by the AWS service. </p>
        capo_location.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_location.types.list_geofences_request.ListGeofencesRequest]",
    ) -> AsyncOperationResponse[
        "capo_location.types.list_geofences_response.ListGeofencesResponse"
    ]:
        import capo_location._operations.location_service.list_geofences

        (
            output,
            http_response,
        ) = await capo_location._operations.location_service.list_geofences.async_list_geofences(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_location.types.list_geofences_response.ListGeofencesResponse",
    ) -> dict[str, Any]:
        import capo_location.types.list_geofences_response

        return capo_location.types.list_geofences_response.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("ListGeofences", redact_output=_redact_output),
    )
    input_: capo_location.types.list_geofences_request.ListGeofencesRequest = {
        "collection_name": collection_name
    }
    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