你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

ReceivedSharesClient.ActivateTenantEmailRegistration 方法

定义

[协议方法]使用收到的激活代码激活租户和电子邮件组合。

  • 协议方法 允许显式创建请求并处理高级方案的响应。
public virtual Azure.Response ActivateTenantEmailRegistration (Azure.Core.RequestContent content, string repeatabilityRequestId = default, Azure.RequestContext context = default);
abstract member ActivateTenantEmailRegistration : Azure.Core.RequestContent * string * Azure.RequestContext -> Azure.Response
override this.ActivateTenantEmailRegistration : Azure.Core.RequestContent * string * Azure.RequestContext -> Azure.Response
Public Overridable Function ActivateTenantEmailRegistration (content As RequestContent, Optional repeatabilityRequestId As String = Nothing, Optional context As RequestContext = Nothing) As Response

参数

content
RequestContent

要作为请求正文发送的内容。

repeatabilityRequestId
String

如果指定,则客户端指示请求是可重复的;也就是说,客户端可以使用相同的 Repeatability-Request-Id 多次发出请求,并返回适当的响应,而无需服务器多次执行请求。 Repeatability-Request-Id 的值是一个不透明的字符串,表示客户端生成的、在所有时间全局唯一的请求标识符。 建议使用版本 4 (随机) UUID。

context
RequestContext

请求上下文,它可以基于每个调用替代客户端管道的默认行为。

返回

从服务返回的响应。

例外

content 为 null。

服务返回了不成功状态代码。

示例

此示例演示如何使用所需参数调用 ActivateTenantEmailRegistration 并分析结果。

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

var data = new {};

Response response = client.ActivateTenantEmailRegistration(RequestContent.Create(data));

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

此示例演示如何使用所有参数和请求内容调用 ActivateTenantEmailRegistration,以及如何分析结果。

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 = client.ActivateTenantEmailRegistration(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());

注解

激活当前租户的电子邮件注册

下面是请求和响应有效负载的 JSON 架构。

请求正文:

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.
}

响应正文:

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.
}

适用于