Compartilhar via


ReceivedSharesClient.ActivateTenantEmailRegistration Método

Definição

[Método de protocolo] Ativa a combinação de locatário e email usando o código de ativação recebido.

  • Esse método de protocolo permite a criação explícita da solicitação e do processamento da resposta para cenários avançados.
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

Parâmetros

content
RequestContent

O conteúdo a ser enviado como o corpo da solicitação.

repeatabilityRequestId
String

Se especificado, o cliente direciona que a solicitação é repetível; ou seja, que o cliente pode fazer a solicitação várias vezes com a mesma Repeatability-Request-Id e obter uma resposta apropriada sem que o servidor execute a solicitação várias vezes. O valor de Repeatability-Request-Id é uma cadeia de caracteres opaca que representa um identificador globalmente exclusivo e gerado pelo cliente para todos os tempos para a solicitação. É recomendável usar UUIDs da versão 4 (aleatória).

context
RequestContext

O contexto de solicitação, que pode substituir os comportamentos padrão do pipeline do cliente por chamada.

Retornos

A resposta retornada do serviço.

Exceções

content é nulo.

O serviço retornou um código de status sem êxito.

Exemplos

Este exemplo mostra como chamar ActivateTenantEmailRegistration com os parâmetros necessários e analisar o resultado.

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());

Este exemplo mostra como chamar ActivateTenantEmailRegistration com todos os parâmetros e conteúdo da solicitação e como analisar o resultado.

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());

Comentários

Ativa o registro de email para o locatário atual

Abaixo está o esquema JSON para os conteúdos de solicitação e resposta.

Corpo da solicitação:

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

Corpo da resposta:

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

Aplica-se a