你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
ReceivedSharesClient.RegisterTenantEmailRegistrationAsync 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
[协议方法]注册要激活的租户和电子邮件组合。
- 此 协议方法 允许显式创建请求并处理高级方案的响应。
public virtual System.Threading.Tasks.Task<Azure.Response> RegisterTenantEmailRegistrationAsync (string repeatabilityRequestId = default, Azure.RequestContext context = default);
abstract member RegisterTenantEmailRegistrationAsync : string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.RegisterTenantEmailRegistrationAsync : string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function RegisterTenantEmailRegistrationAsync (Optional repeatabilityRequestId As String = Nothing, Optional context As RequestContext = Nothing) As Task(Of Response)
参数
- repeatabilityRequestId
- String
如果指定,则客户端指示请求是可重复的;也就是说,客户端可以使用相同的 Repeatability-Request-Id 多次发出请求,并返回适当的响应,而无需服务器多次执行请求。 Repeatability-Request-Id 的值是一个不透明的字符串,表示客户端生成的、在所有时间全局唯一的请求标识符。 建议使用版本 4 (随机) UUID。
- context
- RequestContext
请求上下文,它可以基于每个调用替代客户端管道的默认行为。
返回
从服务返回的响应。
例外
服务返回了不成功状态代码。
示例
此示例演示如何调用 RegisterTenantEmailRegistrationAsync 并分析结果。
var credential = new DefaultAzureCredential();
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new ReceivedSharesClient(endpoint, credential);
Response response = await client.RegisterTenantEmailRegistrationAsync();
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.ToString());
此示例演示如何使用所有参数调用 RegisterTenantEmailRegistrationAsync,以及如何分析结果。
var credential = new DefaultAzureCredential();
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new ReceivedSharesClient(endpoint, credential);
Response response = await client.RegisterTenantEmailRegistrationAsync("<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.
}