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

ReceivedSharesClient.RegisterTenantEmailRegistration 方法

定义

[协议方法]注册用于激活的租户和电子邮件组合。

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

参数

repeatabilityRequestId
String

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

context
RequestContext

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

返回

从服务返回的响应。

例外

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

示例

此示例演示如何调用 RegisterTenantEmailRegistration 并分析结果。

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

Response response = client.RegisterTenantEmailRegistration();

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

此示例演示如何使用所有参数调用 RegisterTenantEmailRegistration,以及如何分析结果。

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

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

适用于