Skip to content

batch_put_geofence async

batch_put_geofence(
    collection_name: ResourceName,
    entries: BatchPutGeofenceRequestEntryList,
    *,
    config_overrides: Optional[AsyncLocationClientConfig] = None,
) -> BatchPutGeofenceResponse

A batch request for storing geofence geometries into a given geofence collection, or updates the geometry of an existing geofence if a geofence ID is included in the request.

Parameters:

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 batch_put_geofence(
    self,
    collection_name: "capo_location.types.resource_name.ResourceName",
    entries: "capo_location.types.batch_put_geofence_request_entry_list.BatchPutGeofenceRequestEntryList",
    *,
    config_overrides: Optional[AsyncLocationClientConfig] = None,
) -> "capo_location.types.batch_put_geofence_response.BatchPutGeofenceResponse":
    """<p>A batch request for storing geofence geometries into a given geofence collection, or updates the geometry of an existing geofence if a geofence ID is included in the request.</p>

    Args:
        collection_name: <p>The geofence collection storing the geofences.</p>
        entries: <p>The batch of geofences to be stored in a geofence collection.</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.batch_put_geofence_request.BatchPutGeofenceRequest]",
    ) -> AsyncOperationResponse[
        "capo_location.types.batch_put_geofence_response.BatchPutGeofenceResponse"
    ]:
        import capo_location._operations.location_service.batch_put_geofence

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

    def _redact_input(
        input_: "capo_location.types.batch_put_geofence_request.BatchPutGeofenceRequest",
    ) -> dict[str, Any]:
        import capo_location.types.batch_put_geofence_request

        return capo_location.types.batch_put_geofence_request.redact_sensitive(
            input_
        )

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

        return capo_location.types.batch_put_geofence_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "BatchPutGeofence",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_location.types.batch_put_geofence_request.BatchPutGeofenceRequest = {
        "collection_name": collection_name,
        "entries": entries,
    }

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