Freigeben über


ReceivedSharesClient.ActivateTenantEmailRegistrationAsync Methode

Definition

[Protokollmethode] Aktiviert die Kombination aus Mandant und E-Mail mithilfe des empfangenen Aktivierungscodes.

  • Diese Protokollmethode ermöglicht die explizite Erstellung der Anforderung und Verarbeitung der Antwort für erweiterte Szenarien.
public virtual System.Threading.Tasks.Task<Azure.Response> ActivateTenantEmailRegistrationAsync (Azure.Core.RequestContent content, string repeatabilityRequestId = default, Azure.RequestContext context = default);
abstract member ActivateTenantEmailRegistrationAsync : Azure.Core.RequestContent * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.ActivateTenantEmailRegistrationAsync : Azure.Core.RequestContent * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function ActivateTenantEmailRegistrationAsync (content As RequestContent, Optional repeatabilityRequestId As String = Nothing, Optional context As RequestContext = Nothing) As Task(Of Response)

Parameter

content
RequestContent

Der Inhalt, der als Textkörper der Anforderung gesendet werden soll.

repeatabilityRequestId
String

Falls angegeben, leitet der Client an, dass die Anforderung wiederholbar ist. Das heißt, dass der Client die Anforderung mehrmals mit derselben Repeatability-Request-ID stellen und eine entsprechende Antwort zurückbekommt, ohne dass der Server die Anforderung mehrmals ausführt. Der Wert der Wiederholbarkeitsanforderungs-ID ist eine undurchsichtige Zeichenfolge, die einen vom Client generierten, global eindeutigen Bezeichner für die Anforderung darstellt. Es wird empfohlen, version 4 (zufällige) UUIDs zu verwenden.

context
RequestContext

Der Anforderungskontext, der das Standardverhalten der Clientpipeline pro Aufruf außer Kraft setzen kann.

Gibt zurück

Die vom Dienst zurückgegebene Antwort.

Ausnahmen

content ist NULL.

Der Dienst hat einen nicht erfolgreichen status Code zurückgegeben.

Beispiele

In diesem Beispiel wird gezeigt, wie Sie ActivateTenantEmailRegistrationAsync mit den erforderlichen Parametern aufrufen und das Ergebnis analysieren.

var credential = new DefaultAzureCredential();
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new ReceivedSharesClient(endpoint, credential);

var data = new {};

Response response = await client.ActivateTenantEmailRegistrationAsync(RequestContent.Create(data));

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.ToString());

In diesem Beispiel wird gezeigt, wie Sie ActivateTenantEmailRegistrationAsync mit allen Parametern und Anforderungsinhalten aufrufen und das Ergebnis analysieren.

var credential = new DefaultAzureCredential();
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new ReceivedSharesClient(endpoint, credential);

var data = new {
    properties = new {
        activationCode = "<activationCode>",
    },
};

Response response = await client.ActivateTenantEmailRegistrationAsync(RequestContent.Create(data), "<repeatabilityRequestId>");

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("properties").GetProperty("activationCode").ToString());
Console.WriteLine(result.GetProperty("properties").GetProperty("activationExpiration").ToString());
Console.WriteLine(result.GetProperty("properties").GetProperty("email").ToString());
Console.WriteLine(result.GetProperty("properties").GetProperty("registrationStatus").ToString());
Console.WriteLine(result.GetProperty("properties").GetProperty("state").ToString());
Console.WriteLine(result.GetProperty("properties").GetProperty("tenantId").ToString());
Console.WriteLine(result.GetProperty("id").ToString());
Console.WriteLine(result.GetProperty("type").ToString());

Hinweise

Aktiviert die E-Mail-Registrierung für den aktuellen Mandanten

Im Folgenden finden Sie das JSON-Schema für die Anforderungs- und Antwortnutzlasten.

Anforderungstext:

Schema für TenantEmailRegistration:

{
  properties: {
    activationCode: string, # Required. Activation code for the registration.
    activationExpiration: string (ISO 8601 Format), # Optional. Date of the activation expiration. Represented in the standard date-time format as defined by [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339)
    email: string, # Optional. The email to register.
    registrationStatus: "ActivationPending" | "Activated" | "ActivationAttemptsExhausted", # Optional. Defines the supported types for registration.
    state: "Unknown" | "Succeeded" | "Creating" | "Deleting" | "Moving" | "Failed", # Optional. State of the resource
    tenantId: string, # Optional. The tenant id to register.
  }, # Optional. Tenant email registration property bag.
  id: string, # Optional. The unique id of the resource.
  type: string, # Optional. Type of the resource.
}

Antworttext:

Schema für TenantEmailRegistration:

{
  properties: {
    activationCode: string, # Required. Activation code for the registration.
    activationExpiration: string (ISO 8601 Format), # Optional. Date of the activation expiration. Represented in the standard date-time format as defined by [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339)
    email: string, # Optional. The email to register.
    registrationStatus: "ActivationPending" | "Activated" | "ActivationAttemptsExhausted", # Optional. Defines the supported types for registration.
    state: "Unknown" | "Succeeded" | "Creating" | "Deleting" | "Moving" | "Failed", # Optional. State of the resource
    tenantId: string, # Optional. The tenant id to register.
  }, # Optional. Tenant email registration property bag.
  id: string, # Optional. The unique id of the resource.
  type: string, # Optional. Type of the resource.
}

Gilt für: