次の方法で共有


ReceivedInvitationsClient.RejectAsync メソッド

定義

名前で識別された受信した招待を拒否します。

public virtual System.Threading.Tasks.Task<Azure.Response> RejectAsync (string receivedInvitationName, Azure.Core.RequestContent content, string repeatabilityRequestId = default, Azure.RequestContext context = default);
abstract member RejectAsync : string * Azure.Core.RequestContent * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.RejectAsync : string * Azure.Core.RequestContent * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function RejectAsync (receivedInvitationName As String, content As RequestContent, Optional repeatabilityRequestId As String = Nothing, Optional context As RequestContext = Nothing) As Task(Of Response)

パラメーター

receivedInvitationName
String

受信した招待の名前。

content
RequestContent

要求の本文として送信するコンテンツ。 要求本文スキーマの詳細については、以下の「解説」セクションを参照してください。

repeatabilityRequestId
String

指定した場合、クライアントは要求が繰り返し可能であることを指示します。つまり、クライアントは同じ Repeatability-Request-Id を使用して要求を複数回行い、サーバーが要求を複数回実行せずに適切な応答を返すことができます。 Repeatability-Request-Id の値は、クライアントによって生成され、常にグローバルに一意である要求の識別子を表す不透明な文字列です。 バージョン 4 (ランダム) UUID を使用することをお勧めします。

context
RequestContext

要求コンテキスト。これは、呼び出しごとにクライアント パイプラインの既定の動作をオーバーライドできます。

戻り値

サービスから返された応答。 応答本文スキーマの詳細については、以下の「解説」セクションを参照してください。

例外

receivedInvitationName または content が null です。

receivedInvitationName は空の文字列であり、空でないと想定されていました。

サービスから成功以外の状態コードが返されました。

このサンプルでは、必要なパラメーターと要求コンテンツを使用して RejectAsync を呼び出す方法と、結果を解析する方法を示します。

var credential = new DefaultAzureCredential();
var client = new ReceivedInvitationsClient("<https://my-service.azure.com>", credential);

var data = new {
    invitationKind = "Application",
    properties = new {
        targetActiveDirectoryId = "<ApplicationReceivedInvitationPropertiesTargetActiveDirectoryId>",
        targetObjectId = "<ApplicationReceivedInvitationPropertiesTargetObjectId>",
    },
};

Response response = await client.RejectAsync("<receivedInvitationName>", RequestContent.Create(data));

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.ToString());

このサンプルでは、すべてのパラメーターと要求コンテンツを使用して RejectAsync を呼び出す方法と、結果を解析する方法を示します。

var credential = new DefaultAzureCredential();
var client = new ReceivedInvitationsClient("<https://my-service.azure.com>", credential);

var data = new {
    invitationKind = "Application",
    properties = new {
        shareKind = "<InPlace>",
        targetActiveDirectoryId = "<ApplicationReceivedInvitationPropertiesTargetActiveDirectoryId>",
        targetObjectId = "<ApplicationReceivedInvitationPropertiesTargetObjectId>",
    },
};

Response response = await client.RejectAsync("<receivedInvitationName>", 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("invitationKind").ToString());

注釈

受信した招待を拒否する

要求と応答のペイロードの JSON スキーマを次に示します。

要求本文:

このメソッドは、以下のいずれかの JSON オブジェクトをペイロードとして受け取ります。 JSON オブジェクトを選択して、このスキーマを表示してください。

