EmailRegistrationClient.Register(String, RequestContext) メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
アクティブ化のためにテナントと電子メールの組み合わせを登録します。
public virtual Azure.Response Register (string repeatabilityRequestId = default, Azure.RequestContext context = default);
abstract member Register : string * Azure.RequestContext -> Azure.Response
override this.Register : string * Azure.RequestContext -> Azure.Response
Public Overridable Function Register (Optional repeatabilityRequestId As String = Nothing, Optional context As RequestContext = Nothing) As Response
パラメーター
- repeatabilityRequestId
- String
指定した場合、クライアントは要求が繰り返し可能であることを指示します。つまり、クライアントは同じ Repeatability-Request-Id を使用して要求を複数回行い、サーバーが要求を複数回実行せずに適切な応答を返すことができます。 Repeatability-Request-Id の値は、クライアントによって生成され、常にグローバルに一意である要求の識別子を表す不透明な文字列です。 バージョン 4 (ランダム) UUID を使用することをお勧めします。
- context
- RequestContext
要求コンテキスト。これは、呼び出しごとにクライアント パイプラインの既定の動作をオーバーライドできます。
戻り値
サービスから返された応答。 応答本文スキーマの詳細については、以下の「解説」セクションを参照してください。
例外
サービスから成功以外の状態コードが返されました。
例
このサンプルでは、Register を呼び出して結果を解析する方法を示します。
var credential = new DefaultAzureCredential();
var client = new EmailRegistrationClient("<https://my-service.azure.com>", credential);
Response response = client.Register();
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.ToString());
このサンプルでは、すべてのパラメーターで Register を呼び出す方法と、結果を解析する方法を示します。
var credential = new DefaultAzureCredential();
var client = new EmailRegistrationClient("<https://my-service.azure.com>", credential);
Response response = client.Register("<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());
注釈
現在のテナントの電子メールを登録する
応答ペイロードの JSON スキーマを次に示します。
応答本文:
の 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.
}
適用対象
Azure SDK for .NET