DeviceLocation.Verify Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
Verify(String, DeviceLocationVerificationContent, CancellationToken) |
Verifies whether a device is within a specified location area, defined as an accuracy (radius) around a point, specified by longitude and latitude. |
Verify(String, RequestContent, RequestContext) |
[Protocol Method] Verifies whether a device is within a specified location area, defined as an accuracy (radius) around a point, specified by longitude and latitude.
|
Verify(String, DeviceLocationVerificationContent, CancellationToken)
- Source:
- DeviceLocation.cs
Verifies whether a device is within a specified location area, defined as an accuracy (radius) around a point, specified by longitude and latitude.
public virtual Azure.Response<Azure.Communication.ProgrammableConnectivity.DeviceLocationVerificationResult> Verify (string apcGatewayId, Azure.Communication.ProgrammableConnectivity.DeviceLocationVerificationContent deviceLocationVerificationContent, System.Threading.CancellationToken cancellationToken = default);
abstract member Verify : string * Azure.Communication.ProgrammableConnectivity.DeviceLocationVerificationContent * System.Threading.CancellationToken -> Azure.Response<Azure.Communication.ProgrammableConnectivity.DeviceLocationVerificationResult>
override this.Verify : string * Azure.Communication.ProgrammableConnectivity.DeviceLocationVerificationContent * System.Threading.CancellationToken -> Azure.Response<Azure.Communication.ProgrammableConnectivity.DeviceLocationVerificationResult>
Public Overridable Function Verify (apcGatewayId As String, deviceLocationVerificationContent As DeviceLocationVerificationContent, Optional cancellationToken As CancellationToken = Nothing) As Response(Of DeviceLocationVerificationResult)
Parameters
- apcGatewayId
- String
The identifier of the APC Gateway resource which should handle this request.
- deviceLocationVerificationContent
- DeviceLocationVerificationContent
Request to verify Location.
- cancellationToken
- CancellationToken
The cancellation token to use.
Returns
Exceptions
apcGatewayId
or deviceLocationVerificationContent
is null.
Examples
This sample shows how to call Verify.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
DeviceLocation client = new ProgrammableConnectivityClient(endpoint, credential).GetDeviceLocationClient(apiVersion: "2024-02-09-preview");
DeviceLocationVerificationContent deviceLocationVerificationContent = new DeviceLocationVerificationContent(new NetworkIdentifier("<identifierType>", "<identifier>"), 123.45, 123.45, 1234, new LocationDevice());
Response<DeviceLocationVerificationResult> response = client.Verify("<apcGatewayId>", deviceLocationVerificationContent);
This sample shows how to call Verify with all parameters.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
DeviceLocation client = new ProgrammableConnectivityClient(endpoint, credential).GetDeviceLocationClient(apiVersion: "2024-02-09-preview");
DeviceLocationVerificationContent deviceLocationVerificationContent = new DeviceLocationVerificationContent(new NetworkIdentifier("<identifierType>", "<identifier>"), 123.45, 123.45, 1234, new LocationDevice
{
NetworkAccessIdentifier = "<networkAccessIdentifier>",
PhoneNumber = "<phoneNumber>",
Ipv4Address = new Ipv4Address("<ipv4>", 1234),
Ipv6Address = new Ipv6Address("<ipv6>", 1234),
});
Response<DeviceLocationVerificationResult> response = client.Verify("<apcGatewayId>", deviceLocationVerificationContent);
Applies to
Verify(String, RequestContent, RequestContext)
- Source:
- DeviceLocation.cs
[Protocol Method] Verifies whether a device is within a specified location area, defined as an accuracy (radius) around a point, specified by longitude and latitude.
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
- Please try the simpler Verify(String, DeviceLocationVerificationContent, CancellationToken) convenience overload with strongly typed models first.
public virtual Azure.Response Verify (string apcGatewayId, Azure.Core.RequestContent content, Azure.RequestContext context = default);
abstract member Verify : string * Azure.Core.RequestContent * Azure.RequestContext -> Azure.Response
override this.Verify : string * Azure.Core.RequestContent * Azure.RequestContext -> Azure.Response
Public Overridable Function Verify (apcGatewayId As String, content As RequestContent, Optional context As RequestContext = Nothing) As Response
Parameters
- apcGatewayId
- String
The identifier of the APC Gateway resource which should handle this request.
- content
- RequestContent
The content to send as the body of the request.
- context
- RequestContext
The request context, which can override default behaviors of the client pipeline on a per-call basis.
Returns
The response returned from the service.
Exceptions
apcGatewayId
or content
is null.
Service returned a non-success status code.
Examples
This sample shows how to call Verify and parse the result.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
DeviceLocation client = new ProgrammableConnectivityClient(endpoint, credential).GetDeviceLocationClient(apiVersion: "2024-02-09-preview");
using RequestContent content = RequestContent.Create(new
{
networkIdentifier = new
{
identifierType = "<identifierType>",
identifier = "<identifier>",
},
latitude = 123.45,
longitude = 123.45,
accuracy = 1234,
device = new object(),
});
Response response = client.Verify("<apcGatewayId>", content);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("verificationResult").ToString());
This sample shows how to call Verify with all parameters and request content and parse the result.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
DeviceLocation client = new ProgrammableConnectivityClient(endpoint, credential).GetDeviceLocationClient(apiVersion: "2024-02-09-preview");
using RequestContent content = RequestContent.Create(new
{
networkIdentifier = new
{
identifierType = "<identifierType>",
identifier = "<identifier>",
},
latitude = 123.45,
longitude = 123.45,
accuracy = 1234,
device = new
{
networkAccessIdentifier = "<networkAccessIdentifier>",
phoneNumber = "<phoneNumber>",
ipv4Address = new
{
ipv4 = "<ipv4>",
port = 1234,
},
ipv6Address = new
{
ipv6 = "<ipv6>",
port = 1234,
},
},
});
Response response = client.Verify("<apcGatewayId>", content);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("verificationResult").ToString());
Applies to
Azure SDK for .NET