ApplicationReceivedInvitationApplicationReceivedInvitationスキーマ:
{
              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: {
                description: string, # Optional. Description shared when the invitation was created
                expirationDate: string (ISO 8601 Format), # Optional. The expiration date for the received share created by accepting the invitation.
                invitationStatus: "Pending" | "Accepted" | "Rejected", # Optional. Status of the invitation.
                location: string, # Optional. Location of the invitation.
                receiverEmail: string, # Optional. Email of the user/receiver who received the sent share invitation
                receiverName: string, # Optional. Name of the user/receiver who received the sent share invitation
                receiverTenantName: string, # Optional. Tenant name of the user/receiver who received the sent share invitation
                respondedAt: string (ISO 8601 Format), # Optional. The time the recipient responded to the invitation.
                senderEmail: string, # Optional. Email of the sender who created the sent share invitation
                senderName: string, # Optional. Name of the sender who created the sent share invitation
                senderTenantName: string, # Optional. Tenant name of the sender who created the sent share invitation
                sentAt: string (ISO 8601 Format), # Optional. Gets the time at which the invitation was sent.
                sentShareName: string, # Optional. Gets the source share Name.
                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 for a received invitation of kind application.
            }
~+ さらに 1 つの JSON オブジェクト
UserReceivedInvitationUserReceivedInvitationスキーマ:
{
              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: {
                description: string, # Optional. Description shared when the invitation was created
                expirationDate: string (ISO 8601 Format), # Optional. The expiration date for the received share created by accepting the invitation.
                invitationStatus: "Pending" | "Accepted" | "Rejected", # Optional. Status of the invitation.
                location: string, # Optional. Location of the invitation.
                receiverEmail: string, # Optional. Email of the user/receiver who received the sent share invitation
                receiverName: string, # Optional. Name of the user/receiver who received the sent share invitation
                receiverTenantName: string, # Optional. Tenant name of the user/receiver who received the sent share invitation
                respondedAt: string (ISO 8601 Format), # Optional. The time the recipient responded to the invitation.
                senderEmail: string, # Optional. Email of the sender who created the sent share invitation
                senderName: string, # Optional. Name of the sender who created the sent share invitation
                senderTenantName: string, # Optional. Tenant name of the sender who created the sent share invitation
                sentAt: string (ISO 8601 Format), # Optional. Gets the time at which the invitation was sent.
                sentShareName: string, # Optional. Gets the source share Name.
                shareKind: "InPlace", # Optional. Defines the supported types for share.
                targetEmail: string, # Required. The receiver email for the invitation is being sent.
              }, # Required. Properties for a received invitation of kind user.
            }

応答本文:

このメソッドは、以下のいずれかの JSON オブジェクトをペイロードとして受け取ります。 JSON オブジェクトを選択して、このスキーマを表示してください。

ApplicationReceivedInvitationApplicationReceivedInvitationスキーマ:
{
              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: {
                description: string, # Optional. Description shared when the invitation was created
                expirationDate: string (ISO 8601 Format), # Optional. The expiration date for the received share created by accepting the invitation.
                invitationStatus: "Pending" | "Accepted" | "Rejected", # Optional. Status of the invitation.
                location: string, # Optional. Location of the invitation.
                receiverEmail: string, # Optional. Email of the user/receiver who received the sent share invitation
                receiverName: string, # Optional. Name of the user/receiver who received the sent share invitation
                receiverTenantName: string, # Optional. Tenant name of the user/receiver who received the sent share invitation
                respondedAt: string (ISO 8601 Format), # Optional. The time the recipient responded to the invitation.
                senderEmail: string, # Optional. Email of the sender who created the sent share invitation
                senderName: string, # Optional. Name of the sender who created the sent share invitation
                senderTenantName: string, # Optional. Tenant name of the sender who created the sent share invitation
                sentAt: string (ISO 8601 Format), # Optional. Gets the time at which the invitation was sent.
                sentShareName: string, # Optional. Gets the source share Name.
                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 for a received invitation of kind application.
            }
~+ さらに 1 つの JSON オブジェクト
UserReceivedInvitationUserReceivedInvitationスキーマ:
{
              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: {
                description: string, # Optional. Description shared when the invitation was created
                expirationDate: string (ISO 8601 Format), # Optional. The expiration date for the received share created by accepting the invitation.
                invitationStatus: "Pending" | "Accepted" | "Rejected", # Optional. Status of the invitation.
                location: string, # Optional. Location of the invitation.
                receiverEmail: string, # Optional. Email of the user/receiver who received the sent share invitation
                receiverName: string, # Optional. Name of the user/receiver who received the sent share invitation
                receiverTenantName: string, # Optional. Tenant name of the user/receiver who received the sent share invitation
                respondedAt: string (ISO 8601 Format), # Optional. The time the recipient responded to the invitation.
                senderEmail: string, # Optional. Email of the sender who created the sent share invitation
                senderName: string, # Optional. Name of the sender who created the sent share invitation
                senderTenantName: string, # Optional. Tenant name of the sender who created the sent share invitation
                sentAt: string (ISO 8601 Format), # Optional. Gets the time at which the invitation was sent.
                sentShareName: string, # Optional. Gets the source share Name.
                shareKind: "InPlace", # Optional. Defines the supported types for share.
                targetEmail: string, # Required. The receiver email for the invitation is being sent.
              }, # Required. Properties for a received invitation of kind user.
            }

適用対象