Compartilhar via


ReceivedInvitationsClient.Reject Método

Definição

Rejeita o convite recebido identificado pelo nome.

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

Parâmetros

receivedInvitationName
String

Nome do convite recebido.

content
RequestContent

O conteúdo a ser enviado como o corpo da solicitação. Os detalhes do esquema do corpo da solicitação estão na seção Comentários abaixo.

repeatabilityRequestId
String

Se especificado, o cliente direciona que a solicitação é repetível; ou seja, o cliente pode fazer a solicitação várias vezes com a mesma Repeatability-Request-Id e obter de volta uma resposta apropriada sem que o servidor execute a solicitação várias vezes. O valor do Repeatability-Request-Id é uma cadeia de caracteres opaca que representa um identificador gerado pelo cliente, globalmente exclusivo 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. Os detalhes do esquema do corpo da resposta estão na seção Comentários abaixo.

Exceções

receivedInvitationName ou content é nulo.

receivedInvitationName é uma cadeia de caracteres vazia e esperava-se que não estivesse vazia.

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

Exemplos

Este exemplo mostra como chamar Rejeitar com parâmetros necessários e solicitar conteúdo e como analisar o resultado.

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 = client.Reject("<receivedInvitationName>", RequestContent.Create(data));

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

Este exemplo mostra como chamar Rejeitar com todos os parâmetros e solicitar conteúdo e como analisar o resultado.

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 = client.Reject("<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());

Comentários

Rejeitar um convite recebido

Abaixo está o esquema JSON para as cargas de solicitação e resposta.

Corpo da solicitação:

Esse método usa um dos objetos JSON abaixo como uma carga. Selecione um objeto JSON para exibir o esquema para isso.

ApplicationReceivedInvitation Esquema para ApplicationReceivedInvitation:
{
              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.
            }
~+ Mais 1 objeto
JSON UserReceivedInvitation Esquema para UserReceivedInvitation:
{
              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.
            }

Corpo da resposta:

Esse método usa um dos objetos JSON abaixo como uma carga. Selecione um objeto JSON para exibir o esquema para isso.

ApplicationReceivedInvitation Esquema para ApplicationReceivedInvitation:
{
              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.
            }
~+ Mais 1 objeto
JSON UserReceivedInvitation Esquema para UserReceivedInvitation:
{
              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.
            }

Aplica-se a