From 68f887be16763a4838c8dc07a729962e540716ed Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Fri, 17 Mar 2023 13:38:52 -0700 Subject: [PATCH 01/34] start typespec --- specification/eventgrid/typespec/main.tsp | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 specification/eventgrid/typespec/main.tsp diff --git a/specification/eventgrid/typespec/main.tsp b/specification/eventgrid/typespec/main.tsp new file mode 100644 index 000000000000..e69de29bb2d1 From 6554c103ed9e7c99bb37ce016c374d775a66e02a Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Mon, 20 Mar 2023 11:14:13 -0700 Subject: [PATCH 02/34] adding eventgrid typespec for api w/ TODOs --- specification/eventgrid/typespec/main.tsp | 266 ++++++++++++++++++++++ 1 file changed, 266 insertions(+) diff --git a/specification/eventgrid/typespec/main.tsp b/specification/eventgrid/typespec/main.tsp index e69de29bb2d1..f1961025e558 100644 --- a/specification/eventgrid/typespec/main.tsp +++ b/specification/eventgrid/typespec/main.tsp @@ -0,0 +1,266 @@ +import "@typespec/http"; +import "@typespec/rest"; +import "@typespec/versioning"; +import "@azure-tools/typespec-autorest"; +import "@azure-tools/typespec-azure-core"; + +enum ServiceApiVersions { + v2022_05_01: "2022-05-01", // TODO: should we use newer one like 2023-06-01-preview or 2023-06-01???? +} + +enum ProtocolType { + https: "https://", +} + +// TODO: will this be included in all operations? or should I explicitely add that? +// TODO: what is the story for SAS signature. + +@useAuth( + ApiKeyAuth | OAuth2Auth<[ + { + type: OAuth2FlowType.implicit, + authorizationUrl: "https://login.microsoftonline.com/common/oauth2/v2.0/authorize", + scopes: ["https://eventgrid.azure.net/.default"], + } + ]> +) +@service({ + title: "EventGridClient", // TODO: Naming + version: "2022-05-01", +}) + +// +// Supported operations as of 3/17/2023. +// +// POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}:publish?api-version={apiVersion}} +// POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:receive?apiVersion={apiVersion}&timeout=60&maxEvents={maxEvents} +// POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:acknowledge&apiVersion={apiVersion} +// POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:release?api-version={apiVersion} + +// TODO: How to describe the query parameters or do we need it? +@server( + "{ProtocolType}{NamespaceName}.{Region}.eventgrid.azure.net}", + "The host name of the topic", + { + // @doc(""" + // The supported endpoints of the service. This includes either: + // 1. Protocol and hostname of the topic. For example: https://namespace1.eastus-1.eventgrid.azure.net/topics/topic1 , or + // 2. protocol and hostname of the event subscription. For example: https://namespace1.eastus-1.eventgrid.azure.net/topics/topic1/eventSubscriptions/eventSubscription1 . + // """) + // Endpoint: string, // TODO: Alternative is to use url but in the future we will add other protocols here. + + @doc("Protocol type.") + @path + ProtocolType: ProtocolType, + + @doc("Namespace Name.") + @path + NamespaceName: string, + + @doc("Azure region where namespace and related nested resources are available.") + @path + Region: string, + } +) + +@doc("Azure EventGrid Client") +@versioned(ServiceApiVersions) +namespace AzureEventGrid { + using TypeSpec.Http; + using TypeSpec.Rest; + using TypeSpec.Versioning; + using Azure.Core; + using Azure.Core.Foundations; + + @doc("Properties of an event published to an Azure EventGrid Namespace topic using the CloudEvent 1.0 Schema.") + model CloudEventEvent { + @doc("An identifier for the event. The combination of id and source must be unique for each distinct event.") + id: string; + + @doc("Identifies the context in which an event happened. The combination of id and source must be unique for each distinct event.") + source: string; + + @doc("Event data specific to the event type.") + data?: object; + + @doc("Event data specific to the event type, encoded as a base64 string.") + data_base64?: bytes; // TODO: maintain same format like event grid v1.. not using cameel dataBase64 + + @doc("Type of event related to the originating occurrence.") + type: string; + + @doc("The time (in UTC) the event was generated, in RFC3339 format.") + time?: zonedDateTime; + + @doc("The version of the CloudEvents specification which the event uses.") + specversion: string; + + @doc("Identifies the schema that data adheres to.") + dataschema?: string; + + @doc("Content type of data value.") + datacontenttype?: string; + + @doc("This describes the subject of the event in the context of the event producer (identified by source).") + subject?: string; + } + + @doc("LockToken information.") + model LockToken { + // TODO: is this correct description? is string right representation + @doc("The token used to lock the event.") + lockToken: string; + } + + @doc("Properties of the Event Broker operation.") + model BrokerProperties { + // TODO: is this correct description? is string right representation + @doc("The token used to lock the event.") + lockToken: LockToken; + + // TODO: is this needed in this context? + @doc("Delivery count.") + deliveryCount: int32; + } + + @doc("Receive operation details per Cloud Event.") + // TODO: is it OK to use ReceiveResponse? Other names: ReceiveReply, ReceiveResult, others? + model ReceiveDetails { + // TODO: is this correct description? is string right representation + @doc("The Event Broker details.") + brokerProperties: BrokerProperties; + + // TODO: is this needed in this context? + @doc("Cloud Event details.") + event: CloudEventEvent; + } + + // TODO: is it OK to use ReceiveResponse? Other names: ReceiveReply, ReceiveResult, others? + + @doc("Details of the Receive operation response.") + model ReceiveResponse { + // TODO: is this correct description? is string right representation + @doc("Array of resceiver responses, one per cloud event.") + value: ReceiveDetails[]; + } + + @doc("Details of the LockTokens informaiton. This is used by both Acknowledge and Reslease operation response.") + model LockTokensResponse { + // TODO: is this correct description? is string right representation + @doc("Array of LockToken values for failed cloud events.") + failedLockTokens: string[]; + + // TODO: is this correct description? is string right representation + @doc("Array of LockToken values for succeeded cloud events.") + succeededLockTokens: string[]; + } + + // TODO: PROBLEM.. show last one only + // TODO: USE SHARED ROUTES in the future + + // POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}:publish?api-version={apiVersion}} + + @doc("Publish Single Cloud Event to namespace topic.") + @route("/topics/{topicName}:publish", { shared: true}) + @post op PublishCloudEvent is Azure.Core.RpcOperation<{ + @doc("content type") + @header("content-type") + contentType: "application/cloudevents+json; charset=utf-8"; + + @doc("Topic Name.") + @path + topicName: string; + + @doc("Single Cloud Event being published.") + @body + event: CloudEventEvent; // NOTE: What is the behavior in V1? is it events or event? + }, {} >; + + + @doc("Publish Batch of Cloud Events to namespace topic.") + // @route("topics/{topicName}:publish?api-version={version}", {shared: true}) + @route("/topics/{topicName}:publish", { shared: true}) + @post op PublishBatchOfCloudEvents is Azure.Core.RpcOperation<{ + @doc("content type") + @header("content-type") + contentType: "application/cloudevents-batch+json; charset=utf-8"; + + @doc("Topic Name.") + @path + topicName: string; + + @doc("Array of Cloud Events being published.") + @body + events: CloudEventEvent[]; + }, {} >; + + @doc("Receive Batch of Cloud Events from EventSubscription.") + @route("/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:receive", { shared: true}) + @post op ReceiveBatchOfCloudEvents is Azure.Core.RpcOperation<{ + @doc("content type") + @header("content-type") + contentType: "application/json; charset=utf-8"; + + @doc("Topic Name.") + @path + topicName: string; + + @doc("Event Subscription Name.") + @path + eventSubscriptionName: string; + + @doc("Max Events count to be received.") + @query + maxEvents: int32; + + // TODO: this does not seem to be implemented. + @doc("Timeout in seconds.") + @query + timeout: int32; + }, ReceiveResponse >; + + // POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:acknowledge&apiVersion={apiVersion} + + @doc("Acknowledge Cloud Events.") + @route("/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:acknowledge", { shared: true}) + @post op AcknowledgeBatchOfCloudEvents is Azure.Core.RpcOperation<{ + @doc("content type") + @header("content-type") + contentType: "application/json; charset=utf-8"; + + @doc("Topic Name.") + @path + topicName: string; + + @doc("Event Subscription Name.") + @path + eventSubscriptionName: string; + + @doc("Array of LockTokens for the corresponding received Cloud Events to be acknowledged.") + @body + lockTokens: string[]; + }, LockTokensResponse >; + + // POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:release?api-version={apiVersion} + + @doc("Release Cloud Events.") + @route("/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:release", { shared: true}) + @post op ReleaseBatchOfCloudEvents is Azure.Core.RpcOperation<{ + @doc("content type") + @header("content-type") + contentType: "application/json; charset=utf-8"; + + @doc("Topic Name.") + @path + topicName: string; + + @doc("Event Subscription Name.") + @path + eventSubscriptionName: string; + + @doc("Array of LockTokens for the corresponding received Cloud Events to be acknowledged.") + @body + // TODO: is it possible to have array of values without property name? + tokens : LockToken[]; + }, LockTokensResponse >; +} From eb98a20f97ae6e170a4c71a88d6c6e8f1a9e1f6c Mon Sep 17 00:00:00 2001 From: Ashraf Hamad Date: Wed, 22 Mar 2023 16:08:22 -0700 Subject: [PATCH 03/34] update eventgrid typespec with latest eventgrid v2 operations --- specification/eventgrid/typespec/main.tsp | 403 ++++++++++------------ 1 file changed, 184 insertions(+), 219 deletions(-) diff --git a/specification/eventgrid/typespec/main.tsp b/specification/eventgrid/typespec/main.tsp index f1961025e558..456615241585 100644 --- a/specification/eventgrid/typespec/main.tsp +++ b/specification/eventgrid/typespec/main.tsp @@ -5,246 +5,212 @@ import "@azure-tools/typespec-autorest"; import "@azure-tools/typespec-azure-core"; enum ServiceApiVersions { - v2022_05_01: "2022-05-01", // TODO: should we use newer one like 2023-06-01-preview or 2023-06-01???? + v2022_05_01: "2023-06-01-preview" } -enum ProtocolType { - https: "https://", -} - -// TODO: will this be included in all operations? or should I explicitely add that? -// TODO: what is the story for SAS signature. - @useAuth( - ApiKeyAuth | OAuth2Auth<[ - { - type: OAuth2FlowType.implicit, - authorizationUrl: "https://login.microsoftonline.com/common/oauth2/v2.0/authorize", - scopes: ["https://eventgrid.azure.net/.default"], - } - ]> + ApiKeyAuth | OAuth2Auth<[{ + type: OAuth2FlowType.implicit, + authorizationUrl: "https://login.microsoftonline.com/common/oauth2/v2.0/authorize", + scopes: ["https://eventgrid.azure.net/.default"], + }]> ) + @service({ - title: "EventGridClient", // TODO: Naming - version: "2022-05-01", + title: "AzureMessagingEventGridClient", + version: "2023-06-01-preview" }) // -// Supported operations as of 3/17/2023. +// Supported operations. // // POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}:publish?api-version={apiVersion}} -// POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:receive?apiVersion={apiVersion}&timeout=60&maxEvents={maxEvents} -// POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:acknowledge&apiVersion={apiVersion} +// POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:receive?api-Version={apiVersion}&timeout=60&maxEvents={maxEvents} +// POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:acknowledge?api-Version={apiVersion} // POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:release?api-version={apiVersion} +// -// TODO: How to describe the query parameters or do we need it? @server( - "{ProtocolType}{NamespaceName}.{Region}.eventgrid.azure.net}", - "The host name of the topic", - { - // @doc(""" - // The supported endpoints of the service. This includes either: - // 1. Protocol and hostname of the topic. For example: https://namespace1.eastus-1.eventgrid.azure.net/topics/topic1 , or - // 2. protocol and hostname of the event subscription. For example: https://namespace1.eastus-1.eventgrid.azure.net/topics/topic1/eventSubscriptions/eventSubscription1 . - // """) - // Endpoint: string, // TODO: Alternative is to use url but in the future we will add other protocols here. - - @doc("Protocol type.") - @path - ProtocolType: ProtocolType, - - @doc("Namespace Name.") - @path - NamespaceName: string, - - @doc("Azure region where namespace and related nested resources are available.") - @path - Region: string, - } + "{endpoint}", + "The host name of the topic", + { + @doc("The host name of the namespace, e.g. namespaceName1.westus-1.eventgrid.azure.net") + endpoint: url, + } ) -@doc("Azure EventGrid Client") +@doc("Azure Messaging EventGrid Client") @versioned(ServiceApiVersions) -namespace AzureEventGrid { - using TypeSpec.Http; - using TypeSpec.Rest; - using TypeSpec.Versioning; - using Azure.Core; - using Azure.Core.Foundations; - - @doc("Properties of an event published to an Azure EventGrid Namespace topic using the CloudEvent 1.0 Schema.") - model CloudEventEvent { - @doc("An identifier for the event. The combination of id and source must be unique for each distinct event.") - id: string; - - @doc("Identifies the context in which an event happened. The combination of id and source must be unique for each distinct event.") - source: string; - - @doc("Event data specific to the event type.") - data?: object; - - @doc("Event data specific to the event type, encoded as a base64 string.") - data_base64?: bytes; // TODO: maintain same format like event grid v1.. not using cameel dataBase64 - - @doc("Type of event related to the originating occurrence.") - type: string; - - @doc("The time (in UTC) the event was generated, in RFC3339 format.") - time?: zonedDateTime; - - @doc("The version of the CloudEvents specification which the event uses.") - specversion: string; - - @doc("Identifies the schema that data adheres to.") - dataschema?: string; - - @doc("Content type of data value.") - datacontenttype?: string; - - @doc("This describes the subject of the event in the context of the event producer (identified by source).") - subject?: string; - } - - @doc("LockToken information.") - model LockToken { - // TODO: is this correct description? is string right representation - @doc("The token used to lock the event.") - lockToken: string; - } - - @doc("Properties of the Event Broker operation.") - model BrokerProperties { - // TODO: is this correct description? is string right representation - @doc("The token used to lock the event.") - lockToken: LockToken; - - // TODO: is this needed in this context? - @doc("Delivery count.") - deliveryCount: int32; - } - - @doc("Receive operation details per Cloud Event.") - // TODO: is it OK to use ReceiveResponse? Other names: ReceiveReply, ReceiveResult, others? - model ReceiveDetails { - // TODO: is this correct description? is string right representation - @doc("The Event Broker details.") - brokerProperties: BrokerProperties; - - // TODO: is this needed in this context? - @doc("Cloud Event details.") - event: CloudEventEvent; - } - - // TODO: is it OK to use ReceiveResponse? Other names: ReceiveReply, ReceiveResult, others? - - @doc("Details of the Receive operation response.") - model ReceiveResponse { - // TODO: is this correct description? is string right representation - @doc("Array of resceiver responses, one per cloud event.") - value: ReceiveDetails[]; - } +namespace AzureMessagingEventGrid { + using TypeSpec.Http; + using TypeSpec.Rest; + using TypeSpec.Versioning; + using Azure.Core; + using Azure.Core.Foundations; + + @doc("Properties of an event published to an Azure Messaging EventGrid Namespace topic using the CloudEvent 1.0 Schema.") + model CloudEventEvent { + @doc("An identifier for the event. The combination of id and source must be unique for each distinct event.") + id: string; + + @doc("Identifies the context in which an event happened. The combination of id and source must be unique for each distinct event.") + source: string; + + @doc("Event data specific to the event type.") + data?: object; - @doc("Details of the LockTokens informaiton. This is used by both Acknowledge and Reslease operation response.") - model LockTokensResponse { - // TODO: is this correct description? is string right representation - @doc("Array of LockToken values for failed cloud events.") - failedLockTokens: string[]; - - // TODO: is this correct description? is string right representation - @doc("Array of LockToken values for succeeded cloud events.") - succeededLockTokens: string[]; - } - - // TODO: PROBLEM.. show last one only - // TODO: USE SHARED ROUTES in the future - - // POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}:publish?api-version={apiVersion}} - - @doc("Publish Single Cloud Event to namespace topic.") - @route("/topics/{topicName}:publish", { shared: true}) - @post op PublishCloudEvent is Azure.Core.RpcOperation<{ - @doc("content type") - @header("content-type") - contentType: "application/cloudevents+json; charset=utf-8"; - - @doc("Topic Name.") - @path - topicName: string; - - @doc("Single Cloud Event being published.") - @body - event: CloudEventEvent; // NOTE: What is the behavior in V1? is it events or event? - }, {} >; - - - @doc("Publish Batch of Cloud Events to namespace topic.") - // @route("topics/{topicName}:publish?api-version={version}", {shared: true}) - @route("/topics/{topicName}:publish", { shared: true}) - @post op PublishBatchOfCloudEvents is Azure.Core.RpcOperation<{ - @doc("content type") - @header("content-type") - contentType: "application/cloudevents-batch+json; charset=utf-8"; - - @doc("Topic Name.") - @path - topicName: string; - - @doc("Array of Cloud Events being published.") - @body - events: CloudEventEvent[]; - }, {} >; - - @doc("Receive Batch of Cloud Events from EventSubscription.") - @route("/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:receive", { shared: true}) - @post op ReceiveBatchOfCloudEvents is Azure.Core.RpcOperation<{ - @doc("content type") - @header("content-type") - contentType: "application/json; charset=utf-8"; - - @doc("Topic Name.") - @path - topicName: string; - - @doc("Event Subscription Name.") - @path - eventSubscriptionName: string; - - @doc("Max Events count to be received.") - @query - maxEvents: int32; - - // TODO: this does not seem to be implemented. - @doc("Timeout in seconds.") - @query - timeout: int32; - }, ReceiveResponse >; - - // POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:acknowledge&apiVersion={apiVersion} - - @doc("Acknowledge Cloud Events.") - @route("/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:acknowledge", { shared: true}) - @post op AcknowledgeBatchOfCloudEvents is Azure.Core.RpcOperation<{ - @doc("content type") - @header("content-type") - contentType: "application/json; charset=utf-8"; - - @doc("Topic Name.") - @path - topicName: string; - - @doc("Event Subscription Name.") - @path - eventSubscriptionName: string; - - @doc("Array of LockTokens for the corresponding received Cloud Events to be acknowledged.") - @body - lockTokens: string[]; + @doc("Type of event related to the originating occurrence.") + type: string; + + @doc("The time (in UTC) the event was generated, in RFC3339 format.") + time?: zonedDateTime; + + @doc("The version of the CloudEvents specification which the event uses.") + specVersion: string; + + @doc("Identifies the schema that data adheres to.") + dataSchema?: string; + + @doc("Content type of data value.") + dataContentType?: string; + + @doc("This describes the subject of the event in the context of the event producer (identified by source).") + subject?: string; + } + + @doc("LockToken information.") + model LockToken { + @doc("The token used to lock the event.") + lockToken: string; + } + + @doc("Properties of the Event Broker operation.") + model BrokerProperties { + @doc("The token used to lock the event.") + lockToken: LockToken; + } + + @doc("Receive operation details per Cloud Event.") + model ReceiveDetails { + @doc("The Event Broker details.") + brokerProperties: BrokerProperties; + + @doc("Cloud Event details.") + event: CloudEventEvent; + } + + @doc("Details of the Receive operation response.") + model ReceiveResponse { + @doc("Array of receive responses, one per cloud event.") + value: ReceiveDetails[]; + } + + @doc("Failed LockToken information.") + model FailedLockToken { + @doc("LockToken value") + lockToken: LockToken; + + @doc("Error code") + errorCode: int32; + + @doc("Description of the error") + errorDescription: string; + } + + @doc("Details of the LockTokens information. This is used for both Acknowledge and Release operation response.") + model LockTokensResponse { + @doc("Array of LockToken values for failed cloud events.") + failedLockTokens: FailedLockToken[]; + + @doc("Array of LockToken values for succeeded cloud events.") + succeededLockTokens: string[]; + } + + // POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}:publish?api-version={apiVersion}} + + @doc("Publish Single Cloud Event to namespace topic.") + @route("/topics/{topicName}:publish", {shared: true}) + @post op PublishCloudEvent is Azure.Core.RpcOperation<{ + @doc("content type") + @header("content-type") + contentType: "application/cloudevents+json; charset=utf-8"; + + @doc("Topic Name.") + @path + topicName: string; + + @doc("Single Cloud Event being published.") + @body + event: CloudEventEvent; + }, {} >; + + + @doc("Publish Batch of Cloud Events to namespace topic.") + @route("/topics/{topicName}:publish", {shared: true}) + @post op PublishBatchOfCloudEvents is Azure.Core.RpcOperation<{ + @doc("content type") + @header("content-type") + contentType: "application/cloudevents-batch+json; charset=utf-8"; + + @doc("Topic Name.") + @path + topicName: string; + + @doc("Array of Cloud Events being published.") + @body + events: CloudEventEvent[]; + }, {} >; + + @doc("Receive Batch of Cloud Events from the Event Subscription.") + @route("/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:receive") + @post op ReceiveBatchOfCloudEvents is Azure.Core.RpcOperation<{ + @doc("content type") + @header("content-type") + contentType: "application/json; charset=utf-8"; + + @doc("Topic Name.") + @path + topicName: string; + + @doc("Event Subscription Name.") + @path + eventSubscriptionName: string; + + @doc("Max Events count to be received.") + @query + maxEvents: int32; + + @doc("Timeout value for receive operation in Seconds. Default is 60 seconds.") + @query + timeout: int32; + }, ReceiveResponse >; + + // POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:acknowledge&apiVersion={apiVersion} + + @doc("Acknowledge Cloud Events.") + @route("/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:acknowledge") + @post op AcknowledgeBatchOfCloudEvents is Azure.Core.RpcOperation<{ + @doc("content type") + @header("content-type") + contentType: "application/json; charset=utf-8"; + + @doc("Topic Name.") + @path + topicName: string; + + @doc("Event Subscription Name.") + @path + eventSubscriptionName: string; + + @doc("Array of LockTokens for the corresponding received Cloud Events to be acknowledged.") + @body + lockTokens: string[]; }, LockTokensResponse >; // POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:release?api-version={apiVersion} @doc("Release Cloud Events.") - @route("/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:release", { shared: true}) + @route("/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:release") @post op ReleaseBatchOfCloudEvents is Azure.Core.RpcOperation<{ @doc("content type") @header("content-type") @@ -260,7 +226,6 @@ namespace AzureEventGrid { @doc("Array of LockTokens for the corresponding received Cloud Events to be acknowledged.") @body - // TODO: is it possible to have array of values without property name? tokens : LockToken[]; }, LockTokensResponse >; } From c879030ab8a98b4f0b37c82f8fd56b6afe13c1f4 Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Thu, 23 Mar 2023 11:46:03 -0700 Subject: [PATCH 04/34] don't require content-type if there is no body --- specification/eventgrid/typespec/main.tsp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/specification/eventgrid/typespec/main.tsp b/specification/eventgrid/typespec/main.tsp index 456615241585..326c4cdc3d4f 100644 --- a/specification/eventgrid/typespec/main.tsp +++ b/specification/eventgrid/typespec/main.tsp @@ -164,10 +164,6 @@ namespace AzureMessagingEventGrid { @doc("Receive Batch of Cloud Events from the Event Subscription.") @route("/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:receive") @post op ReceiveBatchOfCloudEvents is Azure.Core.RpcOperation<{ - @doc("content type") - @header("content-type") - contentType: "application/json; charset=utf-8"; - @doc("Topic Name.") @path topicName: string; From 6b989da733aa6a9d7c38c04f6e13a4aadf4ff68b Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Fri, 24 Mar 2023 13:36:42 -0700 Subject: [PATCH 05/34] Update specification/eventgrid/typespec/main.tsp Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com> --- specification/eventgrid/typespec/main.tsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/eventgrid/typespec/main.tsp b/specification/eventgrid/typespec/main.tsp index 326c4cdc3d4f..f3271f47e630 100644 --- a/specification/eventgrid/typespec/main.tsp +++ b/specification/eventgrid/typespec/main.tsp @@ -142,7 +142,7 @@ namespace AzureMessagingEventGrid { @doc("Single Cloud Event being published.") @body event: CloudEventEvent; - }, {} >; + }, void >; @doc("Publish Batch of Cloud Events to namespace topic.") From 4a5f9cf6b85fff056c95702fa2cd02259a06aa15 Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Fri, 24 Mar 2023 13:36:50 -0700 Subject: [PATCH 06/34] Update specification/eventgrid/typespec/main.tsp Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com> --- specification/eventgrid/typespec/main.tsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/eventgrid/typespec/main.tsp b/specification/eventgrid/typespec/main.tsp index f3271f47e630..70dd7c0f079e 100644 --- a/specification/eventgrid/typespec/main.tsp +++ b/specification/eventgrid/typespec/main.tsp @@ -159,7 +159,7 @@ namespace AzureMessagingEventGrid { @doc("Array of Cloud Events being published.") @body events: CloudEventEvent[]; - }, {} >; + }, void >; @doc("Receive Batch of Cloud Events from the Event Subscription.") @route("/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:receive") From 55113138a296d6adb86e36c209a3dc218bc281bd Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Fri, 24 Mar 2023 14:04:01 -0700 Subject: [PATCH 07/34] changing naming of cloudevent and added in data_base64 --- specification/eventgrid/typespec/main.tsp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/specification/eventgrid/typespec/main.tsp b/specification/eventgrid/typespec/main.tsp index 70dd7c0f079e..f53142f197b8 100644 --- a/specification/eventgrid/typespec/main.tsp +++ b/specification/eventgrid/typespec/main.tsp @@ -58,6 +58,9 @@ namespace AzureMessagingEventGrid { @doc("Event data specific to the event type.") data?: object; + + @doc("Event data specific to the event type, encoded as a base64 string.") + data_base64?: bytes; @doc("Type of event related to the originating occurrence.") type: string; @@ -66,13 +69,13 @@ namespace AzureMessagingEventGrid { time?: zonedDateTime; @doc("The version of the CloudEvents specification which the event uses.") - specVersion: string; + specversion: string; @doc("Identifies the schema that data adheres to.") - dataSchema?: string; + dataschema?: string; @doc("Content type of data value.") - dataContentType?: string; + datacontenttype?: string; @doc("This describes the subject of the event in the context of the event producer (identified by source).") subject?: string; From 1a56614dead7e13109328ffb618860d794663c94 Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Fri, 24 Mar 2023 14:10:47 -0700 Subject: [PATCH 08/34] openapi.json --- .../2023-06-01-preview/openapi.json | 551 ++++++++++++++++++ 1 file changed, 551 insertions(+) create mode 100644 specification/eventgrid/typespec/tsp-output/@azure-tools/typespec-autorest/2023-06-01-preview/openapi.json diff --git a/specification/eventgrid/typespec/tsp-output/@azure-tools/typespec-autorest/2023-06-01-preview/openapi.json b/specification/eventgrid/typespec/tsp-output/@azure-tools/typespec-autorest/2023-06-01-preview/openapi.json new file mode 100644 index 000000000000..a905db192ca5 --- /dev/null +++ b/specification/eventgrid/typespec/tsp-output/@azure-tools/typespec-autorest/2023-06-01-preview/openapi.json @@ -0,0 +1,551 @@ +{ + "swagger": "2.0", + "info": { + "title": "AzureMessagingEventGridClient", + "version": "2023-06-01-preview", + "description": "Azure Messaging EventGrid Client", + "x-typespec-generated": [ + { + "emitter": "@azure-tools/typespec-autorest" + } + ] + }, + "schemes": [ + "https" + ], + "x-ms-parameterized-host": { + "hostTemplate": "{endpoint}", + "useSchemePrefix": false, + "parameters": [ + { + "name": "endpoint", + "in": "path", + "required": true, + "description": "The host name of the namespace, e.g. namespaceName1.westus-1.eventgrid.azure.net", + "type": "string", + "format": "uri", + "x-ms-skip-url-encoding": true + } + ] + }, + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "security": [ + { + "ApiKeyAuth": [] + }, + { + "OAuth2Auth": [ + "https://eventgrid.azure.net/.default" + ] + } + ], + "securityDefinitions": { + "ApiKeyAuth": { + "type": "apiKey", + "in": "header", + "name": "aeg-sas-key" + }, + "OAuth2Auth": { + "type": "oauth2", + "flow": "implicit", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/v2.0/authorize", + "scopes": { + "https://eventgrid.azure.net/.default": "" + } + } + }, + "tags": [], + "paths": { + "/topics/{topicName}:publish": { + "post": { + "operationId": "PublishBatchOfCloudEvents", + "description": "Publish Batch of Cloud Events to namespace topic.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "topicName", + "in": "path", + "required": true, + "description": "Topic Name.", + "type": "string" + }, + { + "name": "events", + "in": "body", + "required": true, + "description": "Array of Cloud Events being published.", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/CloudEventEvent" + }, + "x-typespec-name": "CloudEventEvent[]" + } + } + ], + "responses": { + "204": { + "description": "There is no content to send for this request, but the headers may be useful. " + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + } + } + }, + "consumes": [ + "application/cloudevents-batch+json; charset=utf-8" + ] + } + }, + "/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:receive": { + "post": { + "operationId": "ReceiveBatchOfCloudEvents", + "description": "Receive Batch of Cloud Events from the Event Subscription.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "topicName", + "in": "path", + "required": true, + "description": "Topic Name.", + "type": "string" + }, + { + "name": "eventSubscriptionName", + "in": "path", + "required": true, + "description": "Event Subscription Name.", + "type": "string" + }, + { + "name": "maxEvents", + "in": "query", + "required": true, + "description": "Max Events count to be received.", + "type": "integer", + "format": "int32" + }, + { + "name": "timeout", + "in": "query", + "required": true, + "description": "Timeout value for receive operation in Seconds. Default is 60 seconds.", + "type": "integer", + "format": "int32" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/ReceiveResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + } + } + } + } + }, + "/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:acknowledge": { + "post": { + "operationId": "AcknowledgeBatchOfCloudEvents", + "description": "Acknowledge Cloud Events.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "topicName", + "in": "path", + "required": true, + "description": "Topic Name.", + "type": "string" + }, + { + "name": "eventSubscriptionName", + "in": "path", + "required": true, + "description": "Event Subscription Name.", + "type": "string" + }, + { + "name": "lockTokens", + "in": "body", + "required": true, + "description": "Array of LockTokens for the corresponding received Cloud Events to be acknowledged.", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "x-typespec-name": "string[]" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/LockTokensResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + } + } + }, + "consumes": [ + "application/json; charset=utf-8" + ] + } + }, + "/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:release": { + "post": { + "operationId": "ReleaseBatchOfCloudEvents", + "description": "Release Cloud Events.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "topicName", + "in": "path", + "required": true, + "description": "Topic Name.", + "type": "string" + }, + { + "name": "eventSubscriptionName", + "in": "path", + "required": true, + "description": "Event Subscription Name.", + "type": "string" + }, + { + "name": "tokens", + "in": "body", + "required": true, + "description": "Array of LockTokens for the corresponding received Cloud Events to be acknowledged.", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/LockToken" + }, + "x-ms-identifiers": [], + "x-typespec-name": "LockToken[]" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/LockTokensResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + } + } + }, + "consumes": [ + "application/json; charset=utf-8" + ] + } + } + }, + "definitions": { + "Azure.Core.Foundations.Error": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "One of a server-defined set of error codes." + }, + "message": { + "type": "string", + "description": "A human-readable representation of the error." + }, + "target": { + "type": "string", + "description": "The target of the error." + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/Azure.Core.Foundations.Error" + }, + "x-ms-identifiers": [], + "x-typespec-name": "Azure.Core.Foundations.Error[]", + "description": "An array of details about specific errors that led to this reported error." + }, + "innererror": { + "$ref": "#/definitions/Azure.Core.Foundations.InnerError", + "description": "An object containing more specific information than the current object about the error." + } + }, + "description": "The error object.", + "required": [ + "code", + "message", + "details" + ] + }, + "Azure.Core.Foundations.ErrorResponse": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Azure.Core.Foundations.Error", + "description": "The error object." + } + }, + "description": "A response containing error details.", + "required": [ + "error" + ] + }, + "Azure.Core.Foundations.InnerError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "One of a server-defined set of error codes." + }, + "innererror": { + "$ref": "#/definitions/Azure.Core.Foundations.InnerError", + "description": "Inner error." + } + }, + "description": "An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.", + "required": [ + "code" + ] + }, + "BrokerProperties": { + "type": "object", + "properties": { + "lockToken": { + "$ref": "#/definitions/LockToken", + "description": "The token used to lock the event." + } + }, + "description": "Properties of the Event Broker operation.", + "required": [ + "lockToken" + ] + }, + "CloudEventEvent": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "An identifier for the event. The combination of id and source must be unique for each distinct event." + }, + "source": { + "type": "string", + "description": "Identifies the context in which an event happened. The combination of id and source must be unique for each distinct event." + }, + "data": { + "$ref": "#/definitions/object", + "description": "Event data specific to the event type." + }, + "data_base64": { + "type": "string", + "format": "byte", + "description": "Event data specific to the event type, encoded as a base64 string." + }, + "type": { + "type": "string", + "description": "Type of event related to the originating occurrence." + }, + "time": { + "type": "string", + "format": "date-time", + "description": "The time (in UTC) the event was generated, in RFC3339 format." + }, + "specversion": { + "type": "string", + "description": "The version of the CloudEvents specification which the event uses." + }, + "dataschema": { + "type": "string", + "description": "Identifies the schema that data adheres to." + }, + "datacontenttype": { + "type": "string", + "description": "Content type of data value." + }, + "subject": { + "type": "string", + "description": "This describes the subject of the event in the context of the event producer (identified by source)." + } + }, + "description": "Properties of an event published to an Azure Messaging EventGrid Namespace topic using the CloudEvent 1.0 Schema.", + "required": [ + "id", + "source", + "type", + "specversion" + ] + }, + "FailedLockToken": { + "type": "object", + "properties": { + "lockToken": { + "$ref": "#/definitions/LockToken", + "description": "LockToken value" + }, + "errorCode": { + "type": "integer", + "format": "int32", + "description": "Error code" + }, + "errorDescription": { + "type": "string", + "description": "Description of the error" + } + }, + "description": "Failed LockToken information.", + "required": [ + "lockToken", + "errorCode", + "errorDescription" + ] + }, + "LockToken": { + "type": "object", + "properties": { + "lockToken": { + "type": "string", + "description": "The token used to lock the event." + } + }, + "description": "LockToken information.", + "required": [ + "lockToken" + ] + }, + "LockTokensResponse": { + "type": "object", + "properties": { + "failedLockTokens": { + "type": "array", + "items": { + "$ref": "#/definitions/FailedLockToken" + }, + "x-ms-identifiers": [], + "x-typespec-name": "FailedLockToken[]", + "description": "Array of LockToken values for failed cloud events." + }, + "succeededLockTokens": { + "type": "array", + "items": { + "type": "string" + }, + "x-typespec-name": "string[]", + "description": "Array of LockToken values for succeeded cloud events." + } + }, + "description": "Details of the LockTokens information. This is used for both Acknowledge and Release operation response.", + "required": [ + "failedLockTokens", + "succeededLockTokens" + ] + }, + "ReceiveDetails": { + "type": "object", + "properties": { + "brokerProperties": { + "$ref": "#/definitions/BrokerProperties", + "description": "The Event Broker details." + }, + "event": { + "$ref": "#/definitions/CloudEventEvent", + "description": "Cloud Event details." + } + }, + "description": "Receive operation details per Cloud Event.", + "required": [ + "brokerProperties", + "event" + ] + }, + "ReceiveResponse": { + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/ReceiveDetails" + }, + "x-ms-identifiers": [], + "x-typespec-name": "ReceiveDetails[]", + "description": "Array of receive responses, one per cloud event." + } + }, + "description": "Details of the Receive operation response.", + "required": [ + "value" + ] + }, + "object": { + "type": "object", + "properties": {} + } + }, + "parameters": { + "Azure.Core.Foundations.ApiVersionParameter": { + "name": "api-version", + "in": "query", + "required": true, + "description": "The API version to use for this operation.", + "x-ms-client-name": "apiVersion", + "minLength": 1, + "type": "string", + "x-ms-parameter-location": "method" + } + } +} From c724eed9e8962cff7db4c93dbed55959fb975fcb Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Fri, 24 Mar 2023 15:43:26 -0700 Subject: [PATCH 09/34] Update specification/eventgrid/typespec/main.tsp Co-authored-by: Libba Lawrence --- specification/eventgrid/typespec/main.tsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/eventgrid/typespec/main.tsp b/specification/eventgrid/typespec/main.tsp index f53142f197b8..ea562bfcf724 100644 --- a/specification/eventgrid/typespec/main.tsp +++ b/specification/eventgrid/typespec/main.tsp @@ -145,7 +145,7 @@ namespace AzureMessagingEventGrid { @doc("Single Cloud Event being published.") @body event: CloudEventEvent; - }, void >; + }, OkResponse>; @doc("Publish Batch of Cloud Events to namespace topic.") From f91ee18b7d53ded11cda5d43a9da8368bf597948 Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Fri, 24 Mar 2023 15:43:46 -0700 Subject: [PATCH 10/34] Update specification/eventgrid/typespec/main.tsp Co-authored-by: Libba Lawrence --- specification/eventgrid/typespec/main.tsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/eventgrid/typespec/main.tsp b/specification/eventgrid/typespec/main.tsp index ea562bfcf724..060d6477581a 100644 --- a/specification/eventgrid/typespec/main.tsp +++ b/specification/eventgrid/typespec/main.tsp @@ -162,7 +162,7 @@ namespace AzureMessagingEventGrid { @doc("Array of Cloud Events being published.") @body events: CloudEventEvent[]; - }, void >; + }, OkResponse>; @doc("Receive Batch of Cloud Events from the Event Subscription.") @route("/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:receive") From eb01ed42507dbf42f8b79d8dbe31325d904f0db6 Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Fri, 24 Mar 2023 15:44:06 -0700 Subject: [PATCH 11/34] Update specification/eventgrid/typespec/main.tsp Co-authored-by: Libba Lawrence --- specification/eventgrid/typespec/main.tsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/eventgrid/typespec/main.tsp b/specification/eventgrid/typespec/main.tsp index 060d6477581a..34ccae29c293 100644 --- a/specification/eventgrid/typespec/main.tsp +++ b/specification/eventgrid/typespec/main.tsp @@ -182,7 +182,7 @@ namespace AzureMessagingEventGrid { @doc("Timeout value for receive operation in Seconds. Default is 60 seconds.") @query timeout: int32; - }, ReceiveResponse >; + }, ReceiveResponse & CreatedResponse >; // POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:acknowledge&apiVersion={apiVersion} From 69ccc41b6aa3187da40345bb340e4fbee60d4a07 Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Fri, 24 Mar 2023 17:01:00 -0700 Subject: [PATCH 12/34] lockTokens format, updated json, optional? params --- .../main.tsp | 12 ++++++-- .../2023-06-01-preview/openapi.json | 29 ++++++++++++++----- 2 files changed, 31 insertions(+), 10 deletions(-) rename specification/eventgrid/{typespec => Azure.Messaging.EventGrid}/main.tsp (97%) rename specification/eventgrid/{typespec => Azure.Messaging.EventGrid}/tsp-output/@azure-tools/typespec-autorest/2023-06-01-preview/openapi.json (96%) diff --git a/specification/eventgrid/typespec/main.tsp b/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp similarity index 97% rename from specification/eventgrid/typespec/main.tsp rename to specification/eventgrid/Azure.Messaging.EventGrid/main.tsp index f53142f197b8..7b5f8eab2be7 100644 --- a/specification/eventgrid/typespec/main.tsp +++ b/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp @@ -129,6 +129,12 @@ namespace AzureMessagingEventGrid { succeededLockTokens: string[]; } + @doc("Lock token input formatting.") + model LockTokenInput { + @doc("LockToken") + lockTokens: string[]; + } + // POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}:publish?api-version={apiVersion}} @doc("Publish Single Cloud Event to namespace topic.") @@ -177,11 +183,11 @@ namespace AzureMessagingEventGrid { @doc("Max Events count to be received.") @query - maxEvents: int32; + maxEvents?: int32 = 1; @doc("Timeout value for receive operation in Seconds. Default is 60 seconds.") @query - timeout: int32; + timeout?: int32 = 60; }, ReceiveResponse >; // POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:acknowledge&apiVersion={apiVersion} @@ -203,7 +209,7 @@ namespace AzureMessagingEventGrid { @doc("Array of LockTokens for the corresponding received Cloud Events to be acknowledged.") @body - lockTokens: string[]; + lockTokens: LockTokenInput; }, LockTokensResponse >; // POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:release?api-version={apiVersion} diff --git a/specification/eventgrid/typespec/tsp-output/@azure-tools/typespec-autorest/2023-06-01-preview/openapi.json b/specification/eventgrid/Azure.Messaging.EventGrid/tsp-output/@azure-tools/typespec-autorest/2023-06-01-preview/openapi.json similarity index 96% rename from specification/eventgrid/typespec/tsp-output/@azure-tools/typespec-autorest/2023-06-01-preview/openapi.json rename to specification/eventgrid/Azure.Messaging.EventGrid/tsp-output/@azure-tools/typespec-autorest/2023-06-01-preview/openapi.json index a905db192ca5..b170e2b8f609 100644 --- a/specification/eventgrid/typespec/tsp-output/@azure-tools/typespec-autorest/2023-06-01-preview/openapi.json +++ b/specification/eventgrid/Azure.Messaging.EventGrid/tsp-output/@azure-tools/typespec-autorest/2023-06-01-preview/openapi.json @@ -137,16 +137,18 @@ { "name": "maxEvents", "in": "query", - "required": true, + "required": false, "description": "Max Events count to be received.", + "default": 1, "type": "integer", "format": "int32" }, { "name": "timeout", "in": "query", - "required": true, + "required": false, "description": "Timeout value for receive operation in Seconds. Default is 60 seconds.", + "default": 60, "type": "integer", "format": "int32" } @@ -201,11 +203,7 @@ "required": true, "description": "Array of LockTokens for the corresponding received Cloud Events to be acknowledged.", "schema": { - "type": "array", - "items": { - "type": "string" - }, - "x-typespec-name": "string[]" + "$ref": "#/definitions/LockTokenInput" } } ], @@ -468,6 +466,23 @@ "lockToken" ] }, + "LockTokenInput": { + "type": "object", + "properties": { + "lockTokens": { + "type": "array", + "items": { + "type": "string" + }, + "x-typespec-name": "string[]", + "description": "LockToken" + } + }, + "description": "Lock token input formatting.", + "required": [ + "lockTokens" + ] + }, "LockTokensResponse": { "type": "object", "properties": { From c2d4c68d531871c9ecbff4e74d2f557b5d4cb659 Mon Sep 17 00:00:00 2001 From: Ashraf Hamad Date: Tue, 28 Mar 2023 10:46:48 -0700 Subject: [PATCH 13/34] address code review comments --- specification/eventgrid/typespec/main.tsp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/eventgrid/typespec/main.tsp b/specification/eventgrid/typespec/main.tsp index 456615241585..94ae13f8f44e 100644 --- a/specification/eventgrid/typespec/main.tsp +++ b/specification/eventgrid/typespec/main.tsp @@ -5,11 +5,11 @@ import "@azure-tools/typespec-autorest"; import "@azure-tools/typespec-azure-core"; enum ServiceApiVersions { - v2022_05_01: "2023-06-01-preview" + v2023_06_01_preview: "2023-06-01-preview" } @useAuth( - ApiKeyAuth | OAuth2Auth<[{ + ApiKeyAuth | OAuth2Auth<[{ type: OAuth2FlowType.implicit, authorizationUrl: "https://login.microsoftonline.com/common/oauth2/v2.0/authorize", scopes: ["https://eventgrid.azure.net/.default"], From 15dcceca3da149921be45a6f73fb3a200e6cd936 Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Wed, 12 Apr 2023 09:04:41 -0700 Subject: [PATCH 14/34] name_change --- specification/eventgrid/Azure.Messaging.EventGrid/main.tsp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp b/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp index 3c1a000e7de7..cf3428a4456e 100644 --- a/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp +++ b/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp @@ -17,7 +17,7 @@ enum ServiceApiVersions { ) @service({ - title: "AzureMessagingEventGridClient", + title: "Azure.Messaging.EventGridMessagingClient", version: "2023-06-01-preview" }) @@ -41,7 +41,7 @@ enum ServiceApiVersions { @doc("Azure Messaging EventGrid Client") @versioned(ServiceApiVersions) -namespace AzureMessagingEventGrid { +namespace Azure.Messaging.EventGridMessaging { using TypeSpec.Http; using TypeSpec.Rest; using TypeSpec.Versioning; From 13f6949cfbf5296ae6770774569ebf65defc7bb8 Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Wed, 12 Apr 2023 11:03:07 -0700 Subject: [PATCH 15/34] add @internal for python --- .../eventgrid/Azure.Messaging.EventGrid/main.tsp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp b/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp index cf3428a4456e..9f7dfd245af6 100644 --- a/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp +++ b/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp @@ -3,6 +3,7 @@ import "@typespec/rest"; import "@typespec/versioning"; import "@azure-tools/typespec-autorest"; import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-client-generator-core"; enum ServiceApiVersions { v2023_06_01_preview: "2023-06-01-preview" @@ -47,8 +48,10 @@ namespace Azure.Messaging.EventGridMessaging { using TypeSpec.Versioning; using Azure.Core; using Azure.Core.Foundations; + using Azure.ClientGenerator.Core; @doc("Properties of an event published to an Azure Messaging EventGrid Namespace topic using the CloudEvent 1.0 Schema.") + @internal model CloudEventEvent { @doc("An identifier for the event. The combination of id and source must be unique for each distinct event.") id: string; @@ -93,7 +96,8 @@ namespace Azure.Messaging.EventGridMessaging { lockToken: LockToken; } - @doc("Receive operation details per Cloud Event.") + @doc("Receive operation details per Cloud Event.") + @internal model ReceiveDetails { @doc("The Event Broker details.") brokerProperties: BrokerProperties; @@ -131,7 +135,7 @@ namespace Azure.Messaging.EventGridMessaging { @doc("Lock token input formatting.") model LockTokenInput { - @doc("LockToken") + @doc("LockTokens") lockTokens: string[]; } @@ -139,6 +143,7 @@ namespace Azure.Messaging.EventGridMessaging { @doc("Publish Single Cloud Event to namespace topic.") @route("/topics/{topicName}:publish", {shared: true}) + @internal @post op PublishCloudEvent is Azure.Core.RpcOperation<{ @doc("content type") @header("content-type") @@ -156,6 +161,7 @@ namespace Azure.Messaging.EventGridMessaging { @doc("Publish Batch of Cloud Events to namespace topic.") @route("/topics/{topicName}:publish", {shared: true}) + @internal @post op PublishBatchOfCloudEvents is Azure.Core.RpcOperation<{ @doc("content type") @header("content-type") @@ -172,6 +178,7 @@ namespace Azure.Messaging.EventGridMessaging { @doc("Receive Batch of Cloud Events from the Event Subscription.") @route("/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:receive") + @internal @post op ReceiveBatchOfCloudEvents is Azure.Core.RpcOperation<{ @doc("Topic Name.") @path From 069bafb35d8787a6bf0fc267a1f2010ada70fe70 Mon Sep 17 00:00:00 2001 From: Libba Lawrence Date: Wed, 12 Apr 2023 13:24:48 -0700 Subject: [PATCH 16/34] Update specification/eventgrid/Azure.Messaging.EventGrid/main.tsp Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com> --- specification/eventgrid/Azure.Messaging.EventGrid/main.tsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp b/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp index 9f7dfd245af6..c641d6a8b303 100644 --- a/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp +++ b/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp @@ -42,7 +42,7 @@ enum ServiceApiVersions { @doc("Azure Messaging EventGrid Client") @versioned(ServiceApiVersions) -namespace Azure.Messaging.EventGridMessaging { +namespace Azure.Messaging.EventGrid { using TypeSpec.Http; using TypeSpec.Rest; using TypeSpec.Versioning; From 5d216327d4df9c2978b4f22812ebe39036258f64 Mon Sep 17 00:00:00 2001 From: Libba Lawrence Date: Thu, 13 Apr 2023 09:36:45 -0700 Subject: [PATCH 17/34] move @internal to client.tsp (#23538) --- .../eventgrid/Azure.Messaging.EventGrid/client.tsp | 10 ++++++++++ .../eventgrid/Azure.Messaging.EventGrid/main.tsp | 7 ------- 2 files changed, 10 insertions(+), 7 deletions(-) create mode 100644 specification/eventgrid/Azure.Messaging.EventGrid/client.tsp diff --git a/specification/eventgrid/Azure.Messaging.EventGrid/client.tsp b/specification/eventgrid/Azure.Messaging.EventGrid/client.tsp new file mode 100644 index 000000000000..78097ec2e6b6 --- /dev/null +++ b/specification/eventgrid/Azure.Messaging.EventGrid/client.tsp @@ -0,0 +1,10 @@ +import "@azure-tools/typespec-client-generator-core"; +import "./main.tsp"; + +using Azure.ClientGenerator.Core; + +@@internal(Azure.Messaging.EventGrid.CloudEventEvent); +@@internal(Azure.Messaging.EventGrid.ReceiveDetails); +@@internal(Azure.Messaging.EventGrid.PublishBatchOfCloudEvents); +@@internal(Azure.Messaging.EventGrid.PublishCloudEvent); +@@internal(Azure.Messaging.EventGrid.ReceiveBatchOfCloudEvents); diff --git a/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp b/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp index c641d6a8b303..d2f8d0b197e9 100644 --- a/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp +++ b/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp @@ -3,7 +3,6 @@ import "@typespec/rest"; import "@typespec/versioning"; import "@azure-tools/typespec-autorest"; import "@azure-tools/typespec-azure-core"; -import "@azure-tools/typespec-client-generator-core"; enum ServiceApiVersions { v2023_06_01_preview: "2023-06-01-preview" @@ -48,10 +47,8 @@ namespace Azure.Messaging.EventGrid { using TypeSpec.Versioning; using Azure.Core; using Azure.Core.Foundations; - using Azure.ClientGenerator.Core; @doc("Properties of an event published to an Azure Messaging EventGrid Namespace topic using the CloudEvent 1.0 Schema.") - @internal model CloudEventEvent { @doc("An identifier for the event. The combination of id and source must be unique for each distinct event.") id: string; @@ -97,7 +94,6 @@ namespace Azure.Messaging.EventGrid { } @doc("Receive operation details per Cloud Event.") - @internal model ReceiveDetails { @doc("The Event Broker details.") brokerProperties: BrokerProperties; @@ -143,7 +139,6 @@ namespace Azure.Messaging.EventGrid { @doc("Publish Single Cloud Event to namespace topic.") @route("/topics/{topicName}:publish", {shared: true}) - @internal @post op PublishCloudEvent is Azure.Core.RpcOperation<{ @doc("content type") @header("content-type") @@ -161,7 +156,6 @@ namespace Azure.Messaging.EventGrid { @doc("Publish Batch of Cloud Events to namespace topic.") @route("/topics/{topicName}:publish", {shared: true}) - @internal @post op PublishBatchOfCloudEvents is Azure.Core.RpcOperation<{ @doc("content type") @header("content-type") @@ -178,7 +172,6 @@ namespace Azure.Messaging.EventGrid { @doc("Receive Batch of Cloud Events from the Event Subscription.") @route("/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:receive") - @internal @post op ReceiveBatchOfCloudEvents is Azure.Core.RpcOperation<{ @doc("Topic Name.") @path From 17fd291e8c771423e75a209942b25c3adbbed913 Mon Sep 17 00:00:00 2001 From: Libba Lawrence Date: Fri, 14 Apr 2023 12:48:21 -0700 Subject: [PATCH 18/34] rename (#23565) --- specification/eventgrid/Azure.Messaging.EventGrid/main.tsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp b/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp index d2f8d0b197e9..55742128446b 100644 --- a/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp +++ b/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp @@ -17,7 +17,7 @@ enum ServiceApiVersions { ) @service({ - title: "Azure.Messaging.EventGridMessagingClient", + title: "Azure.Messaging.EventGridClient", version: "2023-06-01-preview" }) From 663b3482ea7d724a5204075a346d74d62e4731b3 Mon Sep 17 00:00:00 2001 From: Libba Lawrence Date: Fri, 14 Apr 2023 13:23:40 -0700 Subject: [PATCH 19/34] [EventGrid Typespec] breaking changes with april release of typespec (#23539) * breaking changes with april release of typespec * unknown type --- specification/eventgrid/Azure.Messaging.EventGrid/main.tsp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp b/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp index 55742128446b..173d0a67fa53 100644 --- a/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp +++ b/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp @@ -57,7 +57,7 @@ namespace Azure.Messaging.EventGrid { source: string; @doc("Event data specific to the event type.") - data?: object; + data?: unknown; @doc("Event data specific to the event type, encoded as a base64 string.") data_base64?: bytes; @@ -66,7 +66,7 @@ namespace Azure.Messaging.EventGrid { type: string; @doc("The time (in UTC) the event was generated, in RFC3339 format.") - time?: zonedDateTime; + time?: utcDateTime; @doc("The version of the CloudEvents specification which the event uses.") specversion: string; From fd1fd9deb536c896574e2b1314f480472a56e8b8 Mon Sep 17 00:00:00 2001 From: Libba Lawrence Date: Mon, 24 Apr 2023 15:28:28 -0700 Subject: [PATCH 20/34] [EG Typespec] Update Release behavior (#23699) * update behavior * just behavior --- specification/eventgrid/Azure.Messaging.EventGrid/main.tsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp b/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp index 173d0a67fa53..e1a828eb56e5 100644 --- a/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp +++ b/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp @@ -231,6 +231,6 @@ namespace Azure.Messaging.EventGrid { @doc("Array of LockTokens for the corresponding received Cloud Events to be acknowledged.") @body - tokens : LockToken[]; + tokens : LockTokenInput; }, LockTokensResponse >; } From 02ea7deb5040573a9f2400e9f213e4c2074b0dac Mon Sep 17 00:00:00 2001 From: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com> Date: Tue, 25 Apr 2023 13:22:16 -0700 Subject: [PATCH 21/34] Add tspconfig and remove AAD auth (#23717) * add tspconfig * add namespace * remove oauth --- specification/eventgrid/Azure.Messaging.EventGrid/main.tsp | 6 +----- .../eventgrid/Azure.Messaging.EventGrid/tspconfig.yaml | 6 ++++++ 2 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 specification/eventgrid/Azure.Messaging.EventGrid/tspconfig.yaml diff --git a/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp b/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp index e1a828eb56e5..d507d0a4e026 100644 --- a/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp +++ b/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp @@ -9,11 +9,7 @@ enum ServiceApiVersions { } @useAuth( - ApiKeyAuth | OAuth2Auth<[{ - type: OAuth2FlowType.implicit, - authorizationUrl: "https://login.microsoftonline.com/common/oauth2/v2.0/authorize", - scopes: ["https://eventgrid.azure.net/.default"], - }]> + ApiKeyAuth ) @service({ diff --git a/specification/eventgrid/Azure.Messaging.EventGrid/tspconfig.yaml b/specification/eventgrid/Azure.Messaging.EventGrid/tspconfig.yaml new file mode 100644 index 000000000000..d99c4a42088c --- /dev/null +++ b/specification/eventgrid/Azure.Messaging.EventGrid/tspconfig.yaml @@ -0,0 +1,6 @@ +options: + # Uncomment this line and add "@azure-tools/typespec-csharp" to your package.json to generate C# code + "@azure-tools/typespec-csharp": + model-namespace: false + generate-convenience-methods: false + namespace: Azure.Messaging.EventGrid.Namespaces \ No newline at end of file From 3806bc1b41ad13955fa446b11e4cde040eed397c Mon Sep 17 00:00:00 2001 From: Libba Lawrence Date: Wed, 26 Apr 2023 16:34:57 -0700 Subject: [PATCH 22/34] [EG TypeSpec] Archboard Comments (#23696) * refactoring off of apiview * keep as int * no duration * aligning ack and release * remove behavioral change * ack to release * initial naming changes * Update ReleaseResult doc Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com> * Update AckResult doc Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com> * versioning twice-- remove one instance --------- Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com> --- .../Azure.Messaging.EventGrid/client.tsp | 6 +- .../Azure.Messaging.EventGrid/main.tsp | 55 ++++++++++++------- 2 files changed, 36 insertions(+), 25 deletions(-) diff --git a/specification/eventgrid/Azure.Messaging.EventGrid/client.tsp b/specification/eventgrid/Azure.Messaging.EventGrid/client.tsp index 78097ec2e6b6..478dfa16ec15 100644 --- a/specification/eventgrid/Azure.Messaging.EventGrid/client.tsp +++ b/specification/eventgrid/Azure.Messaging.EventGrid/client.tsp @@ -3,8 +3,6 @@ import "./main.tsp"; using Azure.ClientGenerator.Core; -@@internal(Azure.Messaging.EventGrid.CloudEventEvent); -@@internal(Azure.Messaging.EventGrid.ReceiveDetails); -@@internal(Azure.Messaging.EventGrid.PublishBatchOfCloudEvents); +@@internal(Azure.Messaging.EventGrid.PublishCloudEvents); @@internal(Azure.Messaging.EventGrid.PublishCloudEvent); -@@internal(Azure.Messaging.EventGrid.ReceiveBatchOfCloudEvents); +@@internal(Azure.Messaging.EventGrid.ReceiveCloudEvents); \ No newline at end of file diff --git a/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp b/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp index d507d0a4e026..40ee3ff09ed4 100644 --- a/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp +++ b/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp @@ -1,7 +1,6 @@ import "@typespec/http"; import "@typespec/rest"; import "@typespec/versioning"; -import "@azure-tools/typespec-autorest"; import "@azure-tools/typespec-azure-core"; enum ServiceApiVersions { @@ -14,7 +13,6 @@ enum ServiceApiVersions { @service({ title: "Azure.Messaging.EventGridClient", - version: "2023-06-01-preview" }) // @@ -99,7 +97,7 @@ namespace Azure.Messaging.EventGrid { } @doc("Details of the Receive operation response.") - model ReceiveResponse { + model ReceiveResult { @doc("Array of receive responses, one per cloud event.") value: ReceiveDetails[]; } @@ -116,8 +114,8 @@ namespace Azure.Messaging.EventGrid { errorDescription: string; } - @doc("Details of the LockTokens information. This is used for both Acknowledge and Release operation response.") - model LockTokensResponse { + @doc("The result of the Acknowledge operation.") + model AcknowledgeResult { @doc("Array of LockToken values for failed cloud events.") failedLockTokens: FailedLockToken[]; @@ -125,9 +123,24 @@ namespace Azure.Messaging.EventGrid { succeededLockTokens: string[]; } - @doc("Lock token input formatting.") - model LockTokenInput { - @doc("LockTokens") + @doc("The result of the Release operation.") + model ReleaseResult { + @doc("Array of LockToken values for failed cloud events.") + failedLockTokens: FailedLockToken[]; + + @doc("Array of LockToken values for succeeded cloud events.") + succeededLockTokens: string[]; + } + + @doc("Array of lock token strings for the corresponding received Cloud Events to be released.") + model ReleaseOptions { + @doc("String array of lock tokens.") + lockTokens: string[]; + } + + @doc("Array of lock token strings for the corresponding received Cloud Events to be acknowledged.") + model AcknowledgeOptions { + @doc("String array of lock tokens.") lockTokens: string[]; } @@ -152,7 +165,7 @@ namespace Azure.Messaging.EventGrid { @doc("Publish Batch of Cloud Events to namespace topic.") @route("/topics/{topicName}:publish", {shared: true}) - @post op PublishBatchOfCloudEvents is Azure.Core.RpcOperation<{ + @post op PublishCloudEvents is Azure.Core.RpcOperation<{ @doc("content type") @header("content-type") contentType: "application/cloudevents-batch+json; charset=utf-8"; @@ -168,7 +181,7 @@ namespace Azure.Messaging.EventGrid { @doc("Receive Batch of Cloud Events from the Event Subscription.") @route("/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:receive") - @post op ReceiveBatchOfCloudEvents is Azure.Core.RpcOperation<{ + @post op ReceiveCloudEvents is Azure.Core.RpcOperation<{ @doc("Topic Name.") @path topicName: string; @@ -182,15 +195,15 @@ namespace Azure.Messaging.EventGrid { maxEvents?: int32 = 1; @doc("Timeout value for receive operation in Seconds. Default is 60 seconds.") - @query - timeout?: int32 =60; - }, ReceiveResponse & CreatedResponse >; + @query({name:"timeout"}) + maxWaitTime?: int32 = 60; + }, ReceiveResult & CreatedResponse >; // POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:acknowledge&apiVersion={apiVersion} @doc("Acknowledge Cloud Events.") @route("/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:acknowledge") - @post op AcknowledgeBatchOfCloudEvents is Azure.Core.RpcOperation<{ + @post op AcknowledgeCloudEvents is Azure.Core.RpcOperation<{ @doc("content type") @header("content-type") contentType: "application/json; charset=utf-8"; @@ -203,16 +216,16 @@ namespace Azure.Messaging.EventGrid { @path eventSubscriptionName: string; - @doc("Array of LockTokens for the corresponding received Cloud Events to be acknowledged.") + @doc("AcknowledgeOptions.") @body - lockTokens: LockTokenInput; - }, LockTokensResponse >; + lockTokens: AcknowledgeOptions; + }, AcknowledgeResult >; // POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:release?api-version={apiVersion} @doc("Release Cloud Events.") @route("/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:release") - @post op ReleaseBatchOfCloudEvents is Azure.Core.RpcOperation<{ + @post op ReleaseCloudEvents is Azure.Core.RpcOperation<{ @doc("content type") @header("content-type") contentType: "application/json; charset=utf-8"; @@ -225,8 +238,8 @@ namespace Azure.Messaging.EventGrid { @path eventSubscriptionName: string; - @doc("Array of LockTokens for the corresponding received Cloud Events to be acknowledged.") + @doc("ReleaseOptions") @body - tokens : LockTokenInput; - }, LockTokensResponse >; + lockTokens : ReleaseOptions; + }, ReleaseResult >; } From 799d10cb4f10a2df1ad574916a935744bbfd3a5a Mon Sep 17 00:00:00 2001 From: Ashraf Hamad Date: Thu, 27 Apr 2023 18:47:05 -0700 Subject: [PATCH 23/34] Address couple of stewardship team feedback. These include: 1. Rename CloudEventEvent to simply CloudEvent, 2. Add more description to the operations including the possible erorr codes, 3. Add PublishResult with empty Json object as successful response for the Publish operation, 4. Others. --- .../Azure.Messaging.EventGrid/main.tsp | 49 +++++++++++-------- 1 file changed, 29 insertions(+), 20 deletions(-) diff --git a/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp b/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp index 40ee3ff09ed4..0dab65717a7f 100644 --- a/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp +++ b/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp @@ -26,7 +26,7 @@ enum ServiceApiVersions { @server( "{endpoint}", - "The host name of the topic", + "The host name of the namespace", { @doc("The host name of the namespace, e.g. namespaceName1.westus-1.eventgrid.azure.net") endpoint: url, @@ -43,7 +43,7 @@ namespace Azure.Messaging.EventGrid { using Azure.Core.Foundations; @doc("Properties of an event published to an Azure Messaging EventGrid Namespace topic using the CloudEvent 1.0 Schema.") - model CloudEventEvent { + model CloudEvent { @doc("An identifier for the event. The combination of id and source must be unique for each distinct event.") id: string; @@ -93,7 +93,7 @@ namespace Azure.Messaging.EventGrid { brokerProperties: BrokerProperties; @doc("Cloud Event details.") - event: CloudEventEvent; + event: CloudEvent; } @doc("Details of the Receive operation response.") @@ -107,13 +107,16 @@ namespace Azure.Messaging.EventGrid { @doc("LockToken value") lockToken: LockToken; - @doc("Error code") + @doc("Error code related to the token. Example of such error codes are BadToken: which indicates the Token is not formatted correctly, TokenLost: which indicates that token is not found, and InternalServerError: For any internal server errors.") errorCode: int32; - @doc("Description of the error") + @doc("Description of the token error.") errorDescription: string; } - + + @doc("The result of the Publish operation.") + model PublishResult {} + @doc("The result of the Acknowledge operation.") model AcknowledgeResult { @doc("Array of LockToken values for failed cloud events.") @@ -144,9 +147,10 @@ namespace Azure.Messaging.EventGrid { lockTokens: string[]; } + // Publish Operation: // POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}:publish?api-version={apiVersion}} - @doc("Publish Single Cloud Event to namespace topic.") + @doc("Publish Single Cloud Event to namespace topic. In case of success, the server responds with an HTTP 200 status code with an empty JSON object in response. Otherwise, the server can return various error codes. For example, 401: which indicates authorization failure, 403: which indicates quota exceeded or message is too large, 410: which indicates that specific topic is not found, 400: for bad request, and 500: for internal server error. ") @route("/topics/{topicName}:publish", {shared: true}) @post op PublishCloudEvent is Azure.Core.RpcOperation<{ @doc("content type") @@ -159,12 +163,11 @@ namespace Azure.Messaging.EventGrid { @doc("Single Cloud Event being published.") @body - event: CloudEventEvent; - }, OkResponse>; + event: CloudEvent; + }, PublishResult>; - @doc("Publish Batch of Cloud Events to namespace topic.") - @route("/topics/{topicName}:publish", {shared: true}) + @doc("Publish Batch Cloud Event to namespace topic. In case of success, the server responds with an HTTP 200 status code with an empty JSON object in response. Otherwise, the server can return various error codes. For example, 401: which indicates authorization failure, 403: which indicates quota exceeded or message is too large, 410: which indicates that specific topic is not found, 400: for bad request, and 500: for internal server error. ") @route("/topics/{topicName}:publish", {shared: true}) @post op PublishCloudEvents is Azure.Core.RpcOperation<{ @doc("content type") @header("content-type") @@ -176,8 +179,11 @@ namespace Azure.Messaging.EventGrid { @doc("Array of Cloud Events being published.") @body - events: CloudEventEvent[]; - }, OkResponse>; + events: CloudEvent[]; + }, PublishResult>; + + // Receive Operation: + // POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:receive?api-Version={apiVersion}&timeout=60&maxEvents={maxEvents} @doc("Receive Batch of Cloud Events from the Event Subscription.") @route("/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:receive") @@ -190,18 +196,20 @@ namespace Azure.Messaging.EventGrid { @path eventSubscriptionName: string; - @doc("Max Events count to be received.") + @doc("Max Events count to be received. Minimum value is 1, while maximum value is 100 seconds. If not specified, the default value is 1.") @query maxEvents?: int32 = 1; - @doc("Timeout value for receive operation in Seconds. Default is 60 seconds.") + @doc("Timeout value for receive operation in Seconds. It is the time in seconds that the server approximately waits for the availability of an event and responds to the request. If an event is available, the broker responds immediately to the client. Minimum value is 10 seconds, while maximum value is 120 seconds. If not specified, the default value is 60 seconds.") @query({name:"timeout"}) maxWaitTime?: int32 = 60; - }, ReceiveResult & CreatedResponse >; + }, ReceiveResult>; + // Acknowledge Operation: // POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:acknowledge&apiVersion={apiVersion} - @doc("Acknowledge Cloud Events.") + @doc("Acknowledge batch of Cloud Events. The server responds with an HTTP 200 status code if at least one event is successfully acknowledged. The response body will include the set of successfully acknowledged lockTokens, along with other failed lockTokens with their corresponding error information. Successfully acknowledged events will no longer be available to any consumer.") + @route("/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:acknowledge") @post op AcknowledgeCloudEvents is Azure.Core.RpcOperation<{ @doc("content type") @@ -219,11 +227,12 @@ namespace Azure.Messaging.EventGrid { @doc("AcknowledgeOptions.") @body lockTokens: AcknowledgeOptions; - }, AcknowledgeResult >; + }, AcknowledgeResult>; + // Release Operation: // POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:release?api-version={apiVersion} - @doc("Release Cloud Events.") + @doc("Release batch of Cloud Events.") @route("/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:release") @post op ReleaseCloudEvents is Azure.Core.RpcOperation<{ @doc("content type") @@ -241,5 +250,5 @@ namespace Azure.Messaging.EventGrid { @doc("ReleaseOptions") @body lockTokens : ReleaseOptions; - }, ReleaseResult >; + }, ReleaseResult>; } From 10e0e8ccb08d2f78fa9e592bbac97992a3877308 Mon Sep 17 00:00:00 2001 From: Ashraf Hamad Date: Sat, 29 Apr 2023 00:16:18 -0700 Subject: [PATCH 24/34] Add support for missing Reject operation + adding deliveryAttemptCount to BrokerProperties + Adding query parameter for release operation for deliveryDelayInSeconds --- .../Azure.Messaging.EventGrid/main.tsp | 62 ++++++++++++++++--- 1 file changed, 54 insertions(+), 8 deletions(-) diff --git a/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp b/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp index 0dab65717a7f..c43e7e693edc 100644 --- a/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp +++ b/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp @@ -19,10 +19,11 @@ enum ServiceApiVersions { // Supported operations. // // POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}:publish?api-version={apiVersion}} -// POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:receive?api-Version={apiVersion}&timeout=60&maxEvents={maxEvents} +// POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:receive?api-Version={apiVersion}&maxWaitTime=60&maxEvents={maxEvents} // POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:acknowledge?api-Version={apiVersion} // POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:release?api-version={apiVersion} -// +// POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:reject?api-version={apiVersion} + @server( "{endpoint}", @@ -85,6 +86,9 @@ namespace Azure.Messaging.EventGrid { model BrokerProperties { @doc("The token used to lock the event.") lockToken: LockToken; + + @doc("The attempt count for deliverying the event.") + deliveryAttemptCount:: int32; } @doc("Receive operation details per Cloud Event.") @@ -135,6 +139,15 @@ namespace Azure.Messaging.EventGrid { succeededLockTokens: string[]; } + @doc("The result of the Reject operation.") + model RejectResult { + @doc("Array of LockToken values for failed cloud events.") + failedLockTokens: FailedLockToken[]; + + @doc("Array of LockToken values for succeeded cloud events.") + succeededLockTokens: string[]; + } + @doc("Array of lock token strings for the corresponding received Cloud Events to be released.") model ReleaseOptions { @doc("String array of lock tokens.") @@ -147,6 +160,12 @@ namespace Azure.Messaging.EventGrid { lockTokens: string[]; } + @doc("Array of lock token strings for the corresponding received Cloud Events to be rejected.") + model RejectOptions { + @doc("String array of lock tokens.") + lockTokens: string[]; + } + // Publish Operation: // POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}:publish?api-version={apiVersion}} @@ -183,7 +202,7 @@ namespace Azure.Messaging.EventGrid { }, PublishResult>; // Receive Operation: - // POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:receive?api-Version={apiVersion}&timeout=60&maxEvents={maxEvents} + // POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:receive?api-Version={apiVersion}&maxWaitTime=60&maxEvents={maxEvents} @doc("Receive Batch of Cloud Events from the Event Subscription.") @route("/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:receive") @@ -196,12 +215,12 @@ namespace Azure.Messaging.EventGrid { @path eventSubscriptionName: string; - @doc("Max Events count to be received. Minimum value is 1, while maximum value is 100 seconds. If not specified, the default value is 1.") + @doc("Max Events count to be received. Minimum value is 1, while maximum value is 100 events. If not specified, the default value is 1.") @query maxEvents?: int32 = 1; - @doc("Timeout value for receive operation in Seconds. It is the time in seconds that the server approximately waits for the availability of an event and responds to the request. If an event is available, the broker responds immediately to the client. Minimum value is 10 seconds, while maximum value is 120 seconds. If not specified, the default value is 60 seconds.") - @query({name:"timeout"}) + @doc("Max wait time value for receive operation in Seconds. It is the time in seconds that the server approximately waits for the availability of an event and responds to the request. If an event is available, the broker responds immediately to the client. Minimum value is 10 seconds, while maximum value is 120 seconds. If not specified, the default value is 60 seconds.") + @query({name:"maxWaitTime"}) maxWaitTime?: int32 = 60; }, ReceiveResult>; @@ -230,9 +249,9 @@ namespace Azure.Messaging.EventGrid { }, AcknowledgeResult>; // Release Operation: - // POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:release?api-version={apiVersion} + // POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:release?api-version={apiVersion}&eventDeliveryDelayInSeconds={eventDeliveryDelayInSeconds} - @doc("Release batch of Cloud Events.") + @doc("Release batch of Cloud Events. The server responds with an HTTP 200 status code if at least one event is successfully released. The response body will include the set of successfully released lockTokens, along with other failed lockTokens with their corresponding error information.") @route("/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:release") @post op ReleaseCloudEvents is Azure.Core.RpcOperation<{ @doc("content type") @@ -247,8 +266,35 @@ namespace Azure.Messaging.EventGrid { @path eventSubscriptionName: string; + @doc("Delivery delay for the event in seconds. When value is 0, the event is released immediately. It is an optional parameter and if not specified, the default value is 0.") + @query + eventDeliveryDelayInSeconds?: int32 = 0; + @doc("ReleaseOptions") @body lockTokens : ReleaseOptions; }, ReleaseResult>; + + // Reject Operation: + // POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:reject?api-version={apiVersion} + + @doc("Reject batch of Cloud Events.") + @route("/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:reject") + @post op RejectCloudEvents is Azure.Core.RpcOperation<{ + @doc("content type") + @header("content-type") + contentType: "application/json; charset=utf-8"; + + @doc("Topic Name.") + @path + topicName: string; + + @doc("Event Subscription Name.") + @path + eventSubscriptionName: string; + + @doc("RejectOptions") + @body + lockTokens : RejectOptions; + }, RejectResult>; } From 09f92448dadf6eb13697a64c93a94ebc861215b3 Mon Sep 17 00:00:00 2001 From: Ashraf Hamad Date: Mon, 1 May 2023 00:16:56 -0700 Subject: [PATCH 25/34] Update failedTokens/SuccessfulTokens Description to address code review comments --- .../eventgrid/Azure.Messaging.EventGrid/main.tsp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp b/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp index c43e7e693edc..7332fd7c0369 100644 --- a/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp +++ b/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp @@ -112,7 +112,7 @@ namespace Azure.Messaging.EventGrid { lockToken: LockToken; @doc("Error code related to the token. Example of such error codes are BadToken: which indicates the Token is not formatted correctly, TokenLost: which indicates that token is not found, and InternalServerError: For any internal server errors.") - errorCode: int32; + errorCode: string; @doc("Description of the token error.") errorDescription: string; @@ -123,28 +123,28 @@ namespace Azure.Messaging.EventGrid { @doc("The result of the Acknowledge operation.") model AcknowledgeResult { - @doc("Array of LockToken values for failed cloud events.") + @doc("Array of LockToken values for failed cloud events. Each LockToken includes the lock token value along with the related error information (namely, the error code and description).") failedLockTokens: FailedLockToken[]; - @doc("Array of LockToken values for succeeded cloud events.") + @doc("Array of lock tokens values for the successfully acknowledged cloud events.") succeededLockTokens: string[]; } @doc("The result of the Release operation.") model ReleaseResult { - @doc("Array of LockToken values for failed cloud events.") + @doc("Array of LockToken values for failed cloud events. Each LockToken includes the lock token value along with the related error information (namely, the error code and description).") failedLockTokens: FailedLockToken[]; - @doc("Array of LockToken values for succeeded cloud events.") + @doc("Array of lock tokens values for the successfully released cloud events.") succeededLockTokens: string[]; } @doc("The result of the Reject operation.") model RejectResult { - @doc("Array of LockToken values for failed cloud events.") + @doc("Array of LockToken values for failed cloud events. Each LockToken includes the lock token value along with the related error information (namely, the error code and description).") failedLockTokens: FailedLockToken[]; - @doc("Array of LockToken values for succeeded cloud events.") + @doc("Array of lock tokens values for the successfully rejected cloud events.") succeededLockTokens: string[]; } From 6c2b560b23366852dc9efbd1e4ac170e3678a3ee Mon Sep 17 00:00:00 2001 From: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com> Date: Mon, 1 May 2023 13:15:29 -0700 Subject: [PATCH 26/34] Update to match service behavior (#23754) * Update to match service behavior * remove locktoken --- .../eventgrid/Azure.Messaging.EventGrid/main.tsp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp b/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp index 7332fd7c0369..47e5458a346c 100644 --- a/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp +++ b/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp @@ -18,7 +18,7 @@ enum ServiceApiVersions { // // Supported operations. // -// POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}:publish?api-version={apiVersion}} +// POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}:publish?api-version={apiVersion} // POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:receive?api-Version={apiVersion}&maxWaitTime=60&maxEvents={maxEvents} // POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:acknowledge?api-Version={apiVersion} // POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:release?api-version={apiVersion} @@ -76,19 +76,13 @@ namespace Azure.Messaging.EventGrid { subject?: string; } - @doc("LockToken information.") - model LockToken { - @doc("The token used to lock the event.") - lockToken: string; - } - @doc("Properties of the Event Broker operation.") model BrokerProperties { @doc("The token used to lock the event.") - lockToken: LockToken; + lockToken: string; @doc("The attempt count for deliverying the event.") - deliveryAttemptCount:: int32; + deliveryAttemptCount: int32; } @doc("Receive operation details per Cloud Event.") @@ -109,7 +103,7 @@ namespace Azure.Messaging.EventGrid { @doc("Failed LockToken information.") model FailedLockToken { @doc("LockToken value") - lockToken: LockToken; + lockToken: string; @doc("Error code related to the token. Example of such error codes are BadToken: which indicates the Token is not formatted correctly, TokenLost: which indicates that token is not found, and InternalServerError: For any internal server errors.") errorCode: string; From 20958fd0ffe7af759574b759802690e981b95f16 Mon Sep 17 00:00:00 2001 From: Libba Lawrence Date: Wed, 10 May 2023 15:24:30 -0700 Subject: [PATCH 27/34] [EGv2] Editing unused variables (#23917) * event delivery delay not in preview * remove from url comment --- specification/eventgrid/Azure.Messaging.EventGrid/main.tsp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp b/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp index 47e5458a346c..9af6f29d3450 100644 --- a/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp +++ b/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp @@ -243,7 +243,7 @@ namespace Azure.Messaging.EventGrid { }, AcknowledgeResult>; // Release Operation: - // POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:release?api-version={apiVersion}&eventDeliveryDelayInSeconds={eventDeliveryDelayInSeconds} + // POST https://{namespaceName}.{region}.eventgrid.azure.net/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:release?api-version={apiVersion} @doc("Release batch of Cloud Events. The server responds with an HTTP 200 status code if at least one event is successfully released. The response body will include the set of successfully released lockTokens, along with other failed lockTokens with their corresponding error information.") @route("/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:release") @@ -260,10 +260,6 @@ namespace Azure.Messaging.EventGrid { @path eventSubscriptionName: string; - @doc("Delivery delay for the event in seconds. When value is 0, the event is released immediately. It is an optional parameter and if not specified, the default value is 0.") - @query - eventDeliveryDelayInSeconds?: int32 = 0; - @doc("ReleaseOptions") @body lockTokens : ReleaseOptions; From 911c47f2e27df78f0c0b25072e08d2ca08e4399c Mon Sep 17 00:00:00 2001 From: Libba Lawrence Date: Thu, 11 May 2023 14:49:57 -0700 Subject: [PATCH 28/34] [EGv2] Version dependency on Azure.Core (#23936) * verioning fix * spacing mishap? --- .../eventgrid/Azure.Messaging.EventGrid/main.tsp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp b/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp index 9af6f29d3450..02b9dd348e95 100644 --- a/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp +++ b/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp @@ -3,10 +3,6 @@ import "@typespec/rest"; import "@typespec/versioning"; import "@azure-tools/typespec-azure-core"; -enum ServiceApiVersions { - v2023_06_01_preview: "2023-06-01-preview" -} - @useAuth( ApiKeyAuth ) @@ -43,6 +39,11 @@ namespace Azure.Messaging.EventGrid { using Azure.Core; using Azure.Core.Foundations; + enum ServiceApiVersions { + @useDependency(Azure.Core.Versions.v1_0_Preview_2) + v2023_06_01_preview: "2023-06-01-preview" + } + @doc("Properties of an event published to an Azure Messaging EventGrid Namespace topic using the CloudEvent 1.0 Schema.") model CloudEvent { @doc("An identifier for the event. The combination of id and source must be unique for each distinct event.") @@ -180,7 +181,8 @@ namespace Azure.Messaging.EventGrid { }, PublishResult>; - @doc("Publish Batch Cloud Event to namespace topic. In case of success, the server responds with an HTTP 200 status code with an empty JSON object in response. Otherwise, the server can return various error codes. For example, 401: which indicates authorization failure, 403: which indicates quota exceeded or message is too large, 410: which indicates that specific topic is not found, 400: for bad request, and 500: for internal server error. ") @route("/topics/{topicName}:publish", {shared: true}) + @doc("Publish Batch Cloud Event to namespace topic. In case of success, the server responds with an HTTP 200 status code with an empty JSON object in response. Otherwise, the server can return various error codes. For example, 401: which indicates authorization failure, 403: which indicates quota exceeded or message is too large, 410: which indicates that specific topic is not found, 400: for bad request, and 500: for internal server error. ") + @route("/topics/{topicName}:publish", {shared: true}) @post op PublishCloudEvents is Azure.Core.RpcOperation<{ @doc("content type") @header("content-type") From 418e39a59a5f96843943f9a26716a851da5a787e Mon Sep 17 00:00:00 2001 From: Libba Lawrence Date: Fri, 12 May 2023 13:10:05 -0700 Subject: [PATCH 29/34] [EventGrid] Deliveryattempt change (#23960) * deliveryCount 5/1 * small typo --- specification/eventgrid/Azure.Messaging.EventGrid/main.tsp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp b/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp index 02b9dd348e95..46670a88d46c 100644 --- a/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp +++ b/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp @@ -82,8 +82,8 @@ namespace Azure.Messaging.EventGrid { @doc("The token used to lock the event.") lockToken: string; - @doc("The attempt count for deliverying the event.") - deliveryAttemptCount: int32; + @doc("The attempt count for delivering the event.") + deliveryCount: int32; } @doc("Receive operation details per Cloud Event.") From e57038878f1534cd3a0e76b00d000433c0734ee5 Mon Sep 17 00:00:00 2001 From: Libba Lawrence Date: Tue, 16 May 2023 10:30:43 -0700 Subject: [PATCH 30/34] [EventGrid] Remove internal (#23995) * remove internal * remove client.tsp --- .../eventgrid/Azure.Messaging.EventGrid/client.tsp | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 specification/eventgrid/Azure.Messaging.EventGrid/client.tsp diff --git a/specification/eventgrid/Azure.Messaging.EventGrid/client.tsp b/specification/eventgrid/Azure.Messaging.EventGrid/client.tsp deleted file mode 100644 index 478dfa16ec15..000000000000 --- a/specification/eventgrid/Azure.Messaging.EventGrid/client.tsp +++ /dev/null @@ -1,8 +0,0 @@ -import "@azure-tools/typespec-client-generator-core"; -import "./main.tsp"; - -using Azure.ClientGenerator.Core; - -@@internal(Azure.Messaging.EventGrid.PublishCloudEvents); -@@internal(Azure.Messaging.EventGrid.PublishCloudEvent); -@@internal(Azure.Messaging.EventGrid.ReceiveCloudEvents); \ No newline at end of file From 0b24c898ad335f176f82d572b20317cbfc8c61c8 Mon Sep 17 00:00:00 2001 From: Libba Lawrence Date: Fri, 19 May 2023 11:57:52 -0700 Subject: [PATCH 31/34] remove waitWaitTime (#24078) --- specification/eventgrid/Azure.Messaging.EventGrid/main.tsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp b/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp index 46670a88d46c..3700fb1d24f1 100644 --- a/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp +++ b/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp @@ -216,7 +216,7 @@ namespace Azure.Messaging.EventGrid { maxEvents?: int32 = 1; @doc("Max wait time value for receive operation in Seconds. It is the time in seconds that the server approximately waits for the availability of an event and responds to the request. If an event is available, the broker responds immediately to the client. Minimum value is 10 seconds, while maximum value is 120 seconds. If not specified, the default value is 60 seconds.") - @query({name:"maxWaitTime"}) + @query maxWaitTime?: int32 = 60; }, ReceiveResult>; From a90210c417002ed836b7aeef4208ba2375146fc9 Mon Sep 17 00:00:00 2001 From: Libba Lawrence Date: Fri, 19 May 2023 11:58:58 -0700 Subject: [PATCH 32/34] move location of json file (#24076) --- .../Azure.Messaging.EventGrid/tspconfig.yaml | 19 + .../2023-06-01-preview/EventGrid.json} | 354 ++++++++++++------ 2 files changed, 258 insertions(+), 115 deletions(-) rename specification/eventgrid/{Azure.Messaging.EventGrid/tsp-output/@azure-tools/typespec-autorest/2023-06-01-preview/openapi.json => data-plane/Microsoft.EventGrid/preview/2023-06-01-preview/EventGrid.json} (62%) diff --git a/specification/eventgrid/Azure.Messaging.EventGrid/tspconfig.yaml b/specification/eventgrid/Azure.Messaging.EventGrid/tspconfig.yaml index d99c4a42088c..0a4a34857529 100644 --- a/specification/eventgrid/Azure.Messaging.EventGrid/tspconfig.yaml +++ b/specification/eventgrid/Azure.Messaging.EventGrid/tspconfig.yaml @@ -1,4 +1,23 @@ +parameters: + "python-sdk-folder": + default: "{project-root}/azure-sdk-for-python/" + "service-directory-name": + default: "eventgrid" +emit: [ + "@azure-tools/typespec-autorest", +] options: + "@azure-tools/typespec-autorest": + examples-directory: ./examples + omit-unreachable-types: true + output-file: EventGrid.json + emitter-output-dir: "{project-root}/../data-plane/Microsoft.EventGrid/preview/2023-06-01-preview" + "@azure-tools/typespec-python": + "package-pprint-name": "\"Azure Event Grid\"" + "package-mode": "dataplane" + "package-version": 4.12.0b1 + "package-name": "azure-eventgrid" + "emitter-output-dir": "{python-sdk-folder}/sdk/{service-directory-name}/{package-name}" # Uncomment this line and add "@azure-tools/typespec-csharp" to your package.json to generate C# code "@azure-tools/typespec-csharp": model-namespace: false diff --git a/specification/eventgrid/Azure.Messaging.EventGrid/tsp-output/@azure-tools/typespec-autorest/2023-06-01-preview/openapi.json b/specification/eventgrid/data-plane/Microsoft.EventGrid/preview/2023-06-01-preview/EventGrid.json similarity index 62% rename from specification/eventgrid/Azure.Messaging.EventGrid/tsp-output/@azure-tools/typespec-autorest/2023-06-01-preview/openapi.json rename to specification/eventgrid/data-plane/Microsoft.EventGrid/preview/2023-06-01-preview/EventGrid.json index b170e2b8f609..4c9d778ac932 100644 --- a/specification/eventgrid/Azure.Messaging.EventGrid/tsp-output/@azure-tools/typespec-autorest/2023-06-01-preview/openapi.json +++ b/specification/eventgrid/data-plane/Microsoft.EventGrid/preview/2023-06-01-preview/EventGrid.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "title": "AzureMessagingEventGridClient", + "title": "Azure.Messaging.EventGridClient", "version": "2023-06-01-preview", "description": "Azure Messaging EventGrid Client", "x-typespec-generated": [ @@ -37,34 +37,21 @@ "security": [ { "ApiKeyAuth": [] - }, - { - "OAuth2Auth": [ - "https://eventgrid.azure.net/.default" - ] } ], "securityDefinitions": { "ApiKeyAuth": { "type": "apiKey", "in": "header", - "name": "aeg-sas-key" - }, - "OAuth2Auth": { - "type": "oauth2", - "flow": "implicit", - "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/v2.0/authorize", - "scopes": { - "https://eventgrid.azure.net/.default": "" - } + "name": "SharedAccessKey" } }, "tags": [], "paths": { - "/topics/{topicName}:publish": { + "/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:receive": { "post": { - "operationId": "PublishBatchOfCloudEvents", - "description": "Publish Batch of Cloud Events to namespace topic.", + "operationId": "ReceiveCloudEvents", + "description": "Receive Batch of Cloud Events from the Event Subscription.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" @@ -77,22 +64,37 @@ "type": "string" }, { - "name": "events", - "in": "body", + "name": "eventSubscriptionName", + "in": "path", "required": true, - "description": "Array of Cloud Events being published.", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/CloudEventEvent" - }, - "x-typespec-name": "CloudEventEvent[]" - } + "description": "Event Subscription Name.", + "type": "string" + }, + { + "name": "maxEvents", + "in": "query", + "required": false, + "description": "Max Events count to be received. Minimum value is 1, while maximum value is 100 events. If not specified, the default value is 1.", + "default": 1, + "type": "integer", + "format": "int32" + }, + { + "name": "maxWaitTime", + "in": "query", + "required": false, + "description": "Max wait time value for receive operation in Seconds. It is the time in seconds that the server approximately waits for the availability of an event and responds to the request. If an event is available, the broker responds immediately to the client. Minimum value is 10 seconds, while maximum value is 120 seconds. If not specified, the default value is 60 seconds.", + "default": 60, + "type": "integer", + "format": "int32" } ], "responses": { - "204": { - "description": "There is no content to send for this request, but the headers may be useful. " + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/ReceiveResult" + } }, "default": { "description": "An unexpected error response.", @@ -106,16 +108,13 @@ "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" } } - }, - "consumes": [ - "application/cloudevents-batch+json; charset=utf-8" - ] + } } }, - "/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:receive": { + "/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:acknowledge": { "post": { - "operationId": "ReceiveBatchOfCloudEvents", - "description": "Receive Batch of Cloud Events from the Event Subscription.", + "operationId": "AcknowledgeCloudEvents", + "description": "Acknowledge batch of Cloud Events. The server responds with an HTTP 200 status code if at least one event is successfully acknowledged. The response body will include the set of successfully acknowledged lockTokens, along with other failed lockTokens with their corresponding error information. Successfully acknowledged events will no longer be available to any consumer.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" @@ -135,29 +134,20 @@ "type": "string" }, { - "name": "maxEvents", - "in": "query", - "required": false, - "description": "Max Events count to be received.", - "default": 1, - "type": "integer", - "format": "int32" - }, - { - "name": "timeout", - "in": "query", - "required": false, - "description": "Timeout value for receive operation in Seconds. Default is 60 seconds.", - "default": 60, - "type": "integer", - "format": "int32" + "name": "lockTokens", + "in": "body", + "required": true, + "description": "AcknowledgeOptions.", + "schema": { + "$ref": "#/definitions/AcknowledgeOptions" + } } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { - "$ref": "#/definitions/ReceiveResponse" + "$ref": "#/definitions/AcknowledgeResult" } }, "default": { @@ -172,13 +162,16 @@ "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" } } - } + }, + "consumes": [ + "application/json; charset=utf-8" + ] } }, - "/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:acknowledge": { + "/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:release": { "post": { - "operationId": "AcknowledgeBatchOfCloudEvents", - "description": "Acknowledge Cloud Events.", + "operationId": "ReleaseCloudEvents", + "description": "Release batch of Cloud Events. The server responds with an HTTP 200 status code if at least one event is successfully released. The response body will include the set of successfully released lockTokens, along with other failed lockTokens with their corresponding error information.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" @@ -201,9 +194,9 @@ "name": "lockTokens", "in": "body", "required": true, - "description": "Array of LockTokens for the corresponding received Cloud Events to be acknowledged.", + "description": "ReleaseOptions", "schema": { - "$ref": "#/definitions/LockTokenInput" + "$ref": "#/definitions/ReleaseOptions" } } ], @@ -211,7 +204,7 @@ "200": { "description": "The request has succeeded.", "schema": { - "$ref": "#/definitions/LockTokensResponse" + "$ref": "#/definitions/ReleaseResult" } }, "default": { @@ -232,10 +225,10 @@ ] } }, - "/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:release": { + "/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:reject": { "post": { - "operationId": "ReleaseBatchOfCloudEvents", - "description": "Release Cloud Events.", + "operationId": "RejectCloudEvents", + "description": "Reject batch of Cloud Events.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" @@ -255,17 +248,68 @@ "type": "string" }, { - "name": "tokens", + "name": "lockTokens", + "in": "body", + "required": true, + "description": "RejectOptions", + "schema": { + "$ref": "#/definitions/RejectOptions" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/RejectResult" + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + } + } + }, + "consumes": [ + "application/json; charset=utf-8" + ] + } + } + }, + "x-ms-paths": { + "/topics/{topicName}:publish?api-version={apiVersion}": { + "post": { + "operationId": "PublishCloudEvents", + "description": "Publish Batch Cloud Event to namespace topic. In case of success, the server responds with an HTTP 200 status code with an empty JSON object in response. Otherwise, the server can return various error codes. For example, 401: which indicates authorization failure, 403: which indicates quota exceeded or message is too large, 410: which indicates that specific topic is not found, 400: for bad request, and 500: for internal server error. ", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "topicName", + "in": "path", + "required": true, + "description": "Topic Name.", + "type": "string" + }, + { + "name": "events", "in": "body", "required": true, - "description": "Array of LockTokens for the corresponding received Cloud Events to be acknowledged.", + "description": "Array of Cloud Events being published.", "schema": { "type": "array", "items": { - "$ref": "#/definitions/LockToken" + "$ref": "#/definitions/CloudEvent" }, - "x-ms-identifiers": [], - "x-typespec-name": "LockToken[]" + "x-typespec-name": "CloudEvent[]" } } ], @@ -273,7 +317,7 @@ "200": { "description": "The request has succeeded.", "schema": { - "$ref": "#/definitions/LockTokensResponse" + "$ref": "#/definitions/PublishResult" } }, "default": { @@ -290,12 +334,56 @@ } }, "consumes": [ - "application/json; charset=utf-8" + "application/cloudevents-batch+json; charset=utf-8" ] } } }, "definitions": { + "AcknowledgeOptions": { + "type": "object", + "properties": { + "lockTokens": { + "type": "array", + "items": { + "type": "string" + }, + "x-typespec-name": "string[]", + "description": "String array of lock tokens." + } + }, + "description": "Array of lock token strings for the corresponding received Cloud Events to be acknowledged.", + "required": [ + "lockTokens" + ] + }, + "AcknowledgeResult": { + "type": "object", + "properties": { + "failedLockTokens": { + "type": "array", + "items": { + "$ref": "#/definitions/FailedLockToken" + }, + "x-ms-identifiers": [], + "x-typespec-name": "FailedLockToken[]", + "description": "Array of LockToken values for failed cloud events. Each LockToken includes the lock token value along with the related error information (namely, the error code and description)." + }, + "succeededLockTokens": { + "type": "array", + "items": { + "type": "string" + }, + "x-typespec-name": "string[]", + "description": "Array of lock tokens values for the successfully acknowledged cloud events." + } + }, + "description": "The result of the Acknowledge operation.", + "required": [ + "failedLockTokens", + "succeededLockTokens" + ] + }, "Azure.Core.Foundations.Error": { "type": "object", "properties": { @@ -366,16 +454,22 @@ "type": "object", "properties": { "lockToken": { - "$ref": "#/definitions/LockToken", + "type": "string", "description": "The token used to lock the event." + }, + "deliveryCount": { + "type": "integer", + "format": "int32", + "description": "The attempt count for delivering the event." } }, "description": "Properties of the Event Broker operation.", "required": [ - "lockToken" + "lockToken", + "deliveryCount" ] }, - "CloudEventEvent": { + "CloudEvent": { "type": "object", "properties": { "id": { @@ -387,7 +481,6 @@ "description": "Identifies the context in which an event happened. The combination of id and source must be unique for each distinct event." }, "data": { - "$ref": "#/definitions/object", "description": "Event data specific to the event type." }, "data_base64": { @@ -433,17 +526,16 @@ "type": "object", "properties": { "lockToken": { - "$ref": "#/definitions/LockToken", + "type": "string", "description": "LockToken value" }, "errorCode": { - "type": "integer", - "format": "int32", - "description": "Error code" + "type": "string", + "description": "Error code related to the token. Example of such error codes are BadToken: which indicates the Token is not formatted correctly, TokenLost: which indicates that token is not found, and InternalServerError: For any internal server errors." }, "errorDescription": { "type": "string", - "description": "Description of the error" + "description": "Description of the token error." } }, "description": "Failed LockToken information.", @@ -453,20 +545,48 @@ "errorDescription" ] }, - "LockToken": { + "PublishResult": { + "type": "object", + "properties": {}, + "description": "The result of the Publish operation." + }, + "ReceiveDetails": { "type": "object", "properties": { - "lockToken": { - "type": "string", - "description": "The token used to lock the event." + "brokerProperties": { + "$ref": "#/definitions/BrokerProperties", + "description": "The Event Broker details." + }, + "event": { + "$ref": "#/definitions/CloudEvent", + "description": "Cloud Event details." + } + }, + "description": "Receive operation details per Cloud Event.", + "required": [ + "brokerProperties", + "event" + ] + }, + "ReceiveResult": { + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/ReceiveDetails" + }, + "x-ms-identifiers": [], + "x-typespec-name": "ReceiveDetails[]", + "description": "Array of receive responses, one per cloud event." } }, - "description": "LockToken information.", + "description": "Details of the Receive operation response.", "required": [ - "lockToken" + "value" ] }, - "LockTokenInput": { + "RejectOptions": { "type": "object", "properties": { "lockTokens": { @@ -475,15 +595,15 @@ "type": "string" }, "x-typespec-name": "string[]", - "description": "LockToken" + "description": "String array of lock tokens." } }, - "description": "Lock token input formatting.", + "description": "Array of lock token strings for the corresponding received Cloud Events to be rejected.", "required": [ "lockTokens" ] }, - "LockTokensResponse": { + "RejectResult": { "type": "object", "properties": { "failedLockTokens": { @@ -493,7 +613,7 @@ }, "x-ms-identifiers": [], "x-typespec-name": "FailedLockToken[]", - "description": "Array of LockToken values for failed cloud events." + "description": "Array of LockToken values for failed cloud events. Each LockToken includes the lock token value along with the related error information (namely, the error code and description)." }, "succeededLockTokens": { "type": "array", @@ -501,54 +621,58 @@ "type": "string" }, "x-typespec-name": "string[]", - "description": "Array of LockToken values for succeeded cloud events." + "description": "Array of lock tokens values for the successfully rejected cloud events." } }, - "description": "Details of the LockTokens information. This is used for both Acknowledge and Release operation response.", + "description": "The result of the Reject operation.", "required": [ "failedLockTokens", "succeededLockTokens" ] }, - "ReceiveDetails": { + "ReleaseOptions": { "type": "object", "properties": { - "brokerProperties": { - "$ref": "#/definitions/BrokerProperties", - "description": "The Event Broker details." - }, - "event": { - "$ref": "#/definitions/CloudEventEvent", - "description": "Cloud Event details." + "lockTokens": { + "type": "array", + "items": { + "type": "string" + }, + "x-typespec-name": "string[]", + "description": "String array of lock tokens." } }, - "description": "Receive operation details per Cloud Event.", + "description": "Array of lock token strings for the corresponding received Cloud Events to be released.", "required": [ - "brokerProperties", - "event" + "lockTokens" ] }, - "ReceiveResponse": { + "ReleaseResult": { "type": "object", "properties": { - "value": { + "failedLockTokens": { "type": "array", "items": { - "$ref": "#/definitions/ReceiveDetails" + "$ref": "#/definitions/FailedLockToken" }, "x-ms-identifiers": [], - "x-typespec-name": "ReceiveDetails[]", - "description": "Array of receive responses, one per cloud event." + "x-typespec-name": "FailedLockToken[]", + "description": "Array of LockToken values for failed cloud events. Each LockToken includes the lock token value along with the related error information (namely, the error code and description)." + }, + "succeededLockTokens": { + "type": "array", + "items": { + "type": "string" + }, + "x-typespec-name": "string[]", + "description": "Array of lock tokens values for the successfully released cloud events." } }, - "description": "Details of the Receive operation response.", + "description": "The result of the Release operation.", "required": [ - "value" + "failedLockTokens", + "succeededLockTokens" ] - }, - "object": { - "type": "object", - "properties": {} } }, "parameters": { From d1c21b5a4aa7e84c87766678282f38fa06cceb8d Mon Sep 17 00:00:00 2001 From: Libba Lawrence Date: Mon, 22 May 2023 10:53:23 -0700 Subject: [PATCH 33/34] [Egv2] Encode param (#24080) * encode * remove num default on duration --------- Co-authored-by: Laurent Mazuel --- specification/eventgrid/Azure.Messaging.EventGrid/main.tsp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp b/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp index 3700fb1d24f1..2ccee59e62f9 100644 --- a/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp +++ b/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp @@ -216,8 +216,9 @@ namespace Azure.Messaging.EventGrid { maxEvents?: int32 = 1; @doc("Max wait time value for receive operation in Seconds. It is the time in seconds that the server approximately waits for the availability of an event and responds to the request. If an event is available, the broker responds immediately to the client. Minimum value is 10 seconds, while maximum value is 120 seconds. If not specified, the default value is 60 seconds.") + @encode("seconds", int32) @query - maxWaitTime?: int32 = 60; + maxWaitTime?: duration; }, ReceiveResult>; // Acknowledge Operation: From 4b1d4a0e3b95152fb0aca665b17e9489c6f5749d Mon Sep 17 00:00:00 2001 From: Libba Lawrence Date: Mon, 22 May 2023 14:49:34 -0700 Subject: [PATCH 34/34] [EGv2] Fix pipeline (#24098) * regen off new commit for encode * reference preview tag * ignore word * update readme to have both apis * update with next autorest * change format to int32 --- custom-words.txt | 1 + .../preview/2023-06-01-preview/EventGrid.json | 1 - specification/eventgrid/data-plane/readme.md | 31 +++++++++++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/custom-words.txt b/custom-words.txt index 9bb7e88f4e12..cb78e1563e4d 100644 --- a/custom-words.txt +++ b/custom-words.txt @@ -741,6 +741,7 @@ eventhubconnections eventhubs eventroutes eventstream +eventsubscriptions eventtime eventtypes evpn diff --git a/specification/eventgrid/data-plane/Microsoft.EventGrid/preview/2023-06-01-preview/EventGrid.json b/specification/eventgrid/data-plane/Microsoft.EventGrid/preview/2023-06-01-preview/EventGrid.json index 4c9d778ac932..c7a945b67c4a 100644 --- a/specification/eventgrid/data-plane/Microsoft.EventGrid/preview/2023-06-01-preview/EventGrid.json +++ b/specification/eventgrid/data-plane/Microsoft.EventGrid/preview/2023-06-01-preview/EventGrid.json @@ -84,7 +84,6 @@ "in": "query", "required": false, "description": "Max wait time value for receive operation in Seconds. It is the time in seconds that the server approximately waits for the availability of an event and responds to the request. If an event is available, the broker responds immediately to the client. Minimum value is 10 seconds, while maximum value is 120 seconds. If not specified, the default value is 60 seconds.", - "default": 60, "type": "integer", "format": "int32" } diff --git a/specification/eventgrid/data-plane/readme.md b/specification/eventgrid/data-plane/readme.md index f9b4f85f5a52..bd96408a73ef 100644 --- a/specification/eventgrid/data-plane/readme.md +++ b/specification/eventgrid/data-plane/readme.md @@ -142,6 +142,37 @@ input-file: ``` +### Tag: package-2023-06-01-preview + +These settings apply only when `--tag=package-2023-06-01-preview` is specified on the command line. + +``` yaml $(tag) == 'package-2023-06-01-preview' +input-file: +- Microsoft.Storage/stable/2018-01-01/Storage.json +- Microsoft.EventHub/stable/2018-01-01/EventHub.json +- Microsoft.Resources/stable/2018-01-01/Resources.json +- Microsoft.EventGrid/stable/2018-01-01/EventGrid.json +- Microsoft.EventGrid/preview/2023-06-01-preview/EventGrid.json +- Microsoft.DataBox/stable/2018-01-01/DataBox.json +- Microsoft.Devices/stable/2018-01-01/IotHub.json +- Microsoft.ContainerRegistry/stable/2018-01-01/ContainerRegistry.json +- Microsoft.ServiceBus/stable/2018-01-01/ServiceBus.json +- Microsoft.Media/stable/2018-01-01/MediaServices.json +- Microsoft.Maps/stable/2018-01-01/Maps.json +- Microsoft.AppConfiguration/stable/2018-01-01/AppConfiguration.json +- Microsoft.SignalRService/stable/2018-01-01/SignalRService.json +- Microsoft.KeyVault/stable/2018-01-01/KeyVault.json +- Microsoft.MachineLearningServices/stable/2018-01-01/MachineLearningServices.json +- Microsoft.Cache/stable/2018-01-01/RedisCache.json +- Microsoft.Web/stable/2018-01-01/Web.json +- Microsoft.Communication/stable/2018-01-01/AzureCommunicationServices.json +- Microsoft.PolicyInsights/stable/2018-01-01/PolicyInsights.json +- Microsoft.ContainerService/stable/2018-01-01/ContainerService.json +- Microsoft.ApiManagement/stable/2018-01-01/APIManagement.json +- Microsoft.HealthcareApis/stable/2018-01-01/HealthcareApis.json + +``` + ### Suppression ``` yaml directive: