EmailRegistrationClient.ActivateAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Activates the tenant and email combination using the activation code received.
public virtual System.Threading.Tasks.Task<Azure.Response> ActivateAsync (Azure.Core.RequestContent content, string repeatabilityRequestId = default, Azure.RequestContext context = default);
abstract member ActivateAsync : Azure.Core.RequestContent * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.ActivateAsync : Azure.Core.RequestContent * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function ActivateAsync (content As RequestContent, Optional repeatabilityRequestId As String = Nothing, Optional context As RequestContext = Nothing) As Task(Of Response)
Parameters
- content
- RequestContent
The content to send as the body of the request. Details of the request body schema are in the Remarks section below.
- repeatabilityRequestId
- String
If specified, the client directs that the request is repeatable; that is, that the client can make the request multiple times with the same Repeatability-Request-Id and get back an appropriate response without the server executing the request multiple times. The value of the Repeatability-Request-Id is an opaque string representing a client-generated, globally unique for all time, identifier for the request. It is recommended to use version 4 (random) UUIDs.
- context
- RequestContext
The request context, which can override default behaviors of the client pipeline on a per-call basis.
Returns
The response returned from the service. Details of the response body schema are in the Remarks section below.
Exceptions
content
is null.
Service returned a non-success status code.
Examples
This sample shows how to call ActivateAsync with required parameters and parse the result.
var credential = new DefaultAzureCredential();
var client = new EmailRegistrationClient("<https://my-service.azure.com>", credential);
var data = new {};
Response response = await client.ActivateAsync(RequestContent.Create(data));
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.ToString());
This sample shows how to call ActivateAsync with all parameters and request content, and how to parse the result.
var credential = new DefaultAzureCredential();
var client = new EmailRegistrationClient("<https://my-service.azure.com>", credential);
var data = new {
properties = new {
activationCode = "<TenantEmailRegistrationPropertiesActivationCode>",
},
};
Response response = await client.ActivateAsync(RequestContent.Create(data), "<repeatabilityRequestId>");
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("id").ToString());
Console.WriteLine(result.GetProperty("name").ToString());
Console.WriteLine(result.GetProperty("type").ToString());
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("tenantId").ToString());
Remarks
Activates the email registration for current tenant
Below is the JSON schema for the request and response payloads.
Request Body:
Schema for TenantEmailRegistration
:
{
id: string, # Optional. The resource id of the resource.
name: string, # Optional. Name of the resource.
type: string, # Optional. Type of the resource.
properties: {
activationCode: string, # Required. Activation code for the registration.
activationExpiration: string (ISO 8601 Format), # Optional. Date of the activation expiration.
email: string, # Optional. The email to register.
registrationStatus: "ActivationPending" | "Activated" | "ActivationAttemptsExhausted", # Optional. Defines the supported types for registration.
tenantId: string, # Optional. The tenant id to register.
}, # Optional. Tenant email registration property bag.
}
Response Body:
Schema for TenantEmailRegistration
:
{
id: string, # Optional. The resource id of the resource.
name: string, # Optional. Name of the resource.
type: string, # Optional. Type of the resource.
properties: {
activationCode: string, # Required. Activation code for the registration.
activationExpiration: string (ISO 8601 Format), # Optional. Date of the activation expiration.
email: string, # Optional. The email to register.
registrationStatus: "ActivationPending" | "Activated" | "ActivationAttemptsExhausted", # Optional. Defines the supported types for registration.
tenantId: string, # Optional. The tenant id to register.
}, # Optional. Tenant email registration property bag.
}