Udostępnij za pośrednictwem


SensorPartnerIntegrations.CheckConsent Method

Definition

Checks consent for partner integration.

public virtual Azure.Response CheckConsent (string sensorPartnerId, string integrationId, string key, Azure.RequestContext context = default);
abstract member CheckConsent : string * string * string * Azure.RequestContext -> Azure.Response
override this.CheckConsent : string * string * string * Azure.RequestContext -> Azure.Response
Public Overridable Function CheckConsent (sensorPartnerId As String, integrationId As String, key As String, Optional context As RequestContext = Nothing) As 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 CheckConsent with required parameters and parse the result.

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

Response response = client.CheckConsent("<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