SensorPartnerIntegrations.GenerateConsentLinkAsync 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.
Generates partner integration consent link.
public virtual System.Threading.Tasks.Task<Azure.Response> GenerateConsentLinkAsync (string sensorPartnerId, string integrationId, Azure.RequestContext context = default);
abstract member GenerateConsentLinkAsync : string * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GenerateConsentLinkAsync : string * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function GenerateConsentLinkAsync (sensorPartnerId As String, integrationId 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.
- 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
or integrationId
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 GenerateConsentLinkAsync 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.GenerateConsentLinkAsync("<sensorPartnerId>", "<integrationId>");
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("consentLink").ToString());
Console.WriteLine(result.GetProperty("consentExpiryDateTime").ToString());
Remarks
Below is the JSON schema for the response payload.
Response Body:
Schema for SensorPartnerIntegrationGenerateConsentLinkResponse
:
{
consentLink: string, # Optional. Consent link.
consentExpiryDateTime: string (ISO 8601 Format), # Optional. Consent expiry date time, sample format: yyyy-MM-ddTHH:mm:ssZ.
}
Applies to
Azure SDK for .NET