Skip to content

update_resource_position async

update_resource_position(
    resource_identifier: PositionResourceIdentifier,
    resource_type: PositionResourceType,
    *,
    config_overrides: Optional[AsyncIoTWirelessClientConfig] = None,
    geo_json_payload: Optional[GeoJsonPayload] = None,
) -> UpdateResourcePositionResponse

Update the position information of a given wireless device or a wireless gateway resource. The position coordinates are based on the World Geodetic System (WGS84).

Parameters:

  • resource_identifier (PositionResourceIdentifier) –

    The identifier of the resource for which position information is updated. It can be the wireless device ID or the wireless gateway ID, depending on the resource type.

  • resource_type (PositionResourceType) –

    The type of resource for which position information is updated, which can be a wireless device or a wireless gateway.

  • geo_json_payload (Optional[GeoJsonPayload], default: None ) –

    The position information of the resource, displayed as a JSON payload. The payload uses the GeoJSON format, which a format that's used to encode geographic data structures. For more information, see GeoJSON.

Raises:

Source code in docs_src/capo_iot_wireless/_services/async_io_t_wireless.py
async def update_resource_position(
    self,
    resource_identifier: "capo_iot_wireless.types.position_resource_identifier.PositionResourceIdentifier",
    resource_type: "capo_iot_wireless.types.position_resource_type.PositionResourceType",
    *,
    config_overrides: Optional[AsyncIoTWirelessClientConfig] = None,
    geo_json_payload: Optional[
        "capo_iot_wireless.types.geo_json_payload.GeoJsonPayload"
    ] = None,
) -> "capo_iot_wireless.types.update_resource_position_response.UpdateResourcePositionResponse":
    """<p>Update the position information of a given wireless device or a wireless gateway resource. The position coordinates are based on the <a href="https://gisgeography.com/wgs84-world-geodetic-system/"> World Geodetic System (WGS84)</a>.</p>

    Args:
        resource_identifier: <p>The identifier of the resource for which position information is updated. It can be the wireless device ID or the wireless gateway ID, depending on the resource type.</p>
        resource_type: <p>The type of resource for which position information is updated, which can be a wireless device or a wireless gateway.</p>
        geo_json_payload: <p>The position information of the resource, displayed as a JSON payload. The payload uses the GeoJSON format, which a format that's used to encode geographic data structures. For more information, see <a href="https://geojson.org/">GeoJSON</a>.</p>

    Raises:
        capo_iot_wireless.errors.access_denied_exception.AccessDeniedException: <p>User does not have permission to perform this action.</p>
        capo_iot_wireless.errors.internal_server_exception.InternalServerException: <p>An unexpected error occurred while processing a request.</p>
        capo_iot_wireless.errors.resource_not_found_exception.ResourceNotFoundException: <p>Resource does not exist.</p>
        capo_iot_wireless.errors.throttling_exception.ThrottlingException: <p>The request was denied because it exceeded the allowed API request rate.</p>
        capo_iot_wireless.errors.validation_exception.ValidationException: <p>The input did not meet the specified constraints.</p>
        capo_iot_wireless.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_iot_wireless.types.update_resource_position_request.UpdateResourcePositionRequest]",
    ) -> AsyncOperationResponse[
        "capo_iot_wireless.types.update_resource_position_response.UpdateResourcePositionResponse"
    ]:
        import capo_iot_wireless._operations.iotwireless.update_resource_position

        (
            output,
            http_response,
        ) = await capo_iot_wireless._operations.iotwireless.update_resource_position.async_update_resource_position(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateResourcePosition")
    )
    input_: capo_iot_wireless.types.update_resource_position_request.UpdateResourcePositionRequest = {
        "resource_identifier": resource_identifier,
        "resource_type": resource_type,
    }
    if geo_json_payload is not None:
        input_["geo_json_payload"] = geo_json_payload

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