SentShareInvitationsClient.CreateOrUpdateAsync メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
特定のアカウントで送信された共有の招待を作成/更新します。
public virtual System.Threading.Tasks.Task<Azure.Response> CreateOrUpdateAsync (string sentShareName, string sentShareInvitationName, Azure.Core.RequestContent content, Azure.RequestContext context = default);
abstract member CreateOrUpdateAsync : string * string * Azure.Core.RequestContent * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.CreateOrUpdateAsync : string * string * Azure.Core.RequestContent * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function CreateOrUpdateAsync (sentShareName As String, sentShareInvitationName As String, content As RequestContent, Optional context As RequestContext = Nothing) As Task(Of Response)
パラメーター
- sentShareName
- String
送信された共有の名前。
- sentShareInvitationName
- String
送信された招待の名前。
- content
- RequestContent
要求の本文として送信するコンテンツ。 要求本文スキーマの詳細については、以下の「解説」セクションを参照してください。
- context
- RequestContext
要求コンテキスト。これは、クライアント パイプラインの既定の動作を呼び出しごとにオーバーライドできます。
戻り値
サービスから返された応答。 応答本文スキーマの詳細については、以下の「解説」セクションを参照してください。
例外
sentShareName
、sentShareInvitationName
、または content
が null です。
sentShareName
または sentShareInvitationName
が空の文字列であり、空でないと想定されていました。
サービスから成功以外の状態コードが返されました。
例
このサンプルでは、必要なパラメーターと要求コンテンツを使用して CreateOrUpdateAsync を呼び出す方法と、結果を解析する方法を示します。
var credential = new DefaultAzureCredential();
var client = new SentShareInvitationsClient("<https://my-service.azure.com>", credential);
var data = new {
invitationKind = "Application",
properties = new {
targetActiveDirectoryId = "<ApplicationInvitationPropertiesTargetActiveDirectoryId>",
targetObjectId = "<ApplicationInvitationPropertiesTargetObjectId>",
},
};
Response response = await client.CreateOrUpdateAsync("<sentShareName>", "<sentShareInvitationName>", RequestContent.Create(data));
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.ToString());
このサンプルでは、すべてのパラメーターと要求コンテンツを使用して CreateOrUpdateAsync を呼び出す方法と、結果を解析する方法を示します。
var credential = new DefaultAzureCredential();
var client = new SentShareInvitationsClient("<https://my-service.azure.com>", credential);
var data = new {
invitationKind = "Application",
properties = new {
expirationDate = "<2022-05-10T14:57:31.2311892-04:00>",
shareKind = "<InPlace>",
targetActiveDirectoryId = "<ApplicationInvitationPropertiesTargetActiveDirectoryId>",
targetObjectId = "<ApplicationInvitationPropertiesTargetObjectId>",
},
};
Response response = await client.CreateOrUpdateAsync("<sentShareName>", "<sentShareInvitationName>", RequestContent.Create(data));
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("invitationKind").ToString());
注釈
送信された共有の招待を作成する
要求と応答のペイロードの JSON スキーマを次に示します。
要求本文:
このメソッドは、以下のいずれかの JSON オブジェクトをペイロードとして受け取ります。 このスキーマを表示するには、JSON オブジェクトを選択してください。
ApplicationInvitation
のApplicationInvitation
スキーマ:{
invitationKind: Application, # Required. The types of invitations.
id: string, # Optional. The resource id of the resource.
name: string, # Optional. Name of the resource.
type: string, # Optional. Type of the resource.
properties: {
expirationDate: string (ISO 8601 Format), # Optional. The expiration date for the invitation
invitationId: string, # Optional. Id of the invitation
invitationStatus: "Pending" | "Accepted" | "Rejected", # Optional. Status of the invitation.
provisioningState: "Unknown" | "Succeeded" | "Creating" | "Deleting" | "Moving" | "Failed" | "SoftDeleting" | "SoftDeleted" | "SourceMoved" | "SourceDeleted" | "TargetMoved" | "TargetDeleted", # Optional. Provisioning status of the resource
respondedAt: string (ISO 8601 Format), # Optional. The time the recipient responded to the invitation.
senderEmail: string, # Optional. Email address of the sender.
senderName: string, # Optional. Name of the sender
senderTenantName: string, # Optional. Tenant name of the sender
sentAt: string (ISO 8601 Format), # Optional. Gets the time at which the invitation was sent.
shareKind: "InPlace", # Optional. Defines the supported types for share.
targetActiveDirectoryId: string, # Required. The target azure active directory id the invitation is sent to.
targetObjectId: string, # Required. The target object id in the azure active directory the invitation is sent to.
}, # Required. Properties of the application invitation type.
}
~+ 1 つ以上の JSON オブジェクト
UserInvitation
のUserInvitation
スキーマ:{
invitationKind: User, # Required. The types of invitations.
id: string, # Optional. The resource id of the resource.
name: string, # Optional. Name of the resource.
type: string, # Optional. Type of the resource.
properties: {
expirationDate: string (ISO 8601 Format), # Optional. The expiration date for the invitation
invitationId: string, # Optional. Id of the invitation
invitationStatus: "Pending" | "Accepted" | "Rejected", # Optional. Status of the invitation.
provisioningState: "Unknown" | "Succeeded" | "Creating" | "Deleting" | "Moving" | "Failed" | "SoftDeleting" | "SoftDeleted" | "SourceMoved" | "SourceDeleted" | "TargetMoved" | "TargetDeleted", # Optional. Provisioning status of the resource
respondedAt: string (ISO 8601 Format), # Optional. The time the recipient responded to the invitation.
senderEmail: string, # Optional. Email address of the sender.
senderName: string, # Optional. Name of the sender
senderTenantName: string, # Optional. Tenant name of the sender
sentAt: string (ISO 8601 Format), # Optional. Gets the time at which the invitation was sent.
shareKind: "InPlace", # Optional. Defines the supported types for share.
targetEmail: string, # Required. The receiver email for the invitation is being sent.
}, # Required. Properties of the user invitation type.
}
応答本文:
このメソッドは、以下のいずれかの JSON オブジェクトをペイロードとして受け取ります。 このスキーマを表示するには、JSON オブジェクトを選択してください。
ApplicationInvitation
のApplicationInvitation
スキーマ:{
invitationKind: Application, # Required. The types of invitations.
id: string, # Optional. The resource id of the resource.
name: string, # Optional. Name of the resource.
type: string, # Optional. Type of the resource.
properties: {
expirationDate: string (ISO 8601 Format), # Optional. The expiration date for the invitation
invitationId: string, # Optional. Id of the invitation
invitationStatus: "Pending" | "Accepted" | "Rejected", # Optional. Status of the invitation.
provisioningState: "Unknown" | "Succeeded" | "Creating" | "Deleting" | "Moving" | "Failed" | "SoftDeleting" | "SoftDeleted" | "SourceMoved" | "SourceDeleted" | "TargetMoved" | "TargetDeleted", # Optional. Provisioning status of the resource
respondedAt: string (ISO 8601 Format), # Optional. The time the recipient responded to the invitation.
senderEmail: string, # Optional. Email address of the sender.
senderName: string, # Optional. Name of the sender
senderTenantName: string, # Optional. Tenant name of the sender
sentAt: string (ISO 8601 Format), # Optional. Gets the time at which the invitation was sent.
shareKind: "InPlace", # Optional. Defines the supported types for share.
targetActiveDirectoryId: string, # Required. The target azure active directory id the invitation is sent to.
targetObjectId: string, # Required. The target object id in the azure active directory the invitation is sent to.
}, # Required. Properties of the application invitation type.
}
~+ 1 つ以上の JSON オブジェクト
UserInvitation
のUserInvitation
スキーマ:{
invitationKind: User, # Required. The types of invitations.
id: string, # Optional. The resource id of the resource.
name: string, # Optional. Name of the resource.
type: string, # Optional. Type of the resource.
properties: {
expirationDate: string (ISO 8601 Format), # Optional. The expiration date for the invitation
invitationId: string, # Optional. Id of the invitation
invitationStatus: "Pending" | "Accepted" | "Rejected", # Optional. Status of the invitation.
provisioningState: "Unknown" | "Succeeded" | "Creating" | "Deleting" | "Moving" | "Failed" | "SoftDeleting" | "SoftDeleted" | "SourceMoved" | "SourceDeleted" | "TargetMoved" | "TargetDeleted", # Optional. Provisioning status of the resource
respondedAt: string (ISO 8601 Format), # Optional. The time the recipient responded to the invitation.
senderEmail: string, # Optional. Email address of the sender.
senderName: string, # Optional. Name of the sender
senderTenantName: string, # Optional. Tenant name of the sender
sentAt: string (ISO 8601 Format), # Optional. Gets the time at which the invitation was sent.
shareKind: "InPlace", # Optional. Defines the supported types for share.
targetEmail: string, # Required. The receiver email for the invitation is being sent.
}, # Required. Properties of the user invitation type.
}
適用対象
Azure SDK for .NET