Sdílet prostřednictvím


SensorPartnerIntegrations.CheckConsentAsync Method

Definition

Checks consent for partner integration.

public virtual System.Threading.Tasks.Task<Azure.Response> CheckConsentAsync (string sensorPartnerId, string integrationId, string key, Azure.RequestContext context = default);
abstract member CheckConsentAsync : string * string * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.CheckConsentAsync : string * string * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function CheckConsentAsync (sensorPartnerId As String, integrationId As String, key As String, Optional context As RequestContext = Nothing) As Task(Of Response)

Parameters

sensorPartnerId
String

Id of the sensor partner.

integrationId
String

Id of the integration object.

key
String

Partner integration key.

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. Details of the response body schema are in the Remarks section below.

Exceptions

sensorPartnerId, integrationId or key is null.

sensorPartnerId or integrationId is an empty string, and was expected to be non-empty.

Service returned a non-success status code.

Examples

This sample shows how to call CheckConsentAsync with required parameters and parse the result.

var credential = new DefaultAzureCredential();
var client = new FarmBeatsClient(credential).GetSensorPartnerIntegrationsClient(<2022-11-01-preview>);

Response response = await client.CheckConsentAsync("<sensorPartnerId>", "<integrationId>", "<key>");

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("consented").ToString());
Console.WriteLine(result.GetProperty("sensorPartnerId").ToString());
Console.WriteLine(result.GetProperty("integrationId").ToString());

Remarks

Below is the JSON schema for the response payload.

Response Body:

Schema for SensorPartnerIntegrationCheckConsentResponse:

{
  consented: boolean, # Optional. Flag to determine the status of partner integration consent.
  sensorPartnerId: string, # Optional. Id of the associated sensor partner.
  integrationId: string, # Optional. Id of the integration.
}

Applies to