Skip to content

verify_device_position async

verify_device_position(
    tracker_name: ResourceName,
    device_state: DeviceState,
    *,
    config_overrides: Optional[AsyncLocationClientConfig] = None,
    distance_unit: Optional[DistanceUnit] = None,
) -> VerifyDevicePositionResponse

Verifies the integrity of the device's position by determining if it was reported behind a proxy, and by comparing it to an inferred position estimated based on the device's state.

The Location Integrity SDK provides enhanced features related to device verification, and it is available for use by request. To get access to the SDK, contact Sales Support.

Parameters:

  • tracker_name (ResourceName) –

    The name of the tracker resource to be associated with verification request.

  • device_state (DeviceState) –

    The device's state, including position, IP address, cell signals and Wi-Fi access points.

  • distance_unit (Optional[DistanceUnit], default: None ) –

    The distance unit for the verification request.

    Default Value: Kilometers

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 verify_device_position(
    self,
    tracker_name: "capo_location.types.resource_name.ResourceName",
    device_state: "capo_location.types.device_state.DeviceState",
    *,
    config_overrides: Optional[AsyncLocationClientConfig] = None,
    distance_unit: Optional[
        "capo_location.types.distance_unit.DistanceUnit"
    ] = None,
) -> "capo_location.types.verify_device_position_response.VerifyDevicePositionResponse":
    """<p>Verifies the integrity of the device's position by determining if it was reported behind a proxy, and by comparing it to an inferred position estimated based on the device's state.</p> <note> <p>The Location Integrity SDK provides enhanced features related to device verification, and it is available for use by request. To get access to the SDK, contact <a href="https://aws.amazon.com/contact-us/sales-support/?pg=locationprice&amp;cta=herobtn">Sales Support</a>.</p> </note>

    Args:
        tracker_name: <p>The name of the tracker resource to be associated with verification request.</p>
        device_state: <p>The device's state, including position, IP address, cell signals and Wi-Fi access points.</p>
        distance_unit: <p>The distance unit for the verification request.</p> <p>Default Value: <code>Kilometers</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.verify_device_position_request.VerifyDevicePositionRequest]",
    ) -> AsyncOperationResponse[
        "capo_location.types.verify_device_position_response.VerifyDevicePositionResponse"
    ]:
        import capo_location._operations.location_service.verify_device_position

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

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

        return capo_location.types.verify_device_position_request.redact_sensitive(
            input_
        )

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

        return capo_location.types.verify_device_position_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "VerifyDevicePosition",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_location.types.verify_device_position_request.VerifyDevicePositionRequest = {
        "tracker_name": tracker_name,
        "device_state": device_state,
    }
    if distance_unit is not None:
        input_["distance_unit"] = distance_unit

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