From 2a40de41fabbed77329254131f32d4174b7d83df Mon Sep 17 00:00:00 2001 From: Rakshith Bhyravabhotla Date: Thu, 3 Nov 2022 08:52:44 -0700 Subject: [PATCH 01/65] [Do not Merge] Eventgrid to CADL (#19819) * Initial commit * formatted * fix appconfig * API management fix * keyvault * Storage * signalR * servicebus * resources * redis * policy insights * eventhub * Iothub * cr * cr-2 * web * maps * healthcare APi * media services * media services * ACS * Eg omdels --- .../data-plane/cadl/ApiManagement.cadl | 49 +++ .../data-plane/cadl/AppConfiguration.cadl | 24 ++ .../cadl/AzureCommunicationServiceCore.cadl | 48 +++ .../cadl/AzureCommunicationServices.cadl | 322 ++++++++++++++++++ .../data-plane/cadl/ContainerRegistry.cadl | 140 ++++++++ .../data-plane/cadl/ContainerService.cadl | 14 + .../eventgrid/data-plane/cadl/EventGrid.cadl | 103 ++++++ .../eventgrid/data-plane/cadl/EventHub.cadl | 29 ++ .../data-plane/cadl/HealthcareApis.cadl | 188 ++++++++++ .../eventgrid/data-plane/cadl/IotHub.cadl | 110 ++++++ .../eventgrid/data-plane/cadl/KeyVault.cadl | 53 +++ .../cadl/MachineLearningServices.cadl | 104 ++++++ .../eventgrid/data-plane/cadl/Maps.cadl | 44 +++ .../data-plane/cadl/MediaServices.cadl | 318 +++++++++++++++++ .../data-plane/cadl/PolicyInsights.cadl | 31 ++ .../eventgrid/data-plane/cadl/RedisCache.cadl | 22 ++ .../eventgrid/data-plane/cadl/Resources.cadl | 88 +++++ .../eventgrid/data-plane/cadl/ServiceBus.cadl | 31 ++ .../data-plane/cadl/SignalRService.cadl | 24 ++ .../eventgrid/data-plane/cadl/Storage.cadl | 165 +++++++++ .../eventgrid/data-plane/cadl/Web.cadl | 137 ++++++++ .../eventgrid/data-plane/cadl/main.cadl | 0 .../data-plane/cadl/package-lock.json | 17 + .../eventgrid/data-plane/cadl/package.json | 10 + .../eventgrid/data-plane/import_models.py | 163 +++++++++ 25 files changed, 2234 insertions(+) create mode 100644 specification/eventgrid/data-plane/cadl/ApiManagement.cadl create mode 100644 specification/eventgrid/data-plane/cadl/AppConfiguration.cadl create mode 100644 specification/eventgrid/data-plane/cadl/AzureCommunicationServiceCore.cadl create mode 100644 specification/eventgrid/data-plane/cadl/AzureCommunicationServices.cadl create mode 100644 specification/eventgrid/data-plane/cadl/ContainerRegistry.cadl create mode 100644 specification/eventgrid/data-plane/cadl/ContainerService.cadl create mode 100644 specification/eventgrid/data-plane/cadl/EventGrid.cadl create mode 100644 specification/eventgrid/data-plane/cadl/EventHub.cadl create mode 100644 specification/eventgrid/data-plane/cadl/HealthcareApis.cadl create mode 100644 specification/eventgrid/data-plane/cadl/IotHub.cadl create mode 100644 specification/eventgrid/data-plane/cadl/KeyVault.cadl create mode 100644 specification/eventgrid/data-plane/cadl/MachineLearningServices.cadl create mode 100644 specification/eventgrid/data-plane/cadl/Maps.cadl create mode 100644 specification/eventgrid/data-plane/cadl/MediaServices.cadl create mode 100644 specification/eventgrid/data-plane/cadl/PolicyInsights.cadl create mode 100644 specification/eventgrid/data-plane/cadl/RedisCache.cadl create mode 100644 specification/eventgrid/data-plane/cadl/Resources.cadl create mode 100644 specification/eventgrid/data-plane/cadl/ServiceBus.cadl create mode 100644 specification/eventgrid/data-plane/cadl/SignalRService.cadl create mode 100644 specification/eventgrid/data-plane/cadl/Storage.cadl create mode 100644 specification/eventgrid/data-plane/cadl/Web.cadl create mode 100644 specification/eventgrid/data-plane/cadl/main.cadl create mode 100644 specification/eventgrid/data-plane/cadl/package-lock.json create mode 100644 specification/eventgrid/data-plane/cadl/package.json create mode 100644 specification/eventgrid/data-plane/import_models.py diff --git a/specification/eventgrid/data-plane/cadl/ApiManagement.cadl b/specification/eventgrid/data-plane/cadl/ApiManagement.cadl new file mode 100644 index 000000000000..78c0529f445c --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/ApiManagement.cadl @@ -0,0 +1,49 @@ +model ApiManagementBase { + @doc("The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions//resourceGroups//Microsoft.ApiManagement/service///`") + resourceUri?: string; +} + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.UserCreated event.") +model ApiManagementUserCreatedEventData is ApiManagementBase; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.UserUpdated event.") +model ApiManagementUserUpdatedEventData is ApiManagementBase; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.UserDeleted event.") +model ApiManagementUserDeletedEventData is ApiManagementBase; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.SubscriptionCreated event.") +model ApiManagementSubscriptionCreatedEventData is ApiManagementBase; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.SubscriptionUpdated event.") +model ApiManagementSubscriptionUpdatedEventData is ApiManagementBase; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.SubscriptionDeleted event.") +model ApiManagementSubscriptionDeletedEventData is ApiManagementBase; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.ProductCreated event.") +model ApiManagementProductCreatedEventData is ApiManagementBase; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.ProductUpdated event.") +model ApiManagementProductUpdatedEventData is ApiManagementBase; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.ProductDeleted event.") +model ApiManagementProductDeletedEventData is ApiManagementBase; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APICreated event.") +model ApiManagementApiCreatedEventData is ApiManagementBase; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIUpdated event.") +model ApiManagementApiUpdatedEventData is ApiManagementBase; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIDeleted event.") +model ApiManagementApiDeletedEventData is ApiManagementBase; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIReleaseCreated event.") +model ApiManagementApiReleaseCreatedEventData is ApiManagementBase; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIReleaseUpdated event.") +model ApiManagementApiReleaseUpdatedEventData is ApiManagementBase; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIReleaseDeleted event.") +model ApiManagementApiReleaseDeletedEventData is ApiManagementBase; diff --git a/specification/eventgrid/data-plane/cadl/AppConfiguration.cadl b/specification/eventgrid/data-plane/cadl/AppConfiguration.cadl new file mode 100644 index 000000000000..7b10eb7a284c --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/AppConfiguration.cadl @@ -0,0 +1,24 @@ +enum AppConfigurationEventTypes { + modified; + deleted; +} + +model AppConfigurationBase { + @doc("The key used to identify the key-value that was {name}.", TEventType) + key?: string; + + @doc("The label, if any, used to identify the key-value that was {name}.", TEventType) + label?: string; + + @doc("The etag representing the key-value that was {name}.", TEventType) + etag?: string; + + @doc("The sync token representing the server state after the event.") + syncToken?: string; +} + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.AppConfiguration.KeyValueModified event.") +model AppConfigurationKeyValueModifiedEventData is AppConfigurationBase; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.AppConfiguration.KeyValueDeleted event.") +model AppConfigurationKeyValueDeletedEventData is AppConfigurationBase; diff --git a/specification/eventgrid/data-plane/cadl/AzureCommunicationServiceCore.cadl b/specification/eventgrid/data-plane/cadl/AzureCommunicationServiceCore.cadl new file mode 100644 index 000000000000..4bb58efd0045 --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/AzureCommunicationServiceCore.cadl @@ -0,0 +1,48 @@ +@doc("Identifies a participant in Azure Communication services. A participant is, for example, a phone number or an Azure communication user. This model must be interpreted as a union: Apart from rawId, at most one further property may be set.") +model CommunicationIdentifierModel { + @doc("Raw Id of the identifier. Optional in requests, required in responses.") + rawId?: string; + + @doc("The communication user.") + communicationUser?: CommunicationUserIdentifierModel; + + @doc("The phone number.") + phoneNumber?: PhoneNumberIdentifierModel; + + @doc("The Microsoft Teams user.") + microsoftTeamsUser?: MicrosoftTeamsUserIdentifierModel; +} + + +@doc ("A Microsoft Teams user.") +model MicrosoftTeamsUserIdentifierModel { + @doc("The Id of the Microsoft Teams user. If not anonymous, this is the AAD object Id of the user.") + userId: string; + + @doc("True if the Microsoft Teams user is anonymous. By default false if missing.") + isAnonymous?: boolean; + + @doc("The cloud that the Microsoft Teams user belongs to. By default 'public' if missing.") + cloud?: CommunicationCloudEnvironmentModel; +} + +@doc ("A phone number.") +model PhoneNumberIdentifierModel { + @doc("The phone number in E.164 format.") + value: string; +} + +@doc ("A user that got created with an Azure Communication Services resource.") +model CommunicationUserIdentifierModel { + @doc("The Id of the communication user.") + id: string; +} + +@knownValues(CommunicationCloudEnvironmentModelKV) +@doc("The cloud that the identifier belongs to.") +model CommunicationCloudEnvironmentModel is string {} +enum CommunicationCloudEnvironmentModelKV { + public, + dod, + gcch +} diff --git a/specification/eventgrid/data-plane/cadl/AzureCommunicationServices.cadl b/specification/eventgrid/data-plane/cadl/AzureCommunicationServices.cadl new file mode 100644 index 000000000000..24935237eddc --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/AzureCommunicationServices.cadl @@ -0,0 +1,322 @@ +import "./AzureCommunicationServicesCore.cadl" + +@doc("Schema of the Data property of an EventGridEvent for an Microsoft.Communication.UserDisconnected event.") +model AcsUserDisconnectedEventData { + @doc("The communication identifier of the user who was disconnected") + userCommunicationIdentifier?: CommunicationIdentifierModel; +} + +model AcsChatMessageBaseEventData { + @doc("The body of the chat message") + messageBody?: string; + + @doc("The chat message metadata") + metadata?: Map; +} +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageReceived event.") +model AcsChatMessageReceivedEventData is AcsChatMessageBaseEventData; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageReceivedInThread event.") +model AcsChatMessageReceivedInThreadEventData is AcsChatMessageBaseEventData; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageEdited event.") +model AcsChatMessageEditedEventData { + ...AcsChatMessageBaseEventData; + + @doc("The time at which the message was edited") + editTime?: zonedDateTime; +} + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageEditedInThread event.") +model AcsChatMessageEditedInThreadEventData { + ...AcsChatMessageBaseEventData; + + @doc("The time at which the message was edited") + editTime?: zonedDateTime; +} + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageDeleted event.") +model AcsChatMessageDeletedEventData { + @doc("The time at which the message was deleted") + deleteTime?: zonedDateTime; +} + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageDeletedInThread event.") +model AcsChatMessageDeletedInThreadEventData { + @doc("The time at which the message was deleted") + deleteTime?: zonedDateTime; +} + +model AcsChatThreadBaseEventData { + @doc("The communication identifier of the user who created the thread") + createdByCommunicationIdentifier?: CommunicationIdentifierModel; + + @doc("The thread properties") + properties?: Map; + + @doc("The list of properties of participants who are part of the thread") + participants?: AcsChatThreadParticipantProperties[]; +} + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadCreatedWithUser event.") +model AcsChatThreadCreatedWithUserEventData is AcsChatThreadBaseEventData; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadCreated event.") +model AcsChatThreadCreatedEventData is AcsChatThreadBaseEventData; + +model AcsChatThreadDeletedBaseEventData { + @doc("The communication identifier of the user who deleted the thread") + deletedByCommunicationIdentifier?: CommunicationIdentifierModel; + + @doc("The deletion time of the thread") + deleteTime?: zonedDateTime; +} + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadWithUserDeleted event.") +model AcsChatThreadWithUserDeletedEventData is AcsChatThreadDeletedBaseEventData; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadDeleted event.") +model AcsChatThreadDeletedEventData is AcsChatThreadDeletedBaseEventData; + +model AcsChatThredPropertiesBaseEventData { + @doc("The communication identifier of the user who updated the thread properties") + editedByCommunicationIdentifier?: CommunicationIdentifierModel; + + @doc("The time at which the properties of the thread were updated") + editTime?: zonedDateTime; + + @doc("The updated thread properties") + properties?: Map; +} + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadPropertiesUpdatedPerUser event.") +model AcsChatThreadPropertiesUpdatedPerUserEventData is AcsChatThredPropertiesBaseEventData; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadPropertiesUpdated event.") +model AcsChatThreadPropertiesUpdatedEventData is AcsChatThredPropertiesBaseEventData; + +model AcsChatParticipantBaseEventData { + @doc("The time at which the user was added to the thread") + time?: zonedDateTime; + + @doc("The communication identifier of the user who added the user") + addedByCommunicationIdentifier?: CommunicationIdentifierModel; + + @doc("The details of the user who was added") + participantAdded?: AcsChatThreadParticipantProperties; +} + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatParticipantAddedToThreadWithUser event.") +model AcsChatParticipantAddedToThreadWithUserEventData is AcsChatParticipantBaseEventData; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatParticipantRemovedFromThreadWithUser event.") +model AcsChatParticipantRemovedFromThreadWithUserEventData is AcsChatParticipantBaseEventData; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadParticipantAdded event.") +model AcsChatParticipantAddedToThreadEventData { + ...AcsChatParticipantBaseEventData; + + @doc("The version of the thread") + version?: int64; +} + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadParticipantRemoved event.") +model AcsChatParticipantRemovedFromThreadEventData { + @doc("The time at which the user was removed to the thread") + time?: zonedDateTime; + + @doc("The communication identifier of the user who removed the user") + removedByCommunicationIdentifier?: CommunicationIdentifierModel; + + @doc("The details of the user who was removed") + participantRemoved?: AcsChatThreadParticipantProperties; + + @doc("The version of the thread") + version?: int64; +} + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.SMSDeliveryReportReceived event.") +model AcsSmsDeliveryReportReceivedEventData { + @doc("Status of Delivery") + deliveryStatus?: string; + + @doc("Details about Delivery Status") + deliveryStatusDetails?: string; + + @doc("List of details of delivery attempts made") + deliveryAttempts?: AcsSmsDeliveryAttemptProperties[]; + + @doc("The time at which the SMS delivery report was received") + receivedTimestamp?: zonedDateTime; + + @doc("Customer Content") + tag?: string; +} + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.SMSReceived event.") +model AcsSmsReceivedEventData { + @doc("The SMS content") + message?: string; + + @doc("The time at which the SMS was received") + receivedTimestamp?: zonedDateTime; +} + +@knownValues(recordingContentTypeKV) +model recordingContentType is string {} +enum recordingContentTypeKV { + AudioVideo, + Audio, +} + +@knownValues(recordingChannelTypeKV) +model recordingChannelType is string {} +enum recordingChannelTypeKV { + Mixed, + Unmixed, +} + +@knownValues(recordingFormatTypeKV) +model recordingFormatType is string {} +enum recordingFormatTypeKV { + Wav, + Mp3, + Mp4, +} + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RecordingFileStatusUpdated event.") +model AcsRecordingFileStatusUpdatedEventData { + @doc("The details of recording storage information") + recordingStorageInfo?: AcsRecordingStorageInfoProperties; + + @doc("The time at which the recording started") + recordingStartTime?: zonedDateTime; + + @doc("The recording duration in milliseconds") + recordingDurationMs?: int64; + + @doc("The recording content type- AudioVideo, or Audio") + recordingContentType?: recordingContentType; + + @doc("The recording channel type - Mixed, Unmixed") + recordingChannelType?: recordingChannelType; + + @doc("The recording format type - Mp4, Mp3, Wav") + recordingFormatType?: recordingFormatType; + + @doc("The reason for ending recording session") + sessionEndReason?: string; +} + +@doc("Schema of common properties of all chat thread events") +model AcsChatThreadEventBaseProperties { + @doc("The original creation time of the thread") + createTime?: zonedDateTime; + + @doc("The version of the thread") + version?: int64; +} + +@doc("Schema of common properties of all chat thread events") +model AcsChatThreadEventInThreadBaseProperties is AcsChatThreadEventBaseProperties; + +@doc("Schema of common properties of all chat message events") +model AcsChatMessageEventBaseProperties { + @doc("The chat message id") + messageId?: string; + + @doc("The communication identifier of the sender") + senderCommunicationIdentifier?: CommunicationIdentifierModel; + + @doc("The display name of the sender") + senderDisplayName?: string; + + @doc("The original compose time of the message") + composeTime?: zonedDateTime; + + @doc("The type of the message") + type?: string; + + @doc("The version of the message") + version?: int64; +} + +@doc("Schema of common properties of all thread-level chat message events") +model AcsChatMessageEventInThreadBaseProperties is AcsChatMessageEventBaseProperties; + +@doc("Schema of common properties of all thread-level chat events") +model AcsChatEventInThreadBaseProperties { + @doc("The transaction id will be used as co-relation vector") + transactionId?: string; + + @doc("The chat thread id") + threadId?: string; +} + +@doc("Schema of common properties of all chat events") +model AcsChatEventBaseProperties { + @doc("The communication identifier of the target user") + recipientCommunicationIdentifier?: CommunicationIdentifierModel; + + ...AcsChatEventInThreadBaseProperties; +} + +@doc("Schema of the chat thread participant") +model AcsChatThreadParticipantProperties { + @doc("The name of the user") + displayName?: string; + + @doc("The communication identifier of the user") + participantCommunicationIdentifier?: CommunicationIdentifierModel; +} + +@doc("Schema of common properties of all SMS events") +model AcsSmsEventBaseProperties { + @doc("The identity of the SMS message") + messageId?: string; + + @doc("The identity of SMS message sender") + from?: string; + + @doc("The identity of SMS message receiver") + to?: string; +} + +@doc("Schema for details of a delivery attempt") +model AcsSmsDeliveryAttemptProperties { + @doc("TimeStamp when delivery was attempted") + timestamp?: zonedDateTime; + + @doc("Number of segments that were successfully delivered") + segmentsSucceeded?: integer; + + @doc("Number of segments whose delivery failed") + segmentsFailed?: integer; +} + +@doc("Schema for all properties of Recording Storage Information.") +model AcsRecordingStorageInfoProperties { + @doc("List of details of recording chunks information") + recordingChunks?: AcsRecordingChunkInfoProperties[]; +} + +@doc("Schema for all properties of Recording Chunk Information.") +model AcsRecordingChunkInfoProperties { + @doc("The documentId of the recording chunk") + documentId?: string; + + @doc("The index of the recording chunk") + index?: int64; + + @doc("The reason for ending the recording chunk") + endReason?: string; + + @doc("The location of the metadata for this chunk") + metadataLocation?: string; + + @doc("The location of the content for this chunk") + contentLocation?: string; + + @doc("The location to delete all chunk storage") + deleteLocation?: string; +} diff --git a/specification/eventgrid/data-plane/cadl/ContainerRegistry.cadl b/specification/eventgrid/data-plane/cadl/ContainerRegistry.cadl new file mode 100644 index 000000000000..b6ddc4ab4394 --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/ContainerRegistry.cadl @@ -0,0 +1,140 @@ +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.ContainerRegistry.ImagePushed event.") +model ContainerRegistryImagePushedEventData is ContainerRegistryEventData; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.ContainerRegistry.ImageDeleted event.") +model ContainerRegistryImageDeletedEventData is ContainerRegistryEventData; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.ContainerRegistry.ChartPushed event.") +model ContainerRegistryChartPushedEventData is ContainerRegistryArtifactEventData; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.ContainerRegistry.ChartDeleted event.") +model ContainerRegistryChartDeletedEventData is ContainerRegistryArtifactEventData; + +model ContainerRegistryBaseEventData { + @doc("The event ID.") + id?: string; + + @doc("The time at which the event occurred.") + timestamp?: zonedDateTime; + + @doc("The action that encompasses the provided event.") + action?: string; + + @doc("The location of the event.") + location?: string; +} + +@doc("The content of the event request message.") +model ContainerRegistryEventData { + + ...ContainerRegistryBaseEventData; + + @doc("The target of the event.") + target?: ContainerRegistryEventTarget; + + @doc("The request that generated the event.") + request?: ContainerRegistryEventRequest; + + @doc("The agent that initiated the event. For most situations, this could be from the authorization context of the request.") + actor?: ContainerRegistryEventActor; + + @doc("The registry node that generated the event. Put differently, while the actor initiates the event, the source generates it.") + source?: ContainerRegistryEventSource; + + @doc("The connected registry information if the event is generated by a connected registry.") + connectedRegistry?: ContainerRegistryEventConnectedRegistry; +} + +@doc("The content of the event request message.") +model ContainerRegistryArtifactEventData { + ...ContainerRegistryBaseEventData; + + @doc("The target of the event.") + target?: ContainerRegistryArtifactEventTarget; + + @doc("The connected registry information if the event is generated by a connected registry.") + connectedRegistry?: ContainerRegistryEventConnectedRegistry; +} + +model ContainerRegistryBaseEventTarget { + @doc(TmediaType) + mediaType?: string; + + @doc(Tsize) + size?: int64; + + @doc(Tdigest) + digest?: string; + + @doc(Trepository) + repository?: string; + + @doc(Ttag) + tag?: string; +} +@doc("The target of the event.") +model ContainerRegistryEventTarget extends ContainerRegistryBaseEventTarget< + "The MIME type of the referenced object.", + "The number of bytes of the content. Same as Length field.", + "The digest of the content, as defined by the Registry V2 HTTP API Specification.", + "The repository name.", + "The tag name." + > { + @doc("The number of bytes of the content. Same as Size field.") + length?: int64; +} + +@doc("The target of the event.") +model ContainerRegistryArtifactEventTarget extends ContainerRegistryBaseEventTarget< + "The MIME type of the artifact.", + "The size in bytes of the artifact.", + "The digest of the artifact.", + "The repository name of the artifact.", + "The tag of the artifact." + > { + + @doc("The name of the artifact.") + name?: string; + + @doc("The version of the artifact.") + version?: string; +} + +@doc("The request that generated the event.") +model ContainerRegistryEventRequest { + @doc("The ID of the request that initiated the event.") + id?: string; + + @doc("The IP or hostname and possibly port of the client connection that initiated the event. This is the RemoteAddr from the standard http request.") + addr?: string; + + @doc("The externally accessible hostname of the registry instance, as specified by the http host header on incoming requests.") + host?: string; + + @doc("The request method that generated the event.") + method?: string; + + @doc("The user agent header of the request.") + useragent?: string; +} + +@doc("The agent that initiated the event. For most situations, this could be from the authorization context of the request.") +model ContainerRegistryEventActor { + @doc("The subject or username associated with the request context that generated the event.") + name?: string; +} + +@doc("The registry node that generated the event. Put differently, while the actor initiates the event, the source generates it.") +model ContainerRegistryEventSource { + @doc("The IP or hostname and the port of the registry node that generated the event. Generally, this will be resolved by os.Hostname() along with the running port.") + addr?: string; + + @doc("The running instance of an application. Changes after each restart.") + instanceID?: string; +} + +@doc("The connected registry information if the event is generated by a connected registry.") +model ContainerRegistryEventConnectedRegistry { + @doc("The name of the connected registry that generated this event.") + name?: string; +} diff --git a/specification/eventgrid/data-plane/cadl/ContainerService.cadl b/specification/eventgrid/data-plane/cadl/ContainerService.cadl new file mode 100644 index 000000000000..2c7d51db3281 --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/ContainerService.cadl @@ -0,0 +1,14 @@ +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.ContainerService.NewKubernetesVersionAvailable event") +model ContainerServiceNewKubernetesVersionAvailableEventData { + @doc("The highest PATCH Kubernetes version for the highest MINOR version supported by ManagedCluster resource") + latestSupportedKubernetesVersion?: string; + + @doc("The highest PATCH Kubernetes version for the MINOR version considered stable for the ManagedCluster resource") + latestStableKubernetesVersion?: string; + + @doc("The highest PATCH Kubernetes version for the lowest applicable MINOR version available for the ManagedCluster resource") + lowestMinorKubernetesVersion?: string; + + @doc("The highest PATCH Kubernetes version considered preview for the ManagedCluster resource. There might not be any version in preview at the time of publishing the event") + latestPreviewKubernetesVersion?: string; +} diff --git a/specification/eventgrid/data-plane/cadl/EventGrid.cadl b/specification/eventgrid/data-plane/cadl/EventGrid.cadl new file mode 100644 index 000000000000..25f549d16a85 --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/EventGrid.cadl @@ -0,0 +1,103 @@ +import "@cadl-lang/rest"; +import "@cadl-lang/versioning"; +import "@azure-tools/cadl-providerhub"; +import "@azure-tools/cadl-azure-core"; + +@serviceTitle("EventGridClient") +@serviceVersion("2018-01-01") +@doc("Azure EventGrid Client") +namespace Microsoft.EventGrid; + +using Cadl.Http; +using Cadl.Rest; +using Cadl.Versioning; +using Azure.Core; + +@doc("Properties of an event published to an Event Grid topic using the EventGrid Schema.") +model EventGridEvent { + @doc("An unique identifier for the event.") + id: string; + + @doc("The resource path of the event source.") + topic?: string; + + @doc("A resource path relative to the topic path.") + subject: string; + + @doc("Event data specific to the event type.") + data: object; + + @doc("The type of the event that occurred.") + eventType: string; + + @doc("The time (in UTC) the event was generated.") + eventTime: zonedDateTime; + + @doc("The schema version of the event metadata.") + @visibility("read") + metadataVersion?: string; + + @doc("The schema version of the data object.") + dataVersion: string; + +} + +@doc("Properties of an event published to an Event Grid 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.") + data_base64?: bytes; + + @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("Properties of an event published to an Event Grid topic using a custom schema") +model CustomEventEvent {}; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.EventGrid.SubscriptionValidationEvent event.") +model SubscriptionValidationEventData { + @doc("The validation code sent by Azure Event Grid to validate an event subscription. To complete the validation handshake, the subscriber must either respond with this validation code as part of the validation response, or perform a GET request on the validationUrl (available starting version 2018-05-01-preview).") + @visibility("read") + validationCode?: string; + + @doc("The validation URL sent by Azure Event Grid (available starting version 2018-05-01-preview). To complete the validation handshake, the subscriber must either respond with the validationCode as part of the validation response, or perform a GET request on the validationUrl (available starting version 2018-05-01-preview).") + @visibility("read") + validationUrl?: string; +} + +@doc("To complete an event subscription validation handshake, a subscriber can use either the validationCode or the validationUrl received in a SubscriptionValidationEvent. When the validationCode is used, the SubscriptionValidationResponse can be used to build the response.") +model SubscriptionValidationResponse { + @doc("The validation response sent by the subscriber to Azure Event Grid to complete the validation of an event subscription.") + validationResponse?: string; +} + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.EventGrid.SubscriptionDeletedEvent event.") +model SubscriptionDeletedEventData { + @doc("The Azure resource ID of the deleted event subscription.") + @visibility("read") + eventSubscriptionId?: string; +} diff --git a/specification/eventgrid/data-plane/cadl/EventHub.cadl b/specification/eventgrid/data-plane/cadl/EventHub.cadl new file mode 100644 index 000000000000..9789361798b7 --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/EventHub.cadl @@ -0,0 +1,29 @@ +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.EventHub.CaptureFileCreated event.") +model EventHubCaptureFileCreatedEventData { + @doc("The path to the capture file.") + fileUrl?: string; + + @doc("The file type of the capture file.") + fileType?: string; + + @doc("The shard ID.") + partitionId?: string; + + @doc("The file size.") + sizeInBytes?: int64; + + @doc("The number of events in the file.") + eventCount?: int64; + + @doc("The smallest sequence number from the queue.") + firstSequenceNumber?: int64; + + @doc("The last sequence number from the queue.") + lastSequenceNumber?: int64; + + @doc("The first time from the queue.") + firstEnqueueTime?: zonedDateTime; + + @doc("The last time from the queue.") + lastEnqueueTime?: zonedDateTime; +} diff --git a/specification/eventgrid/data-plane/cadl/HealthcareApis.cadl b/specification/eventgrid/data-plane/cadl/HealthcareApis.cadl new file mode 100644 index 000000000000..a8c432f826fa --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/HealthcareApis.cadl @@ -0,0 +1,188 @@ +model HealthcareFhirResourceBaseEventData { + @doc("Type of HL7 FHIR resource.") + resourceType?: HealthcareFhirResourceType; + + @doc("Domain name of FHIR account for this resource.") + resourceFhirAccount?: string; + + @doc("Id of HL7 FHIR resource.") + resourceFhirId?: string; + + @doc("VersionId of HL7 FHIR resource. It changes when the resource is created, updated, or deleted(soft-deletion).") + resourceVersionId?: int64; +} + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.FhirResourceCreated event.") +model HealthcareFhirResourceCreatedEventData is HealthcareFhirResourceBaseEventData; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.FhirResourceUpdated event.") +model HealthcareFhirResourceUpdatedEventData is HealthcareFhirResourceBaseEventData; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.FhirResourceDeleted event.") +model HealthcareFhirResourceDeletedEventData is HealthcareFhirResourceBaseEventData; + +@knownValues(HealthcareFhirResourceTypeKV) +model HealthcareFhirResourceType is string {} +enum HealthcareFhirResourceTypeKV { + Account, + ActivityDefinition, + AdverseEvent, + AllergyIntolerance, + Appointment, + AppointmentResponse, + AuditEvent, + Basic, + Binary, + BiologicallyDerivedProduct, + BodySite, + BodyStructure, + Bundle, + CapabilityStatement, + CarePlan, + CareTeam, + CatalogEntry, + ChargeItem, + ChargeItemDefinition, + Claim, + ClaimResponse, + ClinicalImpression, + CodeSystem, + Communication, + CommunicationRequest, + CompartmentDefinition, + Composition, + ConceptMap, + Condition, + Consent, + Contract, + Coverage, + CoverageEligibilityRequest, + CoverageEligibilityResponse, + DataElement, + DetectedIssue, + Device, + DeviceComponent, + DeviceDefinition, + DeviceMetric, + DeviceRequest, + DeviceUseStatement, + DiagnosticReport, + DocumentManifest, + DocumentReference, + DomainResource, + EffectEvidenceSynthesis, + EligibilityRequest, + EligibilityResponse, + Encounter, + Endpoint, + EnrollmentRequest, + EnrollmentResponse, + EpisodeOfCare, + EventDefinition, + Evidence, + EvidenceVariable, + ExampleScenario, + ExpansionProfile, + ExplanationOfBenefit, + FamilyMemberHistory, + Flag, + Goal, + GraphDefinition, + Group, + GuidanceResponse, + HealthcareService, + ImagingManifest, + ImagingStudy, + Immunization, + ImmunizationEvaluation, + ImmunizationRecommendation, + ImplementationGuide, + InsurancePlan, + Invoice, + Library, + Linkage, + List, + Location, + Measure, + MeasureReport, + Media, + Medication, + MedicationAdministration, + MedicationDispense, + MedicationKnowledge, + MedicationRequest, + MedicationStatement, + MedicinalProduct, + MedicinalProductAuthorization, + MedicinalProductContraindication, + MedicinalProductIndication, + MedicinalProductIngredient, + MedicinalProductInteraction, + MedicinalProductManufactured, + MedicinalProductPackaged, + MedicinalProductPharmaceutical, + MedicinalProductUndesirableEffect, + MessageDefinition, + MessageHeader, + MolecularSequence, + NamingSystem, + NutritionOrder, + Observation, + ObservationDefinition, + OperationDefinition, + OperationOutcome, + Organization, + OrganizationAffiliation, + Parameters, + Patient, + PaymentNotice, + PaymentReconciliation, + Person, + PlanDefinition, + Practitioner, + PractitionerRole, + Procedure, + ProcedureRequest, + ProcessRequest, + ProcessResponse, + Provenance, + Questionnaire, + QuestionnaireResponse, + ReferralRequest, + RelatedPerson, + RequestGroup, + ResearchDefinition, + ResearchElementDefinition, + ResearchStudy, + ResearchSubject, + Resource, + RiskAssessment, + RiskEvidenceSynthesis, + Schedule, + SearchParameter, + Sequence, + ServiceDefinition, + ServiceRequest, + Slot, + Specimen, + SpecimenDefinition, + StructureDefinition, + StructureMap, + Subscription, + Substance, + SubstanceNucleicAcid, + SubstancePolymer, + SubstanceProtein, + SubstanceReferenceInformation, + SubstanceSourceMaterial, + SubstanceSpecification, + SupplyDelivery, + SupplyRequest, + Task, + TerminologyCapabilities, + TestReport, + TestScript, + ValueSet, + VerificationResult, + VisionPrescription, +} diff --git a/specification/eventgrid/data-plane/cadl/IotHub.cadl b/specification/eventgrid/data-plane/cadl/IotHub.cadl new file mode 100644 index 000000000000..649518d82562 --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/IotHub.cadl @@ -0,0 +1,110 @@ +@doc("Schema of the Data property of an EventGridEvent for a device life cycle event (DeviceCreated, DeviceDeleted).") +model DeviceLifeCycleEventProperties { + @doc("The unique identifier of the device. This case-sensitive string can be up to 128 characters long, and supports ASCII 7-bit alphanumeric characters plus the following special characters: - : . + % _ # * ? ! ( ) , = @ ; $ '.") + deviceId?: string; + + @doc("Name of the IoT Hub where the device was created or deleted.") + hubName?: string; + + @doc("Information about the device twin, which is the cloud representation of application device metadata.") + twin?: DeviceTwinInfo; +} + +@doc("Information about the device twin, which is the cloud representation of application device metadata.") +model DeviceTwinInfo { + @doc("Authentication type used for this device: either SAS, SelfSigned, or CertificateAuthority.") + authenticationType?: string; + + @doc("Count of cloud to device messages sent to this device.") + cloudToDeviceMessageCount?: number; + + @doc("Whether the device is connected or disconnected.") + connectionState?: string; + + @doc("The unique identifier of the device twin.") + deviceId?: string; + + @doc("A piece of information that describes the content of the device twin. Each etag is guaranteed to be unique per device twin.") + etag?: string; + + @doc("The ISO8601 timestamp of the last activity.") + lastActivityTime?: string; + + @doc("Properties JSON element.") + properties?: Map; + + @doc("Whether the device twin is enabled or disabled.") + status?: string; + + @doc("The ISO8601 timestamp of the last device twin status update.") + statusUpdateTime?: string; + + @doc("An integer that is incremented by one each time the device twin is updated.") + version?: number; + + @doc("The thumbprint is a unique value for the x509 certificate, commonly used to find a particular certificate in a certificate store. The thumbprint is dynamically generated using the SHA1 algorithm, and does not physically exist in the certificate.") + x509Thumbprint?: Map; +} + +@doc("Schema of the Data property of an EventGridEvent for a device connection state event (DeviceConnected, DeviceDisconnected).") +model DeviceConnectionStateEventProperties { + @doc("The unique identifier of the device. This case-sensitive string can be up to 128 characters long, and supports ASCII 7-bit alphanumeric characters plus the following special characters: - : . + % _ # * ? ! ( ) , = @ ; $ '.") + deviceId?: string; + + @doc("The unique identifier of the module. This case-sensitive string can be up to 128 characters long, and supports ASCII 7-bit alphanumeric characters plus the following special characters: - : . + % _ # * ? ! ( ) , = @ ; $ '.") + moduleId?: string; + + @doc("Name of the IoT Hub where the device was created or deleted.") + hubName?: string; + + @doc("Information about the device connection state event.") + deviceConnectionStateEventInfo?: DeviceConnectionStateEventInfo; +} + +@doc("Schema of the Data property of an EventGridEvent for a device telemetry event (DeviceTelemetry).") +model DeviceTelemetryEventProperties { + @doc("The content of the message from the device.") + body?: Map; + + @doc("Application properties are user-defined strings that can be added to the message. These fields are optional.") + properties?: Map; + + @doc("System properties help identify contents and source of the messages.") + systemProperties?: Map; +} + +@doc("A portion of the properties that can be written only by the application back-end, and read by the device.") +model DeviceTwinProperties { + @doc("Metadata information for the properties JSON document.") + metadata?: DeviceTwinMetadata; + + @doc("Version of device twin properties.") + version?: number; +} + +@doc("Metadata information for the properties JSON document.") +model DeviceTwinMetadata { + @doc("The ISO8601 timestamp of the last time the properties were updated.") + lastUpdated?: string; +} + +@doc("Information about the device connection state event.") +model DeviceConnectionStateEventInfo { + @doc("Sequence number is string representation of a hexadecimal number. string compare can be used to identify the larger number because both in ASCII and HEX numbers come after alphabets. If you are converting the string to hex, then the number is a 256 bit number.") + sequenceNumber?: string; +} + +@doc("Event data for Microsoft.Devices.DeviceCreated event.") +model IotHubDeviceCreatedEventData is DeviceLifeCycleEventProperties; + +@doc("Event data for Microsoft.Devices.DeviceDeleted event.") +model IotHubDeviceDeletedEventData is DeviceLifeCycleEventProperties; + +@doc("Event data for Microsoft.Devices.DeviceConnected event.") +model IotHubDeviceConnectedEventData is DeviceConnectionStateEventProperties; + +@doc("Event data for Microsoft.Devices.DeviceDisconnected event.") +model IotHubDeviceDisconnectedEventData is DeviceConnectionStateEventProperties; + +@doc("Event data for Microsoft.Devices.DeviceTelemetry event.") +model IotHubDeviceTelemetryEventData is DeviceTelemetryEventProperties; diff --git a/specification/eventgrid/data-plane/cadl/KeyVault.cadl b/specification/eventgrid/data-plane/cadl/KeyVault.cadl new file mode 100644 index 000000000000..67f1e05e7683 --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/KeyVault.cadl @@ -0,0 +1,53 @@ +model KeyVaultCertificateBase { + @doc("The id of the object that triggered this event.") + Id?: string; + + @doc("Key vault name of the object that triggered this event.") + VaultName?: string; + + @doc("The type of the object that triggered this event") + ObjectType?: string; + + @doc("The name of the object that triggered this event") + ObjectName?: string; + + @doc("The version of the object that triggered this event") + Version?: string; + + @doc("Not before date of the object that triggered this event") + NBF?: float64; + + @doc("The expiration date of the object that triggered this event") + EXP?: float64; +} + + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.CertificateNewVersionCreated event.") +model KeyVaultCertificateNewVersionCreatedEventData is KeyVaultCertificateBase; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.CertificateNearExpiry event.") +model KeyVaultCertificateNearExpiryEventData is KeyVaultCertificateBase; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.CertificateExpired event.") +model KeyVaultCertificateExpiredEventData is KeyVaultCertificateBase; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.KeyNewVersionCreated event.") +model KeyVaultKeyNewVersionCreatedEventData is KeyVaultCertificateBase; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.KeyNearExpiry event.") +model KeyVaultKeyNearExpiryEventData is KeyVaultCertificateBase; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.KeyExpired event.") +model KeyVaultKeyExpiredEventData is KeyVaultCertificateBase; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.SecretNewVersionCreated event.") +model KeyVaultSecretNewVersionCreatedEventData is KeyVaultCertificateBase; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.SecretNearExpiry event.") +model KeyVaultSecretNearExpiryEventData is KeyVaultCertificateBase; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.SecretExpired event.") +model KeyVaultSecretExpiredEventData is KeyVaultCertificateBase; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.VaultAccessPolicyChanged event.") +model KeyVaultVaultAccessPolicyChangedEventData is KeyVaultCertificateBase; diff --git a/specification/eventgrid/data-plane/cadl/MachineLearningServices.cadl b/specification/eventgrid/data-plane/cadl/MachineLearningServices.cadl new file mode 100644 index 000000000000..e3ea70e493de --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/MachineLearningServices.cadl @@ -0,0 +1,104 @@ +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.MachineLearningServices.ModelRegistered event.") +model MachineLearningServicesModelRegisteredEventData { + @doc("The name of the model that was registered.") + modelName?: string; + + @doc("The version of the model that was registered.") + modelVersion?: string; + + @doc("The tags of the model that was registered.") + modelTags?: Map; + + @doc("The properties of the model that was registered.") + modelProperties?: Map; +} + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.MachineLearningServices.ModelDeployed event.") +model MachineLearningServicesModelDeployedEventData { + @doc("The name of the deployed service.") + serviceName?: string; + + @doc("The compute type (e.g. ACI, AKS) of the deployed service.") + serviceComputeType?: string; + + @doc("A common separated list of model IDs. The IDs of the models deployed in the service.") + modelIds?: string; + + @doc("The tags of the deployed service.") + serviceTags?: Map; + + @doc("The properties of the deployed service.") + serviceProperties?: Map; +} + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.MachineLearningServices.RunCompleted event.") +model MachineLearningServicesRunCompletedEventData { + @doc("The ID of the experiment that the run belongs to.") + experimentId?: string; + + @doc("The name of the experiment that the run belongs to.") + experimentName?: string; + + @doc("The ID of the Run that was completed.") + runId?: string; + + @doc("The Run Type of the completed Run.") + runType?: string; + + @doc("The tags of the completed Run.") + runTags?: Map; + + @doc("The properties of the completed Run.") + runProperties?: Map; +} + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.MachineLearningServices.DatasetDriftDetected event.") +model MachineLearningServicesDatasetDriftDetectedEventData { + @doc("The ID of the data drift monitor that triggered the event.") + dataDriftId?: string; + + @doc("The name of the data drift monitor that triggered the event.") + dataDriftName?: string; + + @doc("The ID of the Run that detected data drift.") + runId?: string; + + @doc("The ID of the base Dataset used to detect drift.") + baseDatasetId?: string; + + @doc("The ID of the target Dataset used to detect drift.") + targetDatasetId?: string; + + @doc("The coefficient result that triggered the event.") + driftCoefficient?: float64; + + @doc("The start time of the target dataset time series that resulted in drift detection.") + startTime?: zonedDateTime; + + @doc("The end time of the target dataset time series that resulted in drift detection.") + endTime?: zonedDateTime; +} + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.MachineLearningServices.RunStatusChanged event.") +model MachineLearningServicesRunStatusChangedEventData { + @doc("The ID of the experiment that the Machine Learning Run belongs to.") + experimentId?: string; + + @doc("The name of the experiment that the Machine Learning Run belongs to.") + experimentName?: string; + + @doc("The ID of the Machine Learning Run.") + runId?: string; + + @doc("The Run Type of the Machine Learning Run.") + runType?: string; + + @doc("The tags of the Machine Learning Run.") + runTags?: Map; + + @doc("The properties of the Machine Learning Run.") + runProperties?: Map; + + @doc("The status of the Machine Learning Run.") + runStatus?: string; +} diff --git a/specification/eventgrid/data-plane/cadl/Maps.cadl b/specification/eventgrid/data-plane/cadl/Maps.cadl new file mode 100644 index 000000000000..e739e78906db --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/Maps.cadl @@ -0,0 +1,44 @@ +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Maps.GeofenceEntered event.") +model MapsGeofenceEnteredEventData is MapsGeofenceEventProperties; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Maps.GeofenceExited event.") +model MapsGeofenceExitedEventData is MapsGeofenceEventProperties; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Maps.GeofenceResult event.") +model MapsGeofenceResultEventData is MapsGeofenceEventProperties; + +@doc("Schema of the Data property of an EventGridEvent for a Geofence event (GeofenceEntered, GeofenceExited, GeofenceResult).") +model MapsGeofenceEventProperties { + @doc("Lists of the geometry ID of the geofence which is expired relative to the user time in the request.") + expiredGeofenceGeometryId?: string[]; + + @doc("Lists the fence geometries that either fully contain the coordinate position or have an overlap with the searchBuffer around the fence.") + geometries?: MapsGeofenceGeometry[]; + + @doc("Lists of the geometry ID of the geofence which is in invalid period relative to the user time in the request.") + invalidPeriodGeofenceGeometryId?: string[]; + + @doc("True if at least one event is published to the Azure Maps event subscriber, false if no event is published to the Azure Maps event subscriber.") + isEventPublished?: boolean; +} + +@doc("The geofence geometry.") +model MapsGeofenceGeometry { + @doc("ID of the device.") + deviceId?: string; + + @doc("Distance from the coordinate to the closest border of the geofence. Positive means the coordinate is outside of the geofence. If the coordinate is outside of the geofence, but more than the value of searchBuffer away from the closest geofence border, then the value is 999. Negative means the coordinate is inside of the geofence. If the coordinate is inside the polygon, but more than the value of searchBuffer away from the closest geofencing border,then the value is -999. A value of 999 means that there is great confidence the coordinate is well outside the geofence. A value of -999 means that there is great confidence the coordinate is well within the geofence.") + distance?: number; + + @doc("The unique ID for the geofence geometry.") + geometryId?: string; + + @doc("Latitude of the nearest point of the geometry.") + nearestLat?: number; + + @doc("Longitude of the nearest point of the geometry.") + nearestLon?: number; + + @doc("The unique id returned from user upload service when uploading a geofence. Will not be included in geofencing post API.") + udId?: string; +} diff --git a/specification/eventgrid/data-plane/cadl/MediaServices.cadl b/specification/eventgrid/data-plane/cadl/MediaServices.cadl new file mode 100644 index 000000000000..42915e23217e --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/MediaServices.cadl @@ -0,0 +1,318 @@ +enum MediaJobState { + Canceled, + Canceling, + Error, + Finished, + Processing, + Queued, + Scheduled, +} + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Media.JobStateChange event.") +model MediaJobStateChangeEventData { + @doc("The previous state of the Job.") + previousState?: MediaJobState; + @doc("The new state of the Job.") + state?: MediaJobState; + @doc("Gets the Job correlation data.") + correlationData?: Map; +} + +enum MediaJobErrorCode { + ServiceError, + ServiceTransientError, + DownloadNotAccessible, + DownloadTransientError, + UploadNotAccessible, + UploadTransientError, + ConfigurationUnsupported, + ContentMalformed, + ContentUnsupported, + IdentityUnsupported, +} + +enum MediaJobErrorCategory { + Service, + Download, + Upload, + Configuration, + Content, + Account, +} + +enum MediaJobRetry { + DoNotRetry, + MayRetry, +} + +@doc("Details of JobOutput errors.") +model MediaJobError { + @doc("Error code describing the error.") + code?: MediaJobErrorCode; + @doc("A human-readable language-dependent representation of the error.") + message?: string; + @doc("Helps with categorization of errors.") + category?: MediaJobErrorCategory; + @doc("Indicates that it may be possible to retry the Job. If retry is unsuccessful, please contact Azure support via Azure Portal.") + retry?: MediaJobRetry; + @doc("An array of details about specific errors that led to this reported error.") + details?: MediaJobErrorDetail[]; +} + +@doc("Details of JobOutput errors.") +model MediaJobErrorDetail { + @doc("Code describing the error detail.") + code?: string; + @doc("A human-readable representation of the error.") + message?: string; +} + +@doc("The event data for a Job output.") +model MediaJobOutput { + @doc("The discriminator for derived types.") + @odata.type?: string; + @doc("Gets the Job output error.") + error?: MediaJobError; + @doc("Gets the Job output label.") + label?: string; + @doc("Gets the Job output progress.") + progress: int64; + @doc("Gets the Job output state.") + state: MediaJobState; +} + +@doc("The event data for a Job output asset.") +model MediaJobOutputAsset { + @doc("Gets the Job output asset name.") + assetName?: string; +} + +@doc("Job Output Progress Event Data. Schema of the Data property of an EventGridEvent for a Microsoft.Media.JobOutputProgress event.") +model MediaJobOutputProgressEventData { + @doc("Gets the Job output label.") + label?: string; + @doc("Gets the Job output progress.") + progress?: int64; + @doc("Gets the Job correlation data.") + jobCorrelationData?: Map; +} + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Media.JobOutputStateChange event.") +model MediaJobOutputStateChangeEventData { + @doc("The previous state of the Job.") + previousState?: MediaJobState; + @doc("Gets the output.") + output?: MediaJobOutput; + @doc("Gets the Job correlation data.") + jobCorrelationData?: Map; +} + +@doc("Job scheduled event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobScheduled event.") +model MediaJobScheduledEventData is MediaJobStateChangeEventData; + +@doc("Job processing event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobProcessing event.") +model MediaJobProcessingEventData is MediaJobStateChangeEventData; + +@doc("Job canceling event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobCanceling event.") +model MediaJobCancelingEventData is MediaJobStateChangeEventData; + +@doc("Job finished event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobFinished event.") +model MediaJobFinishedEventData { + @doc("Gets the Job outputs.") + outputs?: MediaJobOutput[]; +} + +@doc("Job canceled event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobCanceled event.") +model MediaJobCanceledEventData { + @doc("Gets the Job outputs.") + outputs?: MediaJobOutput[]; +} + +@doc("Job error state event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobErrored event.") +model MediaJobErroredEventData { + @doc("Gets the Job outputs.") + outputs?: MediaJobOutput[]; +} + +@doc("Job output canceled event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobOutputCanceled event.") +@Autorest.extension("x-ms-discriminator-value", "#Microsoft.Media.JobOutputCanceled") +model MediaJobOutputCanceledEventData is MediaJobOutputStateChangeEventData; + +@doc("Job output canceling event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobOutputCanceling event.") +@Autorest.extension("x-ms-discriminator-value", "#Microsoft.Media.JobOutputCanceling") +model MediaJobOutputCancelingEventData is MediaJobOutputStateChangeEventData; + +@doc("Job output error event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobOutputErrored event.") +@Autorest.extension("x-ms-discriminator-value", "#Microsoft.Media.JobOutputErrored") +model MediaJobOutputErroredEventData is MediaJobOutputStateChangeEventData; + +@doc("Job output finished event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobOutputFinished event.") +@Autorest.extension("x-ms-discriminator-value", "#Microsoft.Media.JobOutputFinished") +model MediaJobOutputFinishedEventData is MediaJobOutputStateChangeEventData; + +@doc("Job output processing event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobOutputProcessing event.") +@Autorest.extension("x-ms-discriminator-value", "#Microsoft.Media.JobOutputProcessing") +model MediaJobOutputProcessingEventData is MediaJobOutputStateChangeEventData; + +@doc("Job output scheduled event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobOutputScheduled event.") +@Autorest.extension("x-ms-discriminator-value", "#Microsoft.Media.JobOutputCanceled") +model MediaJobOutputScheduledEventData is MediaJobOutputStateChangeEventData; + +model MediaLiveEventConnectionBaseData { + @doc("Gets the ingest URL provided by the live event.") + ingestUrl?: string; + @doc("Gets the stream Id.") + streamId?: string; + @doc("Gets the remote IP.") + encoderIp?: string; + @doc("Gets the remote port.") + encoderPort?: string; +} +@doc("Encoder connect event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventEncoderConnected event.") +model MediaLiveEventEncoderConnectedEventData is MediaLiveEventConnectionBaseData; + +@doc("Encoder connection rejected event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventConnectionRejected event.") +model MediaLiveEventConnectionRejectedEventData { + ...MediaLiveEventConnectionBaseData; + + @doc("Gets the result code.") + resultCode?: string; +} + +@doc("Encoder disconnected event data. Schema of the Data property of an EventGridEvent for a Microsoft.Media.LiveEventEncoderDisconnected event.") +model MediaLiveEventEncoderDisconnectedEventData { + ...MediaLiveEventConnectionBaseData; + + @doc("Gets the result code.") + resultCode?: string; +} + +@doc("Encoder connect event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventIncomingStreamReceived event.") +model MediaLiveEventIncomingStreamReceivedEventData { + @doc("Gets the ingest URL provided by the live event.") + ingestUrl?: string; + @doc("Gets the type of the track (Audio / Video).") + trackType?: string; + @doc("Gets the track name.") + trackName?: string; + @doc("Gets the bitrate of the track.") + bitrate?: int64; + @doc("Gets the remote IP.") + encoderIp?: string; + @doc("Gets the remote port.") + encoderPort?: string; + @doc("Gets the first timestamp of the data chunk received.") + timestamp?: string; + @doc("Gets the duration of the first data chunk.") + duration?: string; + @doc("Gets the timescale in which timestamp is represented.") + timescale?: string; +} + +@doc("Incoming streams out of sync event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventIncomingStreamsOutOfSync event.") +model MediaLiveEventIncomingStreamsOutOfSyncEventData { + @doc("Gets the minimum last timestamp received.") + minLastTimestamp?: string; + @doc("Gets the type of stream with minimum last timestamp.") + typeOfStreamWithMinLastTimestamp?: string; + @doc("Gets the maximum timestamp among all the tracks (audio or video).") + maxLastTimestamp?: string; + @doc("Gets the type of stream with maximum last timestamp.") + typeOfStreamWithMaxLastTimestamp?: string; + @doc("Gets the timescale in which \"MinLastTimestamp\" is represented.") + timescaleOfMinLastTimestamp?: string; + @doc("Gets the timescale in which \"MaxLastTimestamp\" is represented.") + timescaleOfMaxLastTimestamp?: string; +} + +@doc("Incoming video stream out of sync event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventIncomingVideoStreamsOutOfSync event.") +model MediaLiveEventIncomingVideoStreamsOutOfSyncEventData { + @doc("Gets the first timestamp received for one of the quality levels.") + firstTimestamp?: string; + @doc("Gets the duration of the data chunk with first timestamp.") + firstDuration?: string; + @doc("Gets the timestamp received for some other quality levels.") + secondTimestamp?: string; + @doc("Gets the duration of the data chunk with second timestamp.") + secondDuration?: string; + @doc("Gets the timescale in which both the timestamps and durations are represented.") + timescale?: string; +} + +@doc("Ingest fragment dropped event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventIncomingDataChunkDropped event.") +model MediaLiveEventIncomingDataChunkDroppedEventData { + @doc("Gets the timestamp of the data chunk dropped.") + timestamp?: string; + @doc("Gets the type of the track (Audio / Video).") + trackType?: string; + @doc("Gets the bitrate of the track.") + bitrate?: int64; + @doc("Gets the timescale of the Timestamp.") + timescale?: string; + @doc("Gets the result code for fragment drop operation.") + resultCode?: string; + @doc("Gets the name of the track for which fragment is dropped.") + trackName?: string; +} + +@doc("Ingest heartbeat event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventIngestHeartbeat event.") +model MediaLiveEventIngestHeartbeatEventData { + @doc("Gets the type of the track (Audio / Video).") + trackType?: string; + @doc("Gets the track name.") + trackName?: string; + @doc("Gets the Live Transcription language.") + transcriptionLanguage?: string; + @doc("Gets the Live Transcription state.") + transcriptionState?: string; + @doc("Gets the bitrate of the track.") + bitrate?: int64; + @doc("Gets the incoming bitrate.") + incomingBitrate?: int64; + @doc("Gets the track ingest drift value.") + ingestDriftValue?: string; + @doc("Gets the arrival UTC time of the last fragment.") + lastFragmentArrivalTime?: string; + @doc("Gets the last timestamp.") + lastTimestamp?: string; + @doc("Gets the timescale of the last timestamp.") + timescale?: string; + @doc("Gets the fragment Overlap count.") + overlapCount?: int64; + @doc("Gets the fragment Discontinuity count.") + discontinuityCount?: int64; + @doc("Gets Non increasing count.") + nonincreasingCount?: int64; + @doc("Gets a value indicating whether unexpected bitrate is present or not.") + unexpectedBitrate?: boolean; + @doc("Gets the state of the live event.") + state?: string; + @doc("Gets a value indicating whether preview is healthy or not.") + healthy?: boolean; +} + +@doc("Ingest track discontinuity detected event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventTrackDiscontinuityDetected event.") +model MediaLiveEventTrackDiscontinuityDetectedEventData { + @doc("Gets the type of the track (Audio / Video).") + trackType?: string; + @doc("Gets the track name.") + trackName?: string; + @doc("Gets the bitrate.") + bitrate?: int64; + @doc("Gets the timestamp of the previous fragment.") + previousTimestamp?: string; + @doc("Gets the timestamp of the current fragment.") + newTimestamp?: string; + @doc("Gets the timescale in which both timestamps and discontinuity gap are represented.") + timescale?: string; + @doc("Gets the discontinuity gap between PreviousTimestamp and NewTimestamp.") + discontinuityGap?: string; +} + +@doc("Channel Archive heartbeat event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventChannelArchiveHeartbeat event.") +model MediaLiveEventChannelArchiveHeartbeatEventData { + @doc("Gets the channel latency in ms.") + channelLatencyMs: string; + @doc("Gets the latency result code.") + latencyResultCode: string; +} diff --git a/specification/eventgrid/data-plane/cadl/PolicyInsights.cadl b/specification/eventgrid/data-plane/cadl/PolicyInsights.cadl new file mode 100644 index 000000000000..9455ea207940 --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/PolicyInsights.cadl @@ -0,0 +1,31 @@ +model PolicyInsightsBaseEventData { + @doc("The time that the resource was scanned by Azure Policy in the Universal ISO 8601 DateTime format yyyy-MM-ddTHH:mm:ss.fffffffZ.") + timestamp?: zonedDateTime; + + @doc("The resource ID of the policy assignment.") + policyAssignmentId?: string; + + @doc("The resource ID of the policy definition.") + policyDefinitionId?: string; + + @doc("The reference ID for the policy definition inside the initiative definition, if the policy assignment is for an initiative. May be empty.") + policyDefinitionReferenceId?: string; + + @doc("The compliance state of the resource with respect to the policy assignment.") + complianceState?: string; + + @doc("The subscription ID of the resource.") + subscriptionId?: string; + + @doc("The compliance reason code. May be empty.") + complianceReasonCode?: string; +} + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.PolicyInsights.PolicyStateCreated event.") +model PolicyInsightsPolicyStateCreatedEventData is PolicyInsightsBaseEventData; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.PolicyInsights.PolicyStateChanged event.") +model PolicyInsightsPolicyStateChangedEventData is PolicyInsightsBaseEventData; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.PolicyInsights.PolicyStateDeleted event.") +model PolicyInsightsPolicyStateDeletedEventData is PolicyInsightsBaseEventData; diff --git a/specification/eventgrid/data-plane/cadl/RedisCache.cadl b/specification/eventgrid/data-plane/cadl/RedisCache.cadl new file mode 100644 index 000000000000..080366a665df --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/RedisCache.cadl @@ -0,0 +1,22 @@ +model RedisBaseEventData { + @doc("The time at which the event occurred.") + timestamp?: zonedDateTime; + + @doc("The name of this event.") + name?: string; + + @doc("The status of this event. Failed or succeeded ") + status?: string; +} + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Cache.PatchingCompleted event.") +model RedisPatchingCompletedEventData is RedisBaseEventData; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Cache.ScalingCompleted event.") +model RedisScalingCompletedEventData is RedisBaseEventData; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Cache.ExportRDBCompleted event.") +model RedisExportRDBCompletedEventData is RedisBaseEventData; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Cache.ImportRDBCompleted event.") +model RedisImportRDBCompletedEventData is RedisBaseEventData; diff --git a/specification/eventgrid/data-plane/cadl/Resources.cadl b/specification/eventgrid/data-plane/cadl/Resources.cadl new file mode 100644 index 000000000000..e130a1182766 --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/Resources.cadl @@ -0,0 +1,88 @@ +model ResourceBaseEventData { + @doc("The tenant ID of the resource.") + tenantId?: string; + + @doc("The subscription ID of the resource.") + subscriptionId?: string; + + @doc("The resource group of the resource.") + resourceGroup?: string; + + @doc("The resource provider performing the operation.") + resourceProvider?: string; + + @doc("The URI of the resource in the operation.") + resourceUri?: string; + + @doc("The operation that was performed.") + operationName?: string; + + @doc("The status of the operation.") + status?: string; + + @doc("The requested authorization for the operation.") + authorization?: ResourceAuthorization; + + @doc("The properties of the claims.") + claims?: Map; + + @doc("An operation ID used for troubleshooting.") + correlationId?: string; + + @doc("The details of the operation.") + httpRequest?: ResourceHttpRequest; +} + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceWriteSuccess event. This is raised when a resource create or update operation succeeds.") +model ResourceWriteSuccessData is ResourceBaseEventData; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceWriteFailure event. This is raised when a resource create or update operation fails.") +model ResourceWriteFailureData is ResourceBaseEventData; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceWriteCancel event. This is raised when a resource create or update operation is canceled.") +model ResourceWriteCancelData is ResourceBaseEventData; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceDeleteSuccess event. This is raised when a resource delete operation succeeds.") +model ResourceDeleteSuccessData is ResourceBaseEventData; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceDeleteFailure event. This is raised when a resource delete operation fails.") +model ResourceDeleteFailureData is ResourceBaseEventData; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceDeleteCancel event. This is raised when a resource delete operation is canceled.") +model ResourceDeleteCancelData is ResourceBaseEventData; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceActionSuccess event. This is raised when a resource action operation succeeds.") +model ResourceActionSuccessData is ResourceBaseEventData; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceActionFailure event. This is raised when a resource action operation fails.") +model ResourceActionFailureData is ResourceBaseEventData; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceActionCancel event. This is raised when a resource action operation is canceled.") +model ResourceActionCancelData is ResourceBaseEventData; + +@doc("The details of the HTTP request.") +model ResourceHttpRequest { + @doc("The client request ID.") + clientRequestId?: string; + + @doc("The client IP address.") + clientIpAddress?: string; + + @doc("The request method.") + method?: string; + + @doc("The url used in the request.") + url?: string; +} + +@doc("The details of the authorization for the resource.") +model ResourceAuthorization { + @doc("The scope of the authorization.") + scope?: string; + + @doc("The action being requested.") + action?: string; + + @doc("The evidence for the authorization.") + evidence?: Map; +} diff --git a/specification/eventgrid/data-plane/cadl/ServiceBus.cadl b/specification/eventgrid/data-plane/cadl/ServiceBus.cadl new file mode 100644 index 000000000000..934f29010808 --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/ServiceBus.cadl @@ -0,0 +1,31 @@ +model ServiceBusBaseEventData { + @doc("The namespace name of the Microsoft.ServiceBus resource.") + namespaceName?: string; + + @doc("The endpoint of the Microsoft.ServiceBus resource.") + requestUri?: string; + + @doc("The entity type of the Microsoft.ServiceBus resource. Could be one of 'queue' or 'subscriber'.") + entityType?: string; + + @doc("The name of the Microsoft.ServiceBus queue. If the entity type is of type 'subscriber', then this value will be null.") + queueName?: string; + + @doc("The name of the Microsoft.ServiceBus topic. If the entity type is of type 'queue', then this value will be null.") + topicName?: string; + + @doc("The name of the Microsoft.ServiceBus topic's subscription. If the entity type is of type 'queue', then this value will be null.") + subscriptionName?: string; +} + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.ServiceBus.ActiveMessagesAvailableWithNoListeners event.") +model ServiceBusActiveMessagesAvailableWithNoListenersEventData is ServiceBusBaseEventData; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.ServiceBus.DeadletterMessagesAvailableWithNoListeners event.") +model ServiceBusDeadletterMessagesAvailableWithNoListenersEventData is ServiceBusBaseEventData; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.ServiceBus.ActiveMessagesAvailablePeriodicNotifications event.") +model ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData is ServiceBusBaseEventData; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.ServiceBus.DeadletterMessagesAvailablePeriodicNotifications event.") +model ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData is ServiceBusBaseEventData; diff --git a/specification/eventgrid/data-plane/cadl/SignalRService.cadl b/specification/eventgrid/data-plane/cadl/SignalRService.cadl new file mode 100644 index 000000000000..758005be1db1 --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/SignalRService.cadl @@ -0,0 +1,24 @@ +model SignalRServiceBaseEventdata { + @doc("The time at which the event occurred.") + timestamp?: zonedDateTime; + + @doc("The hub of connected client connection.") + hubName?: string; + + @doc("The connection Id of connected client connection.") + connectionId?: string; + + @doc("The user Id of connected client connection.") + userId?: string; +} + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.SignalRService.ClientConnectionConnected event.") +model SignalRServiceClientConnectionConnectedEventData is SignalRServiceBaseEventdata; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.SignalRService.ClientConnectionDisconnected event.") +model SignalRServiceClientConnectionDisconnectedEventData { + @doc("The message of error that cause the client connection disconnected.") + errorMessage?: string; + + ...SignalRServiceBaseEventdata; +} diff --git a/specification/eventgrid/data-plane/cadl/Storage.cadl b/specification/eventgrid/data-plane/cadl/Storage.cadl new file mode 100644 index 000000000000..546747deb3ae --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/Storage.cadl @@ -0,0 +1,165 @@ +enum StorageType{ + blob; + directory; +} + +model StorageBaseEventData { + @doc("The name of the API/operation that triggered this event.") + api?: string; + + @doc("A request id provided by the client of the storage API operation that triggered this event.") + clientRequestId?: string; + + @doc("The request id generated by the Storage service for the storage API operation that triggered this event.") + requestId?: string; + + @doc("An opaque string value representing the logical sequence of events for any particular {name} name. Users can use standard string comparison to understand the relative sequence of two events on the same {name} name.", TStorageType) + sequencer?: string; + + @doc("The identity of the requester that triggered this event.") + identity?: string; + + @doc("For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers.") + storageDiagnostics?: Map; +} + +model StorageBaseTypeData { + @doc("The content type of the blob. This is the same as what would be returned in the Content-Type header from the blob.") + contentType?: string; + + @doc("The type of blob.") + blobType?: string; +} + +model StorageUrlBaseEventData { + @doc("The size of the blob in bytes. This is the same as what would be returned in the Content-Length header from the blob.") + contentLength?: int64; + + @doc("The path to the blob.") + url?: string; +} + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Storage.BlobCreated event.") +model StorageBlobCreatedEventData { + @doc("The etag of the blob at the time this event was triggered.") + eTag?: string; + + @doc("The offset of the blob in bytes.") + contentOffset?: int64; + + ...StorageBaseEventData; + ...StorageUrlBaseEventData; + ...StorageBaseTypeData; +} + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Storage.BlobDeleted event.") +model StorageBlobDeletedEventData { + @doc("The path to the blob.") + url?: string; + + ...StorageBaseEventData; + ...StorageBaseTypeData; +} + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Storage.DirectoryCreated event.") +model StorageDirectoryCreatedEventData { + @doc("The etag of the directory at the time this event was triggered.") + eTag?: string; + + @doc("The path to the directory.") + url?: string; + + ...StorageBaseEventData; +} + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Storage.DirectoryDeleted event.") +model StorageDirectoryDeletedEventData { + @doc("The path to the deleted directory.") + url?: string; + + @doc("Is this event for a recursive delete operation.") + recursive?: string; + + ...StorageBaseEventData; +} + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Storage.BlobRenamed event.") +model StorageBlobRenamedEventData { + @doc("The path to the blob that was renamed.") + sourceUrl?: string; + + @doc("The new path to the blob after the rename operation.") + destinationUrl?: string; + + ...StorageBaseEventData; +} + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Storage.DirectoryRenamed event.") +model StorageDirectoryRenamedEventData { + @doc("The path to the directory that was renamed.") + sourceUrl?: string; + + @doc("The new path to the directory after the rename operation.") + destinationUrl?: string; + + ...StorageBaseEventData; +} + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Storage.LifecyclePolicyCompleted event.") +model StorageLifecyclePolicyCompletedEventData { + @doc("The time the policy task was scheduled.") + scheduleTime?: string; + deleteSummary?: StorageLifecyclePolicyActionSummaryDetail; + tierToCoolSummary?: StorageLifecyclePolicyActionSummaryDetail; + tierToArchiveSummary?: StorageLifecyclePolicyActionSummaryDetail; +} + +@doc("Execution statistics of a specific policy action in a Blob Management cycle.") +model StorageLifecyclePolicyActionSummaryDetail { + @doc("Total number of objects to be acted on by this action.") + totalObjectsCount?: int64; + + @doc("Number of success operations of this action.") + successCount?: int64; + + @doc("Error messages of this action if any.") + errorList?: string; +} + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Storage.BlobTierChanged event.") +model StorageBlobTierChangedEventData { + ...StorageBaseEventData; + ...StorageUrlBaseEventData; + ...StorageBaseTypeData; +} + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Storage.AsyncOperationInitiated event.") +model StorageAsyncOperationInitiatedEventData { + ...StorageBaseEventData; + ...StorageUrlBaseEventData; + ...StorageBaseTypeData; +} + +@doc("Schema of the Data property of an EventGridEvent for an Microsoft.Storage.BlobInventoryPolicyCompleted event.") +model StorageBlobInventoryPolicyCompletedEventData { + @doc("The time at which inventory policy was scheduled.") + scheduleDateTime?: zonedDateTime; + + @doc("The account name for which inventory policy is registered.") + accountName?: string; + + @doc("The rule name for inventory policy.") + ruleName?: string; + + @doc("The status of inventory run, it can be Succeeded/PartiallySucceeded/Failed.") + policyRunStatus?: string; + + @doc("The status message for inventory run.") + policyRunStatusMessage?: string; + + @doc("The policy run id for inventory run.") + policyRunId?: string; + + @doc("The blob URL for manifest file for inventory run.") + manifestBlobUrl?: string; +} diff --git a/specification/eventgrid/data-plane/cadl/Web.cadl b/specification/eventgrid/data-plane/cadl/Web.cadl new file mode 100644 index 000000000000..c92180af609a --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/Web.cadl @@ -0,0 +1,137 @@ +model WebAppBaseEventData { + appEventTypeDetail?: AppEventTypeDetail; + + @doc("name of the web site that had this event.") + name?: string; + + @doc("The client request id generated by the app service for the site API operation that triggered this event.") + clientRequestId?: string; + + @doc("The correlation request id generated by the app service for the site API operation that triggered this event.") + correlationRequestId?: string; + + @doc("The request id generated by the app service for the site API operation that triggered this event.") + requestId?: string; + + @doc("HTTP request URL of this operation.") + address?: string; + + @doc("HTTP verb of this operation.") + verb?: string; +} + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.AppUpdated event.") +model WebAppUpdatedEventData is WebAppBaseEventData; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.BackupOperationStarted event.") +model WebBackupOperationStartedEventData is WebAppBaseEventData; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.BackupOperationCompleted event.") +model WebBackupOperationCompletedEventData is WebAppBaseEventData; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.BackupOperationFailed event.") +model WebBackupOperationFailedEventData is WebAppBaseEventData; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.RestoreOperationStarted event.") +model WebRestoreOperationStartedEventData is WebAppBaseEventData; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.RestoreOperationCompleted event.") +model WebRestoreOperationCompletedEventData is WebAppBaseEventData; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.RestoreOperationFailed event.") +model WebRestoreOperationFailedEventData is WebAppBaseEventData; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapStarted event.") +model WebSlotSwapStartedEventData is WebAppBaseEventData; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapCompleted event.") +model WebSlotSwapCompletedEventData is WebAppBaseEventData; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapFailed event.") +model WebSlotSwapFailedEventData is WebAppBaseEventData; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapWithPreviewStarted event.") +model WebSlotSwapWithPreviewStartedEventData is WebAppBaseEventData; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapWithPreviewCancelled event.") +model WebSlotSwapWithPreviewCancelledEventData is WebAppBaseEventData; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.AppServicePlanUpdated event.") +model WebAppServicePlanUpdatedEventData { + appServicePlanEventTypeDetail?: AppServicePlanEventTypeDetail; + + @doc("name of the app service plan that had this event.") + name?: string; + + @doc("The client request id generated by the app service for the app service plan API operation that triggered this event.") + clientRequestId?: string; + + @doc("The correlation request id generated by the app service for the app service plan API operation that triggered this event.") + correlationRequestId?: string; + + @doc("The request id generated by the app service for the app service plan API operation that triggered this event.") + requestId?: string; + + @doc("HTTP request URL of this operation.") + address?: string; + + @doc("HTTP verb of this operation.") + verb?: string; + + @doc("sku of app service plan.") + sku?: Map; +} + +@knownValues(AppActionKV) +model AppAction is string {} +enum AppActionKV { + Restarted, + Stopped, + ChangedAppSettings, + Started, + Completed, + Failed, +} + +@doc("Detail of action on the app.") +model AppEventTypeDetail { + @doc("Type of action of the operation.") + action?: AppAction; +} + +@knownValues(StampKindKV) +model StampKind is string {} +enum StampKindKV { + Public, + AseV1, + AseV2, +} + +@knownValues(AppServicePlanActionKV) +model AppServicePlanAction is string {} +enum AppServicePlanActionKV { + @doc("App Service plan is being updated.") + Updated, +} + +@doc("Detail of action on the app service plan.") +model AppServicePlanEventTypeDetail { + @doc("Kind of environment where app service plan is.") + stampKind?: StampKind; + + @doc("Type of action on the app service plan.") + action?: AppServicePlanAction; + status?: AsyncStatus; +} + +@knownValues(AsyncStatusKV) +model AsyncStatus is string {} +enum AsyncStatusKV { + @doc("Async operation has started.") + Started, + @doc("Async operation has completed.") + Completed, + @doc("Async operation failed to complete.") + Failed, +} + diff --git a/specification/eventgrid/data-plane/cadl/main.cadl b/specification/eventgrid/data-plane/cadl/main.cadl new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/specification/eventgrid/data-plane/cadl/package-lock.json b/specification/eventgrid/data-plane/cadl/package-lock.json new file mode 100644 index 000000000000..b84242531e15 --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/package-lock.json @@ -0,0 +1,17 @@ +{ + "name": "cadl", + "requires": true, + "lockfileVersion": 1, + "dependencies": { + "@cadl-lang/openapi3": { + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@cadl-lang/openapi3/-/openapi3-0.13.0.tgz", + "integrity": "sha512-XLWQ6QZ5M9F/9SBeYJyOlhA7E0PriZTLJDjtz4uPNVr5RQOegLiH6TWQf+XEiA1co5CSPl5IZ7gd1HHct4Tdcw==" + }, + "@cadl-lang/rest": { + "version": "0.15.1", + "resolved": "https://registry.npmjs.org/@cadl-lang/rest/-/rest-0.15.1.tgz", + "integrity": "sha512-J7gaLFri1huDzUPmndvg7JTJZ8dnQ9csl1PafGbvypjga5Ct9+YZcAInErMKFgnxJJ5NVnDz5auD3579eOCYWg==" + } + } +} diff --git a/specification/eventgrid/data-plane/cadl/package.json b/specification/eventgrid/data-plane/cadl/package.json new file mode 100644 index 000000000000..b4e67e018c84 --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/package.json @@ -0,0 +1,10 @@ +{ + "name": "cadl", + "dependencies": { + "@cadl-lang/compiler": "latest", + "@cadl-lang/openapi3": "^0.13.0", + "@cadl-lang/rest": "^0.15.1", + "@azure-tools/cadl-autorest": "latest" + }, + "private": true +} diff --git a/specification/eventgrid/data-plane/import_models.py b/specification/eventgrid/data-plane/import_models.py new file mode 100644 index 000000000000..cf2117c8d34d --- /dev/null +++ b/specification/eventgrid/data-plane/import_models.py @@ -0,0 +1,163 @@ +import json +import sys + +def _extract_description(data): + desc = data.get("description", None) + desc = desc.replace('"', '\\"') if desc else desc + return desc + + +class CadlEnum: + def __init__(self, ctx, data, name=None): + self._ctx = ctx + enum = data.get("enum", None) + enum_ext = data.get("x-ms-enum", None) + self.name = enum_ext["name"] if enum_ext else name + self.model_as_string = enum_ext.get("modelAsString", False) if enum_ext else False + self.values = enum + + def to_cadl(self): + lines = [] + if self.model_as_string: + lines.append(f"@knownValues({self.name}KV)") + lines.append(f"model {self.name} is string \x7b\x7d") + lines.append(f"enum {self.name}KV \x7b") + for val in self.values: + lines.append(f"\t{val},") + lines.append("}") + else: + lines.append(f"enum {self.name} \x7b") + for val in self.values: + lines.append(f"\t{val},") + lines.append("}") + return "\n".join(lines) + + +class CadlProperty: + def __init__(self, ctx, name, data, required): + self._ctx = ctx + self.name = name + self.required = required + self.description = _extract_description(data) + self.type = self._parse_type(data) + + _STRING_MAP = { + "date-time": "zonedDateTime", + "date": "plainDate", + "time": "plainTime", + "uuid": "string", # No uuid type in CADL + } + + _NUMBER_MAP = { + "float": "float64", + "double": "float64" + } + + _INTEGER_MAP = { + "int16": "int16", + "int32": "int32", + "int64": "int64" + } + + def _parse_type_format(self, data): + type = data["type"] + format = data.get("format", None) + if type == "string": + return CadlProperty._STRING_MAP[format] if format else type + elif type == "number": + return CadlProperty._NUMBER_MAP[format] if format else type + elif type == "integer": + return CadlProperty._INTEGER_MAP[format] if format else type + elif type == "boolean": + assert format == None + return type + elif type == "object": + return "Map" + raise TypeError(f"Unexpected type: {type}") + + def _parse_type(self, data): + ref = data.get("$ref", None) + enum = data.get("enum", None) + type = data.get("type", None) + if ref: + return ref.rsplit("/", 1)[-1] + elif enum: + enum_ext = data.get("x-ms-enum", None) + self._ctx._models.append(CadlEnum(self._ctx, data)) + return enum_ext["name"] + elif type == "array": + item_data = data["items"] + item_type = self._parse_type(item_data) + return f"{item_type}[]" + else: + return self._parse_type_format(data) + + def to_cadl(self): + lines = [] + if self.description: + lines.append(f'\t@doc("{self.description}")') + lines.append(f"\t{self.name}{':' if self.required else '?:'} {self.type};") + return lines + + +class CadlModel: + def __init__(self, ctx, name, data): + self._ctx = ctx + self.name = name + self.description = _extract_description(data) + self.type = data.get("type", None) + self.properties = [] + required = data.get("required", []) + properties = data.get("properties", []) + if properties: + for name, data in properties.items(): + self.properties.append(CadlProperty(ctx, name, data, name in required)) + + def to_cadl(self): + lines = [] + if self.description: + lines.append(f'@doc("{self.description}")') + lines.append(f"model {self.name} \x7b") + for property in self.properties: + lines += property.to_cadl() + lines.append("}") + return "\n".join(lines) + +class SwaggerImport: + + def __init__(self): + self._models = [] + + # args = sys.argv[1:] + # if len(args) != 2: + # print("usage: import_models.py SRC DST") + # sys.exit(1) + + base_path = "C:/Users/Administrator/Documents/Workspace/azure-rest-api-specs/specification/eventgrid/data-plane/" + src = base_path + "Microsoft." + sys.argv[1] + "/stable/2018-01-01/" + sys.argv[-1] + ".json" + self._dest = base_path + "cadl/" + sys.argv[-1] + ".cadl" + with open(src, "r") as infile: + swagger = json.loads(infile.read()) + + models = swagger.get('parameters', {}) + models.update(swagger["definitions"]) + self._process_models(models) + + def _process_models(self, data): + for key, value in data.items(): + enum = value.get("enum", None) + if enum: + self._models.append(CadlEnum(self, value, key)) + else: + self._models.append(CadlModel(self, key, value)) + + def save(self): + dest = self._dest + dest = f"{dest}.cadl" if not dest.endswith(".cadl") else dest + with open(self._dest, "w") as outfile: + for model in self._models: + outfile.write(model.to_cadl()) + outfile.write("\n\n") + +model = SwaggerImport() +model.save() From 143a6fbec4757d9b0a61bdbd83bfa92d83c8f1a7 Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Mon, 7 Nov 2022 12:59:56 -0800 Subject: [PATCH 02/65] updating healthcare api enum for cadl --- specification/eventgrid/data-plane/cadl/HealthcareApis.cadl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/specification/eventgrid/data-plane/cadl/HealthcareApis.cadl b/specification/eventgrid/data-plane/cadl/HealthcareApis.cadl index a8c432f826fa..2b30e63ce2d2 100644 --- a/specification/eventgrid/data-plane/cadl/HealthcareApis.cadl +++ b/specification/eventgrid/data-plane/cadl/HealthcareApis.cadl @@ -21,6 +21,12 @@ model HealthcareFhirResourceUpdatedEventData is HealthcareFhirResourceBaseEventD @doc("Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.FhirResourceDeleted event.") model HealthcareFhirResourceDeletedEventData is HealthcareFhirResourceBaseEventData; +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.DicomImageCreated event.") +model HealthcareDicomImageCreatedEventData is HealthcareFhirResourceBaseEventData; + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.DicomImageDeleted event.") +model HealthcareDicomImageDeletedEventData is HealthcareFhirResourceBaseEventData; + @knownValues(HealthcareFhirResourceTypeKV) model HealthcareFhirResourceType is string {} enum HealthcareFhirResourceTypeKV { From 36f00c80e47d0afba14017fb1cea7e9dcd5200dd Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Mon, 7 Nov 2022 13:01:33 -0800 Subject: [PATCH 03/65] change number in Maps.cadl to float64 --- specification/eventgrid/data-plane/cadl/Maps.cadl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/specification/eventgrid/data-plane/cadl/Maps.cadl b/specification/eventgrid/data-plane/cadl/Maps.cadl index e739e78906db..73cd23760b29 100644 --- a/specification/eventgrid/data-plane/cadl/Maps.cadl +++ b/specification/eventgrid/data-plane/cadl/Maps.cadl @@ -28,16 +28,16 @@ model MapsGeofenceGeometry { deviceId?: string; @doc("Distance from the coordinate to the closest border of the geofence. Positive means the coordinate is outside of the geofence. If the coordinate is outside of the geofence, but more than the value of searchBuffer away from the closest geofence border, then the value is 999. Negative means the coordinate is inside of the geofence. If the coordinate is inside the polygon, but more than the value of searchBuffer away from the closest geofencing border,then the value is -999. A value of 999 means that there is great confidence the coordinate is well outside the geofence. A value of -999 means that there is great confidence the coordinate is well within the geofence.") - distance?: number; + distance?: float64; @doc("The unique ID for the geofence geometry.") geometryId?: string; @doc("Latitude of the nearest point of the geometry.") - nearestLat?: number; + nearestLat?: float64; @doc("Longitude of the nearest point of the geometry.") - nearestLon?: number; + nearestLon?: float64; @doc("The unique id returned from user upload service when uploading a geofence. Will not be included in geofencing post API.") udId?: string; From 393129bea873154382f0cb72f8100f0828bff0a1 Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Mon, 7 Nov 2022 13:07:18 -0800 Subject: [PATCH 04/65] changing Map to Record --- .../cadl/AzureCommunicationServices.cadl | 6 +++--- .../eventgrid/data-plane/cadl/IotHub.cadl | 10 +++++----- .../data-plane/cadl/MachineLearningServices.cadl | 16 ++++++++-------- .../eventgrid/data-plane/cadl/MediaServices.cadl | 6 +++--- .../eventgrid/data-plane/cadl/Resources.cadl | 4 ++-- .../eventgrid/data-plane/cadl/Storage.cadl | 2 +- specification/eventgrid/data-plane/cadl/Web.cadl | 2 +- 7 files changed, 23 insertions(+), 23 deletions(-) diff --git a/specification/eventgrid/data-plane/cadl/AzureCommunicationServices.cadl b/specification/eventgrid/data-plane/cadl/AzureCommunicationServices.cadl index 24935237eddc..6e537621b720 100644 --- a/specification/eventgrid/data-plane/cadl/AzureCommunicationServices.cadl +++ b/specification/eventgrid/data-plane/cadl/AzureCommunicationServices.cadl @@ -11,7 +11,7 @@ model AcsChatMessageBaseEventData { messageBody?: string; @doc("The chat message metadata") - metadata?: Map; + metadata?: Record; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageReceived event.") model AcsChatMessageReceivedEventData is AcsChatMessageBaseEventData; @@ -52,7 +52,7 @@ model AcsChatThreadBaseEventData { createdByCommunicationIdentifier?: CommunicationIdentifierModel; @doc("The thread properties") - properties?: Map; + properties?: Record; @doc("The list of properties of participants who are part of the thread") participants?: AcsChatThreadParticipantProperties[]; @@ -86,7 +86,7 @@ model AcsChatThredPropertiesBaseEventData { editTime?: zonedDateTime; @doc("The updated thread properties") - properties?: Map; + properties?: Record; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadPropertiesUpdatedPerUser event.") diff --git a/specification/eventgrid/data-plane/cadl/IotHub.cadl b/specification/eventgrid/data-plane/cadl/IotHub.cadl index 649518d82562..37d77cce37b4 100644 --- a/specification/eventgrid/data-plane/cadl/IotHub.cadl +++ b/specification/eventgrid/data-plane/cadl/IotHub.cadl @@ -31,7 +31,7 @@ model DeviceTwinInfo { lastActivityTime?: string; @doc("Properties JSON element.") - properties?: Map; + properties?: Record; @doc("Whether the device twin is enabled or disabled.") status?: string; @@ -43,7 +43,7 @@ model DeviceTwinInfo { version?: number; @doc("The thumbprint is a unique value for the x509 certificate, commonly used to find a particular certificate in a certificate store. The thumbprint is dynamically generated using the SHA1 algorithm, and does not physically exist in the certificate.") - x509Thumbprint?: Map; + x509Thumbprint?: Record; } @doc("Schema of the Data property of an EventGridEvent for a device connection state event (DeviceConnected, DeviceDisconnected).") @@ -64,13 +64,13 @@ model DeviceConnectionStateEventProperties { @doc("Schema of the Data property of an EventGridEvent for a device telemetry event (DeviceTelemetry).") model DeviceTelemetryEventProperties { @doc("The content of the message from the device.") - body?: Map; + body?: Record; @doc("Application properties are user-defined strings that can be added to the message. These fields are optional.") - properties?: Map; + properties?: Record; @doc("System properties help identify contents and source of the messages.") - systemProperties?: Map; + systemProperties?: Record; } @doc("A portion of the properties that can be written only by the application back-end, and read by the device.") diff --git a/specification/eventgrid/data-plane/cadl/MachineLearningServices.cadl b/specification/eventgrid/data-plane/cadl/MachineLearningServices.cadl index e3ea70e493de..f09b85481071 100644 --- a/specification/eventgrid/data-plane/cadl/MachineLearningServices.cadl +++ b/specification/eventgrid/data-plane/cadl/MachineLearningServices.cadl @@ -7,10 +7,10 @@ model MachineLearningServicesModelRegisteredEventData { modelVersion?: string; @doc("The tags of the model that was registered.") - modelTags?: Map; + modelTags?: Record; @doc("The properties of the model that was registered.") - modelProperties?: Map; + modelProperties?: Record; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.MachineLearningServices.ModelDeployed event.") @@ -25,10 +25,10 @@ model MachineLearningServicesModelDeployedEventData { modelIds?: string; @doc("The tags of the deployed service.") - serviceTags?: Map; + serviceTags?: Record; @doc("The properties of the deployed service.") - serviceProperties?: Map; + serviceProperties?: Record; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.MachineLearningServices.RunCompleted event.") @@ -46,10 +46,10 @@ model MachineLearningServicesRunCompletedEventData { runType?: string; @doc("The tags of the completed Run.") - runTags?: Map; + runTags?: Record; @doc("The properties of the completed Run.") - runProperties?: Map; + runProperties?: Record; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.MachineLearningServices.DatasetDriftDetected event.") @@ -94,10 +94,10 @@ model MachineLearningServicesRunStatusChangedEventData { runType?: string; @doc("The tags of the Machine Learning Run.") - runTags?: Map; + runTags?: Record; @doc("The properties of the Machine Learning Run.") - runProperties?: Map; + runProperties?: Record; @doc("The status of the Machine Learning Run.") runStatus?: string; diff --git a/specification/eventgrid/data-plane/cadl/MediaServices.cadl b/specification/eventgrid/data-plane/cadl/MediaServices.cadl index 42915e23217e..897b90101678 100644 --- a/specification/eventgrid/data-plane/cadl/MediaServices.cadl +++ b/specification/eventgrid/data-plane/cadl/MediaServices.cadl @@ -15,7 +15,7 @@ model MediaJobStateChangeEventData { @doc("The new state of the Job.") state?: MediaJobState; @doc("Gets the Job correlation data.") - correlationData?: Map; + correlationData?: Record; } enum MediaJobErrorCode { @@ -94,7 +94,7 @@ model MediaJobOutputProgressEventData { @doc("Gets the Job output progress.") progress?: int64; @doc("Gets the Job correlation data.") - jobCorrelationData?: Map; + jobCorrelationData?: Record; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Media.JobOutputStateChange event.") @@ -104,7 +104,7 @@ model MediaJobOutputStateChangeEventData { @doc("Gets the output.") output?: MediaJobOutput; @doc("Gets the Job correlation data.") - jobCorrelationData?: Map; + jobCorrelationData?: Record; } @doc("Job scheduled event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobScheduled event.") diff --git a/specification/eventgrid/data-plane/cadl/Resources.cadl b/specification/eventgrid/data-plane/cadl/Resources.cadl index e130a1182766..cc96f66a6113 100644 --- a/specification/eventgrid/data-plane/cadl/Resources.cadl +++ b/specification/eventgrid/data-plane/cadl/Resources.cadl @@ -24,7 +24,7 @@ model ResourceBaseEventData { authorization?: ResourceAuthorization; @doc("The properties of the claims.") - claims?: Map; + claims?: Record; @doc("An operation ID used for troubleshooting.") correlationId?: string; @@ -84,5 +84,5 @@ model ResourceAuthorization { action?: string; @doc("The evidence for the authorization.") - evidence?: Map; + evidence?: Record; } diff --git a/specification/eventgrid/data-plane/cadl/Storage.cadl b/specification/eventgrid/data-plane/cadl/Storage.cadl index 546747deb3ae..727c55940bc8 100644 --- a/specification/eventgrid/data-plane/cadl/Storage.cadl +++ b/specification/eventgrid/data-plane/cadl/Storage.cadl @@ -20,7 +20,7 @@ model StorageBaseEventData { identity?: string; @doc("For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers.") - storageDiagnostics?: Map; + storageDiagnostics?: Record; } model StorageBaseTypeData { diff --git a/specification/eventgrid/data-plane/cadl/Web.cadl b/specification/eventgrid/data-plane/cadl/Web.cadl index c92180af609a..fdd86ed39a1f 100644 --- a/specification/eventgrid/data-plane/cadl/Web.cadl +++ b/specification/eventgrid/data-plane/cadl/Web.cadl @@ -79,7 +79,7 @@ model WebAppServicePlanUpdatedEventData { verb?: string; @doc("sku of app service plan.") - sku?: Map; + sku?: Record; } @knownValues(AppActionKV) From 16645b4ba71bac8818b6994c1f137a03076b252d Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Tue, 15 Nov 2022 13:19:13 -0800 Subject: [PATCH 05/65] update service title and version for healthcareapi --- specification/eventgrid/data-plane/cadl/HealthcareApis.cadl | 6 +++++- specification/eventgrid/data-plane/cadl/package.json | 5 ++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/specification/eventgrid/data-plane/cadl/HealthcareApis.cadl b/specification/eventgrid/data-plane/cadl/HealthcareApis.cadl index 2b30e63ce2d2..7deda845cb8b 100644 --- a/specification/eventgrid/data-plane/cadl/HealthcareApis.cadl +++ b/specification/eventgrid/data-plane/cadl/HealthcareApis.cadl @@ -1,3 +1,6 @@ +@service({title:"Microsoft.HealthcareApi",version:"2018-01-01"}) +namespace HealthCareApis; + model HealthcareFhirResourceBaseEventData { @doc("Type of HL7 FHIR resource.") resourceType?: HealthcareFhirResourceType; @@ -27,7 +30,6 @@ model HealthcareDicomImageCreatedEventData is HealthcareFhirResourceBaseEventDat @doc("Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.DicomImageDeleted event.") model HealthcareDicomImageDeletedEventData is HealthcareFhirResourceBaseEventData; -@knownValues(HealthcareFhirResourceTypeKV) model HealthcareFhirResourceType is string {} enum HealthcareFhirResourceTypeKV { Account, @@ -192,3 +194,5 @@ enum HealthcareFhirResourceTypeKV { VerificationResult, VisionPrescription, } + + diff --git a/specification/eventgrid/data-plane/cadl/package.json b/specification/eventgrid/data-plane/cadl/package.json index b4e67e018c84..e0909ab7e702 100644 --- a/specification/eventgrid/data-plane/cadl/package.json +++ b/specification/eventgrid/data-plane/cadl/package.json @@ -2,9 +2,8 @@ "name": "cadl", "dependencies": { "@cadl-lang/compiler": "latest", - "@cadl-lang/openapi3": "^0.13.0", - "@cadl-lang/rest": "^0.15.1", - "@azure-tools/cadl-autorest": "latest" + "@cadl-lang/openapi3": "latest", + "@cadl-lang/rest": "latest" }, "private": true } From 34fc27f38fd49ac476ecb4b6596593502a8427d1 Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Thu, 17 Nov 2022 15:44:22 -0800 Subject: [PATCH 06/65] fix containerregistry --- specification/eventgrid/data-plane/cadl/ApiManagement.cadl | 3 +++ .../eventgrid/data-plane/cadl/AppConfiguration.cadl | 3 +++ .../data-plane/cadl/AzureCommunicationServices.cadl | 5 ++++- ...nServiceCore.cadl => AzureCommunicationServicesCore.cadl} | 0 .../eventgrid/data-plane/cadl/ContainerRegistry.cadl | 5 ++++- 5 files changed, 14 insertions(+), 2 deletions(-) rename specification/eventgrid/data-plane/cadl/{AzureCommunicationServiceCore.cadl => AzureCommunicationServicesCore.cadl} (100%) diff --git a/specification/eventgrid/data-plane/cadl/ApiManagement.cadl b/specification/eventgrid/data-plane/cadl/ApiManagement.cadl index 78c0529f445c..a4add81b1601 100644 --- a/specification/eventgrid/data-plane/cadl/ApiManagement.cadl +++ b/specification/eventgrid/data-plane/cadl/ApiManagement.cadl @@ -1,3 +1,6 @@ +@service({title:"Microsoft.ApiManagement",version:"2018-01-01"}) +namespace ApiManagement; + model ApiManagementBase { @doc("The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions//resourceGroups//Microsoft.ApiManagement/service///`") resourceUri?: string; diff --git a/specification/eventgrid/data-plane/cadl/AppConfiguration.cadl b/specification/eventgrid/data-plane/cadl/AppConfiguration.cadl index 7b10eb7a284c..dc0f4c06c9c6 100644 --- a/specification/eventgrid/data-plane/cadl/AppConfiguration.cadl +++ b/specification/eventgrid/data-plane/cadl/AppConfiguration.cadl @@ -1,3 +1,6 @@ +@service({title:"Microsoft.AppConfiguration",version:"2018-01-01"}) +namespace AppConfiguration; + enum AppConfigurationEventTypes { modified; deleted; diff --git a/specification/eventgrid/data-plane/cadl/AzureCommunicationServices.cadl b/specification/eventgrid/data-plane/cadl/AzureCommunicationServices.cadl index 6e537621b720..9cb534713887 100644 --- a/specification/eventgrid/data-plane/cadl/AzureCommunicationServices.cadl +++ b/specification/eventgrid/data-plane/cadl/AzureCommunicationServices.cadl @@ -1,4 +1,7 @@ -import "./AzureCommunicationServicesCore.cadl" +import "./AzureCommunicationServicesCore.cadl"; + +@service({title:"Microsoft.AzureCommunicationServices",version:"2018-01-01"}) +namespace AzureCommunicationServices; @doc("Schema of the Data property of an EventGridEvent for an Microsoft.Communication.UserDisconnected event.") model AcsUserDisconnectedEventData { diff --git a/specification/eventgrid/data-plane/cadl/AzureCommunicationServiceCore.cadl b/specification/eventgrid/data-plane/cadl/AzureCommunicationServicesCore.cadl similarity index 100% rename from specification/eventgrid/data-plane/cadl/AzureCommunicationServiceCore.cadl rename to specification/eventgrid/data-plane/cadl/AzureCommunicationServicesCore.cadl diff --git a/specification/eventgrid/data-plane/cadl/ContainerRegistry.cadl b/specification/eventgrid/data-plane/cadl/ContainerRegistry.cadl index b6ddc4ab4394..25e82d0b5423 100644 --- a/specification/eventgrid/data-plane/cadl/ContainerRegistry.cadl +++ b/specification/eventgrid/data-plane/cadl/ContainerRegistry.cadl @@ -1,3 +1,6 @@ +@service({title:"Microsoft.ContainerRegistry",version:"2018-01-01"}) +namespace ContainerRegistry; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ContainerRegistry.ImagePushed event.") model ContainerRegistryImagePushedEventData is ContainerRegistryEventData; @@ -56,7 +59,7 @@ model ContainerRegistryArtifactEventData { connectedRegistry?: ContainerRegistryEventConnectedRegistry; } -model ContainerRegistryBaseEventTarget { +model ContainerRegistryBaseEventTarget { @doc(TmediaType) mediaType?: string; From b08393a44bd37453a91388a5781f87f85ae5cad4 Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Mon, 28 Nov 2022 10:05:29 -0800 Subject: [PATCH 07/65] container registry updated --- specification/eventgrid/data-plane/cadl/ContainerRegistry.cadl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/specification/eventgrid/data-plane/cadl/ContainerRegistry.cadl b/specification/eventgrid/data-plane/cadl/ContainerRegistry.cadl index 25e82d0b5423..1ea6edf9d06a 100644 --- a/specification/eventgrid/data-plane/cadl/ContainerRegistry.cadl +++ b/specification/eventgrid/data-plane/cadl/ContainerRegistry.cadl @@ -85,6 +85,9 @@ model ContainerRegistryEventTarget extends ContainerRegistryBaseEventTarget< > { @doc("The number of bytes of the content. Same as Size field.") length?: int64; + + @doc("The direct URL to the content.") + url?: string; } @doc("The target of the event.") From d4ec258c549419d47b6bb01ba0914da0d15c8190 Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Mon, 28 Nov 2022 10:15:11 -0800 Subject: [PATCH 08/65] updating container service cadl --- specification/eventgrid/data-plane/cadl/ContainerService.cadl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/specification/eventgrid/data-plane/cadl/ContainerService.cadl b/specification/eventgrid/data-plane/cadl/ContainerService.cadl index 2c7d51db3281..b8c9c5a2635c 100644 --- a/specification/eventgrid/data-plane/cadl/ContainerService.cadl +++ b/specification/eventgrid/data-plane/cadl/ContainerService.cadl @@ -1,3 +1,7 @@ +@service({title:"Schema of Azure Kubernetes Service events published to Azure Event Grid",version:"2018-01-01"}) +@doc("Describes the schema of the Azure Kubernetes Service events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent") +namespace ContainerService; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ContainerService.NewKubernetesVersionAvailable event") model ContainerServiceNewKubernetesVersionAvailableEventData { @doc("The highest PATCH Kubernetes version for the highest MINOR version supported by ManagedCluster resource") From be2094b590b53d2020a8d8782d51a9b1893e930c Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Mon, 28 Nov 2022 10:25:28 -0800 Subject: [PATCH 09/65] eventgrid service version --- specification/eventgrid/data-plane/cadl/EventGrid.cadl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/specification/eventgrid/data-plane/cadl/EventGrid.cadl b/specification/eventgrid/data-plane/cadl/EventGrid.cadl index 25f549d16a85..7e1e097ce88b 100644 --- a/specification/eventgrid/data-plane/cadl/EventGrid.cadl +++ b/specification/eventgrid/data-plane/cadl/EventGrid.cadl @@ -3,8 +3,7 @@ import "@cadl-lang/versioning"; import "@azure-tools/cadl-providerhub"; import "@azure-tools/cadl-azure-core"; -@serviceTitle("EventGridClient") -@serviceVersion("2018-01-01") +@service({title:"EventGridClient", version: "2018-01-01"}) @doc("Azure EventGrid Client") namespace Microsoft.EventGrid; From cce40315cca8ac8233c476e0dda2a3fa893e6f71 Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Mon, 28 Nov 2022 10:30:43 -0800 Subject: [PATCH 10/65] eventhub cadl service version --- specification/eventgrid/data-plane/cadl/EventHub.cadl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/specification/eventgrid/data-plane/cadl/EventHub.cadl b/specification/eventgrid/data-plane/cadl/EventHub.cadl index 9789361798b7..84e6e49e1e15 100644 --- a/specification/eventgrid/data-plane/cadl/EventHub.cadl +++ b/specification/eventgrid/data-plane/cadl/EventHub.cadl @@ -1,3 +1,7 @@ +@service({title:"Schema of Azure EventHub events published to Azure Event Grid", version: "2018-01-01"}) +@doc("Describes the schema of the Azure EventHub events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") +namespace EventHub; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.EventHub.CaptureFileCreated event.") model EventHubCaptureFileCreatedEventData { @doc("The path to the capture file.") From 0225638e2c9812448b7f6097bc15ad12a136d3fb Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Mon, 28 Nov 2022 11:16:32 -0800 Subject: [PATCH 11/65] healthcare api cadl --- .../data-plane/cadl/HealthcareApis.cadl | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/specification/eventgrid/data-plane/cadl/HealthcareApis.cadl b/specification/eventgrid/data-plane/cadl/HealthcareApis.cadl index 7deda845cb8b..1e6cca7bdf4a 100644 --- a/specification/eventgrid/data-plane/cadl/HealthcareApis.cadl +++ b/specification/eventgrid/data-plane/cadl/HealthcareApis.cadl @@ -1,4 +1,5 @@ -@service({title:"Microsoft.HealthcareApi",version:"2018-01-01"}) +@service({title:"Schema of Azure HealthcareApis events published to Azure Event Grid.",version:"2018-01-01"}) +@doc("Describes the schema of the Azure HealthcareApis events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") namespace HealthCareApis; model HealthcareFhirResourceBaseEventData { @@ -15,6 +16,24 @@ model HealthcareFhirResourceBaseEventData { resourceVersionId?: int64; } +model HealthcareDicomImageBaseEventData { + @doc("Unique identifier for the Study") + imageStudyInstanceUid?: string; + + @doc("Unique identifier for the Series") + imageSeriesInstanceUid?: string; + + @doc("Unique identifier for the DICOM Image",) + imageSopInstanceUid?: string; + + @doc("Host name of the DICOM account for this image.") + serviceHostName?: string; + + @doc("Sequence number of the DICOM Service within Azure Health Data Services. It is unique for every image creation and deletion within the service.") + sequenceNumber?: int64; + +} + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.FhirResourceCreated event.") model HealthcareFhirResourceCreatedEventData is HealthcareFhirResourceBaseEventData; @@ -25,10 +44,10 @@ model HealthcareFhirResourceUpdatedEventData is HealthcareFhirResourceBaseEventD model HealthcareFhirResourceDeletedEventData is HealthcareFhirResourceBaseEventData; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.DicomImageCreated event.") -model HealthcareDicomImageCreatedEventData is HealthcareFhirResourceBaseEventData; +model HealthcareDicomImageCreatedEventData is HealthcareDicomImageBaseEventData; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.DicomImageDeleted event.") -model HealthcareDicomImageDeletedEventData is HealthcareFhirResourceBaseEventData; +model HealthcareDicomImageDeletedEventData is HealthcareDicomImageBaseEventData; model HealthcareFhirResourceType is string {} enum HealthcareFhirResourceTypeKV { From 0facb8cbaa66501731bc9918f74ceed73fa7d218 Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Mon, 28 Nov 2022 14:04:15 -0800 Subject: [PATCH 12/65] iothub cadl --- specification/eventgrid/data-plane/cadl/IotHub.cadl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/specification/eventgrid/data-plane/cadl/IotHub.cadl b/specification/eventgrid/data-plane/cadl/IotHub.cadl index 37d77cce37b4..b6617924ef0d 100644 --- a/specification/eventgrid/data-plane/cadl/IotHub.cadl +++ b/specification/eventgrid/data-plane/cadl/IotHub.cadl @@ -1,3 +1,7 @@ +@service({title:"Schema of Azure IoT Hub events published to Azure Event Grid", version:"2018-01-01"}) +@doc("Describes the schema of the Azure IoT Hub events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") +namespace IoTHub; + @doc("Schema of the Data property of an EventGridEvent for a device life cycle event (DeviceCreated, DeviceDeleted).") model DeviceLifeCycleEventProperties { @doc("The unique identifier of the device. This case-sensitive string can be up to 128 characters long, and supports ASCII 7-bit alphanumeric characters plus the following special characters: - : . + % _ # * ? ! ( ) , = @ ; $ '.") @@ -16,7 +20,7 @@ model DeviceTwinInfo { authenticationType?: string; @doc("Count of cloud to device messages sent to this device.") - cloudToDeviceMessageCount?: number; + cloudToDeviceMessageCount?: integer; @doc("Whether the device is connected or disconnected.") connectionState?: string; @@ -40,7 +44,7 @@ model DeviceTwinInfo { statusUpdateTime?: string; @doc("An integer that is incremented by one each time the device twin is updated.") - version?: number; + version?: integer; @doc("The thumbprint is a unique value for the x509 certificate, commonly used to find a particular certificate in a certificate store. The thumbprint is dynamically generated using the SHA1 algorithm, and does not physically exist in the certificate.") x509Thumbprint?: Record; @@ -79,7 +83,7 @@ model DeviceTwinProperties { metadata?: DeviceTwinMetadata; @doc("Version of device twin properties.") - version?: number; + version?: float64; } @doc("Metadata information for the properties JSON document.") From 37c2c2ec91e57479be53909dd33541bc7820c789 Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Mon, 28 Nov 2022 14:26:42 -0800 Subject: [PATCH 13/65] keyvault cadl --- specification/eventgrid/data-plane/cadl/KeyVault.cadl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/specification/eventgrid/data-plane/cadl/KeyVault.cadl b/specification/eventgrid/data-plane/cadl/KeyVault.cadl index 67f1e05e7683..2a4596c8d490 100644 --- a/specification/eventgrid/data-plane/cadl/KeyVault.cadl +++ b/specification/eventgrid/data-plane/cadl/KeyVault.cadl @@ -1,3 +1,7 @@ +@service({title:"Schema of Azure Key Vault events published to Azure Event Grid", version:"2018-01-01"}) +@doc("Describes the schema of the Azure Key Vault events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") +namespace KeyVault; + model KeyVaultCertificateBase { @doc("The id of the object that triggered this event.") Id?: string; From 2abebc992cc159f3a998eb85482a89a411fbf3de Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Tue, 29 Nov 2022 09:11:33 -0800 Subject: [PATCH 14/65] machine learning cadl --- .../eventgrid/data-plane/cadl/MachineLearningServices.cadl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/specification/eventgrid/data-plane/cadl/MachineLearningServices.cadl b/specification/eventgrid/data-plane/cadl/MachineLearningServices.cadl index f09b85481071..e45cd944af58 100644 --- a/specification/eventgrid/data-plane/cadl/MachineLearningServices.cadl +++ b/specification/eventgrid/data-plane/cadl/MachineLearningServices.cadl @@ -1,3 +1,7 @@ +@service({title:"Schema of Azure Machine Learning Services events published to Azure Event Grid", version:"2018-01-01"}) +@doc("Describes the schema of the Azure Machine Learning Services events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") +namespace MachineLearningServices; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.MachineLearningServices.ModelRegistered event.") model MachineLearningServicesModelRegisteredEventData { @doc("The name of the model that was registered.") From dccbb9168acf67545088a9246254436760b5863e Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Tue, 29 Nov 2022 09:18:48 -0800 Subject: [PATCH 15/65] maps cadl --- specification/eventgrid/data-plane/cadl/Maps.cadl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/specification/eventgrid/data-plane/cadl/Maps.cadl b/specification/eventgrid/data-plane/cadl/Maps.cadl index 73cd23760b29..adbbb5b08339 100644 --- a/specification/eventgrid/data-plane/cadl/Maps.cadl +++ b/specification/eventgrid/data-plane/cadl/Maps.cadl @@ -1,3 +1,7 @@ +@service({title:"Schema of Azure Maps events published to Azure Event Grid", version: "2018-01-01"}) +@doc("Describes the schema of the Azure Maps events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") +namespace Maps; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Maps.GeofenceEntered event.") model MapsGeofenceEnteredEventData is MapsGeofenceEventProperties; From c55f5ff8deaf9b6d2822cdcfabd46579363dc921 Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Tue, 29 Nov 2022 11:04:51 -0800 Subject: [PATCH 16/65] policyInsights cadl --- specification/eventgrid/data-plane/cadl/PolicyInsights.cadl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/specification/eventgrid/data-plane/cadl/PolicyInsights.cadl b/specification/eventgrid/data-plane/cadl/PolicyInsights.cadl index 9455ea207940..2457b9be70a9 100644 --- a/specification/eventgrid/data-plane/cadl/PolicyInsights.cadl +++ b/specification/eventgrid/data-plane/cadl/PolicyInsights.cadl @@ -1,3 +1,7 @@ +@service({title:"Schema of Azure Policy events published to Azure Event Grid",version:"2018-01-01"}) +@doc("Describes the schema of the Azure Policy events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") +namespace PolicyInsights; + model PolicyInsightsBaseEventData { @doc("The time that the resource was scanned by Azure Policy in the Universal ISO 8601 DateTime format yyyy-MM-ddTHH:mm:ss.fffffffZ.") timestamp?: zonedDateTime; From 71e20888f13e2d0083903cd07ed299e6bb944e14 Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Tue, 29 Nov 2022 12:38:46 -0800 Subject: [PATCH 17/65] redis cache cadl --- specification/eventgrid/data-plane/cadl/RedisCache.cadl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/specification/eventgrid/data-plane/cadl/RedisCache.cadl b/specification/eventgrid/data-plane/cadl/RedisCache.cadl index 080366a665df..d36d0b7b2971 100644 --- a/specification/eventgrid/data-plane/cadl/RedisCache.cadl +++ b/specification/eventgrid/data-plane/cadl/RedisCache.cadl @@ -1,3 +1,7 @@ +@service({title:"Schema of Redis Cache events published to Azure Event Grid", version:"2018-01-01"}) +@doc("Describes the schema of the Redis Cache events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") +namespace RedisCache; + model RedisBaseEventData { @doc("The time at which the event occurred.") timestamp?: zonedDateTime; From 72d72ba1fa553bcd0a0a9de7861e7e59f8adb6a6 Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Tue, 29 Nov 2022 12:57:59 -0800 Subject: [PATCH 18/65] resources cadl --- specification/eventgrid/data-plane/cadl/Resources.cadl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/specification/eventgrid/data-plane/cadl/Resources.cadl b/specification/eventgrid/data-plane/cadl/Resources.cadl index cc96f66a6113..51f9f8ad9a91 100644 --- a/specification/eventgrid/data-plane/cadl/Resources.cadl +++ b/specification/eventgrid/data-plane/cadl/Resources.cadl @@ -1,3 +1,7 @@ +@service({title:"Schema of Azure resource events published to Azure Event Grid", version: "2018-01-01"}) +@doc("Describes the schema of the Azure resource events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") +namespace Resources; + model ResourceBaseEventData { @doc("The tenant ID of the resource.") tenantId?: string; From c82df6f385ac83d37dbad547e15bb030926e116f Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Tue, 29 Nov 2022 13:02:54 -0800 Subject: [PATCH 19/65] servicebus cadl --- specification/eventgrid/data-plane/cadl/ServiceBus.cadl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/specification/eventgrid/data-plane/cadl/ServiceBus.cadl b/specification/eventgrid/data-plane/cadl/ServiceBus.cadl index 934f29010808..ffbe071a760e 100644 --- a/specification/eventgrid/data-plane/cadl/ServiceBus.cadl +++ b/specification/eventgrid/data-plane/cadl/ServiceBus.cadl @@ -1,3 +1,7 @@ +@service({title: "Schema of Azure ServiceBus Messaging events published to Azure Event Grid", version:"2018-01-01"}) +@doc("Describes the schema of the Azure ServiceBus Messaging events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") +namespace ServiceBus; + model ServiceBusBaseEventData { @doc("The namespace name of the Microsoft.ServiceBus resource.") namespaceName?: string; From 995645090421ac080746a3bd34d3963fefc78158 Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Tue, 29 Nov 2022 13:06:26 -0800 Subject: [PATCH 20/65] signalRservice cadl --- .../eventgrid/data-plane/cadl/SignalRService.cadl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/specification/eventgrid/data-plane/cadl/SignalRService.cadl b/specification/eventgrid/data-plane/cadl/SignalRService.cadl index 758005be1db1..82f176acb399 100644 --- a/specification/eventgrid/data-plane/cadl/SignalRService.cadl +++ b/specification/eventgrid/data-plane/cadl/SignalRService.cadl @@ -1,3 +1,7 @@ +@service({title:"Schema of Azure SignalR Service events published to Azure Event Grid", version:"2018-01-01"}) +@doc("Describes the schema of the Azure SignalR Service events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") +namespace SignalRService; + model SignalRServiceBaseEventdata { @doc("The time at which the event occurred.") timestamp?: zonedDateTime; @@ -17,8 +21,9 @@ model SignalRServiceClientConnectionConnectedEventData is SignalRServiceBaseEven @doc("Schema of the Data property of an EventGridEvent for a Microsoft.SignalRService.ClientConnectionDisconnected event.") model SignalRServiceClientConnectionDisconnectedEventData { - @doc("The message of error that cause the client connection disconnected.") - errorMessage?: string; ...SignalRServiceBaseEventdata; + + @doc("The message of error that cause the client connection disconnected.") + errorMessage?: string; } From c38778878dd88a177765d3c258a36b798b2cca3e Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Tue, 29 Nov 2022 15:11:33 -0800 Subject: [PATCH 21/65] web cadl -- may need improvements --- .../eventgrid/data-plane/cadl/Web.cadl | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/specification/eventgrid/data-plane/cadl/Web.cadl b/specification/eventgrid/data-plane/cadl/Web.cadl index fdd86ed39a1f..aecdebd5fa5f 100644 --- a/specification/eventgrid/data-plane/cadl/Web.cadl +++ b/specification/eventgrid/data-plane/cadl/Web.cadl @@ -1,3 +1,7 @@ +@service({title:"Schema of Azure App Service events published to Azure Event Grid", version: "2018-01-01"}) +@doc("Describes the schema of the Azure App Service events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") +namespace Web; + model WebAppBaseEventData { appEventTypeDetail?: AppEventTypeDetail; @@ -79,7 +83,25 @@ model WebAppServicePlanUpdatedEventData { verb?: string; @doc("sku of app service plan.") - sku?: Record; + sku?: sku; +} + +@doc("sku of app service plan.") +model sku { + @doc("name of app service plan sku.") + name?: string; + + @doc("tier of app service plan sku.") + Tier?:string; + + @doc("size of app service plan sku.") + Size?:string; + + @doc("family of app service plan sku.") + Family?:string; + + @doc("capacity of app service plan sku.") + Capacity?:string; } @knownValues(AppActionKV) From 76ffb83b0200d83504036373354b383c40a76f04 Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Fri, 2 Dec 2022 11:42:30 -0800 Subject: [PATCH 22/65] updating cadl inheritance story --- package-lock.json | 1648 ++++++++++++++- package.json | 3 + .../data-plane/cadl/ApiManagement.cadl | 3 +- .../data-plane/cadl/AppConfiguration.cadl | 9 +- .../cadl/AzureCommunicationServices.cadl | 92 +- .../data-plane/cadl/MediaServices.cadl | 19 +- .../eventgrid/data-plane/cadl/Storage.cadl | 30 +- .../data-plane/cadl/package-lock.json | 1866 ++++++++++++++++- .../eventgrid/data-plane/cadl/package.json | 3 + 9 files changed, 3551 insertions(+), 122 deletions(-) diff --git a/package-lock.json b/package-lock.json index b420236240e4..aa86f51be07b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,9 @@ "version": "0.1.0", "hasInstallScript": true, "license": "MIT", + "dependencies": { + "@cadl-lang/rest": "^0.19.0" + }, "devDependencies": { "@azure/avocado": "^0.8.4", "@ts-common/commonmark-to-markdown": "^2.0.2", @@ -115,6 +118,235 @@ "integrity": "sha512-oc6OHLdoLlOpO5GjMcOFETEhJi45CI3MVIhvVY/yqyGw9AtaqOYw5HzO3wTuYgYFeGS4v9iqFah0SNLZrpk3Sg==", "dev": true }, + "node_modules/@babel/code-frame": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", + "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", + "peer": true, + "dependencies": { + "@babel/highlight": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.19.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", + "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", + "peer": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", + "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", + "peer": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.18.6", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "peer": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "peer": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "peer": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/@babel/highlight/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "peer": true + }, + "node_modules/@babel/highlight/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "peer": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@babel/highlight/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "peer": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@cadl-lang/compiler": { + "version": "0.37.0", + "resolved": "https://registry.npmjs.org/@cadl-lang/compiler/-/compiler-0.37.0.tgz", + "integrity": "sha512-jHMqPZmM4evQlu7oY9vj6PEM+f+OhnfPqAdwxALrU2gwsLcwYG1h8rkjX/iK2KfeewCbXuRT/hztOTo3pcbYWA==", + "peer": true, + "dependencies": { + "@babel/code-frame": "~7.16.7", + "ajv": "~8.9.0", + "change-case": "~4.1.2", + "globby": "~13.1.1", + "js-yaml": "~4.1.0", + "mkdirp": "~1.0.4", + "mustache": "~4.2.0", + "node-fetch": "3.2.8", + "node-watch": "~0.7.1", + "picocolors": "~1.0.0", + "prettier": "~2.7.1", + "prompts": "~2.4.1", + "vscode-languageserver": "~7.0.0", + "vscode-languageserver-textdocument": "~1.0.1", + "yargs": "~17.3.1" + }, + "bin": { + "cadl": "cmd/cadl.js", + "cadl-server": "cmd/cadl-server.js" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@cadl-lang/compiler/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "peer": true + }, + "node_modules/@cadl-lang/compiler/node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "peer": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/@cadl-lang/compiler/node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "peer": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/@cadl-lang/compiler/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "peer": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/@cadl-lang/compiler/node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "peer": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/@cadl-lang/compiler/node_modules/yargs": { + "version": "17.3.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.3.1.tgz", + "integrity": "sha512-WUANQeVgjLbNsEmGk20f+nlHgOqzRFpiGWVaBrYGYIGANIIu3lWjoyi0fNlFmJkvfhCZ6BXINe7/W2O2bV4iaA==", + "peer": true, + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@cadl-lang/compiler/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "peer": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/@cadl-lang/rest": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/@cadl-lang/rest/-/rest-0.19.0.tgz", + "integrity": "sha512-3vMDvr8huQcH03oGYlt5uhRu5TKn6rb+rK0tmPfWgZ9EfZDMn0lR4CAjQOukFv2d93s7KE2IBVtXvQ/Z0C7kdQ==", + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@cadl-lang/compiler": "~0.37.0" + } + }, "node_modules/@cspotcode/source-map-support": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", @@ -152,6 +384,41 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "peer": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "peer": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "peer": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/@ts-common/add-position": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/@ts-common/add-position/-/add-position-0.0.2.tgz", @@ -437,6 +704,22 @@ "node": ">=0.4.0" } }, + "node_modules/ajv": { + "version": "8.9.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.9.0.tgz", + "integrity": "sha512-qOKJyNj/h+OWx7s5DePL6Zu1KeM9jPZhwBqs+7DzP6bGOvqzVCSf0xueYmVuaC/oQ/VtS2zLMLHdQFbkka+XDQ==", + "peer": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, "node_modules/ansi-colors": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", @@ -450,7 +733,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, "engines": { "node": ">=8" } @@ -459,7 +741,6 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -542,7 +823,6 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, "dependencies": { "fill-range": "^7.0.1" }, @@ -562,6 +842,22 @@ "integrity": "sha512-wCyFsDQkKPwwF8BDwOiWNx/9K45L/hvggQiDbve+viMNMQnWhrlYIuBk09offfwCRtCO9P6XwUttufzU11WCVw==", "dev": true }, + "node_modules/camel-case": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-4.1.2.tgz", + "integrity": "sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw==", + "peer": true, + "dependencies": { + "pascal-case": "^3.1.2", + "tslib": "^2.0.3" + } + }, + "node_modules/camel-case/node_modules/tslib": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", + "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", + "peer": true + }, "node_modules/camelcase": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", @@ -574,6 +870,23 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/capital-case": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/capital-case/-/capital-case-1.0.4.tgz", + "integrity": "sha512-ds37W8CytHgwnhGGTi88pcPyR15qoNkOpYwmMMfnWqqWgESapLqvDx6huFjQ5vqWSn2Z06173XNA7LtMOeUh1A==", + "peer": true, + "dependencies": { + "no-case": "^3.0.4", + "tslib": "^2.0.3", + "upper-case-first": "^2.0.2" + } + }, + "node_modules/capital-case/node_modules/tslib": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", + "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", + "peer": true + }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -602,6 +915,32 @@ "node": ">=8" } }, + "node_modules/change-case": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/change-case/-/change-case-4.1.2.tgz", + "integrity": "sha512-bSxY2ws9OtviILG1EiY5K7NNxkqg/JnRnFxLtKQ96JaviiIxi7djMrSd0ECT9AC+lttClmYwKw53BWpOMblo7A==", + "peer": true, + "dependencies": { + "camel-case": "^4.1.2", + "capital-case": "^1.0.4", + "constant-case": "^3.0.4", + "dot-case": "^3.0.4", + "header-case": "^2.0.4", + "no-case": "^3.0.4", + "param-case": "^3.0.4", + "pascal-case": "^3.1.2", + "path-case": "^3.0.4", + "sentence-case": "^3.0.4", + "snake-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, + "node_modules/change-case/node_modules/tslib": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", + "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", + "peer": true + }, "node_modules/chokidar": { "version": "3.5.3", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", @@ -644,7 +983,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, "dependencies": { "color-name": "~1.1.4" }, @@ -655,8 +993,7 @@ "node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, "node_modules/combined-stream": { "version": "1.0.8", @@ -694,6 +1031,23 @@ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, + "node_modules/constant-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/constant-case/-/constant-case-3.0.4.tgz", + "integrity": "sha512-I2hSBi7Vvs7BEuJDr5dDHfzb/Ruj3FyvFyh7KLilAjNQw3Be+xgqUBA2W6scVEcL0hL1dwPRtIqEPVUCKkSsyQ==", + "peer": true, + "dependencies": { + "no-case": "^3.0.4", + "tslib": "^2.0.3", + "upper-case": "^2.0.2" + } + }, + "node_modules/constant-case/node_modules/tslib": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", + "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", + "peer": true + }, "node_modules/create-require": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", @@ -704,7 +1058,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.0.tgz", "integrity": "sha512-Vr3mLBA8qWmcuschSLAOogKgQ/Jwxulv3RNE4FXnYWRGujzrRWQI4m12fQqRkwX06C0KanhLr4hK+GydchZsaA==", - "dev": true, "engines": { "node": ">= 12" } @@ -759,11 +1112,38 @@ "node": ">=0.3.1" } }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "peer": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/dot-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz", + "integrity": "sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==", + "peer": true, + "dependencies": { + "no-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, + "node_modules/dot-case/node_modules/tslib": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", + "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", + "peer": true + }, "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, "node_modules/entities": { "version": "2.0.3", @@ -775,7 +1155,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", - "dev": true, "engines": { "node": ">=6" } @@ -805,11 +1184,41 @@ "node": ">=4" } }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "peer": true + }, + "node_modules/fast-glob": { + "version": "3.2.12", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", + "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", + "peer": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fastq": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", + "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", + "peer": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, "node_modules/fetch-blob": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", - "dev": true, "funding": [ { "type": "github", @@ -832,7 +1241,6 @@ "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, "dependencies": { "to-regex-range": "^5.0.1" }, @@ -889,7 +1297,6 @@ "version": "4.0.10", "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", - "dev": true, "dependencies": { "fetch-blob": "^3.1.2" }, @@ -930,7 +1337,6 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true, "engines": { "node": "6.* || 8.* || >= 10.*" } @@ -959,7 +1365,6 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, "dependencies": { "is-glob": "^4.0.1" }, @@ -967,6 +1372,25 @@ "node": ">= 6" } }, + "node_modules/globby": { + "version": "13.1.2", + "resolved": "https://registry.npmjs.org/globby/-/globby-13.1.2.tgz", + "integrity": "sha512-LKSDZXToac40u8Q1PQtZihbNdTYSNMuWe+K5l+oa6KgDzSvVrHXlJy40hUP522RjAIoNLJYBJi7ow+rbFpIhHQ==", + "peer": true, + "dependencies": { + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.11", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/growl": { "version": "1.10.5", "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", @@ -1000,6 +1424,31 @@ "he": "bin/he" } }, + "node_modules/header-case": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/header-case/-/header-case-2.0.4.tgz", + "integrity": "sha512-H/vuk5TEEVZwrR0lp2zed9OCo1uAILMlx0JEMgC26rzyJJ3N1v6XkwHHXJQdR2doSjcGPM6OKPYoJgf0plJ11Q==", + "peer": true, + "dependencies": { + "capital-case": "^1.0.4", + "tslib": "^2.0.3" + } + }, + "node_modules/header-case/node_modules/tslib": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", + "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", + "peer": true + }, + "node_modules/ignore": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", + "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", + "peer": true, + "engines": { + "node": ">= 4" + } + }, "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -1047,7 +1496,6 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -1056,7 +1504,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, "engines": { "node": ">=8" } @@ -1065,7 +1512,6 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, "dependencies": { "is-extglob": "^2.1.1" }, @@ -1077,7 +1523,6 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, "engines": { "node": ">=0.12.0" } @@ -1121,6 +1566,12 @@ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "peer": true + }, "node_modules/js-yaml": { "version": "3.14.1", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", @@ -1145,6 +1596,12 @@ "ono": "^4.0.11" } }, + "node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "peer": true + }, "node_modules/jsonpath-plus": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/jsonpath-plus/-/jsonpath-plus-6.0.1.tgz", @@ -1154,6 +1611,15 @@ "node": ">=10.0.0" } }, + "node_modules/kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "peer": true, + "engines": { + "node": ">=6" + } + }, "node_modules/locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", @@ -1185,6 +1651,21 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/lower-case": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", + "integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==", + "peer": true, + "dependencies": { + "tslib": "^2.0.3" + } + }, + "node_modules/lower-case/node_modules/tslib": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", + "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", + "peer": true + }, "node_modules/lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -1209,6 +1690,28 @@ "integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==", "dev": true }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "peer": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "peer": true, + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, "node_modules/mime-db": { "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", @@ -1248,6 +1751,18 @@ "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", "dev": true }, + "node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "peer": true, + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/mocha": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.2.2.tgz", @@ -1414,6 +1929,15 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, + "node_modules/mustache": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz", + "integrity": "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==", + "peer": true, + "bin": { + "mustache": "bin/mustache" + } + }, "node_modules/nanoid": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.1.tgz", @@ -1426,11 +1950,26 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, + "node_modules/no-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz", + "integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==", + "peer": true, + "dependencies": { + "lower-case": "^2.0.2", + "tslib": "^2.0.3" + } + }, + "node_modules/no-case/node_modules/tslib": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", + "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", + "peer": true + }, "node_modules/node-domexception": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", - "dev": true, "funding": [ { "type": "github", @@ -1449,7 +1988,6 @@ "version": "3.2.8", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.2.8.tgz", "integrity": "sha512-KtpD1YhGszhntMpBDyp5lyagk8KIMopC1LEb7cQUAh7zcosaX5uK8HnbNb2i3NTQK3sIawCItS0uFC3QzcLHdg==", - "dev": true, "dependencies": { "data-uri-to-buffer": "^4.0.0", "fetch-blob": "^3.1.4", @@ -1486,6 +2024,15 @@ "node": ">=0.10.0" } }, + "node_modules/node-watch": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/node-watch/-/node-watch-0.7.3.tgz", + "integrity": "sha512-3l4E8uMPY1HdMMryPRUAl+oIHtXtyiTlIiESNSVSNxcPfzAFzeTbXFQkZfAwBbo0B1qMSG8nUABx+Gd+YrbKrQ==", + "peer": true, + "engines": { + "node": ">=6" + } + }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -1552,6 +2099,54 @@ "node": ">=6" } }, + "node_modules/param-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/param-case/-/param-case-3.0.4.tgz", + "integrity": "sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A==", + "peer": true, + "dependencies": { + "dot-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, + "node_modules/param-case/node_modules/tslib": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", + "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", + "peer": true + }, + "node_modules/pascal-case": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/pascal-case/-/pascal-case-3.1.2.tgz", + "integrity": "sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g==", + "peer": true, + "dependencies": { + "no-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, + "node_modules/pascal-case/node_modules/tslib": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", + "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", + "peer": true + }, + "node_modules/path-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/path-case/-/path-case-3.0.4.tgz", + "integrity": "sha512-qO4qCFjXqVTrcbPt/hQfhTQ+VhFsqNKOPtytgNKkKxSoEp3XPUQ8ObFuePylOIok5gjn69ry8XiULxCwot3Wfg==", + "peer": true, + "dependencies": { + "dot-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, + "node_modules/path-case/node_modules/tslib": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", + "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", + "peer": true + }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -1570,11 +2165,25 @@ "node": ">=0.10.0" } }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "peer": true + }, "node_modules/picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, "engines": { "node": ">=8.6" }, @@ -1586,7 +2195,6 @@ "version": "2.7.1", "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", - "dev": true, "bin": { "prettier": "bin-prettier.js" }, @@ -1597,6 +2205,48 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, + "node_modules/prompts": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", + "peer": true, + "dependencies": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.5" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "peer": true + }, "node_modules/randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -1622,7 +2272,15 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", - "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "peer": true, "engines": { "node": ">=0.10.0" } @@ -1642,6 +2300,39 @@ "node": ">= 4" } }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "peer": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "peer": true, + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -1677,6 +2368,23 @@ "node": ">=10" } }, + "node_modules/sentence-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/sentence-case/-/sentence-case-3.0.4.tgz", + "integrity": "sha512-8LS0JInaQMCRoQ7YUytAo/xUu5W2XnQxV2HI/6uM6U7CITS1RqPElr30V6uIqyMKM9lJGRVFy5/4CuzcixNYSg==", + "peer": true, + "dependencies": { + "no-case": "^3.0.4", + "tslib": "^2.0.3", + "upper-case-first": "^2.0.2" + } + }, + "node_modules/sentence-case/node_modules/tslib": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", + "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", + "peer": true + }, "node_modules/serialize-javascript": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", @@ -1698,6 +2406,40 @@ "integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==", "dev": true }, + "node_modules/sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "peer": true + }, + "node_modules/slash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", + "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/snake-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/snake-case/-/snake-case-3.0.4.tgz", + "integrity": "sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==", + "peer": true, + "dependencies": { + "dot-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, + "node_modules/snake-case/node_modules/tslib": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", + "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", + "peer": true + }, "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -1708,7 +2450,6 @@ "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -1728,7 +2469,6 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -1767,7 +2507,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, "dependencies": { "is-number": "^7.0.0" }, @@ -1852,6 +2591,45 @@ "node": ">=4.2.0" } }, + "node_modules/upper-case": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/upper-case/-/upper-case-2.0.2.tgz", + "integrity": "sha512-KgdgDGJt2TpuwBUIjgG6lzw2GWFRCW9Qkfkiv0DxqHHLYJHmtmdUIKcZd8rHgFSjopVTlw6ggzCm1b8MFQwikg==", + "peer": true, + "dependencies": { + "tslib": "^2.0.3" + } + }, + "node_modules/upper-case-first": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/upper-case-first/-/upper-case-first-2.0.2.tgz", + "integrity": "sha512-514ppYHBaKwfJRK/pNC6c/OxfGa0obSnAl106u97Ed0I625Nin96KAjttZF6ZL3e1XLtphxnqrOi9iWgm+u+bg==", + "peer": true, + "dependencies": { + "tslib": "^2.0.3" + } + }, + "node_modules/upper-case-first/node_modules/tslib": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", + "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", + "peer": true + }, + "node_modules/upper-case/node_modules/tslib": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", + "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", + "peer": true + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "peer": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, "node_modules/uuid": { "version": "8.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", @@ -1867,11 +2645,53 @@ "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", "dev": true }, + "node_modules/vscode-jsonrpc": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-6.0.0.tgz", + "integrity": "sha512-wnJA4BnEjOSyFMvjZdpiOwhSq9uDoK8e/kpRJDTaMYzwlkrhG1fwDIZI94CLsLzlCK5cIbMMtFlJlfR57Lavmg==", + "peer": true, + "engines": { + "node": ">=8.0.0 || >=10.0.0" + } + }, + "node_modules/vscode-languageserver": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-7.0.0.tgz", + "integrity": "sha512-60HTx5ID+fLRcgdHfmz0LDZAXYEV68fzwG0JWwEPBode9NuMYTIxuYXPg4ngO8i8+Ou0lM7y6GzaYWbiDL0drw==", + "peer": true, + "dependencies": { + "vscode-languageserver-protocol": "3.16.0" + }, + "bin": { + "installServerIntoExtension": "bin/installServerIntoExtension" + } + }, + "node_modules/vscode-languageserver-protocol": { + "version": "3.16.0", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.16.0.tgz", + "integrity": "sha512-sdeUoAawceQdgIfTI+sdcwkiK2KU+2cbEYA0agzM2uqaUy2UpnnGHtWTHVEtS0ES4zHU0eMFRGN+oQgDxlD66A==", + "peer": true, + "dependencies": { + "vscode-jsonrpc": "6.0.0", + "vscode-languageserver-types": "3.16.0" + } + }, + "node_modules/vscode-languageserver-textdocument": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.7.tgz", + "integrity": "sha512-bFJH7UQxlXT8kKeyiyu41r22jCZXG8kuuVVA33OEJn1diWOZK5n8zBSPZFHVBOu8kXZ6h0LIRhf5UnCo61J4Hg==", + "peer": true + }, + "node_modules/vscode-languageserver-types": { + "version": "3.16.0", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.16.0.tgz", + "integrity": "sha512-k8luDIWJWyenLc5ToFQQMaSrqCHiLwyKPHKPQZ5zz21vM+vIVUSvsRpcbiECH4WR88K2XZqc4ScRcZ7nk/jbeA==", + "peer": true + }, "node_modules/web-streams-polyfill": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz", "integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==", - "dev": true, "engines": { "node": ">= 8" } @@ -2188,6 +3008,185 @@ "integrity": "sha512-oc6OHLdoLlOpO5GjMcOFETEhJi45CI3MVIhvVY/yqyGw9AtaqOYw5HzO3wTuYgYFeGS4v9iqFah0SNLZrpk3Sg==", "dev": true }, + "@babel/code-frame": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", + "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", + "peer": true, + "requires": { + "@babel/highlight": "^7.16.7" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.19.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", + "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", + "peer": true + }, + "@babel/highlight": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", + "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", + "peer": true, + "requires": { + "@babel/helper-validator-identifier": "^7.18.6", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "peer": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "peer": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "peer": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "peer": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "peer": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "peer": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "peer": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "@cadl-lang/compiler": { + "version": "0.37.0", + "resolved": "https://registry.npmjs.org/@cadl-lang/compiler/-/compiler-0.37.0.tgz", + "integrity": "sha512-jHMqPZmM4evQlu7oY9vj6PEM+f+OhnfPqAdwxALrU2gwsLcwYG1h8rkjX/iK2KfeewCbXuRT/hztOTo3pcbYWA==", + "peer": true, + "requires": { + "@babel/code-frame": "~7.16.7", + "ajv": "~8.9.0", + "change-case": "~4.1.2", + "globby": "~13.1.1", + "js-yaml": "~4.1.0", + "mkdirp": "~1.0.4", + "mustache": "~4.2.0", + "node-fetch": "3.2.8", + "node-watch": "~0.7.1", + "picocolors": "~1.0.0", + "prettier": "~2.7.1", + "prompts": "~2.4.1", + "vscode-languageserver": "~7.0.0", + "vscode-languageserver-textdocument": "~1.0.1", + "yargs": "~17.3.1" + }, + "dependencies": { + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "peer": true + }, + "cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "peer": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "peer": true, + "requires": { + "argparse": "^2.0.1" + } + }, + "wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "peer": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "peer": true + }, + "yargs": { + "version": "17.3.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.3.1.tgz", + "integrity": "sha512-WUANQeVgjLbNsEmGk20f+nlHgOqzRFpiGWVaBrYGYIGANIIu3lWjoyi0fNlFmJkvfhCZ6BXINe7/W2O2bV4iaA==", + "peer": true, + "requires": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.0.0" + } + }, + "yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "peer": true + } + } + }, + "@cadl-lang/rest": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/@cadl-lang/rest/-/rest-0.19.0.tgz", + "integrity": "sha512-3vMDvr8huQcH03oGYlt5uhRu5TKn6rb+rK0tmPfWgZ9EfZDMn0lR4CAjQOukFv2d93s7KE2IBVtXvQ/Z0C7kdQ==", + "requires": {} + }, "@cspotcode/source-map-support": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", @@ -2219,6 +3218,32 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, + "@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "peer": true, + "requires": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + } + }, + "@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "peer": true + }, + "@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "peer": true, + "requires": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + } + }, "@ts-common/add-position": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/@ts-common/add-position/-/add-position-0.0.2.tgz", @@ -2482,6 +3507,18 @@ "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", "dev": true }, + "ajv": { + "version": "8.9.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.9.0.tgz", + "integrity": "sha512-qOKJyNj/h+OWx7s5DePL6Zu1KeM9jPZhwBqs+7DzP6bGOvqzVCSf0xueYmVuaC/oQ/VtS2zLMLHdQFbkka+XDQ==", + "peer": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + } + }, "ansi-colors": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", @@ -2491,14 +3528,12 @@ "ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" }, "ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, "requires": { "color-convert": "^2.0.1" } @@ -2569,7 +3604,6 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, "requires": { "fill-range": "^7.0.1" } @@ -2586,12 +3620,49 @@ "integrity": "sha512-wCyFsDQkKPwwF8BDwOiWNx/9K45L/hvggQiDbve+viMNMQnWhrlYIuBk09offfwCRtCO9P6XwUttufzU11WCVw==", "dev": true }, + "camel-case": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-4.1.2.tgz", + "integrity": "sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw==", + "peer": true, + "requires": { + "pascal-case": "^3.1.2", + "tslib": "^2.0.3" + }, + "dependencies": { + "tslib": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", + "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", + "peer": true + } + } + }, "camelcase": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", "dev": true }, + "capital-case": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/capital-case/-/capital-case-1.0.4.tgz", + "integrity": "sha512-ds37W8CytHgwnhGGTi88pcPyR15qoNkOpYwmMMfnWqqWgESapLqvDx6huFjQ5vqWSn2Z06173XNA7LtMOeUh1A==", + "peer": true, + "requires": { + "no-case": "^3.0.4", + "tslib": "^2.0.3", + "upper-case-first": "^2.0.2" + }, + "dependencies": { + "tslib": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", + "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", + "peer": true + } + } + }, "chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -2613,6 +3684,34 @@ } } }, + "change-case": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/change-case/-/change-case-4.1.2.tgz", + "integrity": "sha512-bSxY2ws9OtviILG1EiY5K7NNxkqg/JnRnFxLtKQ96JaviiIxi7djMrSd0ECT9AC+lttClmYwKw53BWpOMblo7A==", + "peer": true, + "requires": { + "camel-case": "^4.1.2", + "capital-case": "^1.0.4", + "constant-case": "^3.0.4", + "dot-case": "^3.0.4", + "header-case": "^2.0.4", + "no-case": "^3.0.4", + "param-case": "^3.0.4", + "pascal-case": "^3.1.2", + "path-case": "^3.0.4", + "sentence-case": "^3.0.4", + "snake-case": "^3.0.4", + "tslib": "^2.0.3" + }, + "dependencies": { + "tslib": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", + "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", + "peer": true + } + } + }, "chokidar": { "version": "3.5.3", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", @@ -2644,7 +3743,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, "requires": { "color-name": "~1.1.4" } @@ -2652,8 +3750,7 @@ "color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, "combined-stream": { "version": "1.0.8", @@ -2682,6 +3779,25 @@ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, + "constant-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/constant-case/-/constant-case-3.0.4.tgz", + "integrity": "sha512-I2hSBi7Vvs7BEuJDr5dDHfzb/Ruj3FyvFyh7KLilAjNQw3Be+xgqUBA2W6scVEcL0hL1dwPRtIqEPVUCKkSsyQ==", + "peer": true, + "requires": { + "no-case": "^3.0.4", + "tslib": "^2.0.3", + "upper-case": "^2.0.2" + }, + "dependencies": { + "tslib": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", + "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", + "peer": true + } + } + }, "create-require": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", @@ -2691,8 +3807,7 @@ "data-uri-to-buffer": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.0.tgz", - "integrity": "sha512-Vr3mLBA8qWmcuschSLAOogKgQ/Jwxulv3RNE4FXnYWRGujzrRWQI4m12fQqRkwX06C0KanhLr4hK+GydchZsaA==", - "dev": true + "integrity": "sha512-Vr3mLBA8qWmcuschSLAOogKgQ/Jwxulv3RNE4FXnYWRGujzrRWQI4m12fQqRkwX06C0KanhLr4hK+GydchZsaA==" }, "debug": { "version": "4.3.3", @@ -2729,11 +3844,37 @@ "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", "dev": true }, + "dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "peer": true, + "requires": { + "path-type": "^4.0.0" + } + }, + "dot-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz", + "integrity": "sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==", + "peer": true, + "requires": { + "no-case": "^3.0.4", + "tslib": "^2.0.3" + }, + "dependencies": { + "tslib": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", + "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", + "peer": true + } + } + }, "emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, "entities": { "version": "2.0.3", @@ -2744,8 +3885,7 @@ "escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", - "dev": true + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==" }, "escape-string-regexp": { "version": "4.0.0", @@ -2759,11 +3899,38 @@ "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "dev": true }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "peer": true + }, + "fast-glob": { + "version": "3.2.12", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", + "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", + "peer": true, + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + } + }, + "fastq": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", + "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", + "peer": true, + "requires": { + "reusify": "^1.0.4" + } + }, "fetch-blob": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", - "dev": true, "requires": { "node-domexception": "^1.0.0", "web-streams-polyfill": "^3.0.3" @@ -2773,7 +3940,6 @@ "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, "requires": { "to-regex-range": "^5.0.1" } @@ -2815,7 +3981,6 @@ "version": "4.0.10", "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", - "dev": true, "requires": { "fetch-blob": "^3.1.2" } @@ -2845,8 +4010,7 @@ "get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" }, "glob": { "version": "7.2.3", @@ -2866,11 +4030,23 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, "requires": { "is-glob": "^4.0.1" } }, + "globby": { + "version": "13.1.2", + "resolved": "https://registry.npmjs.org/globby/-/globby-13.1.2.tgz", + "integrity": "sha512-LKSDZXToac40u8Q1PQtZihbNdTYSNMuWe+K5l+oa6KgDzSvVrHXlJy40hUP522RjAIoNLJYBJi7ow+rbFpIhHQ==", + "peer": true, + "requires": { + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.11", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^4.0.0" + } + }, "growl": { "version": "1.10.5", "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", @@ -2895,6 +4071,30 @@ "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", "dev": true }, + "header-case": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/header-case/-/header-case-2.0.4.tgz", + "integrity": "sha512-H/vuk5TEEVZwrR0lp2zed9OCo1uAILMlx0JEMgC26rzyJJ3N1v6XkwHHXJQdR2doSjcGPM6OKPYoJgf0plJ11Q==", + "peer": true, + "requires": { + "capital-case": "^1.0.4", + "tslib": "^2.0.3" + }, + "dependencies": { + "tslib": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", + "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", + "peer": true + } + } + }, + "ignore": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", + "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", + "peer": true + }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -2929,20 +4129,17 @@ "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==" }, "is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" }, "is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, "requires": { "is-extglob": "^2.1.1" } @@ -2950,8 +4147,7 @@ "is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" }, "is-plain-obj": { "version": "2.1.0", @@ -2980,6 +4176,12 @@ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "peer": true + }, "js-yaml": { "version": "3.14.1", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", @@ -3001,12 +4203,24 @@ "ono": "^4.0.11" } }, + "json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "peer": true + }, "jsonpath-plus": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/jsonpath-plus/-/jsonpath-plus-6.0.1.tgz", "integrity": "sha512-EvGovdvau6FyLexFH2OeXfIITlgIbgZoAZe3usiySeaIDm5QS+A10DKNpaPBBqqRSZr2HN6HVNXxtwUAr2apEw==", "dev": true }, + "kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "peer": true + }, "locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", @@ -3026,6 +4240,23 @@ "is-unicode-supported": "^0.1.0" } }, + "lower-case": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", + "integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==", + "peer": true, + "requires": { + "tslib": "^2.0.3" + }, + "dependencies": { + "tslib": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", + "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", + "peer": true + } + } + }, "lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -3047,6 +4278,22 @@ "integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==", "dev": true }, + "merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "peer": true + }, + "micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "peer": true, + "requires": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + } + }, "mime-db": { "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", @@ -3077,6 +4324,12 @@ "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", "dev": true }, + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "peer": true + }, "mocha": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.2.2.tgz", @@ -3209,23 +4462,45 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, + "mustache": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz", + "integrity": "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==", + "peer": true + }, "nanoid": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.1.tgz", "integrity": "sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw==", "dev": true }, + "no-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz", + "integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==", + "peer": true, + "requires": { + "lower-case": "^2.0.2", + "tslib": "^2.0.3" + }, + "dependencies": { + "tslib": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", + "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", + "peer": true + } + } + }, "node-domexception": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", - "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", - "dev": true + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==" }, "node-fetch": { "version": "3.2.8", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.2.8.tgz", "integrity": "sha512-KtpD1YhGszhntMpBDyp5lyagk8KIMopC1LEb7cQUAh7zcosaX5uK8HnbNb2i3NTQK3sIawCItS0uFC3QzcLHdg==", - "dev": true, "requires": { "data-uri-to-buffer": "^4.0.0", "fetch-blob": "^3.1.4", @@ -3252,6 +4527,12 @@ "integrity": "sha512-UdS4swXs85fCGWWf6t6DMGgpN/vnlKeSGEQ7hJcrs7PBFoxoKLmibc3QRb7fwiYsjdL7PX8iI/TMSlZ90dgHhQ==", "dev": true }, + "node-watch": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/node-watch/-/node-watch-0.7.3.tgz", + "integrity": "sha512-3l4E8uMPY1HdMMryPRUAl+oIHtXtyiTlIiESNSVSNxcPfzAFzeTbXFQkZfAwBbo0B1qMSG8nUABx+Gd+YrbKrQ==", + "peer": true + }, "normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -3300,6 +4581,60 @@ "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true }, + "param-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/param-case/-/param-case-3.0.4.tgz", + "integrity": "sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A==", + "peer": true, + "requires": { + "dot-case": "^3.0.4", + "tslib": "^2.0.3" + }, + "dependencies": { + "tslib": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", + "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", + "peer": true + } + } + }, + "pascal-case": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/pascal-case/-/pascal-case-3.1.2.tgz", + "integrity": "sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g==", + "peer": true, + "requires": { + "no-case": "^3.0.4", + "tslib": "^2.0.3" + }, + "dependencies": { + "tslib": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", + "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", + "peer": true + } + } + }, + "path-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/path-case/-/path-case-3.0.4.tgz", + "integrity": "sha512-qO4qCFjXqVTrcbPt/hQfhTQ+VhFsqNKOPtytgNKkKxSoEp3XPUQ8ObFuePylOIok5gjn69ry8XiULxCwot3Wfg==", + "peer": true, + "requires": { + "dot-case": "^3.0.4", + "tslib": "^2.0.3" + }, + "dependencies": { + "tslib": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", + "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", + "peer": true + } + } + }, "path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -3312,17 +4647,49 @@ "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "dev": true }, + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "peer": true + }, + "picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "peer": true + }, "picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" }, "prettier": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", - "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", - "dev": true + "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==" + }, + "prompts": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", + "peer": true, + "requires": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.5" + } + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "peer": true + }, + "queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "peer": true }, "randombytes": { "version": "2.1.0", @@ -3345,8 +4712,13 @@ "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", - "dev": true + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==" + }, + "require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "peer": true }, "require-main-filename": { "version": "2.0.0", @@ -3360,6 +4732,21 @@ "integrity": "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==", "dev": true }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "peer": true + }, + "run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "peer": true, + "requires": { + "queue-microtask": "^1.2.2" + } + }, "safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -3375,6 +4762,25 @@ "lru-cache": "^6.0.0" } }, + "sentence-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/sentence-case/-/sentence-case-3.0.4.tgz", + "integrity": "sha512-8LS0JInaQMCRoQ7YUytAo/xUu5W2XnQxV2HI/6uM6U7CITS1RqPElr30V6uIqyMKM9lJGRVFy5/4CuzcixNYSg==", + "peer": true, + "requires": { + "no-case": "^3.0.4", + "tslib": "^2.0.3", + "upper-case-first": "^2.0.2" + }, + "dependencies": { + "tslib": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", + "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", + "peer": true + } + } + }, "serialize-javascript": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", @@ -3396,6 +4802,36 @@ "integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==", "dev": true }, + "sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "peer": true + }, + "slash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", + "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", + "peer": true + }, + "snake-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/snake-case/-/snake-case-3.0.4.tgz", + "integrity": "sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==", + "peer": true, + "requires": { + "dot-case": "^3.0.4", + "tslib": "^2.0.3" + }, + "dependencies": { + "tslib": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", + "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", + "peer": true + } + } + }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -3406,7 +4842,6 @@ "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, "requires": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -3423,7 +4858,6 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, "requires": { "ansi-regex": "^5.0.1" } @@ -3447,7 +4881,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, "requires": { "is-number": "^7.0.0" } @@ -3499,6 +4932,49 @@ "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==", "dev": true }, + "upper-case": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/upper-case/-/upper-case-2.0.2.tgz", + "integrity": "sha512-KgdgDGJt2TpuwBUIjgG6lzw2GWFRCW9Qkfkiv0DxqHHLYJHmtmdUIKcZd8rHgFSjopVTlw6ggzCm1b8MFQwikg==", + "peer": true, + "requires": { + "tslib": "^2.0.3" + }, + "dependencies": { + "tslib": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", + "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", + "peer": true + } + } + }, + "upper-case-first": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/upper-case-first/-/upper-case-first-2.0.2.tgz", + "integrity": "sha512-514ppYHBaKwfJRK/pNC6c/OxfGa0obSnAl106u97Ed0I625Nin96KAjttZF6ZL3e1XLtphxnqrOi9iWgm+u+bg==", + "peer": true, + "requires": { + "tslib": "^2.0.3" + }, + "dependencies": { + "tslib": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", + "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", + "peer": true + } + } + }, + "uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "peer": true, + "requires": { + "punycode": "^2.1.0" + } + }, "uuid": { "version": "8.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", @@ -3511,11 +4987,47 @@ "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", "dev": true }, + "vscode-jsonrpc": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-6.0.0.tgz", + "integrity": "sha512-wnJA4BnEjOSyFMvjZdpiOwhSq9uDoK8e/kpRJDTaMYzwlkrhG1fwDIZI94CLsLzlCK5cIbMMtFlJlfR57Lavmg==", + "peer": true + }, + "vscode-languageserver": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-7.0.0.tgz", + "integrity": "sha512-60HTx5ID+fLRcgdHfmz0LDZAXYEV68fzwG0JWwEPBode9NuMYTIxuYXPg4ngO8i8+Ou0lM7y6GzaYWbiDL0drw==", + "peer": true, + "requires": { + "vscode-languageserver-protocol": "3.16.0" + } + }, + "vscode-languageserver-protocol": { + "version": "3.16.0", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.16.0.tgz", + "integrity": "sha512-sdeUoAawceQdgIfTI+sdcwkiK2KU+2cbEYA0agzM2uqaUy2UpnnGHtWTHVEtS0ES4zHU0eMFRGN+oQgDxlD66A==", + "peer": true, + "requires": { + "vscode-jsonrpc": "6.0.0", + "vscode-languageserver-types": "3.16.0" + } + }, + "vscode-languageserver-textdocument": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.7.tgz", + "integrity": "sha512-bFJH7UQxlXT8kKeyiyu41r22jCZXG8kuuVVA33OEJn1diWOZK5n8zBSPZFHVBOu8kXZ6h0LIRhf5UnCo61J4Hg==", + "peer": true + }, + "vscode-languageserver-types": { + "version": "3.16.0", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.16.0.tgz", + "integrity": "sha512-k8luDIWJWyenLc5ToFQQMaSrqCHiLwyKPHKPQZ5zz21vM+vIVUSvsRpcbiECH4WR88K2XZqc4ScRcZ7nk/jbeA==", + "peer": true + }, "web-streams-polyfill": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz", - "integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==", - "dev": true + "integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==" }, "webidl-conversions": { "version": "3.0.1", diff --git a/package.json b/package.json index c96a4693c2f4..e7c683dcbf1e 100644 --- a/package.json +++ b/package.json @@ -41,5 +41,8 @@ "prettier": "prettier", "tsc": "tsc", "multiapi": "ts-node ./scripts/multiapi.ts" + }, + "dependencies": { + "@cadl-lang/rest": "^0.19.0" } } diff --git a/specification/eventgrid/data-plane/cadl/ApiManagement.cadl b/specification/eventgrid/data-plane/cadl/ApiManagement.cadl index a4add81b1601..2f37573084c5 100644 --- a/specification/eventgrid/data-plane/cadl/ApiManagement.cadl +++ b/specification/eventgrid/data-plane/cadl/ApiManagement.cadl @@ -1,4 +1,5 @@ -@service({title:"Microsoft.ApiManagement",version:"2018-01-01"}) +@service({title:"Schema of Azure API Management events published to Azure Event Grid",version:"2018-01-01"}) +@doc("Describes the schema of the Azure API Management events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") namespace ApiManagement; model ApiManagementBase { diff --git a/specification/eventgrid/data-plane/cadl/AppConfiguration.cadl b/specification/eventgrid/data-plane/cadl/AppConfiguration.cadl index dc0f4c06c9c6..0647952c6293 100644 --- a/specification/eventgrid/data-plane/cadl/AppConfiguration.cadl +++ b/specification/eventgrid/data-plane/cadl/AppConfiguration.cadl @@ -1,4 +1,5 @@ -@service({title:"Microsoft.AppConfiguration",version:"2018-01-01"}) +@service({title:"Schema of Azure App Configuration events published to Azure Event Grid",version:"2018-01-01"}) +@doc("Describes the schema of the Azure App Configuration events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") namespace AppConfiguration; enum AppConfigurationEventTypes { @@ -7,13 +8,13 @@ enum AppConfigurationEventTypes { } model AppConfigurationBase { - @doc("The key used to identify the key-value that was {name}.", TEventType) + @doc("The key used to identify the key-value that was {name}.", {name:TEventType}) key?: string; - @doc("The label, if any, used to identify the key-value that was {name}.", TEventType) + @doc("The label, if any, used to identify the key-value that was {name}.", {name:TEventType}) label?: string; - @doc("The etag representing the key-value that was {name}.", TEventType) + @doc("The etag representing the key-value that was {name}.", {name:TEventType}) etag?: string; @doc("The sync token representing the server state after the event.") diff --git a/specification/eventgrid/data-plane/cadl/AzureCommunicationServices.cadl b/specification/eventgrid/data-plane/cadl/AzureCommunicationServices.cadl index 9cb534713887..64dd0f020ab1 100644 --- a/specification/eventgrid/data-plane/cadl/AzureCommunicationServices.cadl +++ b/specification/eventgrid/data-plane/cadl/AzureCommunicationServices.cadl @@ -1,6 +1,7 @@ import "./AzureCommunicationServicesCore.cadl"; -@service({title:"Microsoft.AzureCommunicationServices",version:"2018-01-01"}) +@service({title:"Schema of Azure Communication Services events published to Azure Event Grid",version:"2018-01-01"}) +@doc("Describes the schema of the Azure Communication Services events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") namespace AzureCommunicationServices; @doc("Schema of the Data property of an EventGridEvent for an Microsoft.Communication.UserDisconnected event.") @@ -17,13 +18,17 @@ model AcsChatMessageBaseEventData { metadata?: Record; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageReceived event.") -model AcsChatMessageReceivedEventData is AcsChatMessageBaseEventData; +model AcsChatMessageReceivedEventData extends AcsChatMessageEventBaseProperties { + ...AcsChatMessageBaseEventData; +} @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageReceivedInThread event.") -model AcsChatMessageReceivedInThreadEventData is AcsChatMessageBaseEventData; +model AcsChatMessageReceivedInThreadEventData extends AcsChatMessageEventInThreadBaseProperties { + ...AcsChatMessageBaseEventData; +} @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageEdited event.") -model AcsChatMessageEditedEventData { +model AcsChatMessageEditedEventData extends AcsChatMessageEventBaseProperties { ...AcsChatMessageBaseEventData; @doc("The time at which the message was edited") @@ -31,7 +36,7 @@ model AcsChatMessageEditedEventData { } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageEditedInThread event.") -model AcsChatMessageEditedInThreadEventData { +model AcsChatMessageEditedInThreadEventData extends AcsChatMessageEventInThreadBaseProperties { ...AcsChatMessageBaseEventData; @doc("The time at which the message was edited") @@ -39,13 +44,13 @@ model AcsChatMessageEditedInThreadEventData { } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageDeleted event.") -model AcsChatMessageDeletedEventData { +model AcsChatMessageDeletedEventData extends AcsChatMessageEventBaseProperties { @doc("The time at which the message was deleted") deleteTime?: zonedDateTime; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageDeletedInThread event.") -model AcsChatMessageDeletedInThreadEventData { +model AcsChatMessageDeletedInThreadEventData extends AcsChatMessageEventInThreadBaseProperties { @doc("The time at which the message was deleted") deleteTime?: zonedDateTime; } @@ -62,10 +67,14 @@ model AcsChatThreadBaseEventData { } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadCreatedWithUser event.") -model AcsChatThreadCreatedWithUserEventData is AcsChatThreadBaseEventData; +model AcsChatThreadCreatedWithUserEventData extends AcsChatThreadEventBaseProperties { + ...AcsChatThreadBaseEventData; +} @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadCreated event.") -model AcsChatThreadCreatedEventData is AcsChatThreadBaseEventData; +model AcsChatThreadCreatedEventData extends AcsChatThreadEventInThreadBaseProperties{ + ...AcsChatThreadBaseEventData; +} model AcsChatThreadDeletedBaseEventData { @doc("The communication identifier of the user who deleted the thread") @@ -76,10 +85,14 @@ model AcsChatThreadDeletedBaseEventData { } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadWithUserDeleted event.") -model AcsChatThreadWithUserDeletedEventData is AcsChatThreadDeletedBaseEventData; +model AcsChatThreadWithUserDeletedEventData extends AcsChatThreadEventBaseProperties { + ...AcsChatThreadDeletedBaseEventData; +} @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadDeleted event.") -model AcsChatThreadDeletedEventData is AcsChatThreadDeletedBaseEventData; +model AcsChatThreadDeletedEventData extends AcsChatThreadEventInThreadBaseProperties{ + ...AcsChatThreadDeletedBaseEventData; +} model AcsChatThredPropertiesBaseEventData { @doc("The communication identifier of the user who updated the thread properties") @@ -93,10 +106,14 @@ model AcsChatThredPropertiesBaseEventData { } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadPropertiesUpdatedPerUser event.") -model AcsChatThreadPropertiesUpdatedPerUserEventData is AcsChatThredPropertiesBaseEventData; +model AcsChatThreadPropertiesUpdatedPerUserEventData extends AcsChatThreadEventBaseProperties { + ...AcsChatThredPropertiesBaseEventData; +} @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadPropertiesUpdated event.") -model AcsChatThreadPropertiesUpdatedEventData is AcsChatThredPropertiesBaseEventData; +model AcsChatThreadPropertiesUpdatedEventData extends AcsChatThreadEventInThreadBaseProperties{ + ...AcsChatThredPropertiesBaseEventData; +} model AcsChatParticipantBaseEventData { @doc("The time at which the user was added to the thread") @@ -110,13 +127,17 @@ model AcsChatParticipantBaseEventData { } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatParticipantAddedToThreadWithUser event.") -model AcsChatParticipantAddedToThreadWithUserEventData is AcsChatParticipantBaseEventData; +model AcsChatParticipantAddedToThreadWithUserEventData extends AcsChatThreadEventBaseProperties { + ...AcsChatParticipantBaseEventData; +} @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatParticipantRemovedFromThreadWithUser event.") -model AcsChatParticipantRemovedFromThreadWithUserEventData is AcsChatParticipantBaseEventData; +model AcsChatParticipantRemovedFromThreadWithUserEventData extends AcsChatThreadEventBaseProperties { + ...AcsChatParticipantBaseEventData; +} @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadParticipantAdded event.") -model AcsChatParticipantAddedToThreadEventData { +model AcsChatParticipantAddedToThreadEventData extends AcsChatEventInThreadBaseProperties { ...AcsChatParticipantBaseEventData; @doc("The version of the thread") @@ -124,7 +145,7 @@ model AcsChatParticipantAddedToThreadEventData { } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadParticipantRemoved event.") -model AcsChatParticipantRemovedFromThreadEventData { +model AcsChatParticipantRemovedFromThreadEventData extends AcsChatEventInThreadBaseProperties { @doc("The time at which the user was removed to the thread") time?: zonedDateTime; @@ -139,7 +160,7 @@ model AcsChatParticipantRemovedFromThreadEventData { } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.SMSDeliveryReportReceived event.") -model AcsSmsDeliveryReportReceivedEventData { +model AcsSmsDeliveryReportReceivedEventData extends AcsSmsEventBaseProperties{ @doc("Status of Delivery") deliveryStatus?: string; @@ -157,7 +178,7 @@ model AcsSmsDeliveryReportReceivedEventData { } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.SMSReceived event.") -model AcsSmsReceivedEventData { +model AcsSmsReceivedEventData extends AcsSmsEventBaseProperties{ @doc("The SMS content") message?: string; @@ -187,6 +208,7 @@ enum recordingFormatTypeKV { Mp4, } +//TODO: This might need some fixing @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RecordingFileStatusUpdated event.") model AcsRecordingFileStatusUpdatedEventData { @doc("The details of recording storage information") @@ -212,7 +234,7 @@ model AcsRecordingFileStatusUpdatedEventData { } @doc("Schema of common properties of all chat thread events") -model AcsChatThreadEventBaseProperties { +model AcsChatThreadEventBaseProperties extends AcsChatEventBaseProperties { @doc("The original creation time of the thread") createTime?: zonedDateTime; @@ -221,10 +243,16 @@ model AcsChatThreadEventBaseProperties { } @doc("Schema of common properties of all chat thread events") -model AcsChatThreadEventInThreadBaseProperties is AcsChatThreadEventBaseProperties; +model AcsChatThreadEventInThreadBaseProperties extends AcsChatEventInThreadBaseProperties { + @doc("The original creation time of the thread") + createTime?: zonedDateTime; + + @doc("The version of the thread") + version?: int64; +} @doc("Schema of common properties of all chat message events") -model AcsChatMessageEventBaseProperties { +model AcsChatMessageEventBaseProperties extends AcsChatEventBaseProperties { @doc("The chat message id") messageId?: string; @@ -245,7 +273,25 @@ model AcsChatMessageEventBaseProperties { } @doc("Schema of common properties of all thread-level chat message events") -model AcsChatMessageEventInThreadBaseProperties is AcsChatMessageEventBaseProperties; +model AcsChatMessageEventInThreadBaseProperties extends AcsChatEventInThreadBaseProperties{ + @doc("The chat message id") + messageId?: string; + + @doc("The communication identifier of the sender") + senderCommunicationIdentifier?: CommunicationIdentifierModel; + + @doc("The display name of the sender") + senderDisplayName?: string; + + @doc("The original compose time of the message") + composeTime?: zonedDateTime; + + @doc("The type of the message") + type?: string; + + @doc("The version of the message") + version?: int64; +} @doc("Schema of common properties of all thread-level chat events") model AcsChatEventInThreadBaseProperties { diff --git a/specification/eventgrid/data-plane/cadl/MediaServices.cadl b/specification/eventgrid/data-plane/cadl/MediaServices.cadl index 897b90101678..590450c57d09 100644 --- a/specification/eventgrid/data-plane/cadl/MediaServices.cadl +++ b/specification/eventgrid/data-plane/cadl/MediaServices.cadl @@ -1,3 +1,7 @@ +@service({title:"Schema of Azure Media Services events published to Azure Event Grid",version:"2018-01-01"}) +@doc("Describes the schema of the Azure Media Services events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") +namespace MediaServices; + enum MediaJobState { Canceled, Canceling, @@ -70,7 +74,8 @@ model MediaJobErrorDetail { @doc("The event data for a Job output.") model MediaJobOutput { @doc("The discriminator for derived types.") - @odata.type?: string; + @projectedName("json","@odata.type") + OdataType?: string; @doc("Gets the Job output error.") error?: MediaJobError; @doc("Gets the Job output label.") @@ -135,27 +140,27 @@ model MediaJobErroredEventData { } @doc("Job output canceled event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobOutputCanceled event.") -@Autorest.extension("x-ms-discriminator-value", "#Microsoft.Media.JobOutputCanceled") +@discriminator("#Microsoft.Media.JobOutputCanceled") model MediaJobOutputCanceledEventData is MediaJobOutputStateChangeEventData; @doc("Job output canceling event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobOutputCanceling event.") -@Autorest.extension("x-ms-discriminator-value", "#Microsoft.Media.JobOutputCanceling") +@discriminator("#Microsoft.Media.JobOutputCanceling") model MediaJobOutputCancelingEventData is MediaJobOutputStateChangeEventData; @doc("Job output error event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobOutputErrored event.") -@Autorest.extension("x-ms-discriminator-value", "#Microsoft.Media.JobOutputErrored") +@discriminator("#Microsoft.Media.JobOutputErrored") model MediaJobOutputErroredEventData is MediaJobOutputStateChangeEventData; @doc("Job output finished event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobOutputFinished event.") -@Autorest.extension("x-ms-discriminator-value", "#Microsoft.Media.JobOutputFinished") +@discriminator("#Microsoft.Media.JobOutputFinished") model MediaJobOutputFinishedEventData is MediaJobOutputStateChangeEventData; @doc("Job output processing event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobOutputProcessing event.") -@Autorest.extension("x-ms-discriminator-value", "#Microsoft.Media.JobOutputProcessing") +@discriminator("#Microsoft.Media.JobOutputProcessing") model MediaJobOutputProcessingEventData is MediaJobOutputStateChangeEventData; @doc("Job output scheduled event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobOutputScheduled event.") -@Autorest.extension("x-ms-discriminator-value", "#Microsoft.Media.JobOutputCanceled") +@discriminator("#Microsoft.Media.JobOutputCanceled") model MediaJobOutputScheduledEventData is MediaJobOutputStateChangeEventData; model MediaLiveEventConnectionBaseData { diff --git a/specification/eventgrid/data-plane/cadl/Storage.cadl b/specification/eventgrid/data-plane/cadl/Storage.cadl index 727c55940bc8..74de49c275f0 100644 --- a/specification/eventgrid/data-plane/cadl/Storage.cadl +++ b/specification/eventgrid/data-plane/cadl/Storage.cadl @@ -1,9 +1,15 @@ +@service({title:"Schema of Azure Storage events published to Azure Event Grid", version: "2018-01-01"}) + +@doc("Describes the schema of the Azure Storage events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") +namespace Storage; + enum StorageType{ - blob; - directory; + blob: "blob", + directory: "directory", } -model StorageBaseEventData { + +model StorageBaseEventData { @doc("The name of the API/operation that triggered this event.") api?: string; @@ -13,7 +19,7 @@ model StorageBaseEventData { @doc("The request id generated by the Storage service for the storage API operation that triggered this event.") requestId?: string; - @doc("An opaque string value representing the logical sequence of events for any particular {name} name. Users can use standard string comparison to understand the relative sequence of two events on the same {name} name.", TStorageType) + @doc("An opaque string value representing the logical sequence of events for any particular {name} name. Users can use standard string comparison to understand the relative sequence of two events on the same {name} name.", {name: TStorageType,}) sequencer?: string; @doc("The identity of the requester that triggered this event.") @@ -47,7 +53,7 @@ model StorageBlobCreatedEventData { @doc("The offset of the blob in bytes.") contentOffset?: int64; - ...StorageBaseEventData; + ...StorageBaseEventData<"blob">; ...StorageUrlBaseEventData; ...StorageBaseTypeData; } @@ -57,7 +63,7 @@ model StorageBlobDeletedEventData { @doc("The path to the blob.") url?: string; - ...StorageBaseEventData; + ...StorageBaseEventData<"blob">; ...StorageBaseTypeData; } @@ -69,7 +75,7 @@ model StorageDirectoryCreatedEventData { @doc("The path to the directory.") url?: string; - ...StorageBaseEventData; + ...StorageBaseEventData<"directory">; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Storage.DirectoryDeleted event.") @@ -80,7 +86,7 @@ model StorageDirectoryDeletedEventData { @doc("Is this event for a recursive delete operation.") recursive?: string; - ...StorageBaseEventData; + ...StorageBaseEventData<"directory">; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Storage.BlobRenamed event.") @@ -91,7 +97,7 @@ model StorageBlobRenamedEventData { @doc("The new path to the blob after the rename operation.") destinationUrl?: string; - ...StorageBaseEventData; + ...StorageBaseEventData<"blob">; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Storage.DirectoryRenamed event.") @@ -102,7 +108,7 @@ model StorageDirectoryRenamedEventData { @doc("The new path to the directory after the rename operation.") destinationUrl?: string; - ...StorageBaseEventData; + ...StorageBaseEventData<"directory">; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Storage.LifecyclePolicyCompleted event.") @@ -128,14 +134,14 @@ model StorageLifecyclePolicyActionSummaryDetail { @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Storage.BlobTierChanged event.") model StorageBlobTierChangedEventData { - ...StorageBaseEventData; + ...StorageBaseEventData<"blob">; ...StorageUrlBaseEventData; ...StorageBaseTypeData; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Storage.AsyncOperationInitiated event.") model StorageAsyncOperationInitiatedEventData { - ...StorageBaseEventData; + ...StorageBaseEventData<"blob">; ...StorageUrlBaseEventData; ...StorageBaseTypeData; } diff --git a/specification/eventgrid/data-plane/cadl/package-lock.json b/specification/eventgrid/data-plane/cadl/package-lock.json index b84242531e15..3c0504d3208c 100644 --- a/specification/eventgrid/data-plane/cadl/package-lock.json +++ b/specification/eventgrid/data-plane/cadl/package-lock.json @@ -1,17 +1,1869 @@ { "name": "cadl", + "lockfileVersion": 2, "requires": true, - "lockfileVersion": 1, + "packages": { + "": { + "name": "cadl", + "dependencies": { + "@azure-tools/cadl-autorest": "^0.22.0", + "@azure-tools/cadl-azure-core": "^0.9.0", + "@azure-tools/cadl-providerhub": "^0.23.0", + "@cadl-lang/compiler": "latest", + "@cadl-lang/openapi3": "latest", + "@cadl-lang/rest": "latest" + } + }, + "node_modules/@azure-tools/cadl-autorest": { + "version": "0.22.0", + "resolved": "https://registry.npmjs.org/@azure-tools/cadl-autorest/-/cadl-autorest-0.22.0.tgz", + "integrity": "sha512-O1uoFav6UzkkU5r28nbrQXkE94Cw2N6RFtqZso+VJQV3rvcLXQygvLxA+GA0WBCSkqLyQXfPg8JV0uWq4JDPsQ==", + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@azure-tools/cadl-azure-core": "~0.9.0", + "@cadl-lang/compiler": "~0.37.0", + "@cadl-lang/openapi": "~0.14.0", + "@cadl-lang/rest": "~0.19.0", + "@cadl-lang/versioning": "~0.10.0" + } + }, + "node_modules/@azure-tools/cadl-azure-core": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@azure-tools/cadl-azure-core/-/cadl-azure-core-0.9.0.tgz", + "integrity": "sha512-iGBI9YmRIoUpM0aDC0jhv9IIDQgA3f32h3af/8dBZ38b8TPmFkWaA3nw9BVsG5sPiTNfxUDEwLqKI+/wKo5H8A==", + "dependencies": { + "@cadl-lang/lint": "~0.3.0" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@cadl-lang/compiler": "~0.37.0", + "@cadl-lang/rest": "~0.19.0" + } + }, + "node_modules/@azure-tools/cadl-azure-resource-manager": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/@azure-tools/cadl-azure-resource-manager/-/cadl-azure-resource-manager-0.12.0.tgz", + "integrity": "sha512-bewwKbRr2JJgG9337K8ceEdGa1ycWlO174ywbN3F1IHqs1MuJeG3Bg8czTSbfGGl5ew0kcD9DaqV5FLvPytLuQ==", + "peer": true, + "dependencies": { + "@cadl-lang/lint": "~0.3.0" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@azure-tools/cadl-autorest": "~0.22.0", + "@azure-tools/cadl-azure-core": "~0.9.0", + "@cadl-lang/compiler": "~0.37.0", + "@cadl-lang/openapi": "~0.14.0", + "@cadl-lang/rest": "~0.19.0", + "@cadl-lang/versioning": "~0.10.0" + } + }, + "node_modules/@azure-tools/cadl-providerhub": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@azure-tools/cadl-providerhub/-/cadl-providerhub-0.23.0.tgz", + "integrity": "sha512-8B/U3vVgpNKa/At77iuiCSIqs6mCThY1xqP9V3YcEeOIJIEjb2B/hyLKS5KfC4qE0BeI5b3obHDhJGz+5hvRFw==", + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@azure-tools/cadl-autorest": "~0.22.0", + "@azure-tools/cadl-azure-core": "~0.9.0", + "@azure-tools/cadl-azure-resource-manager": "~0.12.0", + "@cadl-lang/compiler": "~0.37.0", + "@cadl-lang/openapi": "~0.14.0", + "@cadl-lang/rest": "~0.19.0", + "@cadl-lang/versioning": "~0.10.0" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", + "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", + "dependencies": { + "@babel/highlight": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.19.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", + "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", + "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", + "dependencies": { + "@babel/helper-validator-identifier": "^7.18.6", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@cadl-lang/compiler": { + "version": "0.37.0", + "resolved": "https://registry.npmjs.org/@cadl-lang/compiler/-/compiler-0.37.0.tgz", + "integrity": "sha512-jHMqPZmM4evQlu7oY9vj6PEM+f+OhnfPqAdwxALrU2gwsLcwYG1h8rkjX/iK2KfeewCbXuRT/hztOTo3pcbYWA==", + "dependencies": { + "@babel/code-frame": "~7.16.7", + "ajv": "~8.9.0", + "change-case": "~4.1.2", + "globby": "~13.1.1", + "js-yaml": "~4.1.0", + "mkdirp": "~1.0.4", + "mustache": "~4.2.0", + "node-fetch": "3.2.8", + "node-watch": "~0.7.1", + "picocolors": "~1.0.0", + "prettier": "~2.7.1", + "prompts": "~2.4.1", + "vscode-languageserver": "~7.0.0", + "vscode-languageserver-textdocument": "~1.0.1", + "yargs": "~17.3.1" + }, + "bin": { + "cadl": "cmd/cadl.js", + "cadl-server": "cmd/cadl-server.js" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@cadl-lang/lint": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@cadl-lang/lint/-/lint-0.3.0.tgz", + "integrity": "sha512-CWqkD+O/sltXzuFcc2ucPf4b1E3ozIqukkFlhwDUXs5DvQIGDTEeekPVBn2kJAFj15kKHGDssp7tAQGzucmPdQ==", + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@cadl-lang/compiler": "~0.37.0" + } + }, + "node_modules/@cadl-lang/openapi": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/@cadl-lang/openapi/-/openapi-0.14.0.tgz", + "integrity": "sha512-jjjTKVLC1OGJeDstDPfLgRzcnaGlt9LtJz3brheJMTX9l8eItUq+bJi5+dWo6TG4P5oqcX6HHPxeh8oRREoM7Q==", + "peer": true, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@cadl-lang/compiler": "~0.37.0", + "@cadl-lang/rest": "~0.19.0" + } + }, + "node_modules/@cadl-lang/openapi3": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/@cadl-lang/openapi3/-/openapi3-0.17.0.tgz", + "integrity": "sha512-O7qx81jmz4p3IbQk+au7LC98DV7noeGq/8herJ/A+H2heZ/c0Z0wyoVhENk69QHhoPsKUiGxLeWH/yNie0qsiQ==", + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@cadl-lang/compiler": "~0.37.0", + "@cadl-lang/openapi": "~0.14.0", + "@cadl-lang/rest": "~0.19.0", + "@cadl-lang/versioning": "~0.10.0" + } + }, + "node_modules/@cadl-lang/rest": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/@cadl-lang/rest/-/rest-0.19.0.tgz", + "integrity": "sha512-3vMDvr8huQcH03oGYlt5uhRu5TKn6rb+rK0tmPfWgZ9EfZDMn0lR4CAjQOukFv2d93s7KE2IBVtXvQ/Z0C7kdQ==", + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@cadl-lang/compiler": "~0.37.0" + } + }, + "node_modules/@cadl-lang/versioning": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@cadl-lang/versioning/-/versioning-0.10.0.tgz", + "integrity": "sha512-+9gdn2N1a3VyOu1ou12U9Uq5Mfvp/1A4nfEPOoZzDDm3U2GZZuRR4ZMUU1MqlJy0jrQdpW1yBNQD3ZYy0ngS7Q==", + "peer": true, + "dependencies": { + "@cadl-lang/compiler": "~0.37.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/ajv": { + "version": "8.9.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.9.0.tgz", + "integrity": "sha512-qOKJyNj/h+OWx7s5DePL6Zu1KeM9jPZhwBqs+7DzP6bGOvqzVCSf0xueYmVuaC/oQ/VtS2zLMLHdQFbkka+XDQ==", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/camel-case": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-4.1.2.tgz", + "integrity": "sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw==", + "dependencies": { + "pascal-case": "^3.1.2", + "tslib": "^2.0.3" + } + }, + "node_modules/capital-case": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/capital-case/-/capital-case-1.0.4.tgz", + "integrity": "sha512-ds37W8CytHgwnhGGTi88pcPyR15qoNkOpYwmMMfnWqqWgESapLqvDx6huFjQ5vqWSn2Z06173XNA7LtMOeUh1A==", + "dependencies": { + "no-case": "^3.0.4", + "tslib": "^2.0.3", + "upper-case-first": "^2.0.2" + } + }, + "node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/change-case": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/change-case/-/change-case-4.1.2.tgz", + "integrity": "sha512-bSxY2ws9OtviILG1EiY5K7NNxkqg/JnRnFxLtKQ96JaviiIxi7djMrSd0ECT9AC+lttClmYwKw53BWpOMblo7A==", + "dependencies": { + "camel-case": "^4.1.2", + "capital-case": "^1.0.4", + "constant-case": "^3.0.4", + "dot-case": "^3.0.4", + "header-case": "^2.0.4", + "no-case": "^3.0.4", + "param-case": "^3.0.4", + "pascal-case": "^3.1.2", + "path-case": "^3.0.4", + "sentence-case": "^3.0.4", + "snake-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, + "node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" + }, + "node_modules/constant-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/constant-case/-/constant-case-3.0.4.tgz", + "integrity": "sha512-I2hSBi7Vvs7BEuJDr5dDHfzb/Ruj3FyvFyh7KLilAjNQw3Be+xgqUBA2W6scVEcL0hL1dwPRtIqEPVUCKkSsyQ==", + "dependencies": { + "no-case": "^3.0.4", + "tslib": "^2.0.3", + "upper-case": "^2.0.2" + } + }, + "node_modules/data-uri-to-buffer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.0.tgz", + "integrity": "sha512-Vr3mLBA8qWmcuschSLAOogKgQ/Jwxulv3RNE4FXnYWRGujzrRWQI4m12fQqRkwX06C0KanhLr4hK+GydchZsaA==", + "engines": { + "node": ">= 12" + } + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/dot-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz", + "integrity": "sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==", + "dependencies": { + "no-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "node_modules/escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + }, + "node_modules/fast-glob": { + "version": "3.2.12", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", + "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fastq": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", + "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fetch-blob": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", + "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "paypal", + "url": "https://paypal.me/jimmywarting" + } + ], + "dependencies": { + "node-domexception": "^1.0.0", + "web-streams-polyfill": "^3.0.3" + }, + "engines": { + "node": "^12.20 || >= 14.13" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/formdata-polyfill": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", + "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", + "dependencies": { + "fetch-blob": "^3.1.2" + }, + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/globby": { + "version": "13.1.2", + "resolved": "https://registry.npmjs.org/globby/-/globby-13.1.2.tgz", + "integrity": "sha512-LKSDZXToac40u8Q1PQtZihbNdTYSNMuWe+K5l+oa6KgDzSvVrHXlJy40hUP522RjAIoNLJYBJi7ow+rbFpIhHQ==", + "dependencies": { + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.11", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "engines": { + "node": ">=4" + } + }, + "node_modules/header-case": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/header-case/-/header-case-2.0.4.tgz", + "integrity": "sha512-H/vuk5TEEVZwrR0lp2zed9OCo1uAILMlx0JEMgC26rzyJJ3N1v6XkwHHXJQdR2doSjcGPM6OKPYoJgf0plJ11Q==", + "dependencies": { + "capital-case": "^1.0.4", + "tslib": "^2.0.3" + } + }, + "node_modules/ignore": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", + "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", + "engines": { + "node": ">= 4" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" + }, + "node_modules/kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "engines": { + "node": ">=6" + } + }, + "node_modules/lower-case": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", + "integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==", + "dependencies": { + "tslib": "^2.0.3" + } + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/mustache": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz", + "integrity": "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==", + "bin": { + "mustache": "bin/mustache" + } + }, + "node_modules/no-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz", + "integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==", + "dependencies": { + "lower-case": "^2.0.2", + "tslib": "^2.0.3" + } + }, + "node_modules/node-domexception": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "github", + "url": "https://paypal.me/jimmywarting" + } + ], + "engines": { + "node": ">=10.5.0" + } + }, + "node_modules/node-fetch": { + "version": "3.2.8", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.2.8.tgz", + "integrity": "sha512-KtpD1YhGszhntMpBDyp5lyagk8KIMopC1LEb7cQUAh7zcosaX5uK8HnbNb2i3NTQK3sIawCItS0uFC3QzcLHdg==", + "dependencies": { + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/node-fetch" + } + }, + "node_modules/node-watch": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/node-watch/-/node-watch-0.7.3.tgz", + "integrity": "sha512-3l4E8uMPY1HdMMryPRUAl+oIHtXtyiTlIiESNSVSNxcPfzAFzeTbXFQkZfAwBbo0B1qMSG8nUABx+Gd+YrbKrQ==", + "engines": { + "node": ">=6" + } + }, + "node_modules/param-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/param-case/-/param-case-3.0.4.tgz", + "integrity": "sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A==", + "dependencies": { + "dot-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, + "node_modules/pascal-case": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/pascal-case/-/pascal-case-3.1.2.tgz", + "integrity": "sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g==", + "dependencies": { + "no-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, + "node_modules/path-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/path-case/-/path-case-3.0.4.tgz", + "integrity": "sha512-qO4qCFjXqVTrcbPt/hQfhTQ+VhFsqNKOPtytgNKkKxSoEp3XPUQ8ObFuePylOIok5gjn69ry8XiULxCwot3Wfg==", + "dependencies": { + "dot-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "engines": { + "node": ">=8" + } + }, + "node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/prettier": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", + "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/prompts": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", + "dependencies": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.5" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "engines": { + "node": ">=6" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/sentence-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/sentence-case/-/sentence-case-3.0.4.tgz", + "integrity": "sha512-8LS0JInaQMCRoQ7YUytAo/xUu5W2XnQxV2HI/6uM6U7CITS1RqPElr30V6uIqyMKM9lJGRVFy5/4CuzcixNYSg==", + "dependencies": { + "no-case": "^3.0.4", + "tslib": "^2.0.3", + "upper-case-first": "^2.0.2" + } + }, + "node_modules/sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==" + }, + "node_modules/slash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", + "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/snake-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/snake-case/-/snake-case-3.0.4.tgz", + "integrity": "sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==", + "dependencies": { + "dot-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/tslib": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", + "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==" + }, + "node_modules/upper-case": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/upper-case/-/upper-case-2.0.2.tgz", + "integrity": "sha512-KgdgDGJt2TpuwBUIjgG6lzw2GWFRCW9Qkfkiv0DxqHHLYJHmtmdUIKcZd8rHgFSjopVTlw6ggzCm1b8MFQwikg==", + "dependencies": { + "tslib": "^2.0.3" + } + }, + "node_modules/upper-case-first": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/upper-case-first/-/upper-case-first-2.0.2.tgz", + "integrity": "sha512-514ppYHBaKwfJRK/pNC6c/OxfGa0obSnAl106u97Ed0I625Nin96KAjttZF6ZL3e1XLtphxnqrOi9iWgm+u+bg==", + "dependencies": { + "tslib": "^2.0.3" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/vscode-jsonrpc": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-6.0.0.tgz", + "integrity": "sha512-wnJA4BnEjOSyFMvjZdpiOwhSq9uDoK8e/kpRJDTaMYzwlkrhG1fwDIZI94CLsLzlCK5cIbMMtFlJlfR57Lavmg==", + "engines": { + "node": ">=8.0.0 || >=10.0.0" + } + }, + "node_modules/vscode-languageserver": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-7.0.0.tgz", + "integrity": "sha512-60HTx5ID+fLRcgdHfmz0LDZAXYEV68fzwG0JWwEPBode9NuMYTIxuYXPg4ngO8i8+Ou0lM7y6GzaYWbiDL0drw==", + "dependencies": { + "vscode-languageserver-protocol": "3.16.0" + }, + "bin": { + "installServerIntoExtension": "bin/installServerIntoExtension" + } + }, + "node_modules/vscode-languageserver-protocol": { + "version": "3.16.0", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.16.0.tgz", + "integrity": "sha512-sdeUoAawceQdgIfTI+sdcwkiK2KU+2cbEYA0agzM2uqaUy2UpnnGHtWTHVEtS0ES4zHU0eMFRGN+oQgDxlD66A==", + "dependencies": { + "vscode-jsonrpc": "6.0.0", + "vscode-languageserver-types": "3.16.0" + } + }, + "node_modules/vscode-languageserver-textdocument": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.7.tgz", + "integrity": "sha512-bFJH7UQxlXT8kKeyiyu41r22jCZXG8kuuVVA33OEJn1diWOZK5n8zBSPZFHVBOu8kXZ6h0LIRhf5UnCo61J4Hg==" + }, + "node_modules/vscode-languageserver-types": { + "version": "3.16.0", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.16.0.tgz", + "integrity": "sha512-k8luDIWJWyenLc5ToFQQMaSrqCHiLwyKPHKPQZ5zz21vM+vIVUSvsRpcbiECH4WR88K2XZqc4ScRcZ7nk/jbeA==" + }, + "node_modules/web-streams-polyfill": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz", + "integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==", + "engines": { + "node": ">= 8" + } + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/wrap-ansi/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs": { + "version": "17.3.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.3.1.tgz", + "integrity": "sha512-WUANQeVgjLbNsEmGk20f+nlHgOqzRFpiGWVaBrYGYIGANIIu3lWjoyi0fNlFmJkvfhCZ6BXINe7/W2O2bV4iaA==", + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "engines": { + "node": ">=12" + } + } + }, "dependencies": { + "@azure-tools/cadl-autorest": { + "version": "0.22.0", + "resolved": "https://registry.npmjs.org/@azure-tools/cadl-autorest/-/cadl-autorest-0.22.0.tgz", + "integrity": "sha512-O1uoFav6UzkkU5r28nbrQXkE94Cw2N6RFtqZso+VJQV3rvcLXQygvLxA+GA0WBCSkqLyQXfPg8JV0uWq4JDPsQ==", + "requires": {} + }, + "@azure-tools/cadl-azure-core": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@azure-tools/cadl-azure-core/-/cadl-azure-core-0.9.0.tgz", + "integrity": "sha512-iGBI9YmRIoUpM0aDC0jhv9IIDQgA3f32h3af/8dBZ38b8TPmFkWaA3nw9BVsG5sPiTNfxUDEwLqKI+/wKo5H8A==", + "requires": { + "@cadl-lang/lint": "~0.3.0" + } + }, + "@azure-tools/cadl-azure-resource-manager": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/@azure-tools/cadl-azure-resource-manager/-/cadl-azure-resource-manager-0.12.0.tgz", + "integrity": "sha512-bewwKbRr2JJgG9337K8ceEdGa1ycWlO174ywbN3F1IHqs1MuJeG3Bg8czTSbfGGl5ew0kcD9DaqV5FLvPytLuQ==", + "peer": true, + "requires": { + "@cadl-lang/lint": "~0.3.0" + } + }, + "@azure-tools/cadl-providerhub": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@azure-tools/cadl-providerhub/-/cadl-providerhub-0.23.0.tgz", + "integrity": "sha512-8B/U3vVgpNKa/At77iuiCSIqs6mCThY1xqP9V3YcEeOIJIEjb2B/hyLKS5KfC4qE0BeI5b3obHDhJGz+5hvRFw==", + "requires": {} + }, + "@babel/code-frame": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", + "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", + "requires": { + "@babel/highlight": "^7.16.7" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.19.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", + "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==" + }, + "@babel/highlight": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", + "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", + "requires": { + "@babel/helper-validator-identifier": "^7.18.6", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "@cadl-lang/compiler": { + "version": "0.37.0", + "resolved": "https://registry.npmjs.org/@cadl-lang/compiler/-/compiler-0.37.0.tgz", + "integrity": "sha512-jHMqPZmM4evQlu7oY9vj6PEM+f+OhnfPqAdwxALrU2gwsLcwYG1h8rkjX/iK2KfeewCbXuRT/hztOTo3pcbYWA==", + "requires": { + "@babel/code-frame": "~7.16.7", + "ajv": "~8.9.0", + "change-case": "~4.1.2", + "globby": "~13.1.1", + "js-yaml": "~4.1.0", + "mkdirp": "~1.0.4", + "mustache": "~4.2.0", + "node-fetch": "3.2.8", + "node-watch": "~0.7.1", + "picocolors": "~1.0.0", + "prettier": "~2.7.1", + "prompts": "~2.4.1", + "vscode-languageserver": "~7.0.0", + "vscode-languageserver-textdocument": "~1.0.1", + "yargs": "~17.3.1" + } + }, + "@cadl-lang/lint": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@cadl-lang/lint/-/lint-0.3.0.tgz", + "integrity": "sha512-CWqkD+O/sltXzuFcc2ucPf4b1E3ozIqukkFlhwDUXs5DvQIGDTEeekPVBn2kJAFj15kKHGDssp7tAQGzucmPdQ==", + "requires": {} + }, + "@cadl-lang/openapi": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/@cadl-lang/openapi/-/openapi-0.14.0.tgz", + "integrity": "sha512-jjjTKVLC1OGJeDstDPfLgRzcnaGlt9LtJz3brheJMTX9l8eItUq+bJi5+dWo6TG4P5oqcX6HHPxeh8oRREoM7Q==", + "peer": true, + "requires": {} + }, "@cadl-lang/openapi3": { - "version": "0.13.0", - "resolved": "https://registry.npmjs.org/@cadl-lang/openapi3/-/openapi3-0.13.0.tgz", - "integrity": "sha512-XLWQ6QZ5M9F/9SBeYJyOlhA7E0PriZTLJDjtz4uPNVr5RQOegLiH6TWQf+XEiA1co5CSPl5IZ7gd1HHct4Tdcw==" + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/@cadl-lang/openapi3/-/openapi3-0.17.0.tgz", + "integrity": "sha512-O7qx81jmz4p3IbQk+au7LC98DV7noeGq/8herJ/A+H2heZ/c0Z0wyoVhENk69QHhoPsKUiGxLeWH/yNie0qsiQ==", + "requires": {} }, "@cadl-lang/rest": { - "version": "0.15.1", - "resolved": "https://registry.npmjs.org/@cadl-lang/rest/-/rest-0.15.1.tgz", - "integrity": "sha512-J7gaLFri1huDzUPmndvg7JTJZ8dnQ9csl1PafGbvypjga5Ct9+YZcAInErMKFgnxJJ5NVnDz5auD3579eOCYWg==" + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/@cadl-lang/rest/-/rest-0.19.0.tgz", + "integrity": "sha512-3vMDvr8huQcH03oGYlt5uhRu5TKn6rb+rK0tmPfWgZ9EfZDMn0lR4CAjQOukFv2d93s7KE2IBVtXvQ/Z0C7kdQ==", + "requires": {} + }, + "@cadl-lang/versioning": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@cadl-lang/versioning/-/versioning-0.10.0.tgz", + "integrity": "sha512-+9gdn2N1a3VyOu1ou12U9Uq5Mfvp/1A4nfEPOoZzDDm3U2GZZuRR4ZMUU1MqlJy0jrQdpW1yBNQD3ZYy0ngS7Q==", + "peer": true, + "requires": { + "@cadl-lang/compiler": "~0.37.0" + } + }, + "@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "requires": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + } + }, + "@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==" + }, + "@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "requires": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + } + }, + "ajv": { + "version": "8.9.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.9.0.tgz", + "integrity": "sha512-qOKJyNj/h+OWx7s5DePL6Zu1KeM9jPZhwBqs+7DzP6bGOvqzVCSf0xueYmVuaC/oQ/VtS2zLMLHdQFbkka+XDQ==", + "requires": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + } + }, + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "requires": { + "fill-range": "^7.0.1" + } + }, + "camel-case": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-4.1.2.tgz", + "integrity": "sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw==", + "requires": { + "pascal-case": "^3.1.2", + "tslib": "^2.0.3" + } + }, + "capital-case": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/capital-case/-/capital-case-1.0.4.tgz", + "integrity": "sha512-ds37W8CytHgwnhGGTi88pcPyR15qoNkOpYwmMMfnWqqWgESapLqvDx6huFjQ5vqWSn2Z06173XNA7LtMOeUh1A==", + "requires": { + "no-case": "^3.0.4", + "tslib": "^2.0.3", + "upper-case-first": "^2.0.2" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "change-case": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/change-case/-/change-case-4.1.2.tgz", + "integrity": "sha512-bSxY2ws9OtviILG1EiY5K7NNxkqg/JnRnFxLtKQ96JaviiIxi7djMrSd0ECT9AC+lttClmYwKw53BWpOMblo7A==", + "requires": { + "camel-case": "^4.1.2", + "capital-case": "^1.0.4", + "constant-case": "^3.0.4", + "dot-case": "^3.0.4", + "header-case": "^2.0.4", + "no-case": "^3.0.4", + "param-case": "^3.0.4", + "pascal-case": "^3.1.2", + "path-case": "^3.0.4", + "sentence-case": "^3.0.4", + "snake-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, + "cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" + }, + "constant-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/constant-case/-/constant-case-3.0.4.tgz", + "integrity": "sha512-I2hSBi7Vvs7BEuJDr5dDHfzb/Ruj3FyvFyh7KLilAjNQw3Be+xgqUBA2W6scVEcL0hL1dwPRtIqEPVUCKkSsyQ==", + "requires": { + "no-case": "^3.0.4", + "tslib": "^2.0.3", + "upper-case": "^2.0.2" + } + }, + "data-uri-to-buffer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.0.tgz", + "integrity": "sha512-Vr3mLBA8qWmcuschSLAOogKgQ/Jwxulv3RNE4FXnYWRGujzrRWQI4m12fQqRkwX06C0KanhLr4hK+GydchZsaA==" + }, + "dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "requires": { + "path-type": "^4.0.0" + } + }, + "dot-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz", + "integrity": "sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==", + "requires": { + "no-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==" + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==" + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + }, + "fast-glob": { + "version": "3.2.12", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", + "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + } + }, + "fastq": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", + "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", + "requires": { + "reusify": "^1.0.4" + } + }, + "fetch-blob": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", + "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", + "requires": { + "node-domexception": "^1.0.0", + "web-streams-polyfill": "^3.0.3" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "formdata-polyfill": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", + "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", + "requires": { + "fetch-blob": "^3.1.2" + } + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" + }, + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "requires": { + "is-glob": "^4.0.1" + } + }, + "globby": { + "version": "13.1.2", + "resolved": "https://registry.npmjs.org/globby/-/globby-13.1.2.tgz", + "integrity": "sha512-LKSDZXToac40u8Q1PQtZihbNdTYSNMuWe+K5l+oa6KgDzSvVrHXlJy40hUP522RjAIoNLJYBJi7ow+rbFpIhHQ==", + "requires": { + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.11", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^4.0.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==" + }, + "header-case": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/header-case/-/header-case-2.0.4.tgz", + "integrity": "sha512-H/vuk5TEEVZwrR0lp2zed9OCo1uAILMlx0JEMgC26rzyJJ3N1v6XkwHHXJQdR2doSjcGPM6OKPYoJgf0plJ11Q==", + "requires": { + "capital-case": "^1.0.4", + "tslib": "^2.0.3" + } + }, + "ignore": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", + "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==" + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==" + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" + }, + "is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + }, + "js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "requires": { + "argparse": "^2.0.1" + } + }, + "json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" + }, + "kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==" + }, + "lower-case": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", + "integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==", + "requires": { + "tslib": "^2.0.3" + } + }, + "merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==" + }, + "micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "requires": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + } + }, + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==" + }, + "mustache": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz", + "integrity": "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==" + }, + "no-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz", + "integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==", + "requires": { + "lower-case": "^2.0.2", + "tslib": "^2.0.3" + } + }, + "node-domexception": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==" + }, + "node-fetch": { + "version": "3.2.8", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.2.8.tgz", + "integrity": "sha512-KtpD1YhGszhntMpBDyp5lyagk8KIMopC1LEb7cQUAh7zcosaX5uK8HnbNb2i3NTQK3sIawCItS0uFC3QzcLHdg==", + "requires": { + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" + } + }, + "node-watch": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/node-watch/-/node-watch-0.7.3.tgz", + "integrity": "sha512-3l4E8uMPY1HdMMryPRUAl+oIHtXtyiTlIiESNSVSNxcPfzAFzeTbXFQkZfAwBbo0B1qMSG8nUABx+Gd+YrbKrQ==" + }, + "param-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/param-case/-/param-case-3.0.4.tgz", + "integrity": "sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A==", + "requires": { + "dot-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, + "pascal-case": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/pascal-case/-/pascal-case-3.1.2.tgz", + "integrity": "sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g==", + "requires": { + "no-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, + "path-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/path-case/-/path-case-3.0.4.tgz", + "integrity": "sha512-qO4qCFjXqVTrcbPt/hQfhTQ+VhFsqNKOPtytgNKkKxSoEp3XPUQ8ObFuePylOIok5gjn69ry8XiULxCwot3Wfg==", + "requires": { + "dot-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==" + }, + "picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" + }, + "picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" + }, + "prettier": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", + "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==" + }, + "prompts": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", + "requires": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.5" + } + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + }, + "queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==" + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==" + }, + "require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==" + }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==" + }, + "run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "requires": { + "queue-microtask": "^1.2.2" + } + }, + "sentence-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/sentence-case/-/sentence-case-3.0.4.tgz", + "integrity": "sha512-8LS0JInaQMCRoQ7YUytAo/xUu5W2XnQxV2HI/6uM6U7CITS1RqPElr30V6uIqyMKM9lJGRVFy5/4CuzcixNYSg==", + "requires": { + "no-case": "^3.0.4", + "tslib": "^2.0.3", + "upper-case-first": "^2.0.2" + } + }, + "sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==" + }, + "slash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", + "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==" + }, + "snake-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/snake-case/-/snake-case-3.0.4.tgz", + "integrity": "sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==", + "requires": { + "dot-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "requires": { + "ansi-regex": "^5.0.1" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "requires": { + "is-number": "^7.0.0" + } + }, + "tslib": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", + "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==" + }, + "upper-case": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/upper-case/-/upper-case-2.0.2.tgz", + "integrity": "sha512-KgdgDGJt2TpuwBUIjgG6lzw2GWFRCW9Qkfkiv0DxqHHLYJHmtmdUIKcZd8rHgFSjopVTlw6ggzCm1b8MFQwikg==", + "requires": { + "tslib": "^2.0.3" + } + }, + "upper-case-first": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/upper-case-first/-/upper-case-first-2.0.2.tgz", + "integrity": "sha512-514ppYHBaKwfJRK/pNC6c/OxfGa0obSnAl106u97Ed0I625Nin96KAjttZF6ZL3e1XLtphxnqrOi9iWgm+u+bg==", + "requires": { + "tslib": "^2.0.3" + } + }, + "uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "requires": { + "punycode": "^2.1.0" + } + }, + "vscode-jsonrpc": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-6.0.0.tgz", + "integrity": "sha512-wnJA4BnEjOSyFMvjZdpiOwhSq9uDoK8e/kpRJDTaMYzwlkrhG1fwDIZI94CLsLzlCK5cIbMMtFlJlfR57Lavmg==" + }, + "vscode-languageserver": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-7.0.0.tgz", + "integrity": "sha512-60HTx5ID+fLRcgdHfmz0LDZAXYEV68fzwG0JWwEPBode9NuMYTIxuYXPg4ngO8i8+Ou0lM7y6GzaYWbiDL0drw==", + "requires": { + "vscode-languageserver-protocol": "3.16.0" + } + }, + "vscode-languageserver-protocol": { + "version": "3.16.0", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.16.0.tgz", + "integrity": "sha512-sdeUoAawceQdgIfTI+sdcwkiK2KU+2cbEYA0agzM2uqaUy2UpnnGHtWTHVEtS0ES4zHU0eMFRGN+oQgDxlD66A==", + "requires": { + "vscode-jsonrpc": "6.0.0", + "vscode-languageserver-types": "3.16.0" + } + }, + "vscode-languageserver-textdocument": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.7.tgz", + "integrity": "sha512-bFJH7UQxlXT8kKeyiyu41r22jCZXG8kuuVVA33OEJn1diWOZK5n8zBSPZFHVBOu8kXZ6h0LIRhf5UnCo61J4Hg==" + }, + "vscode-languageserver-types": { + "version": "3.16.0", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.16.0.tgz", + "integrity": "sha512-k8luDIWJWyenLc5ToFQQMaSrqCHiLwyKPHKPQZ5zz21vM+vIVUSvsRpcbiECH4WR88K2XZqc4ScRcZ7nk/jbeA==" + }, + "web-streams-polyfill": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz", + "integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==" + }, + "wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "requires": { + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + } + } + }, + "y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==" + }, + "yargs": { + "version": "17.3.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.3.1.tgz", + "integrity": "sha512-WUANQeVgjLbNsEmGk20f+nlHgOqzRFpiGWVaBrYGYIGANIIu3lWjoyi0fNlFmJkvfhCZ6BXINe7/W2O2bV4iaA==", + "requires": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.0.0" + } + }, + "yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==" } } } diff --git a/specification/eventgrid/data-plane/cadl/package.json b/specification/eventgrid/data-plane/cadl/package.json index e0909ab7e702..31513350918b 100644 --- a/specification/eventgrid/data-plane/cadl/package.json +++ b/specification/eventgrid/data-plane/cadl/package.json @@ -1,6 +1,9 @@ { "name": "cadl", "dependencies": { + "@azure-tools/cadl-autorest": "^0.22.0", + "@azure-tools/cadl-azure-core": "^0.9.0", + "@azure-tools/cadl-providerhub": "^0.23.0", "@cadl-lang/compiler": "latest", "@cadl-lang/openapi3": "latest", "@cadl-lang/rest": "latest" From b378f78f496678e779861f27a04b97f1486257c0 Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Fri, 2 Dec 2022 11:47:58 -0800 Subject: [PATCH 23/65] made a remove an add on communication --- .../data-plane/cadl/AzureCommunicationServices.cadl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/specification/eventgrid/data-plane/cadl/AzureCommunicationServices.cadl b/specification/eventgrid/data-plane/cadl/AzureCommunicationServices.cadl index 64dd0f020ab1..7171076398e9 100644 --- a/specification/eventgrid/data-plane/cadl/AzureCommunicationServices.cadl +++ b/specification/eventgrid/data-plane/cadl/AzureCommunicationServices.cadl @@ -133,7 +133,14 @@ model AcsChatParticipantAddedToThreadWithUserEventData extends AcsChatThreadEven @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatParticipantRemovedFromThreadWithUser event.") model AcsChatParticipantRemovedFromThreadWithUserEventData extends AcsChatThreadEventBaseProperties { - ...AcsChatParticipantBaseEventData; + @doc("The time at which the user was removed to the thread") + time?: zonedDateTime; + + @doc("The communication identifier of the user who removed the user") + removedByCommunicationIdentifier?: CommunicationIdentifierModel; + + @doc("The details of the user who was removed") + participantRemoved?: AcsChatThreadParticipantProperties; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadParticipantAdded event.") From 47dfa7a48b858c5597266191988741137a4ffdfb Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Fri, 2 Dec 2022 13:09:21 -0800 Subject: [PATCH 24/65] trying 2 namespaces --- .../data-plane/cadl/ApiManagement.cadl | 46 ++++++++++--------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/specification/eventgrid/data-plane/cadl/ApiManagement.cadl b/specification/eventgrid/data-plane/cadl/ApiManagement.cadl index 2f37573084c5..11eeeb8bf31c 100644 --- a/specification/eventgrid/data-plane/cadl/ApiManagement.cadl +++ b/specification/eventgrid/data-plane/cadl/ApiManagement.cadl @@ -1,53 +1,57 @@ @service({title:"Schema of Azure API Management events published to Azure Event Grid",version:"2018-01-01"}) @doc("Describes the schema of the Azure API Management events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") -namespace ApiManagement; - -model ApiManagementBase { - @doc("The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions//resourceGroups//Microsoft.ApiManagement/service///`") - resourceUri?: string; -} +namespace ApiManagement{ @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.UserCreated event.") -model ApiManagementUserCreatedEventData is ApiManagementBase; +model ApiManagementUserCreatedEventData is BaseEvents.ApiManagementBase; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.UserUpdated event.") -model ApiManagementUserUpdatedEventData is ApiManagementBase; +model ApiManagementUserUpdatedEventData is BaseEvents.ApiManagementBase; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.UserDeleted event.") -model ApiManagementUserDeletedEventData is ApiManagementBase; +model ApiManagementUserDeletedEventData is BaseEvents.ApiManagementBase; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.SubscriptionCreated event.") -model ApiManagementSubscriptionCreatedEventData is ApiManagementBase; +model ApiManagementSubscriptionCreatedEventData is BaseEvents.ApiManagementBase; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.SubscriptionUpdated event.") -model ApiManagementSubscriptionUpdatedEventData is ApiManagementBase; +model ApiManagementSubscriptionUpdatedEventData is BaseEvents.ApiManagementBase; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.SubscriptionDeleted event.") -model ApiManagementSubscriptionDeletedEventData is ApiManagementBase; +model ApiManagementSubscriptionDeletedEventData is BaseEvents.ApiManagementBase; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.ProductCreated event.") -model ApiManagementProductCreatedEventData is ApiManagementBase; +model ApiManagementProductCreatedEventData is BaseEvents.ApiManagementBase; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.ProductUpdated event.") -model ApiManagementProductUpdatedEventData is ApiManagementBase; +model ApiManagementProductUpdatedEventData is BaseEvents.ApiManagementBase; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.ProductDeleted event.") -model ApiManagementProductDeletedEventData is ApiManagementBase; +model ApiManagementProductDeletedEventData is BaseEvents.ApiManagementBase; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APICreated event.") -model ApiManagementApiCreatedEventData is ApiManagementBase; +model ApiManagementApiCreatedEventData is BaseEvents.ApiManagementBase; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIUpdated event.") -model ApiManagementApiUpdatedEventData is ApiManagementBase; +model ApiManagementApiUpdatedEventData is BaseEvents.ApiManagementBase; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIDeleted event.") -model ApiManagementApiDeletedEventData is ApiManagementBase; +model ApiManagementApiDeletedEventData is BaseEvents.ApiManagementBase; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIReleaseCreated event.") -model ApiManagementApiReleaseCreatedEventData is ApiManagementBase; +model ApiManagementApiReleaseCreatedEventData is BaseEvents.ApiManagementBase; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIReleaseUpdated event.") -model ApiManagementApiReleaseUpdatedEventData is ApiManagementBase; +model ApiManagementApiReleaseUpdatedEventData is BaseEvents.ApiManagementBase; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIReleaseDeleted event.") -model ApiManagementApiReleaseDeletedEventData is ApiManagementBase; +model ApiManagementApiReleaseDeletedEventData is BaseEvents.ApiManagementBase; + +} + +namespace BaseEvents{ + model ApiManagementBase { + @doc("The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions//resourceGroups//Microsoft.ApiManagement/service///`") + resourceUri?: string; + } +} \ No newline at end of file From 3877057ca026a839b4fbf4940834749f9a2ba19e Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Fri, 2 Dec 2022 13:09:38 -0800 Subject: [PATCH 25/65] cleaning up container --- .../data-plane/cadl/ContainerRegistry.cadl | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/specification/eventgrid/data-plane/cadl/ContainerRegistry.cadl b/specification/eventgrid/data-plane/cadl/ContainerRegistry.cadl index 1ea6edf9d06a..98ecafe69bbe 100644 --- a/specification/eventgrid/data-plane/cadl/ContainerRegistry.cadl +++ b/specification/eventgrid/data-plane/cadl/ContainerRegistry.cadl @@ -1,17 +1,18 @@ -@service({title:"Microsoft.ContainerRegistry",version:"2018-01-01"}) +@service({title:"Schema of Azure Container Registry events published to Azure Event Grid",version:"2018-01-01"}) +@doc("Describes the schema of the Azure Container Registry events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") namespace ContainerRegistry; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ContainerRegistry.ImagePushed event.") -model ContainerRegistryImagePushedEventData is ContainerRegistryEventData; +model ContainerRegistryImagePushedEventData extends ContainerRegistryEventData{}; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ContainerRegistry.ImageDeleted event.") -model ContainerRegistryImageDeletedEventData is ContainerRegistryEventData; +model ContainerRegistryImageDeletedEventData extends ContainerRegistryEventData{}; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ContainerRegistry.ChartPushed event.") -model ContainerRegistryChartPushedEventData is ContainerRegistryArtifactEventData; +model ContainerRegistryChartPushedEventData extends ContainerRegistryArtifactEventData{}; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ContainerRegistry.ChartDeleted event.") -model ContainerRegistryChartDeletedEventData is ContainerRegistryArtifactEventData; +model ContainerRegistryChartDeletedEventData extends ContainerRegistryArtifactEventData{}; model ContainerRegistryBaseEventData { @doc("The event ID.") @@ -76,7 +77,7 @@ model ContainerRegistryBaseEventTarget Date: Fri, 2 Dec 2022 13:11:48 -0800 Subject: [PATCH 26/65] 2nd anmespace for baseevent container --- .../data-plane/cadl/ContainerRegistry.cadl | 43 +++++++++++-------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/specification/eventgrid/data-plane/cadl/ContainerRegistry.cadl b/specification/eventgrid/data-plane/cadl/ContainerRegistry.cadl index 98ecafe69bbe..e099d8ba8a4d 100644 --- a/specification/eventgrid/data-plane/cadl/ContainerRegistry.cadl +++ b/specification/eventgrid/data-plane/cadl/ContainerRegistry.cadl @@ -1,6 +1,6 @@ @service({title:"Schema of Azure Container Registry events published to Azure Event Grid",version:"2018-01-01"}) @doc("Describes the schema of the Azure Container Registry events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") -namespace ContainerRegistry; +namespace ContainerRegistry{ @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ContainerRegistry.ImagePushed event.") model ContainerRegistryImagePushedEventData extends ContainerRegistryEventData{}; @@ -60,24 +60,8 @@ model ContainerRegistryArtifactEventData { connectedRegistry?: ContainerRegistryEventConnectedRegistry; } -model ContainerRegistryBaseEventTarget { - @doc(TmediaType) - mediaType?: string; - - @doc(Tsize) - size?: int64; - - @doc(Tdigest) - digest?: string; - - @doc(Trepository) - repository?: string; - - @doc(Ttag) - tag?: string; -} @doc("The target of the event.") -model ContainerRegistryEventTarget is ContainerRegistryBaseEventTarget< +model ContainerRegistryEventTarget is BaseEvent.ContainerRegistryBaseEventTarget< "The MIME type of the referenced object.", "The number of bytes of the content. Same as Length field.", "The digest of the content, as defined by the Registry V2 HTTP API Specification.", @@ -92,7 +76,7 @@ model ContainerRegistryEventTarget is ContainerRegistryBaseEventTarget< } @doc("The target of the event.") -model ContainerRegistryArtifactEventTarget is ContainerRegistryBaseEventTarget< +model ContainerRegistryArtifactEventTarget is BaseEvent.ContainerRegistryBaseEventTarget< "The MIME type of the artifact.", "The size in bytes of the artifact.", "The digest of the artifact.", @@ -145,3 +129,24 @@ model ContainerRegistryEventConnectedRegistry { @doc("The name of the connected registry that generated this event.") name?: string; } + +} + +namespace BaseEvent{ + model ContainerRegistryBaseEventTarget { + @doc(TmediaType) + mediaType?: string; + + @doc(Tsize) + size?: int64; + + @doc(Tdigest) + digest?: string; + + @doc(Trepository) + repository?: string; + + @doc(Ttag) + tag?: string; + } +} \ No newline at end of file From f10f20de63b74373358d219862337848ef3e355e Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Fri, 2 Dec 2022 15:16:57 -0800 Subject: [PATCH 27/65] adding in docs to healthcare cadl --- .../data-plane/cadl/HealthcareApis.cadl | 559 ++++++++++++------ 1 file changed, 374 insertions(+), 185 deletions(-) diff --git a/specification/eventgrid/data-plane/cadl/HealthcareApis.cadl b/specification/eventgrid/data-plane/cadl/HealthcareApis.cadl index 1e6cca7bdf4a..811e1e3887ca 100644 --- a/specification/eventgrid/data-plane/cadl/HealthcareApis.cadl +++ b/specification/eventgrid/data-plane/cadl/HealthcareApis.cadl @@ -1,22 +1,45 @@ @service({title:"Schema of Azure HealthcareApis events published to Azure Event Grid.",version:"2018-01-01"}) @doc("Describes the schema of the Azure HealthcareApis events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") -namespace HealthCareApis; +namespace HealthCareApis{ -model HealthcareFhirResourceBaseEventData { +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.FhirResourceCreated event.") +model HealthcareFhirResourceCreatedEventData is BaseEvent.HealthcareFhirResourceBaseEventData{ + @doc("Type of HL7 FHIR resource.") + resourceType?: HealthcareFhirResourceType; +} + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.FhirResourceUpdated event.") +model HealthcareFhirResourceUpdatedEventData is BaseEvent.HealthcareFhirResourceBaseEventData{ + @doc("Type of HL7 FHIR resource.") + resourceType?: HealthcareFhirResourceType; +} + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.FhirResourceDeleted event.") +model HealthcareFhirResourceDeletedEventData is BaseEvent.HealthcareFhirResourceBaseEventData{ @doc("Type of HL7 FHIR resource.") resourceType?: HealthcareFhirResourceType; +} + +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.DicomImageCreated event.") +model HealthcareDicomImageCreatedEventData{ + @doc("Unique identifier for the Study") + imageStudyInstanceUid?: string; - @doc("Domain name of FHIR account for this resource.") - resourceFhirAccount?: string; + @doc("Unique identifier for the Series") + imageSeriesInstanceUid?: string; + + @doc("Unique identifier for the DICOM Image",) + imageSopInstanceUid?: string; - @doc("Id of HL7 FHIR resource.") - resourceFhirId?: string; + @doc("Domain name of the DICOM account for this image.") + serviceHostName?: string; - @doc("VersionId of HL7 FHIR resource. It changes when the resource is created, updated, or deleted(soft-deletion).") - resourceVersionId?: int64; + @doc("Sequence number of the DICOM Service within Azure Health Data Services. It is unique for every image creation and deletion within the service.") + sequenceNumber?: int64; } -model HealthcareDicomImageBaseEventData { +@doc("Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.DicomImageDeleted event.") +model HealthcareDicomImageDeletedEventData{ @doc("Unique identifier for the Study") imageStudyInstanceUid?: string; @@ -34,184 +57,350 @@ model HealthcareDicomImageBaseEventData { } -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.FhirResourceCreated event.") -model HealthcareFhirResourceCreatedEventData is HealthcareFhirResourceBaseEventData; - -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.FhirResourceUpdated event.") -model HealthcareFhirResourceUpdatedEventData is HealthcareFhirResourceBaseEventData; - -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.FhirResourceDeleted event.") -model HealthcareFhirResourceDeletedEventData is HealthcareFhirResourceBaseEventData; +// model HealthcareFhirResourceType is string {} -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.DicomImageCreated event.") -model HealthcareDicomImageCreatedEventData is HealthcareDicomImageBaseEventData; +@knownValues(BaseEvent.HealthcareFhirResourceTypeKV) +model HealthcareFhirResourceType is string; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.DicomImageDeleted event.") -model HealthcareDicomImageDeletedEventData is HealthcareDicomImageBaseEventData; - -model HealthcareFhirResourceType is string {} -enum HealthcareFhirResourceTypeKV { - Account, - ActivityDefinition, - AdverseEvent, - AllergyIntolerance, - Appointment, - AppointmentResponse, - AuditEvent, - Basic, - Binary, - BiologicallyDerivedProduct, - BodySite, - BodyStructure, - Bundle, - CapabilityStatement, - CarePlan, - CareTeam, - CatalogEntry, - ChargeItem, - ChargeItemDefinition, - Claim, - ClaimResponse, - ClinicalImpression, - CodeSystem, - Communication, - CommunicationRequest, - CompartmentDefinition, - Composition, - ConceptMap, - Condition, - Consent, - Contract, - Coverage, - CoverageEligibilityRequest, - CoverageEligibilityResponse, - DataElement, - DetectedIssue, - Device, - DeviceComponent, - DeviceDefinition, - DeviceMetric, - DeviceRequest, - DeviceUseStatement, - DiagnosticReport, - DocumentManifest, - DocumentReference, - DomainResource, - EffectEvidenceSynthesis, - EligibilityRequest, - EligibilityResponse, - Encounter, - Endpoint, - EnrollmentRequest, - EnrollmentResponse, - EpisodeOfCare, - EventDefinition, - Evidence, - EvidenceVariable, - ExampleScenario, - ExpansionProfile, - ExplanationOfBenefit, - FamilyMemberHistory, - Flag, - Goal, - GraphDefinition, - Group, - GuidanceResponse, - HealthcareService, - ImagingManifest, - ImagingStudy, - Immunization, - ImmunizationEvaluation, - ImmunizationRecommendation, - ImplementationGuide, - InsurancePlan, - Invoice, - Library, - Linkage, - List, - Location, - Measure, - MeasureReport, - Media, - Medication, - MedicationAdministration, - MedicationDispense, - MedicationKnowledge, - MedicationRequest, - MedicationStatement, - MedicinalProduct, - MedicinalProductAuthorization, - MedicinalProductContraindication, - MedicinalProductIndication, - MedicinalProductIngredient, - MedicinalProductInteraction, - MedicinalProductManufactured, - MedicinalProductPackaged, - MedicinalProductPharmaceutical, - MedicinalProductUndesirableEffect, - MessageDefinition, - MessageHeader, - MolecularSequence, - NamingSystem, - NutritionOrder, - Observation, - ObservationDefinition, - OperationDefinition, - OperationOutcome, - Organization, - OrganizationAffiliation, - Parameters, - Patient, - PaymentNotice, - PaymentReconciliation, - Person, - PlanDefinition, - Practitioner, - PractitionerRole, - Procedure, - ProcedureRequest, - ProcessRequest, - ProcessResponse, - Provenance, - Questionnaire, - QuestionnaireResponse, - ReferralRequest, - RelatedPerson, - RequestGroup, - ResearchDefinition, - ResearchElementDefinition, - ResearchStudy, - ResearchSubject, - Resource, - RiskAssessment, - RiskEvidenceSynthesis, - Schedule, - SearchParameter, - Sequence, - ServiceDefinition, - ServiceRequest, - Slot, - Specimen, - SpecimenDefinition, - StructureDefinition, - StructureMap, - Subscription, - Substance, - SubstanceNucleicAcid, - SubstancePolymer, - SubstanceProtein, - SubstanceReferenceInformation, - SubstanceSourceMaterial, - SubstanceSpecification, - SupplyDelivery, - SupplyRequest, - Task, - TerminologyCapabilities, - TestReport, - TestScript, - ValueSet, - VerificationResult, - VisionPrescription, } +namespace BaseEvent{ + model HealthcareFhirResourceBaseEventData { + + @doc("Domain name of FHIR account for this resource.") + resourceFhirAccount?: string; + + @doc("Id of HL7 FHIR resource.") + resourceFhirId?: string; + + @doc("VersionId of HL7 FHIR resource. It changes when the resource is created, updated, or deleted(soft-deletion).") + resourceVersionId?: int64; + } + enum HealthcareFhirResourceTypeKV { + @doc("The FHIR resource type defined in STU3 and R4.") + Account, + @doc("The FHIR resource type defined in STU3 and R4.") + ActivityDefinition, + @doc("The FHIR resource type defined in STU3 and R4.") + AdverseEvent, + @doc("The FHIR resource type defined in STU3 and R4.") + AllergyIntolerance, + @doc("The FHIR resource type defined in STU3 and R4.") + Appointment, + @doc("The FHIR resource type defined in STU3 and R4.") + AppointmentResponse, + @doc("The FHIR resource type defined in STU3 and R4.") + AuditEvent, + @doc("The FHIR resource type defined in STU3 and R4.") + Basic, + @doc("The FHIR resource type defined in STU3 and R4.") + Binary, + @doc("The FHIR resource type defined in R4.") + BiologicallyDerivedProduct, + @doc("The FHIR resource type defined in STU3.") + BodySite, + @doc("The FHIR resource type defined in R4.") + BodyStructure, + @doc("The FHIR resource type defined in STU3 and R4.") + Bundle, + @doc("The FHIR resource type defined in STU3 and R4.") + CapabilityStatement, + @doc("The FHIR resource type defined in STU3 and R4.") + CarePlan, + @doc("The FHIR resource type defined in STU3 and R4.") + CareTeam, + @doc("The FHIR resource type defined in R4.") + CatalogEntry, + @doc("The FHIR resource type defined in STU3 and R4.") + ChargeItem, + @doc("The FHIR resource type defined in R4.") + ChargeItemDefinition, + @doc("The FHIR resource type defined in STU3 and R4.") + Claim, + @doc("The FHIR resource type defined in STU3 and R4.") + ClaimResponse, + @doc("The FHIR resource type defined in STU3 and R4.") + ClinicalImpression, + @doc("The FHIR resource type defined in STU3 and R4.") + CodeSystem, + @doc("The FHIR resource type defined in STU3 and R4.") + Communication, + @doc("The FHIR resource type defined in STU3 and R4.") + CommunicationRequest, + @doc("The FHIR resource type defined in STU3 and R4.") + CompartmentDefinition, + @doc("The FHIR resource type defined in STU3 and R4.") + Composition, + @doc("The FHIR resource type defined in STU3 and R4.") + ConceptMap, + @doc("The FHIR resource type defined in STU3 and R4.") + Condition, + @doc("The FHIR resource type defined in STU3 and R4.") + Consent, + @doc("The FHIR resource type defined in STU3 and R4.") + Contract, + @doc("The FHIR resource type defined in STU3 and R4.") + Coverage, + @doc("The FHIR resource type defined in R4.") + CoverageEligibilityRequest, + @doc("The FHIR resource type defined in R4.") + CoverageEligibilityResponse, + @doc("The FHIR resource type defined in STU3.") + DataElement, + @doc("The FHIR resource type defined in STU3 and R4.") + DetectedIssue, + @doc("The FHIR resource type defined in STU3 and R4.") + Device, + @doc("The FHIR resource type defined in STU3.") + DeviceComponent, + @doc("The FHIR resource type defined in R4.") + DeviceDefinition, + @doc("The FHIR resource type defined in STU3 and R4.") + DeviceMetric, + @doc("The FHIR resource type defined in STU3 and R4.") + DeviceRequest, + @doc("The FHIR resource type defined in STU3 and R4.") + DeviceUseStatement, + @doc("The FHIR resource type defined in STU3 and R4.") + DiagnosticReport, + @doc("The FHIR resource type defined in STU3 and R4.") + DocumentManifest, + @doc("The FHIR resource type defined in STU3 and R4.") + DocumentReference, + @doc("The FHIR resource type defined in STU3 and R4.") + DomainResource, + @doc("The FHIR resource type defined in R4.") + EffectEvidenceSynthesis, + @doc("The FHIR resource type defined in STU3.") + EligibilityRequest, + @doc("The FHIR resource type defined in STU3.") + EligibilityResponse, + @doc("The FHIR resource type defined in STU3 and R4.") + Encounter, + @doc("The FHIR resource type defined in STU3 and R4.") + Endpoint, + @doc("The FHIR resource type defined in STU3 and R4.") + EnrollmentRequest, + @doc("The FHIR resource type defined in STU3 and R4.") + EnrollmentResponse, + @doc("The FHIR resource type defined in STU3 and R4.") + EpisodeOfCare, + @doc("The FHIR resource type defined in R4.") + EventDefinition, + @doc("The FHIR resource type defined in R4.") + Evidence, + @doc("The FHIR resource type defined in R4.") + EvidenceVariable, + @doc("The FHIR resource type defined in R4.") + ExampleScenario, + @doc("The FHIR resource type defined in STU3.") + ExpansionProfile, + @doc("The FHIR resource type defined in STU3 and R4.") + ExplanationOfBenefit, + @doc("The FHIR resource type defined in STU3 and R4.") + FamilyMemberHistory, + @doc("The FHIR resource type defined in STU3 and R4.") + Flag, + @doc("The FHIR resource type defined in STU3 and R4.") + Goal, + @doc("The FHIR resource type defined in STU3 and R4.") + GraphDefinition, + @doc("The FHIR resource type defined in STU3 and R4.") + Group, + @doc("The FHIR resource type defined in STU3 and R4.") + GuidanceResponse, + @doc("The FHIR resource type defined in STU3 and R4.") + HealthcareService, + @doc("The FHIR resource type defined in STU3.") + ImagingManifest, + @doc("The FHIR resource type defined in STU3 and R4.") + ImagingStudy, + @doc("The FHIR resource type defined in STU3 and R4.") + Immunization, + @doc("The FHIR resource type defined in R4.") + ImmunizationEvaluation, + @doc("The FHIR resource type defined in STU3 and R4.") + ImmunizationRecommendation, + @doc("The FHIR resource type defined in STU3 and R4.") + ImplementationGuide, + @doc("The FHIR resource type defined in R4.") + InsurancePlan, + @doc("The FHIR resource type defined in R4.") + Invoice, + @doc("The FHIR resource type defined in STU3 and R4.") + Library, + @doc("The FHIR resource type defined in STU3 and R4.") + Linkage, + @doc("The FHIR resource type defined in STU3 and R4.") + List, + @doc("The FHIR resource type defined in STU3 and R4.") + Location, + @doc("The FHIR resource type defined in STU3 and R4.") + Measure, + @doc("The FHIR resource type defined in STU3 and R4.") + MeasureReport, + @doc("The FHIR resource type defined in STU3 and R4.") + Media, + @doc("The FHIR resource type defined in STU3 and R4.") + Medication, + @doc("The FHIR resource type defined in STU3 and R4.") + MedicationAdministration, + @doc("The FHIR resource type defined in STU3 and R4.") + MedicationDispense, + @doc("The FHIR resource type defined in R4.") + MedicationKnowledge, + @doc("The FHIR resource type defined in STU3 and R4.") + MedicationRequest, + @doc("The FHIR resource type defined in STU3 and R4.") + MedicationStatement, + @doc("The FHIR resource type defined in R4.") + MedicinalProduct, + @doc("The FHIR resource type defined in R4.") + MedicinalProductAuthorization, + @doc("The FHIR resource type defined in R4.") + MedicinalProductContraindication, + @doc("The FHIR resource type defined in R4.") + MedicinalProductIndication, + @doc("The FHIR resource type defined in R4.") + MedicinalProductIngredient, + @doc("The FHIR resource type defined in R4.") + MedicinalProductInteraction, + @doc("The FHIR resource type defined in R4.") + MedicinalProductManufactured, + @doc("The FHIR resource type defined in R4.") + MedicinalProductPackaged, + @doc("The FHIR resource type defined in R4.") + MedicinalProductPharmaceutical, + @doc("The FHIR resource type defined in R4.") + MedicinalProductUndesirableEffect, + @doc("The FHIR resource type defined in STU3 and R4.") + MessageDefinition, + @doc("The FHIR resource type defined in STU3 and R4.") + MessageHeader, + @doc("The FHIR resource type defined in R4.") + MolecularSequence, + @doc("The FHIR resource type defined in STU3 and R4.") + NamingSystem, + @doc("The FHIR resource type defined in STU3 and R4.") + NutritionOrder, + @doc("The FHIR resource type defined in STU3 and R4.") + Observation, + @doc("The FHIR resource type defined in R4.") + ObservationDefinition, + @doc("The FHIR resource type defined in STU3 and R4.") + OperationDefinition, + @doc("The FHIR resource type defined in STU3 and R4.") + OperationOutcome, + @doc("The FHIR resource type defined in STU3 and R4.") + Organization, + @doc("The FHIR resource type defined in R4.") + OrganizationAffiliation, + @doc("The FHIR resource type defined in STU3 and R4.") + Parameters, + @doc("The FHIR resource type defined in STU3 and R4.") + Patient, + @doc("The FHIR resource type defined in STU3 and R4.") + PaymentNotice, + @doc("The FHIR resource type defined in STU3 and R4.") + PaymentReconciliation, + @doc("The FHIR resource type defined in STU3 and R4.") + Person, + @doc("The FHIR resource type defined in STU3 and R4.") + PlanDefinition, + @doc("The FHIR resource type defined in STU3 and R4.") + Practitioner, + @doc("The FHIR resource type defined in STU3 and R4.") + PractitionerRole, + @doc("The FHIR resource type defined in STU3 and R4.") + Procedure, + @doc("The FHIR resource type defined in STU3.") + ProcedureRequest, + @doc("The FHIR resource type defined in STU3.") + ProcessRequest, + @doc("The FHIR resource type defined in STU3.") + ProcessResponse, + @doc("The FHIR resource type defined in STU3 and R4.") + Provenance, + @doc("The FHIR resource type defined in STU3 and R4.") + Questionnaire, + @doc("The FHIR resource type defined in STU3 and R4.") + QuestionnaireResponse, + @doc("The FHIR resource type defined in STU3.") + ReferralRequest, + @doc("The FHIR resource type defined in STU3 and R4.") + RelatedPerson, + @doc("The FHIR resource type defined in STU3 and R4.") + RequestGroup, + @doc("The FHIR resource type defined in R4.") + ResearchDefinition, + @doc("The FHIR resource type defined in R4.") + ResearchElementDefinition, + @doc("The FHIR resource type defined in STU3 and R4.") + ResearchStudy, + @doc("The FHIR resource type defined in STU3 and R4.") + ResearchSubject, + @doc("The FHIR resource type defined in STU3 and R4.") + Resource, + @doc("The FHIR resource type defined in STU3 and R4.") + RiskAssessment, + @doc("The FHIR resource type defined in R4.") + RiskEvidenceSynthesis, + @doc("The FHIR resource type defined in STU3 and R4.") + Schedule, + @doc("The FHIR resource type defined in STU3 and R4.") + SearchParameter, + @doc("The FHIR resource type defined in STU3.") + Sequence, + @doc("The FHIR resource type defined in STU3.") + ServiceDefinition, + @doc("The FHIR resource type defined in R4.") + ServiceRequest, + @doc("The FHIR resource type defined in STU3 and R4.") + Slot, + @doc("The FHIR resource type defined in STU3 and R4.") + Specimen, + @doc("The FHIR resource type defined in R4.") + SpecimenDefinition, + @doc("The FHIR resource type defined in STU3 and R4.") + StructureDefinition, + @doc("The FHIR resource type defined in STU3 and R4.") + StructureMap, + @doc("The FHIR resource type defined in STU3 and R4.") + Subscription, + @doc("The FHIR resource type defined in STU3 and R4.") + Substance, + @doc("The FHIR resource type defined in R4.") + SubstanceNucleicAcid, + @doc("The FHIR resource type defined in R4.") + SubstancePolymer, + @doc("The FHIR resource type defined in R4.") + SubstanceProtein, + @doc("The FHIR resource type defined in R4.") + SubstanceReferenceInformation, + @doc("The FHIR resource type defined in R4.") + SubstanceSourceMaterial, + @doc("The FHIR resource type defined in R4.") + SubstanceSpecification, + @doc("The FHIR resource type defined in STU3 and R4.") + SupplyDelivery, + @doc("The FHIR resource type defined in STU3 and R4.") + SupplyRequest, + @doc("The FHIR resource type defined in STU3 and R4.") + Task, + @doc("The FHIR resource type defined in R4.") + TerminologyCapabilities, + @doc("The FHIR resource type defined in STU3 and R4.") + TestReport, + @doc("The FHIR resource type defined in STU3 and R4.") + TestScript, + @doc("The FHIR resource type defined in STU3 and R4.") + ValueSet, + @doc("The FHIR resource type defined in R4.") + VerificationResult, + @doc("The FHIR resource type defined in STU3 and R4.") + VisionPrescription, + } + + +} \ No newline at end of file From 9212d9d87c28040859ad63d57cf8cd42a8759577 Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Fri, 2 Dec 2022 15:25:03 -0800 Subject: [PATCH 28/65] add doc for healthcareresourcetype enum --- specification/eventgrid/data-plane/cadl/HealthcareApis.cadl | 1 + 1 file changed, 1 insertion(+) diff --git a/specification/eventgrid/data-plane/cadl/HealthcareApis.cadl b/specification/eventgrid/data-plane/cadl/HealthcareApis.cadl index 811e1e3887ca..3395dbd0d66c 100644 --- a/specification/eventgrid/data-plane/cadl/HealthcareApis.cadl +++ b/specification/eventgrid/data-plane/cadl/HealthcareApis.cadl @@ -60,6 +60,7 @@ model HealthcareDicomImageDeletedEventData{ // model HealthcareFhirResourceType is string {} @knownValues(BaseEvent.HealthcareFhirResourceTypeKV) +@doc("Schema of FHIR resource type enumeration.") model HealthcareFhirResourceType is string; } From 7d342c1e75aac07e97aa0db06fd7f27e9409a679 Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Fri, 2 Dec 2022 16:14:30 -0800 Subject: [PATCH 29/65] save recent --- .../data-plane/cadl/AppConfiguration.cadl | 8 +- .../eventgrid/data-plane/cadl/EventGrid.cadl | 6 +- .../eventgrid/data-plane/cadl/IotHub.cadl | 37 ++++++++-- .../eventgrid/data-plane/cadl/KeyVault.cadl | 73 ++++++++++--------- .../eventgrid/data-plane/cadl/Maps.cadl | 6 +- .../data-plane/cadl/MediaServices.cadl | 58 ++++++++++++--- 6 files changed, 125 insertions(+), 63 deletions(-) diff --git a/specification/eventgrid/data-plane/cadl/AppConfiguration.cadl b/specification/eventgrid/data-plane/cadl/AppConfiguration.cadl index 0647952c6293..ac0734ccc0b9 100644 --- a/specification/eventgrid/data-plane/cadl/AppConfiguration.cadl +++ b/specification/eventgrid/data-plane/cadl/AppConfiguration.cadl @@ -3,8 +3,8 @@ namespace AppConfiguration; enum AppConfigurationEventTypes { - modified; - deleted; + "modified", + "deleted", } model AppConfigurationBase { @@ -22,7 +22,7 @@ model AppConfigurationBase { } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.AppConfiguration.KeyValueModified event.") -model AppConfigurationKeyValueModifiedEventData is AppConfigurationBase; +model AppConfigurationKeyValueModifiedEventData is AppConfigurationBase{}; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.AppConfiguration.KeyValueDeleted event.") -model AppConfigurationKeyValueDeletedEventData is AppConfigurationBase; +model AppConfigurationKeyValueDeletedEventData is AppConfigurationBase{}; diff --git a/specification/eventgrid/data-plane/cadl/EventGrid.cadl b/specification/eventgrid/data-plane/cadl/EventGrid.cadl index 7e1e097ce88b..c06cc9b6bee9 100644 --- a/specification/eventgrid/data-plane/cadl/EventGrid.cadl +++ b/specification/eventgrid/data-plane/cadl/EventGrid.cadl @@ -12,6 +12,8 @@ using Cadl.Rest; using Cadl.Versioning; using Azure.Core; +//TODO: add in publish here + @doc("Properties of an event published to an Event Grid topic using the EventGrid Schema.") model EventGridEvent { @doc("An unique identifier for the event.") @@ -41,6 +43,7 @@ model EventGridEvent { } +//TODO: how to get additional properties true? @doc("Properties of an event published to an Event Grid 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.") @@ -52,7 +55,7 @@ model CloudEventEvent { @doc("Event data specific to the event type.") data?: object; - @doc("Event data specific to the event type.") + @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.") @@ -72,6 +75,7 @@ model CloudEventEvent { @doc("This describes the subject of the event in the context of the event producer (identified by source).") subject?: string; + } @doc("Properties of an event published to an Event Grid topic using a custom schema") diff --git a/specification/eventgrid/data-plane/cadl/IotHub.cadl b/specification/eventgrid/data-plane/cadl/IotHub.cadl index b6617924ef0d..f46d77fc1b22 100644 --- a/specification/eventgrid/data-plane/cadl/IotHub.cadl +++ b/specification/eventgrid/data-plane/cadl/IotHub.cadl @@ -34,8 +34,9 @@ model DeviceTwinInfo { @doc("The ISO8601 timestamp of the last activity.") lastActivityTime?: string; + //TODO: something here needs to change @doc("Properties JSON element.") - properties?: Record; + properties?: PropertiesJson; @doc("Whether the device twin is enabled or disabled.") status?: string; @@ -46,8 +47,9 @@ model DeviceTwinInfo { @doc("An integer that is incremented by one each time the device twin is updated.") version?: integer; + //TODO: also here @doc("The thumbprint is a unique value for the x509 certificate, commonly used to find a particular certificate in a certificate store. The thumbprint is dynamically generated using the SHA1 algorithm, and does not physically exist in the certificate.") - x509Thumbprint?: Record; + x509Thumbprint?: ThumbPrintValue; } @doc("Schema of the Data property of an EventGridEvent for a device connection state event (DeviceConnected, DeviceDisconnected).") @@ -68,7 +70,7 @@ model DeviceConnectionStateEventProperties { @doc("Schema of the Data property of an EventGridEvent for a device telemetry event (DeviceTelemetry).") model DeviceTelemetryEventProperties { @doc("The content of the message from the device.") - body?: Record; + body?: object; @doc("Application properties are user-defined strings that can be added to the message. These fields are optional.") properties?: Record; @@ -99,16 +101,35 @@ model DeviceConnectionStateEventInfo { } @doc("Event data for Microsoft.Devices.DeviceCreated event.") -model IotHubDeviceCreatedEventData is DeviceLifeCycleEventProperties; +model IotHubDeviceCreatedEventData extends DeviceLifeCycleEventProperties{}; @doc("Event data for Microsoft.Devices.DeviceDeleted event.") -model IotHubDeviceDeletedEventData is DeviceLifeCycleEventProperties; +model IotHubDeviceDeletedEventData extends DeviceLifeCycleEventProperties{}; @doc("Event data for Microsoft.Devices.DeviceConnected event.") -model IotHubDeviceConnectedEventData is DeviceConnectionStateEventProperties; +model IotHubDeviceConnectedEventData extends DeviceConnectionStateEventProperties{}; @doc("Event data for Microsoft.Devices.DeviceDisconnected event.") -model IotHubDeviceDisconnectedEventData is DeviceConnectionStateEventProperties; +model IotHubDeviceDisconnectedEventData extends DeviceConnectionStateEventProperties{}; @doc("Event data for Microsoft.Devices.DeviceTelemetry event.") -model IotHubDeviceTelemetryEventData is DeviceTelemetryEventProperties; +model IotHubDeviceTelemetryEventData extends DeviceTelemetryEventProperties{}; + + + +model PropertiesJson{ + @doc("A portion of the properties that can be written only by the application back-end, and read by the device.") + desired?:IoTHub.DeviceTwinProperties; + + @doc("A portion of the properties that can be written only by the device, and read by the application back-end.") + reported?:IoTHub.DeviceTwinProperties +} + +model ThumbPrintValue{ + @doc("Primary thumbprint for the x509 certificate.") + primaryThumbprint?:string; + + @doc("Secondary thumbprint for the x509 certificate.") + secondaryThumbprint?:string; +} + diff --git a/specification/eventgrid/data-plane/cadl/KeyVault.cadl b/specification/eventgrid/data-plane/cadl/KeyVault.cadl index 2a4596c8d490..dc467f7cf310 100644 --- a/specification/eventgrid/data-plane/cadl/KeyVault.cadl +++ b/specification/eventgrid/data-plane/cadl/KeyVault.cadl @@ -1,57 +1,60 @@ @service({title:"Schema of Azure Key Vault events published to Azure Event Grid", version:"2018-01-01"}) @doc("Describes the schema of the Azure Key Vault events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") -namespace KeyVault; - -model KeyVaultCertificateBase { - @doc("The id of the object that triggered this event.") - Id?: string; - - @doc("Key vault name of the object that triggered this event.") - VaultName?: string; - - @doc("The type of the object that triggered this event") - ObjectType?: string; - - @doc("The name of the object that triggered this event") - ObjectName?: string; - - @doc("The version of the object that triggered this event") - Version?: string; - - @doc("Not before date of the object that triggered this event") - NBF?: float64; - - @doc("The expiration date of the object that triggered this event") - EXP?: float64; -} - +namespace KeyVault{ @doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.CertificateNewVersionCreated event.") -model KeyVaultCertificateNewVersionCreatedEventData is KeyVaultCertificateBase; +model KeyVaultCertificateNewVersionCreatedEventData is BaseEvents.KeyVaultCertificateBase; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.CertificateNearExpiry event.") -model KeyVaultCertificateNearExpiryEventData is KeyVaultCertificateBase; +model KeyVaultCertificateNearExpiryEventData is BaseEvents.KeyVaultCertificateBase; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.CertificateExpired event.") -model KeyVaultCertificateExpiredEventData is KeyVaultCertificateBase; +model KeyVaultCertificateExpiredEventData is BaseEvents.KeyVaultCertificateBase; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.KeyNewVersionCreated event.") -model KeyVaultKeyNewVersionCreatedEventData is KeyVaultCertificateBase; +model KeyVaultKeyNewVersionCreatedEventData is BaseEvents.KeyVaultCertificateBase; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.KeyNearExpiry event.") -model KeyVaultKeyNearExpiryEventData is KeyVaultCertificateBase; +model KeyVaultKeyNearExpiryEventData is BaseEvents.KeyVaultCertificateBase; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.KeyExpired event.") -model KeyVaultKeyExpiredEventData is KeyVaultCertificateBase; +model KeyVaultKeyExpiredEventData is BaseEvents.KeyVaultCertificateBase; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.SecretNewVersionCreated event.") -model KeyVaultSecretNewVersionCreatedEventData is KeyVaultCertificateBase; +model KeyVaultSecretNewVersionCreatedEventData is BaseEvents.KeyVaultCertificateBase; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.SecretNearExpiry event.") -model KeyVaultSecretNearExpiryEventData is KeyVaultCertificateBase; +model KeyVaultSecretNearExpiryEventData is BaseEvents.KeyVaultCertificateBase; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.SecretExpired event.") -model KeyVaultSecretExpiredEventData is KeyVaultCertificateBase; +model KeyVaultSecretExpiredEventData is BaseEvents.KeyVaultCertificateBase; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.VaultAccessPolicyChanged event.") -model KeyVaultVaultAccessPolicyChangedEventData is KeyVaultCertificateBase; +model KeyVaultVaultAccessPolicyChangedEventData is BaseEvents.KeyVaultCertificateBase; + +} + +namespace BaseEvents{ + model KeyVaultCertificateBase { + @doc("The id of the object that triggered this event.") + Id?: string; + + @doc("Key vault name of the object that triggered this event.") + VaultName?: string; + + @doc("The type of the object that triggered this event") + ObjectType?: string; + + @doc("The name of the object that triggered this event") + ObjectName?: string; + + @doc("The version of the object that triggered this event") + Version?: string; + + @doc("Not before date of the object that triggered this event") + NBF?: float64; + + @doc("The expiration date of the object that triggered this event") + EXP?: float64; + } +} diff --git a/specification/eventgrid/data-plane/cadl/Maps.cadl b/specification/eventgrid/data-plane/cadl/Maps.cadl index adbbb5b08339..700a25612b02 100644 --- a/specification/eventgrid/data-plane/cadl/Maps.cadl +++ b/specification/eventgrid/data-plane/cadl/Maps.cadl @@ -3,13 +3,13 @@ namespace Maps; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Maps.GeofenceEntered event.") -model MapsGeofenceEnteredEventData is MapsGeofenceEventProperties; +model MapsGeofenceEnteredEventData extends MapsGeofenceEventProperties{}; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Maps.GeofenceExited event.") -model MapsGeofenceExitedEventData is MapsGeofenceEventProperties; +model MapsGeofenceExitedEventData extends MapsGeofenceEventProperties{}; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Maps.GeofenceResult event.") -model MapsGeofenceResultEventData is MapsGeofenceEventProperties; +model MapsGeofenceResultEventData extends MapsGeofenceEventProperties{}; @doc("Schema of the Data property of an EventGridEvent for a Geofence event (GeofenceEntered, GeofenceExited, GeofenceResult).") model MapsGeofenceEventProperties { diff --git a/specification/eventgrid/data-plane/cadl/MediaServices.cadl b/specification/eventgrid/data-plane/cadl/MediaServices.cadl index 590450c57d09..c28ec303c498 100644 --- a/specification/eventgrid/data-plane/cadl/MediaServices.cadl +++ b/specification/eventgrid/data-plane/cadl/MediaServices.cadl @@ -3,12 +3,19 @@ namespace MediaServices; enum MediaJobState { + @doc("The job was canceled. This is a final state for the job.") Canceled, + @doc("The job is in the process of being canceled. This is a transient state for the job.") Canceling, + @doc("The job has encountered an error. This is a final state for the job.") Error, + @doc("The job is finished. This is a final state for the job.") Finished, + @doc("The job is processing. This is a transient state for the job.") Processing, + @doc("The job is in a queued state, waiting for resources to become available. This is a transient state.") Queued, + @doc("The job is being scheduled to run on an available resource. This is a transient state, between queued and processing states.") Scheduled, } @@ -23,29 +30,47 @@ model MediaJobStateChangeEventData { } enum MediaJobErrorCode { + @doc("Fatal service error, please contact support.") ServiceError, + @doc("Transient error, please retry, if retry is unsuccessful, please contact support.") ServiceTransientError, + @doc("While trying to download the input files, the files were not accessible, please check the availability of the source.") DownloadNotAccessible, + @doc("While trying to download the input files, there was an issue during transfer (storage service, network errors), see details and check your source.") DownloadTransientError, + @doc("While trying to upload the output files, the destination was not reachable, please check the availability of the destination.") UploadNotAccessible, + @doc("While trying to upload the output files, there was an issue during transfer (storage service, network errors), see details and check your destination.") UploadTransientError, + @doc("There was a problem with the combination of input files and the configuration settings applied, fix the configuration settings and retry with the same input, or change input to match the configuration.") ConfigurationUnsupported, + @doc("There was a problem with the input content (for example: zero byte files, or corrupt/non-decodable files), check the input files.") ContentMalformed, + @doc("There was a problem with the format of the input (not valid media file, or an unsupported file/codec), check the validity of the input files.") ContentUnsupported, + @doc("There is an error verifying to the account identity. Check and fix the identity configurations and retry. If unsuccessful, please contact support.") IdentityUnsupported, } enum MediaJobErrorCategory { + @doc("The error is service related.") Service, + @doc("The error is download related.") Download, + @doc("The error is upload related.") Upload, + @doc("The error is configuration related.") Configuration, + @doc("The error is related to data in the input files.") Content, + @doc("The error is related to account information.") Account, } enum MediaJobRetry { + @doc("Issue needs to be investigated and then the job resubmitted with corrections or retried once the underlying issue has been corrected.") DoNotRetry, + @doc("Issue may be resolved after waiting for a period of time and resubmitting the same Job.") MayRetry, } @@ -72,6 +97,7 @@ model MediaJobErrorDetail { } @doc("The event data for a Job output.") +@discriminator("@odata.type") model MediaJobOutput { @doc("The discriminator for derived types.") @projectedName("json","@odata.type") @@ -87,12 +113,14 @@ model MediaJobOutput { } @doc("The event data for a Job output asset.") +@discriminator("#Microsoft.Media.JobOutputAsset") model MediaJobOutputAsset { @doc("Gets the Job output asset name.") assetName?: string; } @doc("Job Output Progress Event Data. Schema of the Data property of an EventGridEvent for a Microsoft.Media.JobOutputProgress event.") +@discriminator("#Microsoft.Media.JobOutputProgress") model MediaJobOutputProgressEventData { @doc("Gets the Job output label.") label?: string; @@ -113,55 +141,61 @@ model MediaJobOutputStateChangeEventData { } @doc("Job scheduled event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobScheduled event.") -model MediaJobScheduledEventData is MediaJobStateChangeEventData; +@discriminator("#Microsoft.Media.JobScheduled") +model MediaJobScheduledEventData extends MediaJobStateChangeEventData{}; @doc("Job processing event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobProcessing event.") -model MediaJobProcessingEventData is MediaJobStateChangeEventData; +@discriminator("#Microsoft.Media.JobProcessing") +model MediaJobProcessingEventData extends MediaJobStateChangeEventData{}; @doc("Job canceling event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobCanceling event.") -model MediaJobCancelingEventData is MediaJobStateChangeEventData; +@discriminator("#Microsoft.Media.JobCanceling") +model MediaJobCancelingEventData extends MediaJobStateChangeEventData{}; @doc("Job finished event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobFinished event.") -model MediaJobFinishedEventData { +@discriminator("#Microsoft.Media.JobFinished") +model MediaJobFinishedEventData extends MediaJobStateChangeEventData { @doc("Gets the Job outputs.") outputs?: MediaJobOutput[]; } @doc("Job canceled event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobCanceled event.") -model MediaJobCanceledEventData { +@discriminator("#Microsoft.Media.JobCanceled") +model MediaJobCanceledEventData extends MediaJobStateChangeEventData { @doc("Gets the Job outputs.") outputs?: MediaJobOutput[]; } @doc("Job error state event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobErrored event.") -model MediaJobErroredEventData { +@discriminator("#Microsoft.Media.JobErrored") +model MediaJobErroredEventData extends MediaJobStateChangeEventData{ @doc("Gets the Job outputs.") outputs?: MediaJobOutput[]; } @doc("Job output canceled event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobOutputCanceled event.") @discriminator("#Microsoft.Media.JobOutputCanceled") -model MediaJobOutputCanceledEventData is MediaJobOutputStateChangeEventData; +model MediaJobOutputCanceledEventData extends MediaJobOutputStateChangeEventData{}; @doc("Job output canceling event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobOutputCanceling event.") @discriminator("#Microsoft.Media.JobOutputCanceling") -model MediaJobOutputCancelingEventData is MediaJobOutputStateChangeEventData; +model MediaJobOutputCancelingEventData extends MediaJobOutputStateChangeEventData{}; @doc("Job output error event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobOutputErrored event.") @discriminator("#Microsoft.Media.JobOutputErrored") -model MediaJobOutputErroredEventData is MediaJobOutputStateChangeEventData; +model MediaJobOutputErroredEventData extends MediaJobOutputStateChangeEventData{}; @doc("Job output finished event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobOutputFinished event.") @discriminator("#Microsoft.Media.JobOutputFinished") -model MediaJobOutputFinishedEventData is MediaJobOutputStateChangeEventData; +model MediaJobOutputFinishedEventData extends MediaJobOutputStateChangeEventData{}; @doc("Job output processing event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobOutputProcessing event.") @discriminator("#Microsoft.Media.JobOutputProcessing") -model MediaJobOutputProcessingEventData is MediaJobOutputStateChangeEventData; +model MediaJobOutputProcessingEventData extends MediaJobOutputStateChangeEventData{}; @doc("Job output scheduled event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobOutputScheduled event.") @discriminator("#Microsoft.Media.JobOutputCanceled") -model MediaJobOutputScheduledEventData is MediaJobOutputStateChangeEventData; +model MediaJobOutputScheduledEventData extends MediaJobOutputStateChangeEventData{}; model MediaLiveEventConnectionBaseData { @doc("Gets the ingest URL provided by the live event.") From c3743bac73b891fb571da4bd405fdf6465ebc84e Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Fri, 2 Dec 2022 16:16:10 -0800 Subject: [PATCH 30/65] two namespaces mediaservices --- .../data-plane/cadl/MediaServices.cadl | 32 +++++++++++-------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/specification/eventgrid/data-plane/cadl/MediaServices.cadl b/specification/eventgrid/data-plane/cadl/MediaServices.cadl index c28ec303c498..65b7417119af 100644 --- a/specification/eventgrid/data-plane/cadl/MediaServices.cadl +++ b/specification/eventgrid/data-plane/cadl/MediaServices.cadl @@ -1,6 +1,6 @@ @service({title:"Schema of Azure Media Services events published to Azure Event Grid",version:"2018-01-01"}) @doc("Describes the schema of the Azure Media Services events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") -namespace MediaServices; +namespace MediaServices{ enum MediaJobState { @doc("The job was canceled. This is a final state for the job.") @@ -197,22 +197,12 @@ model MediaJobOutputProcessingEventData extends MediaJobOutputStateChangeEventDa @discriminator("#Microsoft.Media.JobOutputCanceled") model MediaJobOutputScheduledEventData extends MediaJobOutputStateChangeEventData{}; -model MediaLiveEventConnectionBaseData { - @doc("Gets the ingest URL provided by the live event.") - ingestUrl?: string; - @doc("Gets the stream Id.") - streamId?: string; - @doc("Gets the remote IP.") - encoderIp?: string; - @doc("Gets the remote port.") - encoderPort?: string; -} @doc("Encoder connect event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventEncoderConnected event.") -model MediaLiveEventEncoderConnectedEventData is MediaLiveEventConnectionBaseData; +model MediaLiveEventEncoderConnectedEventData is BaseEvents.MediaLiveEventConnectionBaseData; @doc("Encoder connection rejected event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventConnectionRejected event.") model MediaLiveEventConnectionRejectedEventData { - ...MediaLiveEventConnectionBaseData; + ...BaseEvents.MediaLiveEventConnectionBaseData; @doc("Gets the result code.") resultCode?: string; @@ -220,7 +210,7 @@ model MediaLiveEventConnectionRejectedEventData { @doc("Encoder disconnected event data. Schema of the Data property of an EventGridEvent for a Microsoft.Media.LiveEventEncoderDisconnected event.") model MediaLiveEventEncoderDisconnectedEventData { - ...MediaLiveEventConnectionBaseData; + ...BaseEvents.MediaLiveEventConnectionBaseData; @doc("Gets the result code.") resultCode?: string; @@ -355,3 +345,17 @@ model MediaLiveEventChannelArchiveHeartbeatEventData { @doc("Gets the latency result code.") latencyResultCode: string; } +} + +namespace BaseEvents{ + model MediaLiveEventConnectionBaseData { + @doc("Gets the ingest URL provided by the live event.") + ingestUrl?: string; + @doc("Gets the stream Id.") + streamId?: string; + @doc("Gets the remote IP.") + encoderIp?: string; + @doc("Gets the remote port.") + encoderPort?: string; + } +} \ No newline at end of file From 94c0d051e614dcaa9b85e27cfc9bee497ab78d70 Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Fri, 2 Dec 2022 16:29:21 -0800 Subject: [PATCH 31/65] policy insights 2 namespaces --- .../data-plane/cadl/PolicyInsights.cadl | 58 ++++++++++--------- 1 file changed, 31 insertions(+), 27 deletions(-) diff --git a/specification/eventgrid/data-plane/cadl/PolicyInsights.cadl b/specification/eventgrid/data-plane/cadl/PolicyInsights.cadl index 2457b9be70a9..7970b0fad202 100644 --- a/specification/eventgrid/data-plane/cadl/PolicyInsights.cadl +++ b/specification/eventgrid/data-plane/cadl/PolicyInsights.cadl @@ -1,35 +1,39 @@ @service({title:"Schema of Azure Policy events published to Azure Event Grid",version:"2018-01-01"}) @doc("Describes the schema of the Azure Policy events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") -namespace PolicyInsights; - -model PolicyInsightsBaseEventData { - @doc("The time that the resource was scanned by Azure Policy in the Universal ISO 8601 DateTime format yyyy-MM-ddTHH:mm:ss.fffffffZ.") - timestamp?: zonedDateTime; - - @doc("The resource ID of the policy assignment.") - policyAssignmentId?: string; - - @doc("The resource ID of the policy definition.") - policyDefinitionId?: string; - - @doc("The reference ID for the policy definition inside the initiative definition, if the policy assignment is for an initiative. May be empty.") - policyDefinitionReferenceId?: string; - - @doc("The compliance state of the resource with respect to the policy assignment.") - complianceState?: string; - - @doc("The subscription ID of the resource.") - subscriptionId?: string; - - @doc("The compliance reason code. May be empty.") - complianceReasonCode?: string; -} +namespace PolicyInsights{ @doc("Schema of the Data property of an EventGridEvent for a Microsoft.PolicyInsights.PolicyStateCreated event.") -model PolicyInsightsPolicyStateCreatedEventData is PolicyInsightsBaseEventData; +model PolicyInsightsPolicyStateCreatedEventData is BaseEvents.PolicyInsightsBaseEventData; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.PolicyInsights.PolicyStateChanged event.") -model PolicyInsightsPolicyStateChangedEventData is PolicyInsightsBaseEventData; +model PolicyInsightsPolicyStateChangedEventData is BaseEvents.PolicyInsightsBaseEventData; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.PolicyInsights.PolicyStateDeleted event.") -model PolicyInsightsPolicyStateDeletedEventData is PolicyInsightsBaseEventData; +model PolicyInsightsPolicyStateDeletedEventData is BaseEvents.PolicyInsightsBaseEventData; + +} + +namespace BaseEvents{ + model PolicyInsightsBaseEventData { + @doc("The time that the resource was scanned by Azure Policy in the Universal ISO 8601 DateTime format yyyy-MM-ddTHH:mm:ss.fffffffZ.") + timestamp?: zonedDateTime; + + @doc("The resource ID of the policy assignment.") + policyAssignmentId?: string; + + @doc("The resource ID of the policy definition.") + policyDefinitionId?: string; + + @doc("The reference ID for the policy definition inside the initiative definition, if the policy assignment is for an initiative. May be empty.") + policyDefinitionReferenceId?: string; + + @doc("The compliance state of the resource with respect to the policy assignment.") + complianceState?: string; + + @doc("The subscription ID of the resource.") + subscriptionId?: string; + + @doc("The compliance reason code. May be empty.") + complianceReasonCode?: string; + } +} \ No newline at end of file From 00ffafaee4b79ac5b7725b5dc1ede7cac3cb6fdc Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Fri, 2 Dec 2022 16:33:24 -0800 Subject: [PATCH 32/65] two namespaces resources --- .../eventgrid/data-plane/cadl/Resources.cadl | 93 ++++++++++--------- 1 file changed, 48 insertions(+), 45 deletions(-) diff --git a/specification/eventgrid/data-plane/cadl/Resources.cadl b/specification/eventgrid/data-plane/cadl/Resources.cadl index 51f9f8ad9a91..c22369b5792b 100644 --- a/specification/eventgrid/data-plane/cadl/Resources.cadl +++ b/specification/eventgrid/data-plane/cadl/Resources.cadl @@ -1,68 +1,33 @@ @service({title:"Schema of Azure resource events published to Azure Event Grid", version: "2018-01-01"}) @doc("Describes the schema of the Azure resource events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") -namespace Resources; - -model ResourceBaseEventData { - @doc("The tenant ID of the resource.") - tenantId?: string; - - @doc("The subscription ID of the resource.") - subscriptionId?: string; - - @doc("The resource group of the resource.") - resourceGroup?: string; - - @doc("The resource provider performing the operation.") - resourceProvider?: string; - - @doc("The URI of the resource in the operation.") - resourceUri?: string; - - @doc("The operation that was performed.") - operationName?: string; - - @doc("The status of the operation.") - status?: string; - - @doc("The requested authorization for the operation.") - authorization?: ResourceAuthorization; - - @doc("The properties of the claims.") - claims?: Record; - - @doc("An operation ID used for troubleshooting.") - correlationId?: string; - - @doc("The details of the operation.") - httpRequest?: ResourceHttpRequest; -} +namespace Resources{ @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceWriteSuccess event. This is raised when a resource create or update operation succeeds.") -model ResourceWriteSuccessData is ResourceBaseEventData; +model ResourceWriteSuccessData is BaseEvents.ResourceBaseEventData; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceWriteFailure event. This is raised when a resource create or update operation fails.") -model ResourceWriteFailureData is ResourceBaseEventData; +model ResourceWriteFailureData is BaseEvents.ResourceBaseEventData; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceWriteCancel event. This is raised when a resource create or update operation is canceled.") -model ResourceWriteCancelData is ResourceBaseEventData; +model ResourceWriteCancelData is BaseEvents.ResourceBaseEventData; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceDeleteSuccess event. This is raised when a resource delete operation succeeds.") -model ResourceDeleteSuccessData is ResourceBaseEventData; +model ResourceDeleteSuccessData is BaseEvents.ResourceBaseEventData; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceDeleteFailure event. This is raised when a resource delete operation fails.") -model ResourceDeleteFailureData is ResourceBaseEventData; +model ResourceDeleteFailureData is BaseEvents.ResourceBaseEventData; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceDeleteCancel event. This is raised when a resource delete operation is canceled.") -model ResourceDeleteCancelData is ResourceBaseEventData; +model ResourceDeleteCancelData is BaseEvents.ResourceBaseEventData; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceActionSuccess event. This is raised when a resource action operation succeeds.") -model ResourceActionSuccessData is ResourceBaseEventData; +model ResourceActionSuccessData is BaseEvents.ResourceBaseEventData; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceActionFailure event. This is raised when a resource action operation fails.") -model ResourceActionFailureData is ResourceBaseEventData; +model ResourceActionFailureData is BaseEvents.ResourceBaseEventData; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceActionCancel event. This is raised when a resource action operation is canceled.") -model ResourceActionCancelData is ResourceBaseEventData; +model ResourceActionCancelData is BaseEvents.ResourceBaseEventData; @doc("The details of the HTTP request.") model ResourceHttpRequest { @@ -90,3 +55,41 @@ model ResourceAuthorization { @doc("The evidence for the authorization.") evidence?: Record; } +} + +namespace BaseEvents{ + model ResourceBaseEventData { + @doc("The tenant ID of the resource.") + tenantId?: string; + + @doc("The subscription ID of the resource.") + subscriptionId?: string; + + @doc("The resource group of the resource.") + resourceGroup?: string; + + @doc("The resource provider performing the operation.") + resourceProvider?: string; + + @doc("The URI of the resource in the operation.") + resourceUri?: string; + + @doc("The operation that was performed.") + operationName?: string; + + @doc("The status of the operation.") + status?: string; + + @doc("The requested authorization for the operation.") + authorization?: Resources.ResourceAuthorization; + + @doc("The properties of the claims.") + claims?: Record; + + @doc("An operation ID used for troubleshooting.") + correlationId?: string; + + @doc("The details of the operation.") + httpRequest?: Resources.ResourceHttpRequest; + } +} \ No newline at end of file From ed0e06367a4795bb4afbdd5af1f0fbf703882320 Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Fri, 2 Dec 2022 16:35:57 -0800 Subject: [PATCH 33/65] two namespaces sb --- .../eventgrid/data-plane/cadl/ServiceBus.cadl | 55 ++++++++++--------- 1 file changed, 30 insertions(+), 25 deletions(-) diff --git a/specification/eventgrid/data-plane/cadl/ServiceBus.cadl b/specification/eventgrid/data-plane/cadl/ServiceBus.cadl index ffbe071a760e..1a345e0bb330 100644 --- a/specification/eventgrid/data-plane/cadl/ServiceBus.cadl +++ b/specification/eventgrid/data-plane/cadl/ServiceBus.cadl @@ -1,35 +1,40 @@ @service({title: "Schema of Azure ServiceBus Messaging events published to Azure Event Grid", version:"2018-01-01"}) @doc("Describes the schema of the Azure ServiceBus Messaging events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") -namespace ServiceBus; - -model ServiceBusBaseEventData { - @doc("The namespace name of the Microsoft.ServiceBus resource.") - namespaceName?: string; - - @doc("The endpoint of the Microsoft.ServiceBus resource.") - requestUri?: string; - - @doc("The entity type of the Microsoft.ServiceBus resource. Could be one of 'queue' or 'subscriber'.") - entityType?: string; - - @doc("The name of the Microsoft.ServiceBus queue. If the entity type is of type 'subscriber', then this value will be null.") - queueName?: string; - - @doc("The name of the Microsoft.ServiceBus topic. If the entity type is of type 'queue', then this value will be null.") - topicName?: string; - - @doc("The name of the Microsoft.ServiceBus topic's subscription. If the entity type is of type 'queue', then this value will be null.") - subscriptionName?: string; -} +namespace ServiceBus{ @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ServiceBus.ActiveMessagesAvailableWithNoListeners event.") -model ServiceBusActiveMessagesAvailableWithNoListenersEventData is ServiceBusBaseEventData; +model ServiceBusActiveMessagesAvailableWithNoListenersEventData is BaseEvents.ServiceBusBaseEventData; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ServiceBus.DeadletterMessagesAvailableWithNoListeners event.") -model ServiceBusDeadletterMessagesAvailableWithNoListenersEventData is ServiceBusBaseEventData; +model ServiceBusDeadletterMessagesAvailableWithNoListenersEventData is BaseEvents.ServiceBusBaseEventData; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ServiceBus.ActiveMessagesAvailablePeriodicNotifications event.") -model ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData is ServiceBusBaseEventData; +model ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData is BaseEvents.ServiceBusBaseEventData; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ServiceBus.DeadletterMessagesAvailablePeriodicNotifications event.") -model ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData is ServiceBusBaseEventData; +model ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData is BaseEvents.ServiceBusBaseEventData; + +} + +namespace BaseEvents{ + + model ServiceBusBaseEventData { + @doc("The namespace name of the Microsoft.ServiceBus resource.") + namespaceName?: string; + + @doc("The endpoint of the Microsoft.ServiceBus resource.") + requestUri?: string; + + @doc("The entity type of the Microsoft.ServiceBus resource. Could be one of 'queue' or 'subscriber'.") + entityType?: string; + + @doc("The name of the Microsoft.ServiceBus queue. If the entity type is of type 'subscriber', then this value will be null.") + queueName?: string; + + @doc("The name of the Microsoft.ServiceBus topic. If the entity type is of type 'queue', then this value will be null.") + topicName?: string; + + @doc("The name of the Microsoft.ServiceBus topic's subscription. If the entity type is of type 'queue', then this value will be null.") + subscriptionName?: string; + } +} \ No newline at end of file From a4df0ffe82dd47b5d7848799ec509305fe6dc540 Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Fri, 2 Dec 2022 16:41:02 -0800 Subject: [PATCH 34/65] 2 namespace signalr --- .../data-plane/cadl/SignalRService.cadl | 38 ++++++++++--------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/specification/eventgrid/data-plane/cadl/SignalRService.cadl b/specification/eventgrid/data-plane/cadl/SignalRService.cadl index 82f176acb399..b964ef1cabc9 100644 --- a/specification/eventgrid/data-plane/cadl/SignalRService.cadl +++ b/specification/eventgrid/data-plane/cadl/SignalRService.cadl @@ -1,29 +1,33 @@ @service({title:"Schema of Azure SignalR Service events published to Azure Event Grid", version:"2018-01-01"}) @doc("Describes the schema of the Azure SignalR Service events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") -namespace SignalRService; - -model SignalRServiceBaseEventdata { - @doc("The time at which the event occurred.") - timestamp?: zonedDateTime; - - @doc("The hub of connected client connection.") - hubName?: string; - - @doc("The connection Id of connected client connection.") - connectionId?: string; - - @doc("The user Id of connected client connection.") - userId?: string; -} +namespace SignalRService{ @doc("Schema of the Data property of an EventGridEvent for a Microsoft.SignalRService.ClientConnectionConnected event.") -model SignalRServiceClientConnectionConnectedEventData is SignalRServiceBaseEventdata; +model SignalRServiceClientConnectionConnectedEventData is BaseEvents.SignalRServiceBaseEventdata; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.SignalRService.ClientConnectionDisconnected event.") model SignalRServiceClientConnectionDisconnectedEventData { - ...SignalRServiceBaseEventdata; + ...BaseEvents.SignalRServiceBaseEventdata; @doc("The message of error that cause the client connection disconnected.") errorMessage?: string; } +} + +namespace BaseEvents{ + model SignalRServiceBaseEventdata { + @doc("The time at which the event occurred.") + timestamp?: zonedDateTime; + + @doc("The hub of connected client connection.") + hubName?: string; + + @doc("The connection Id of connected client connection.") + connectionId?: string; + + @doc("The user Id of connected client connection.") + userId?: string; + } +} + From 00ed94ad0d66549521abe8811656bc991a8a4756 Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Sun, 4 Dec 2022 07:05:05 -0800 Subject: [PATCH 35/65] storage 2 namespaces --- .../eventgrid/data-plane/cadl/Storage.cadl | 122 +++++++++--------- 1 file changed, 64 insertions(+), 58 deletions(-) diff --git a/specification/eventgrid/data-plane/cadl/Storage.cadl b/specification/eventgrid/data-plane/cadl/Storage.cadl index 74de49c275f0..a28f11e7efce 100644 --- a/specification/eventgrid/data-plane/cadl/Storage.cadl +++ b/specification/eventgrid/data-plane/cadl/Storage.cadl @@ -1,49 +1,7 @@ @service({title:"Schema of Azure Storage events published to Azure Event Grid", version: "2018-01-01"}) @doc("Describes the schema of the Azure Storage events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") -namespace Storage; - -enum StorageType{ - blob: "blob", - directory: "directory", -} - - -model StorageBaseEventData { - @doc("The name of the API/operation that triggered this event.") - api?: string; - - @doc("A request id provided by the client of the storage API operation that triggered this event.") - clientRequestId?: string; - - @doc("The request id generated by the Storage service for the storage API operation that triggered this event.") - requestId?: string; - - @doc("An opaque string value representing the logical sequence of events for any particular {name} name. Users can use standard string comparison to understand the relative sequence of two events on the same {name} name.", {name: TStorageType,}) - sequencer?: string; - - @doc("The identity of the requester that triggered this event.") - identity?: string; - - @doc("For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers.") - storageDiagnostics?: Record; -} - -model StorageBaseTypeData { - @doc("The content type of the blob. This is the same as what would be returned in the Content-Type header from the blob.") - contentType?: string; - - @doc("The type of blob.") - blobType?: string; -} - -model StorageUrlBaseEventData { - @doc("The size of the blob in bytes. This is the same as what would be returned in the Content-Length header from the blob.") - contentLength?: int64; - - @doc("The path to the blob.") - url?: string; -} +namespace Storage{ @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Storage.BlobCreated event.") model StorageBlobCreatedEventData { @@ -53,9 +11,9 @@ model StorageBlobCreatedEventData { @doc("The offset of the blob in bytes.") contentOffset?: int64; - ...StorageBaseEventData<"blob">; - ...StorageUrlBaseEventData; - ...StorageBaseTypeData; + ...BaseEvents.StorageBaseEventData<"blob">; + ...BaseEvents.StorageUrlBaseEventData; + ...BaseEvents.StorageBaseTypeData; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Storage.BlobDeleted event.") @@ -63,8 +21,8 @@ model StorageBlobDeletedEventData { @doc("The path to the blob.") url?: string; - ...StorageBaseEventData<"blob">; - ...StorageBaseTypeData; + ...BaseEvents.StorageBaseEventData<"blob">; + ...BaseEvents.StorageBaseTypeData; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Storage.DirectoryCreated event.") @@ -75,7 +33,7 @@ model StorageDirectoryCreatedEventData { @doc("The path to the directory.") url?: string; - ...StorageBaseEventData<"directory">; + ...BaseEvents.StorageBaseEventData<"directory">; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Storage.DirectoryDeleted event.") @@ -86,7 +44,7 @@ model StorageDirectoryDeletedEventData { @doc("Is this event for a recursive delete operation.") recursive?: string; - ...StorageBaseEventData<"directory">; + ...BaseEvents.StorageBaseEventData<"directory">; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Storage.BlobRenamed event.") @@ -97,7 +55,7 @@ model StorageBlobRenamedEventData { @doc("The new path to the blob after the rename operation.") destinationUrl?: string; - ...StorageBaseEventData<"blob">; + ...BaseEvents.StorageBaseEventData<"blob">; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Storage.DirectoryRenamed event.") @@ -108,7 +66,7 @@ model StorageDirectoryRenamedEventData { @doc("The new path to the directory after the rename operation.") destinationUrl?: string; - ...StorageBaseEventData<"directory">; + ...BaseEvents.StorageBaseEventData<"directory">; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Storage.LifecyclePolicyCompleted event.") @@ -134,16 +92,16 @@ model StorageLifecyclePolicyActionSummaryDetail { @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Storage.BlobTierChanged event.") model StorageBlobTierChangedEventData { - ...StorageBaseEventData<"blob">; - ...StorageUrlBaseEventData; - ...StorageBaseTypeData; + ...BaseEvents.StorageBaseEventData<"blob">; + ...BaseEvents.StorageUrlBaseEventData; + ...BaseEvents.StorageBaseTypeData; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Storage.AsyncOperationInitiated event.") model StorageAsyncOperationInitiatedEventData { - ...StorageBaseEventData<"blob">; - ...StorageUrlBaseEventData; - ...StorageBaseTypeData; + ...BaseEvents.StorageBaseEventData<"blob">; + ...BaseEvents.StorageUrlBaseEventData; + ...BaseEvents.StorageBaseTypeData; } @doc("Schema of the Data property of an EventGridEvent for an Microsoft.Storage.BlobInventoryPolicyCompleted event.") @@ -169,3 +127,51 @@ model StorageBlobInventoryPolicyCompletedEventData { @doc("The blob URL for manifest file for inventory run.") manifestBlobUrl?: string; } + +} + +namespace BaseEvents{ + enum StorageType{ + blob: "blob", + directory: "directory", + } + + + model StorageBaseEventData { + @doc("The name of the API/operation that triggered this event.") + api?: string; + + @doc("A request id provided by the client of the storage API operation that triggered this event.") + clientRequestId?: string; + + @doc("The request id generated by the Storage service for the storage API operation that triggered this event.") + requestId?: string; + + @doc("An opaque string value representing the logical sequence of events for any particular {name} name. Users can use standard string comparison to understand the relative sequence of two events on the same {name} name.", {name: TStorageType,}) + sequencer?: string; + + @doc("The identity of the requester that triggered this event.") + identity?: string; + + @doc("For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers.") + storageDiagnostics?: Record; + } + + model StorageBaseTypeData { + @doc("The content type of the blob. This is the same as what would be returned in the Content-Type header from the blob.") + contentType?: string; + + @doc("The type of blob.") + blobType?: string; + } + + model StorageUrlBaseEventData { + @doc("The size of the blob in bytes. This is the same as what would be returned in the Content-Length header from the blob.") + contentLength?: int64; + + @doc("The path to the blob.") + url?: string; + } + + +} \ No newline at end of file From 99f6a7f1aea39e4d4a015b621c53eb396f92d10e Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Sun, 4 Dec 2022 07:25:23 -0800 Subject: [PATCH 36/65] 2 namespaces web cadl --- .../eventgrid/data-plane/cadl/Web.cadl | 195 ++++++++++-------- 1 file changed, 109 insertions(+), 86 deletions(-) diff --git a/specification/eventgrid/data-plane/cadl/Web.cadl b/specification/eventgrid/data-plane/cadl/Web.cadl index aecdebd5fa5f..3532c0fd1660 100644 --- a/specification/eventgrid/data-plane/cadl/Web.cadl +++ b/specification/eventgrid/data-plane/cadl/Web.cadl @@ -1,64 +1,49 @@ @service({title:"Schema of Azure App Service events published to Azure Event Grid", version: "2018-01-01"}) @doc("Describes the schema of the Azure App Service events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") -namespace Web; +namespace Web{ -model WebAppBaseEventData { - appEventTypeDetail?: AppEventTypeDetail; - - @doc("name of the web site that had this event.") - name?: string; - - @doc("The client request id generated by the app service for the site API operation that triggered this event.") - clientRequestId?: string; - - @doc("The correlation request id generated by the app service for the site API operation that triggered this event.") - correlationRequestId?: string; - - @doc("The request id generated by the app service for the site API operation that triggered this event.") - requestId?: string; - - @doc("HTTP request URL of this operation.") - address?: string; - - @doc("HTTP verb of this operation.") - verb?: string; +@doc("Detail of action on the app.") +model AppEventTypeDetail { + @doc("Type of action of the operation.") + action?: AppAction; } + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.AppUpdated event.") -model WebAppUpdatedEventData is WebAppBaseEventData; +model WebAppUpdatedEventData is BaseEvents.WebAppBaseEventData; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.BackupOperationStarted event.") -model WebBackupOperationStartedEventData is WebAppBaseEventData; +model WebBackupOperationStartedEventData is BaseEvents.WebAppBaseEventData; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.BackupOperationCompleted event.") -model WebBackupOperationCompletedEventData is WebAppBaseEventData; +model WebBackupOperationCompletedEventData is BaseEvents.WebAppBaseEventData; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.BackupOperationFailed event.") -model WebBackupOperationFailedEventData is WebAppBaseEventData; +model WebBackupOperationFailedEventData is BaseEvents.WebAppBaseEventData; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.RestoreOperationStarted event.") -model WebRestoreOperationStartedEventData is WebAppBaseEventData; +model WebRestoreOperationStartedEventData is BaseEvents.WebAppBaseEventData; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.RestoreOperationCompleted event.") -model WebRestoreOperationCompletedEventData is WebAppBaseEventData; +model WebRestoreOperationCompletedEventData is BaseEvents.WebAppBaseEventData; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.RestoreOperationFailed event.") -model WebRestoreOperationFailedEventData is WebAppBaseEventData; +model WebRestoreOperationFailedEventData is BaseEvents.WebAppBaseEventData; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapStarted event.") -model WebSlotSwapStartedEventData is WebAppBaseEventData; +model WebSlotSwapStartedEventData is BaseEvents.WebAppBaseEventData; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapCompleted event.") -model WebSlotSwapCompletedEventData is WebAppBaseEventData; +model WebSlotSwapCompletedEventData is BaseEvents.WebAppBaseEventData; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapFailed event.") -model WebSlotSwapFailedEventData is WebAppBaseEventData; +model WebSlotSwapFailedEventData is BaseEvents.WebAppBaseEventData; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapWithPreviewStarted event.") -model WebSlotSwapWithPreviewStartedEventData is WebAppBaseEventData; +model WebSlotSwapWithPreviewStartedEventData is BaseEvents.WebAppBaseEventData; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapWithPreviewCancelled event.") -model WebSlotSwapWithPreviewCancelledEventData is WebAppBaseEventData; +model WebSlotSwapWithPreviewCancelledEventData is BaseEvents.WebAppBaseEventData; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.AppServicePlanUpdated event.") model WebAppServicePlanUpdatedEventData { @@ -83,58 +68,17 @@ model WebAppServicePlanUpdatedEventData { verb?: string; @doc("sku of app service plan.") - sku?: sku; -} - -@doc("sku of app service plan.") -model sku { - @doc("name of app service plan sku.") - name?: string; - - @doc("tier of app service plan sku.") - Tier?:string; - - @doc("size of app service plan sku.") - Size?:string; - - @doc("family of app service plan sku.") - Family?:string; - - @doc("capacity of app service plan sku.") - Capacity?:string; + sku?: BaseEvents.sku; } -@knownValues(AppActionKV) +@knownValues(BaseEvents.AppActionKV) model AppAction is string {} -enum AppActionKV { - Restarted, - Stopped, - ChangedAppSettings, - Started, - Completed, - Failed, -} -@doc("Detail of action on the app.") -model AppEventTypeDetail { - @doc("Type of action of the operation.") - action?: AppAction; -} - -@knownValues(StampKindKV) +@knownValues(BaseEvents.StampKindKV) model StampKind is string {} -enum StampKindKV { - Public, - AseV1, - AseV2, -} -@knownValues(AppServicePlanActionKV) +@knownValues(BaseEvents.AppServicePlanActionKV) model AppServicePlanAction is string {} -enum AppServicePlanActionKV { - @doc("App Service plan is being updated.") - Updated, -} @doc("Detail of action on the app service plan.") model AppServicePlanEventTypeDetail { @@ -146,14 +90,93 @@ model AppServicePlanEventTypeDetail { status?: AsyncStatus; } -@knownValues(AsyncStatusKV) +@knownValues(BaseEvents.AsyncStatusKV) model AsyncStatus is string {} -enum AsyncStatusKV { - @doc("Async operation has started.") - Started, - @doc("Async operation has completed.") - Completed, - @doc("Async operation failed to complete.") - Failed, + + } + + +namespace BaseEvents{ + + model WebAppBaseEventData { + appEventTypeDetail?: Web.AppEventTypeDetail; + + @doc("name of the web site that had this event.") + name?: string; + + @doc("The client request id generated by the app service for the site API operation that triggered this event.") + clientRequestId?: string; + + @doc("The correlation request id generated by the app service for the site API operation that triggered this event.") + correlationRequestId?: string; + + @doc("The request id generated by the app service for the site API operation that triggered this event.") + requestId?: string; + + @doc("HTTP request URL of this operation.") + address?: string; + + @doc("HTTP verb of this operation.") + verb?: string; + } + + @doc("sku of app service plan.") + model sku { + @doc("name of app service plan sku.") + name?: string; + + @doc("tier of app service plan sku.") + Tier?:string; + + @doc("size of app service plan sku.") + Size?:string; + + @doc("family of app service plan sku.") + Family?:string; + + @doc("capacity of app service plan sku.") + Capacity?:string; + } + + + enum AppActionKV { + @doc("Web app was restarted.") + Restarted, + @doc("Web app was stopped.") + Stopped, + @doc("There was an operation to change app setting on the web app.") + ChangedAppSettings, + @doc("The job has started.") + Started, + @doc("The job has completed.") + Completed, + @doc("The job has failed to complete.") + Failed, + } + + enum StampKindKV { + @doc("App Service Plan is running on a public stamp.") + Public, + @doc("App Service Plan is running on an App Service Environment V1.") + AseV1, + @doc("App Service Plan is running on an App Service Environment V2.") + AseV2, + } + + + enum AppServicePlanActionKV { + @doc("App Service plan is being updated.") + Updated, + } + + enum AsyncStatusKV { + @doc("Async operation has started.") + Started, + @doc("Async operation has completed.") + Completed, + @doc("Async operation failed to complete.") + Failed, + } +} From 699a9201f7f82979feb653f85dc67c5bce98996a Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Tue, 6 Dec 2022 09:57:48 -0800 Subject: [PATCH 37/65] ran prettier on cadl --- .../data-plane/cadl/ApiManagement.cadl | 76 +- .../data-plane/cadl/AppConfiguration.cadl | 32 +- .../cadl/AzureCommunicationServices.cadl | 72 +- .../cadl/AzureCommunicationServicesCore.cadl | 47 +- .../data-plane/cadl/ContainerRegistry.cadl | 225 +++--- .../data-plane/cadl/ContainerService.cadl | 5 +- .../eventgrid/data-plane/cadl/EventGrid.cadl | 21 +- .../eventgrid/data-plane/cadl/EventHub.cadl | 5 +- .../data-plane/cadl/HealthcareApis.cadl | 274 +++++-- .../eventgrid/data-plane/cadl/IotHub.cadl | 44 +- .../eventgrid/data-plane/cadl/KeyVault.cadl | 69 +- .../cadl/MachineLearningServices.cadl | 5 +- .../eventgrid/data-plane/cadl/Maps.cadl | 11 +- .../data-plane/cadl/MediaServices.cadl | 740 ++++++++++-------- .../data-plane/cadl/PolicyInsights.cadl | 40 +- .../eventgrid/data-plane/cadl/RedisCache.cadl | 5 +- .../eventgrid/data-plane/cadl/Resources.cadl | 108 +-- .../eventgrid/data-plane/cadl/ServiceBus.cadl | 44 +- .../data-plane/cadl/SignalRService.cadl | 35 +- .../eventgrid/data-plane/cadl/Storage.cadl | 242 +++--- .../eventgrid/data-plane/cadl/Web.cadl | 175 +++-- .../data-plane/cadl/cadl-output/openapi.json | 188 +++++ .../data-plane/cadl/package-lock.json | 80 +- .../eventgrid/data-plane/cadl/package.json | 6 +- 24 files changed, 1579 insertions(+), 970 deletions(-) create mode 100644 specification/eventgrid/data-plane/cadl/cadl-output/openapi.json diff --git a/specification/eventgrid/data-plane/cadl/ApiManagement.cadl b/specification/eventgrid/data-plane/cadl/ApiManagement.cadl index 11eeeb8bf31c..2ce1cd719cbb 100644 --- a/specification/eventgrid/data-plane/cadl/ApiManagement.cadl +++ b/specification/eventgrid/data-plane/cadl/ApiManagement.cadl @@ -1,57 +1,61 @@ -@service({title:"Schema of Azure API Management events published to Azure Event Grid",version:"2018-01-01"}) +@service({ + title: "Schema of Azure API Management events published to Azure Event Grid", + version: "2018-01-01", +}) @doc("Describes the schema of the Azure API Management events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") -namespace ApiManagement{ +namespace ApiManagement { + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.UserCreated event.") + model ApiManagementUserCreatedEventData is BaseEvents.ApiManagementBase; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.UserCreated event.") -model ApiManagementUserCreatedEventData is BaseEvents.ApiManagementBase; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.UserUpdated event.") + model ApiManagementUserUpdatedEventData is BaseEvents.ApiManagementBase; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.UserUpdated event.") -model ApiManagementUserUpdatedEventData is BaseEvents.ApiManagementBase; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.UserDeleted event.") + model ApiManagementUserDeletedEventData is BaseEvents.ApiManagementBase; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.UserDeleted event.") -model ApiManagementUserDeletedEventData is BaseEvents.ApiManagementBase; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.SubscriptionCreated event.") + model ApiManagementSubscriptionCreatedEventData + is BaseEvents.ApiManagementBase; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.SubscriptionCreated event.") -model ApiManagementSubscriptionCreatedEventData is BaseEvents.ApiManagementBase; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.SubscriptionUpdated event.") + model ApiManagementSubscriptionUpdatedEventData + is BaseEvents.ApiManagementBase; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.SubscriptionUpdated event.") -model ApiManagementSubscriptionUpdatedEventData is BaseEvents.ApiManagementBase; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.SubscriptionDeleted event.") + model ApiManagementSubscriptionDeletedEventData + is BaseEvents.ApiManagementBase; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.SubscriptionDeleted event.") -model ApiManagementSubscriptionDeletedEventData is BaseEvents.ApiManagementBase; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.ProductCreated event.") + model ApiManagementProductCreatedEventData is BaseEvents.ApiManagementBase; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.ProductCreated event.") -model ApiManagementProductCreatedEventData is BaseEvents.ApiManagementBase; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.ProductUpdated event.") + model ApiManagementProductUpdatedEventData is BaseEvents.ApiManagementBase; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.ProductUpdated event.") -model ApiManagementProductUpdatedEventData is BaseEvents.ApiManagementBase; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.ProductDeleted event.") + model ApiManagementProductDeletedEventData is BaseEvents.ApiManagementBase; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.ProductDeleted event.") -model ApiManagementProductDeletedEventData is BaseEvents.ApiManagementBase; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APICreated event.") + model ApiManagementApiCreatedEventData is BaseEvents.ApiManagementBase; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APICreated event.") -model ApiManagementApiCreatedEventData is BaseEvents.ApiManagementBase; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIUpdated event.") + model ApiManagementApiUpdatedEventData is BaseEvents.ApiManagementBase; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIUpdated event.") -model ApiManagementApiUpdatedEventData is BaseEvents.ApiManagementBase; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIDeleted event.") + model ApiManagementApiDeletedEventData is BaseEvents.ApiManagementBase; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIDeleted event.") -model ApiManagementApiDeletedEventData is BaseEvents.ApiManagementBase; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIReleaseCreated event.") + model ApiManagementApiReleaseCreatedEventData is BaseEvents.ApiManagementBase; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIReleaseCreated event.") -model ApiManagementApiReleaseCreatedEventData is BaseEvents.ApiManagementBase; - -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIReleaseUpdated event.") -model ApiManagementApiReleaseUpdatedEventData is BaseEvents.ApiManagementBase; - -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIReleaseDeleted event.") -model ApiManagementApiReleaseDeletedEventData is BaseEvents.ApiManagementBase; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIReleaseUpdated event.") + model ApiManagementApiReleaseUpdatedEventData is BaseEvents.ApiManagementBase; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIReleaseDeleted event.") + model ApiManagementApiReleaseDeletedEventData is BaseEvents.ApiManagementBase; } -namespace BaseEvents{ +namespace BaseEvents { model ApiManagementBase { @doc("The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions//resourceGroups//Microsoft.ApiManagement/service///`") resourceUri?: string; } -} \ No newline at end of file +} diff --git a/specification/eventgrid/data-plane/cadl/AppConfiguration.cadl b/specification/eventgrid/data-plane/cadl/AppConfiguration.cadl index ac0734ccc0b9..2488d50e4363 100644 --- a/specification/eventgrid/data-plane/cadl/AppConfiguration.cadl +++ b/specification/eventgrid/data-plane/cadl/AppConfiguration.cadl @@ -1,4 +1,7 @@ -@service({title:"Schema of Azure App Configuration events published to Azure Event Grid",version:"2018-01-01"}) +@service({ + title: "Schema of Azure App Configuration events published to Azure Event Grid", + version: "2018-01-01", +}) @doc("Describes the schema of the Azure App Configuration events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") namespace AppConfiguration; @@ -8,13 +11,28 @@ enum AppConfigurationEventTypes { } model AppConfigurationBase { - @doc("The key used to identify the key-value that was {name}.", {name:TEventType}) + @doc( + "The key used to identify the key-value that was {name}.", + { + name: TEventType, + } + ) key?: string; - @doc("The label, if any, used to identify the key-value that was {name}.", {name:TEventType}) + @doc( + "The label, if any, used to identify the key-value that was {name}.", + { + name: TEventType, + } + ) label?: string; - @doc("The etag representing the key-value that was {name}.", {name:TEventType}) + @doc( + "The etag representing the key-value that was {name}.", + { + name: TEventType, + } + ) etag?: string; @doc("The sync token representing the server state after the event.") @@ -22,7 +40,9 @@ model AppConfigurationBase { } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.AppConfiguration.KeyValueModified event.") -model AppConfigurationKeyValueModifiedEventData is AppConfigurationBase{}; +model AppConfigurationKeyValueModifiedEventData + is AppConfigurationBase; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.AppConfiguration.KeyValueDeleted event.") -model AppConfigurationKeyValueDeletedEventData is AppConfigurationBase{}; +model AppConfigurationKeyValueDeletedEventData + is AppConfigurationBase; diff --git a/specification/eventgrid/data-plane/cadl/AzureCommunicationServices.cadl b/specification/eventgrid/data-plane/cadl/AzureCommunicationServices.cadl index 7171076398e9..80db802a3d87 100644 --- a/specification/eventgrid/data-plane/cadl/AzureCommunicationServices.cadl +++ b/specification/eventgrid/data-plane/cadl/AzureCommunicationServices.cadl @@ -1,6 +1,9 @@ import "./AzureCommunicationServicesCore.cadl"; -@service({title:"Schema of Azure Communication Services events published to Azure Event Grid",version:"2018-01-01"}) +@service({ + title: "Schema of Azure Communication Services events published to Azure Event Grid", + version: "2018-01-01", +}) @doc("Describes the schema of the Azure Communication Services events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") namespace AzureCommunicationServices; @@ -18,12 +21,14 @@ model AcsChatMessageBaseEventData { metadata?: Record; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageReceived event.") -model AcsChatMessageReceivedEventData extends AcsChatMessageEventBaseProperties { +model AcsChatMessageReceivedEventData + extends AcsChatMessageEventBaseProperties { ...AcsChatMessageBaseEventData; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageReceivedInThread event.") -model AcsChatMessageReceivedInThreadEventData extends AcsChatMessageEventInThreadBaseProperties { +model AcsChatMessageReceivedInThreadEventData + extends AcsChatMessageEventInThreadBaseProperties { ...AcsChatMessageBaseEventData; } @@ -36,7 +41,8 @@ model AcsChatMessageEditedEventData extends AcsChatMessageEventBaseProperties { } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageEditedInThread event.") -model AcsChatMessageEditedInThreadEventData extends AcsChatMessageEventInThreadBaseProperties { +model AcsChatMessageEditedInThreadEventData + extends AcsChatMessageEventInThreadBaseProperties { ...AcsChatMessageBaseEventData; @doc("The time at which the message was edited") @@ -50,7 +56,8 @@ model AcsChatMessageDeletedEventData extends AcsChatMessageEventBaseProperties { } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageDeletedInThread event.") -model AcsChatMessageDeletedInThreadEventData extends AcsChatMessageEventInThreadBaseProperties { +model AcsChatMessageDeletedInThreadEventData + extends AcsChatMessageEventInThreadBaseProperties { @doc("The time at which the message was deleted") deleteTime?: zonedDateTime; } @@ -67,12 +74,14 @@ model AcsChatThreadBaseEventData { } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadCreatedWithUser event.") -model AcsChatThreadCreatedWithUserEventData extends AcsChatThreadEventBaseProperties { +model AcsChatThreadCreatedWithUserEventData + extends AcsChatThreadEventBaseProperties { ...AcsChatThreadBaseEventData; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadCreated event.") -model AcsChatThreadCreatedEventData extends AcsChatThreadEventInThreadBaseProperties{ +model AcsChatThreadCreatedEventData + extends AcsChatThreadEventInThreadBaseProperties { ...AcsChatThreadBaseEventData; } @@ -85,14 +94,16 @@ model AcsChatThreadDeletedBaseEventData { } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadWithUserDeleted event.") -model AcsChatThreadWithUserDeletedEventData extends AcsChatThreadEventBaseProperties { +model AcsChatThreadWithUserDeletedEventData + extends AcsChatThreadEventBaseProperties { ...AcsChatThreadDeletedBaseEventData; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadDeleted event.") -model AcsChatThreadDeletedEventData extends AcsChatThreadEventInThreadBaseProperties{ +model AcsChatThreadDeletedEventData + extends AcsChatThreadEventInThreadBaseProperties { ...AcsChatThreadDeletedBaseEventData; -} +} model AcsChatThredPropertiesBaseEventData { @doc("The communication identifier of the user who updated the thread properties") @@ -106,12 +117,14 @@ model AcsChatThredPropertiesBaseEventData { } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadPropertiesUpdatedPerUser event.") -model AcsChatThreadPropertiesUpdatedPerUserEventData extends AcsChatThreadEventBaseProperties { +model AcsChatThreadPropertiesUpdatedPerUserEventData + extends AcsChatThreadEventBaseProperties { ...AcsChatThredPropertiesBaseEventData; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadPropertiesUpdated event.") -model AcsChatThreadPropertiesUpdatedEventData extends AcsChatThreadEventInThreadBaseProperties{ +model AcsChatThreadPropertiesUpdatedEventData + extends AcsChatThreadEventInThreadBaseProperties { ...AcsChatThredPropertiesBaseEventData; } @@ -127,12 +140,14 @@ model AcsChatParticipantBaseEventData { } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatParticipantAddedToThreadWithUser event.") -model AcsChatParticipantAddedToThreadWithUserEventData extends AcsChatThreadEventBaseProperties { +model AcsChatParticipantAddedToThreadWithUserEventData + extends AcsChatThreadEventBaseProperties { ...AcsChatParticipantBaseEventData; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatParticipantRemovedFromThreadWithUser event.") -model AcsChatParticipantRemovedFromThreadWithUserEventData extends AcsChatThreadEventBaseProperties { +model AcsChatParticipantRemovedFromThreadWithUserEventData + extends AcsChatThreadEventBaseProperties { @doc("The time at which the user was removed to the thread") time?: zonedDateTime; @@ -141,10 +156,11 @@ model AcsChatParticipantRemovedFromThreadWithUserEventData extends AcsChatThread @doc("The details of the user who was removed") participantRemoved?: AcsChatThreadParticipantProperties; -} +} @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadParticipantAdded event.") -model AcsChatParticipantAddedToThreadEventData extends AcsChatEventInThreadBaseProperties { +model AcsChatParticipantAddedToThreadEventData + extends AcsChatEventInThreadBaseProperties { ...AcsChatParticipantBaseEventData; @doc("The version of the thread") @@ -152,7 +168,8 @@ model AcsChatParticipantAddedToThreadEventData extends AcsChatEventInThreadBaseP } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadParticipantRemoved event.") -model AcsChatParticipantRemovedFromThreadEventData extends AcsChatEventInThreadBaseProperties { +model AcsChatParticipantRemovedFromThreadEventData + extends AcsChatEventInThreadBaseProperties { @doc("The time at which the user was removed to the thread") time?: zonedDateTime; @@ -167,7 +184,7 @@ model AcsChatParticipantRemovedFromThreadEventData extends AcsChatEventInThreadB } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.SMSDeliveryReportReceived event.") -model AcsSmsDeliveryReportReceivedEventData extends AcsSmsEventBaseProperties{ +model AcsSmsDeliveryReportReceivedEventData extends AcsSmsEventBaseProperties { @doc("Status of Delivery") deliveryStatus?: string; @@ -185,7 +202,7 @@ model AcsSmsDeliveryReportReceivedEventData extends AcsSmsEventBaseProperties{ } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.SMSReceived event.") -model AcsSmsReceivedEventData extends AcsSmsEventBaseProperties{ +model AcsSmsReceivedEventData extends AcsSmsEventBaseProperties { @doc("The SMS content") message?: string; @@ -194,21 +211,21 @@ model AcsSmsReceivedEventData extends AcsSmsEventBaseProperties{ } @knownValues(recordingContentTypeKV) -model recordingContentType is string {} +model recordingContentType is string; enum recordingContentTypeKV { AudioVideo, Audio, } @knownValues(recordingChannelTypeKV) -model recordingChannelType is string {} +model recordingChannelType is string; enum recordingChannelTypeKV { Mixed, Unmixed, } @knownValues(recordingFormatTypeKV) -model recordingFormatType is string {} +model recordingFormatType is string; enum recordingFormatTypeKV { Wav, Mp3, @@ -250,7 +267,8 @@ model AcsChatThreadEventBaseProperties extends AcsChatEventBaseProperties { } @doc("Schema of common properties of all chat thread events") -model AcsChatThreadEventInThreadBaseProperties extends AcsChatEventInThreadBaseProperties { +model AcsChatThreadEventInThreadBaseProperties + extends AcsChatEventInThreadBaseProperties { @doc("The original creation time of the thread") createTime?: zonedDateTime; @@ -280,7 +298,8 @@ model AcsChatMessageEventBaseProperties extends AcsChatEventBaseProperties { } @doc("Schema of common properties of all thread-level chat message events") -model AcsChatMessageEventInThreadBaseProperties extends AcsChatEventInThreadBaseProperties{ +model AcsChatMessageEventInThreadBaseProperties + extends AcsChatEventInThreadBaseProperties { @doc("The chat message id") messageId?: string; @@ -297,8 +316,8 @@ model AcsChatMessageEventInThreadBaseProperties extends AcsChatEventInThreadBase type?: string; @doc("The version of the message") - version?: int64; -} + version?: int64; +} @doc("Schema of common properties of all thread-level chat events") model AcsChatEventInThreadBaseProperties { @@ -313,7 +332,6 @@ model AcsChatEventInThreadBaseProperties { model AcsChatEventBaseProperties { @doc("The communication identifier of the target user") recipientCommunicationIdentifier?: CommunicationIdentifierModel; - ...AcsChatEventInThreadBaseProperties; } diff --git a/specification/eventgrid/data-plane/cadl/AzureCommunicationServicesCore.cadl b/specification/eventgrid/data-plane/cadl/AzureCommunicationServicesCore.cadl index 4bb58efd0045..a51e3ae774dc 100644 --- a/specification/eventgrid/data-plane/cadl/AzureCommunicationServicesCore.cadl +++ b/specification/eventgrid/data-plane/cadl/AzureCommunicationServicesCore.cadl @@ -1,48 +1,47 @@ @doc("Identifies a participant in Azure Communication services. A participant is, for example, a phone number or an Azure communication user. This model must be interpreted as a union: Apart from rawId, at most one further property may be set.") model CommunicationIdentifierModel { - @doc("Raw Id of the identifier. Optional in requests, required in responses.") - rawId?: string; + @doc("Raw Id of the identifier. Optional in requests, required in responses.") + rawId?: string; - @doc("The communication user.") - communicationUser?: CommunicationUserIdentifierModel; + @doc("The communication user.") + communicationUser?: CommunicationUserIdentifierModel; - @doc("The phone number.") - phoneNumber?: PhoneNumberIdentifierModel; + @doc("The phone number.") + phoneNumber?: PhoneNumberIdentifierModel; - @doc("The Microsoft Teams user.") - microsoftTeamsUser?: MicrosoftTeamsUserIdentifierModel; + @doc("The Microsoft Teams user.") + microsoftTeamsUser?: MicrosoftTeamsUserIdentifierModel; } - -@doc ("A Microsoft Teams user.") +@doc("A Microsoft Teams user.") model MicrosoftTeamsUserIdentifierModel { - @doc("The Id of the Microsoft Teams user. If not anonymous, this is the AAD object Id of the user.") - userId: string; + @doc("The Id of the Microsoft Teams user. If not anonymous, this is the AAD object Id of the user.") + userId: string; - @doc("True if the Microsoft Teams user is anonymous. By default false if missing.") - isAnonymous?: boolean; + @doc("True if the Microsoft Teams user is anonymous. By default false if missing.") + isAnonymous?: boolean; - @doc("The cloud that the Microsoft Teams user belongs to. By default 'public' if missing.") - cloud?: CommunicationCloudEnvironmentModel; + @doc("The cloud that the Microsoft Teams user belongs to. By default 'public' if missing.") + cloud?: CommunicationCloudEnvironmentModel; } -@doc ("A phone number.") +@doc("A phone number.") model PhoneNumberIdentifierModel { - @doc("The phone number in E.164 format.") - value: string; + @doc("The phone number in E.164 format.") + value: string; } -@doc ("A user that got created with an Azure Communication Services resource.") +@doc("A user that got created with an Azure Communication Services resource.") model CommunicationUserIdentifierModel { - @doc("The Id of the communication user.") - id: string; + @doc("The Id of the communication user.") + id: string; } @knownValues(CommunicationCloudEnvironmentModelKV) @doc("The cloud that the identifier belongs to.") -model CommunicationCloudEnvironmentModel is string {} +model CommunicationCloudEnvironmentModel is string; enum CommunicationCloudEnvironmentModelKV { public, dod, - gcch + gcch, } diff --git a/specification/eventgrid/data-plane/cadl/ContainerRegistry.cadl b/specification/eventgrid/data-plane/cadl/ContainerRegistry.cadl index e099d8ba8a4d..9a8aaf5dbfb3 100644 --- a/specification/eventgrid/data-plane/cadl/ContainerRegistry.cadl +++ b/specification/eventgrid/data-plane/cadl/ContainerRegistry.cadl @@ -1,152 +1,163 @@ -@service({title:"Schema of Azure Container Registry events published to Azure Event Grid",version:"2018-01-01"}) +@service({ + title: "Schema of Azure Container Registry events published to Azure Event Grid", + version: "2018-01-01", +}) @doc("Describes the schema of the Azure Container Registry events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") -namespace ContainerRegistry{ +namespace ContainerRegistry { + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ContainerRegistry.ImagePushed event.") + model ContainerRegistryImagePushedEventData + extends ContainerRegistryEventData {} -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.ContainerRegistry.ImagePushed event.") -model ContainerRegistryImagePushedEventData extends ContainerRegistryEventData{}; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ContainerRegistry.ImageDeleted event.") + model ContainerRegistryImageDeletedEventData + extends ContainerRegistryEventData {} -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.ContainerRegistry.ImageDeleted event.") -model ContainerRegistryImageDeletedEventData extends ContainerRegistryEventData{}; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ContainerRegistry.ChartPushed event.") + model ContainerRegistryChartPushedEventData + extends ContainerRegistryArtifactEventData {} -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.ContainerRegistry.ChartPushed event.") -model ContainerRegistryChartPushedEventData extends ContainerRegistryArtifactEventData{}; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ContainerRegistry.ChartDeleted event.") + model ContainerRegistryChartDeletedEventData + extends ContainerRegistryArtifactEventData {} -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.ContainerRegistry.ChartDeleted event.") -model ContainerRegistryChartDeletedEventData extends ContainerRegistryArtifactEventData{}; + model ContainerRegistryBaseEventData { + @doc("The event ID.") + id?: string; -model ContainerRegistryBaseEventData { - @doc("The event ID.") - id?: string; + @doc("The time at which the event occurred.") + timestamp?: zonedDateTime; - @doc("The time at which the event occurred.") - timestamp?: zonedDateTime; + @doc("The action that encompasses the provided event.") + action?: string; - @doc("The action that encompasses the provided event.") - action?: string; + @doc("The location of the event.") + location?: string; + } - @doc("The location of the event.") - location?: string; -} + @doc("The content of the event request message.") + model ContainerRegistryEventData { + ...ContainerRegistryBaseEventData; -@doc("The content of the event request message.") -model ContainerRegistryEventData { + @doc("The target of the event.") + target?: ContainerRegistryEventTarget; - ...ContainerRegistryBaseEventData; + @doc("The request that generated the event.") + request?: ContainerRegistryEventRequest; - @doc("The target of the event.") - target?: ContainerRegistryEventTarget; + @doc("The agent that initiated the event. For most situations, this could be from the authorization context of the request.") + actor?: ContainerRegistryEventActor; - @doc("The request that generated the event.") - request?: ContainerRegistryEventRequest; + @doc("The registry node that generated the event. Put differently, while the actor initiates the event, the source generates it.") + source?: ContainerRegistryEventSource; - @doc("The agent that initiated the event. For most situations, this could be from the authorization context of the request.") - actor?: ContainerRegistryEventActor; + @doc("The connected registry information if the event is generated by a connected registry.") + connectedRegistry?: ContainerRegistryEventConnectedRegistry; + } - @doc("The registry node that generated the event. Put differently, while the actor initiates the event, the source generates it.") - source?: ContainerRegistryEventSource; + @doc("The content of the event request message.") + model ContainerRegistryArtifactEventData { + ...ContainerRegistryBaseEventData; - @doc("The connected registry information if the event is generated by a connected registry.") - connectedRegistry?: ContainerRegistryEventConnectedRegistry; -} + @doc("The target of the event.") + target?: ContainerRegistryArtifactEventTarget; -@doc("The content of the event request message.") -model ContainerRegistryArtifactEventData { - ...ContainerRegistryBaseEventData; + @doc("The connected registry information if the event is generated by a connected registry.") + connectedRegistry?: ContainerRegistryEventConnectedRegistry; + } @doc("The target of the event.") - target?: ContainerRegistryArtifactEventTarget; - - @doc("The connected registry information if the event is generated by a connected registry.") - connectedRegistry?: ContainerRegistryEventConnectedRegistry; -} - -@doc("The target of the event.") -model ContainerRegistryEventTarget is BaseEvent.ContainerRegistryBaseEventTarget< - "The MIME type of the referenced object.", - "The number of bytes of the content. Same as Length field.", - "The digest of the content, as defined by the Registry V2 HTTP API Specification.", - "The repository name.", - "The tag name." - > { - @doc("The number of bytes of the content. Same as Size field.") - length?: int64; - - @doc("The direct URL to the content.") - url?: string; -} - -@doc("The target of the event.") -model ContainerRegistryArtifactEventTarget is BaseEvent.ContainerRegistryBaseEventTarget< - "The MIME type of the artifact.", - "The size in bytes of the artifact.", - "The digest of the artifact.", - "The repository name of the artifact.", - "The tag of the artifact." + model ContainerRegistryEventTarget + is BaseEvent.ContainerRegistryBaseEventTarget< + "The MIME type of the referenced object.", + "The number of bytes of the content. Same as Length field.", + "The digest of the content, as defined by the Registry V2 HTTP API Specification.", + "The repository name.", + "The tag name." > { + @doc("The number of bytes of the content. Same as Size field.") + length?: int64; - @doc("The name of the artifact.") - name?: string; + @doc("The direct URL to the content.") + url?: string; + } - @doc("The version of the artifact.") - version?: string; -} + @doc("The target of the event.") + model ContainerRegistryArtifactEventTarget + is BaseEvent.ContainerRegistryBaseEventTarget< + "The MIME type of the artifact.", + "The size in bytes of the artifact.", + "The digest of the artifact.", + "The repository name of the artifact.", + "The tag of the artifact." + > { + @doc("The name of the artifact.") + name?: string; -@doc("The request that generated the event.") -model ContainerRegistryEventRequest { - @doc("The ID of the request that initiated the event.") - id?: string; + @doc("The version of the artifact.") + version?: string; + } - @doc("The IP or hostname and possibly port of the client connection that initiated the event. This is the RemoteAddr from the standard http request.") - addr?: string; + @doc("The request that generated the event.") + model ContainerRegistryEventRequest { + @doc("The ID of the request that initiated the event.") + id?: string; - @doc("The externally accessible hostname of the registry instance, as specified by the http host header on incoming requests.") - host?: string; + @doc("The IP or hostname and possibly port of the client connection that initiated the event. This is the RemoteAddr from the standard http request.") + addr?: string; - @doc("The request method that generated the event.") - method?: string; + @doc("The externally accessible hostname of the registry instance, as specified by the http host header on incoming requests.") + host?: string; - @doc("The user agent header of the request.") - useragent?: string; -} + @doc("The request method that generated the event.") + method?: string; -@doc("The agent that initiated the event. For most situations, this could be from the authorization context of the request.") -model ContainerRegistryEventActor { - @doc("The subject or username associated with the request context that generated the event.") - name?: string; -} + @doc("The user agent header of the request.") + useragent?: string; + } -@doc("The registry node that generated the event. Put differently, while the actor initiates the event, the source generates it.") -model ContainerRegistryEventSource { - @doc("The IP or hostname and the port of the registry node that generated the event. Generally, this will be resolved by os.Hostname() along with the running port.") - addr?: string; + @doc("The agent that initiated the event. For most situations, this could be from the authorization context of the request.") + model ContainerRegistryEventActor { + @doc("The subject or username associated with the request context that generated the event.") + name?: string; + } - @doc("The running instance of an application. Changes after each restart.") - instanceID?: string; -} + @doc("The registry node that generated the event. Put differently, while the actor initiates the event, the source generates it.") + model ContainerRegistryEventSource { + @doc("The IP or hostname and the port of the registry node that generated the event. Generally, this will be resolved by os.Hostname() along with the running port.") + addr?: string; -@doc("The connected registry information if the event is generated by a connected registry.") -model ContainerRegistryEventConnectedRegistry { - @doc("The name of the connected registry that generated this event.") - name?: string; -} + @doc("The running instance of an application. Changes after each restart.") + instanceID?: string; + } + @doc("The connected registry information if the event is generated by a connected registry.") + model ContainerRegistryEventConnectedRegistry { + @doc("The name of the connected registry that generated this event.") + name?: string; + } } -namespace BaseEvent{ - model ContainerRegistryBaseEventTarget { +namespace BaseEvent { + model ContainerRegistryBaseEventTarget< + TmediaType extends string, + Tsize extends string, + Tdigest extends string, + Trepository extends string, + Ttag extends string + > { @doc(TmediaType) mediaType?: string; - + @doc(Tsize) size?: int64; - + @doc(Tdigest) digest?: string; - + @doc(Trepository) repository?: string; - + @doc(Ttag) tag?: string; } -} \ No newline at end of file +} diff --git a/specification/eventgrid/data-plane/cadl/ContainerService.cadl b/specification/eventgrid/data-plane/cadl/ContainerService.cadl index b8c9c5a2635c..d539bc8775e0 100644 --- a/specification/eventgrid/data-plane/cadl/ContainerService.cadl +++ b/specification/eventgrid/data-plane/cadl/ContainerService.cadl @@ -1,4 +1,7 @@ -@service({title:"Schema of Azure Kubernetes Service events published to Azure Event Grid",version:"2018-01-01"}) +@service({ + title: "Schema of Azure Kubernetes Service events published to Azure Event Grid", + version: "2018-01-01", +}) @doc("Describes the schema of the Azure Kubernetes Service events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent") namespace ContainerService; diff --git a/specification/eventgrid/data-plane/cadl/EventGrid.cadl b/specification/eventgrid/data-plane/cadl/EventGrid.cadl index c06cc9b6bee9..266ebe67798b 100644 --- a/specification/eventgrid/data-plane/cadl/EventGrid.cadl +++ b/specification/eventgrid/data-plane/cadl/EventGrid.cadl @@ -3,7 +3,18 @@ import "@cadl-lang/versioning"; import "@azure-tools/cadl-providerhub"; import "@azure-tools/cadl-azure-core"; -@service({title:"EventGridClient", version: "2018-01-01"}) +@service({ + title: "EventGridClient", + version: "2018-01-01", +}) +@server( + "{topicHostname}", + "example", + { + @doc("The host name of the topic, e.g. topic1.westus2-1.eventgrid.azure.net") + topicHostname: string, + } +) @doc("Azure EventGrid Client") namespace Microsoft.EventGrid; @@ -27,7 +38,7 @@ model EventGridEvent { @doc("Event data specific to the event type.") data: object; - + @doc("The type of the event that occurred.") eventType: string; @@ -40,7 +51,6 @@ model EventGridEvent { @doc("The schema version of the data object.") dataVersion: string; - } //TODO: how to get additional properties true? @@ -57,7 +67,7 @@ model CloudEventEvent { @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; @@ -75,11 +85,10 @@ model CloudEventEvent { @doc("This describes the subject of the event in the context of the event producer (identified by source).") subject?: string; - } @doc("Properties of an event published to an Event Grid topic using a custom schema") -model CustomEventEvent {}; +model CustomEventEvent {} @doc("Schema of the Data property of an EventGridEvent for a Microsoft.EventGrid.SubscriptionValidationEvent event.") model SubscriptionValidationEventData { diff --git a/specification/eventgrid/data-plane/cadl/EventHub.cadl b/specification/eventgrid/data-plane/cadl/EventHub.cadl index 84e6e49e1e15..91cfd50c72d1 100644 --- a/specification/eventgrid/data-plane/cadl/EventHub.cadl +++ b/specification/eventgrid/data-plane/cadl/EventHub.cadl @@ -1,4 +1,7 @@ -@service({title:"Schema of Azure EventHub events published to Azure Event Grid", version: "2018-01-01"}) +@service({ + title: "Schema of Azure EventHub events published to Azure Event Grid", + version: "2018-01-01", +}) @doc("Describes the schema of the Azure EventHub events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") namespace EventHub; diff --git a/specification/eventgrid/data-plane/cadl/HealthcareApis.cadl b/specification/eventgrid/data-plane/cadl/HealthcareApis.cadl index 3395dbd0d66c..6c67332049d1 100644 --- a/specification/eventgrid/data-plane/cadl/HealthcareApis.cadl +++ b/specification/eventgrid/data-plane/cadl/HealthcareApis.cadl @@ -1,79 +1,81 @@ -@service({title:"Schema of Azure HealthcareApis events published to Azure Event Grid.",version:"2018-01-01"}) +@service({ + title: "Schema of Azure HealthcareApis events published to Azure Event Grid.", + version: "2018-01-01", +}) @doc("Describes the schema of the Azure HealthcareApis events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") -namespace HealthCareApis{ - -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.FhirResourceCreated event.") -model HealthcareFhirResourceCreatedEventData is BaseEvent.HealthcareFhirResourceBaseEventData{ - @doc("Type of HL7 FHIR resource.") - resourceType?: HealthcareFhirResourceType; -} - -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.FhirResourceUpdated event.") -model HealthcareFhirResourceUpdatedEventData is BaseEvent.HealthcareFhirResourceBaseEventData{ - @doc("Type of HL7 FHIR resource.") - resourceType?: HealthcareFhirResourceType; -} - -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.FhirResourceDeleted event.") -model HealthcareFhirResourceDeletedEventData is BaseEvent.HealthcareFhirResourceBaseEventData{ - @doc("Type of HL7 FHIR resource.") - resourceType?: HealthcareFhirResourceType; -} +namespace HealthCareApis { + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.FhirResourceCreated event.") + model HealthcareFhirResourceCreatedEventData + is BaseEvent.HealthcareFhirResourceBaseEventData { + @doc("Type of HL7 FHIR resource.") + resourceType?: HealthcareFhirResourceType; + } -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.DicomImageCreated event.") -model HealthcareDicomImageCreatedEventData{ - @doc("Unique identifier for the Study") - imageStudyInstanceUid?: string; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.FhirResourceUpdated event.") + model HealthcareFhirResourceUpdatedEventData + is BaseEvent.HealthcareFhirResourceBaseEventData { + @doc("Type of HL7 FHIR resource.") + resourceType?: HealthcareFhirResourceType; + } - @doc("Unique identifier for the Series") - imageSeriesInstanceUid?: string; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.FhirResourceDeleted event.") + model HealthcareFhirResourceDeletedEventData + is BaseEvent.HealthcareFhirResourceBaseEventData { + @doc("Type of HL7 FHIR resource.") + resourceType?: HealthcareFhirResourceType; + } - @doc("Unique identifier for the DICOM Image",) - imageSopInstanceUid?: string; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.DicomImageCreated event.") + model HealthcareDicomImageCreatedEventData { + @doc("Unique identifier for the Study") + imageStudyInstanceUid?: string; - @doc("Domain name of the DICOM account for this image.") - serviceHostName?: string; + @doc("Unique identifier for the Series") + imageSeriesInstanceUid?: string; - @doc("Sequence number of the DICOM Service within Azure Health Data Services. It is unique for every image creation and deletion within the service.") - sequenceNumber?: int64; -} + @doc("Unique identifier for the DICOM Image") + imageSopInstanceUid?: string; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.DicomImageDeleted event.") -model HealthcareDicomImageDeletedEventData{ - @doc("Unique identifier for the Study") - imageStudyInstanceUid?: string; + @doc("Domain name of the DICOM account for this image.") + serviceHostName?: string; - @doc("Unique identifier for the Series") - imageSeriesInstanceUid?: string; + @doc("Sequence number of the DICOM Service within Azure Health Data Services. It is unique for every image creation and deletion within the service.") + sequenceNumber?: int64; + } - @doc("Unique identifier for the DICOM Image",) - imageSopInstanceUid?: string; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.DicomImageDeleted event.") + model HealthcareDicomImageDeletedEventData { + @doc("Unique identifier for the Study") + imageStudyInstanceUid?: string; - @doc("Host name of the DICOM account for this image.") - serviceHostName?: string; + @doc("Unique identifier for the Series") + imageSeriesInstanceUid?: string; - @doc("Sequence number of the DICOM Service within Azure Health Data Services. It is unique for every image creation and deletion within the service.") - sequenceNumber?: int64; + @doc("Unique identifier for the DICOM Image") + imageSopInstanceUid?: string; -} + @doc("Host name of the DICOM account for this image.") + serviceHostName?: string; -// model HealthcareFhirResourceType is string {} + @doc("Sequence number of the DICOM Service within Azure Health Data Services. It is unique for every image creation and deletion within the service.") + sequenceNumber?: int64; + } -@knownValues(BaseEvent.HealthcareFhirResourceTypeKV) -@doc("Schema of FHIR resource type enumeration.") -model HealthcareFhirResourceType is string; + // model HealthcareFhirResourceType is string {} + @knownValues(BaseEvent.HealthcareFhirResourceTypeKV) + @doc("Schema of FHIR resource type enumeration.") + model HealthcareFhirResourceType is string; } -namespace BaseEvent{ +namespace BaseEvent { model HealthcareFhirResourceBaseEventData { - @doc("Domain name of FHIR account for this resource.") resourceFhirAccount?: string; - + @doc("Id of HL7 FHIR resource.") resourceFhirId?: string; - + @doc("VersionId of HL7 FHIR resource. It changes when the resource is created, updated, or deleted(soft-deletion).") resourceVersionId?: int64; } @@ -81,327 +83,485 @@ namespace BaseEvent{ enum HealthcareFhirResourceTypeKV { @doc("The FHIR resource type defined in STU3 and R4.") Account, + @doc("The FHIR resource type defined in STU3 and R4.") ActivityDefinition, + @doc("The FHIR resource type defined in STU3 and R4.") AdverseEvent, + @doc("The FHIR resource type defined in STU3 and R4.") AllergyIntolerance, + @doc("The FHIR resource type defined in STU3 and R4.") Appointment, + @doc("The FHIR resource type defined in STU3 and R4.") AppointmentResponse, + @doc("The FHIR resource type defined in STU3 and R4.") AuditEvent, + @doc("The FHIR resource type defined in STU3 and R4.") Basic, + @doc("The FHIR resource type defined in STU3 and R4.") Binary, + @doc("The FHIR resource type defined in R4.") BiologicallyDerivedProduct, + @doc("The FHIR resource type defined in STU3.") BodySite, + @doc("The FHIR resource type defined in R4.") BodyStructure, + @doc("The FHIR resource type defined in STU3 and R4.") Bundle, + @doc("The FHIR resource type defined in STU3 and R4.") CapabilityStatement, + @doc("The FHIR resource type defined in STU3 and R4.") CarePlan, + @doc("The FHIR resource type defined in STU3 and R4.") CareTeam, + @doc("The FHIR resource type defined in R4.") CatalogEntry, + @doc("The FHIR resource type defined in STU3 and R4.") ChargeItem, + @doc("The FHIR resource type defined in R4.") ChargeItemDefinition, + @doc("The FHIR resource type defined in STU3 and R4.") Claim, + @doc("The FHIR resource type defined in STU3 and R4.") ClaimResponse, + @doc("The FHIR resource type defined in STU3 and R4.") ClinicalImpression, + @doc("The FHIR resource type defined in STU3 and R4.") CodeSystem, + @doc("The FHIR resource type defined in STU3 and R4.") Communication, + @doc("The FHIR resource type defined in STU3 and R4.") CommunicationRequest, + @doc("The FHIR resource type defined in STU3 and R4.") CompartmentDefinition, + @doc("The FHIR resource type defined in STU3 and R4.") Composition, + @doc("The FHIR resource type defined in STU3 and R4.") ConceptMap, + @doc("The FHIR resource type defined in STU3 and R4.") Condition, + @doc("The FHIR resource type defined in STU3 and R4.") Consent, + @doc("The FHIR resource type defined in STU3 and R4.") Contract, + @doc("The FHIR resource type defined in STU3 and R4.") Coverage, + @doc("The FHIR resource type defined in R4.") CoverageEligibilityRequest, + @doc("The FHIR resource type defined in R4.") CoverageEligibilityResponse, + @doc("The FHIR resource type defined in STU3.") DataElement, + @doc("The FHIR resource type defined in STU3 and R4.") DetectedIssue, + @doc("The FHIR resource type defined in STU3 and R4.") Device, + @doc("The FHIR resource type defined in STU3.") DeviceComponent, + @doc("The FHIR resource type defined in R4.") DeviceDefinition, + @doc("The FHIR resource type defined in STU3 and R4.") DeviceMetric, + @doc("The FHIR resource type defined in STU3 and R4.") DeviceRequest, + @doc("The FHIR resource type defined in STU3 and R4.") DeviceUseStatement, + @doc("The FHIR resource type defined in STU3 and R4.") DiagnosticReport, + @doc("The FHIR resource type defined in STU3 and R4.") DocumentManifest, + @doc("The FHIR resource type defined in STU3 and R4.") DocumentReference, + @doc("The FHIR resource type defined in STU3 and R4.") DomainResource, + @doc("The FHIR resource type defined in R4.") EffectEvidenceSynthesis, + @doc("The FHIR resource type defined in STU3.") EligibilityRequest, + @doc("The FHIR resource type defined in STU3.") EligibilityResponse, + @doc("The FHIR resource type defined in STU3 and R4.") Encounter, + @doc("The FHIR resource type defined in STU3 and R4.") Endpoint, + @doc("The FHIR resource type defined in STU3 and R4.") EnrollmentRequest, + @doc("The FHIR resource type defined in STU3 and R4.") EnrollmentResponse, + @doc("The FHIR resource type defined in STU3 and R4.") EpisodeOfCare, + @doc("The FHIR resource type defined in R4.") EventDefinition, + @doc("The FHIR resource type defined in R4.") Evidence, + @doc("The FHIR resource type defined in R4.") EvidenceVariable, + @doc("The FHIR resource type defined in R4.") ExampleScenario, + @doc("The FHIR resource type defined in STU3.") ExpansionProfile, + @doc("The FHIR resource type defined in STU3 and R4.") ExplanationOfBenefit, + @doc("The FHIR resource type defined in STU3 and R4.") FamilyMemberHistory, + @doc("The FHIR resource type defined in STU3 and R4.") Flag, + @doc("The FHIR resource type defined in STU3 and R4.") Goal, + @doc("The FHIR resource type defined in STU3 and R4.") GraphDefinition, + @doc("The FHIR resource type defined in STU3 and R4.") Group, + @doc("The FHIR resource type defined in STU3 and R4.") GuidanceResponse, + @doc("The FHIR resource type defined in STU3 and R4.") HealthcareService, + @doc("The FHIR resource type defined in STU3.") ImagingManifest, + @doc("The FHIR resource type defined in STU3 and R4.") ImagingStudy, + @doc("The FHIR resource type defined in STU3 and R4.") Immunization, + @doc("The FHIR resource type defined in R4.") ImmunizationEvaluation, + @doc("The FHIR resource type defined in STU3 and R4.") ImmunizationRecommendation, + @doc("The FHIR resource type defined in STU3 and R4.") ImplementationGuide, + @doc("The FHIR resource type defined in R4.") InsurancePlan, + @doc("The FHIR resource type defined in R4.") Invoice, + @doc("The FHIR resource type defined in STU3 and R4.") Library, + @doc("The FHIR resource type defined in STU3 and R4.") Linkage, + @doc("The FHIR resource type defined in STU3 and R4.") List, + @doc("The FHIR resource type defined in STU3 and R4.") Location, + @doc("The FHIR resource type defined in STU3 and R4.") Measure, + @doc("The FHIR resource type defined in STU3 and R4.") MeasureReport, + @doc("The FHIR resource type defined in STU3 and R4.") Media, + @doc("The FHIR resource type defined in STU3 and R4.") Medication, + @doc("The FHIR resource type defined in STU3 and R4.") MedicationAdministration, + @doc("The FHIR resource type defined in STU3 and R4.") MedicationDispense, + @doc("The FHIR resource type defined in R4.") MedicationKnowledge, + @doc("The FHIR resource type defined in STU3 and R4.") MedicationRequest, + @doc("The FHIR resource type defined in STU3 and R4.") MedicationStatement, + @doc("The FHIR resource type defined in R4.") MedicinalProduct, + @doc("The FHIR resource type defined in R4.") MedicinalProductAuthorization, + @doc("The FHIR resource type defined in R4.") MedicinalProductContraindication, + @doc("The FHIR resource type defined in R4.") MedicinalProductIndication, + @doc("The FHIR resource type defined in R4.") MedicinalProductIngredient, + @doc("The FHIR resource type defined in R4.") MedicinalProductInteraction, + @doc("The FHIR resource type defined in R4.") MedicinalProductManufactured, + @doc("The FHIR resource type defined in R4.") MedicinalProductPackaged, + @doc("The FHIR resource type defined in R4.") MedicinalProductPharmaceutical, + @doc("The FHIR resource type defined in R4.") MedicinalProductUndesirableEffect, + @doc("The FHIR resource type defined in STU3 and R4.") MessageDefinition, + @doc("The FHIR resource type defined in STU3 and R4.") MessageHeader, + @doc("The FHIR resource type defined in R4.") MolecularSequence, + @doc("The FHIR resource type defined in STU3 and R4.") NamingSystem, + @doc("The FHIR resource type defined in STU3 and R4.") NutritionOrder, + @doc("The FHIR resource type defined in STU3 and R4.") Observation, + @doc("The FHIR resource type defined in R4.") ObservationDefinition, + @doc("The FHIR resource type defined in STU3 and R4.") OperationDefinition, + @doc("The FHIR resource type defined in STU3 and R4.") OperationOutcome, + @doc("The FHIR resource type defined in STU3 and R4.") Organization, + @doc("The FHIR resource type defined in R4.") OrganizationAffiliation, + @doc("The FHIR resource type defined in STU3 and R4.") Parameters, + @doc("The FHIR resource type defined in STU3 and R4.") Patient, + @doc("The FHIR resource type defined in STU3 and R4.") PaymentNotice, + @doc("The FHIR resource type defined in STU3 and R4.") PaymentReconciliation, + @doc("The FHIR resource type defined in STU3 and R4.") Person, + @doc("The FHIR resource type defined in STU3 and R4.") PlanDefinition, + @doc("The FHIR resource type defined in STU3 and R4.") Practitioner, + @doc("The FHIR resource type defined in STU3 and R4.") PractitionerRole, + @doc("The FHIR resource type defined in STU3 and R4.") Procedure, + @doc("The FHIR resource type defined in STU3.") ProcedureRequest, + @doc("The FHIR resource type defined in STU3.") ProcessRequest, + @doc("The FHIR resource type defined in STU3.") ProcessResponse, + @doc("The FHIR resource type defined in STU3 and R4.") Provenance, + @doc("The FHIR resource type defined in STU3 and R4.") Questionnaire, + @doc("The FHIR resource type defined in STU3 and R4.") QuestionnaireResponse, + @doc("The FHIR resource type defined in STU3.") ReferralRequest, + @doc("The FHIR resource type defined in STU3 and R4.") RelatedPerson, + @doc("The FHIR resource type defined in STU3 and R4.") RequestGroup, + @doc("The FHIR resource type defined in R4.") ResearchDefinition, + @doc("The FHIR resource type defined in R4.") ResearchElementDefinition, + @doc("The FHIR resource type defined in STU3 and R4.") ResearchStudy, + @doc("The FHIR resource type defined in STU3 and R4.") ResearchSubject, + @doc("The FHIR resource type defined in STU3 and R4.") Resource, + @doc("The FHIR resource type defined in STU3 and R4.") RiskAssessment, + @doc("The FHIR resource type defined in R4.") RiskEvidenceSynthesis, + @doc("The FHIR resource type defined in STU3 and R4.") Schedule, + @doc("The FHIR resource type defined in STU3 and R4.") SearchParameter, + @doc("The FHIR resource type defined in STU3.") Sequence, + @doc("The FHIR resource type defined in STU3.") ServiceDefinition, + @doc("The FHIR resource type defined in R4.") ServiceRequest, + @doc("The FHIR resource type defined in STU3 and R4.") Slot, + @doc("The FHIR resource type defined in STU3 and R4.") Specimen, + @doc("The FHIR resource type defined in R4.") SpecimenDefinition, + @doc("The FHIR resource type defined in STU3 and R4.") StructureDefinition, + @doc("The FHIR resource type defined in STU3 and R4.") StructureMap, + @doc("The FHIR resource type defined in STU3 and R4.") Subscription, + @doc("The FHIR resource type defined in STU3 and R4.") Substance, + @doc("The FHIR resource type defined in R4.") SubstanceNucleicAcid, + @doc("The FHIR resource type defined in R4.") SubstancePolymer, + @doc("The FHIR resource type defined in R4.") SubstanceProtein, + @doc("The FHIR resource type defined in R4.") SubstanceReferenceInformation, + @doc("The FHIR resource type defined in R4.") SubstanceSourceMaterial, + @doc("The FHIR resource type defined in R4.") SubstanceSpecification, + @doc("The FHIR resource type defined in STU3 and R4.") SupplyDelivery, + @doc("The FHIR resource type defined in STU3 and R4.") SupplyRequest, + @doc("The FHIR resource type defined in STU3 and R4.") Task, + @doc("The FHIR resource type defined in R4.") TerminologyCapabilities, + @doc("The FHIR resource type defined in STU3 and R4.") TestReport, + @doc("The FHIR resource type defined in STU3 and R4.") TestScript, + @doc("The FHIR resource type defined in STU3 and R4.") ValueSet, + @doc("The FHIR resource type defined in R4.") VerificationResult, + @doc("The FHIR resource type defined in STU3 and R4.") VisionPrescription, } - - -} \ No newline at end of file +} diff --git a/specification/eventgrid/data-plane/cadl/IotHub.cadl b/specification/eventgrid/data-plane/cadl/IotHub.cadl index f46d77fc1b22..b0c7459e33c1 100644 --- a/specification/eventgrid/data-plane/cadl/IotHub.cadl +++ b/specification/eventgrid/data-plane/cadl/IotHub.cadl @@ -1,4 +1,7 @@ -@service({title:"Schema of Azure IoT Hub events published to Azure Event Grid", version:"2018-01-01"}) +@service({ + title: "Schema of Azure IoT Hub events published to Azure Event Grid", + version: "2018-01-01", +}) @doc("Describes the schema of the Azure IoT Hub events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") namespace IoTHub; @@ -33,8 +36,8 @@ model DeviceTwinInfo { @doc("The ISO8601 timestamp of the last activity.") lastActivityTime?: string; - //TODO: something here needs to change + @doc("Properties JSON element.") properties?: PropertiesJson; @@ -46,8 +49,8 @@ model DeviceTwinInfo { @doc("An integer that is incremented by one each time the device twin is updated.") version?: integer; - //TODO: also here + @doc("The thumbprint is a unique value for the x509 certificate, commonly used to find a particular certificate in a certificate store. The thumbprint is dynamically generated using the SHA1 algorithm, and does not physically exist in the certificate.") x509Thumbprint?: ThumbPrintValue; } @@ -101,35 +104,34 @@ model DeviceConnectionStateEventInfo { } @doc("Event data for Microsoft.Devices.DeviceCreated event.") -model IotHubDeviceCreatedEventData extends DeviceLifeCycleEventProperties{}; +model IotHubDeviceCreatedEventData extends DeviceLifeCycleEventProperties {} @doc("Event data for Microsoft.Devices.DeviceDeleted event.") -model IotHubDeviceDeletedEventData extends DeviceLifeCycleEventProperties{}; +model IotHubDeviceDeletedEventData extends DeviceLifeCycleEventProperties {} @doc("Event data for Microsoft.Devices.DeviceConnected event.") -model IotHubDeviceConnectedEventData extends DeviceConnectionStateEventProperties{}; +model IotHubDeviceConnectedEventData + extends DeviceConnectionStateEventProperties {} @doc("Event data for Microsoft.Devices.DeviceDisconnected event.") -model IotHubDeviceDisconnectedEventData extends DeviceConnectionStateEventProperties{}; +model IotHubDeviceDisconnectedEventData + extends DeviceConnectionStateEventProperties {} @doc("Event data for Microsoft.Devices.DeviceTelemetry event.") -model IotHubDeviceTelemetryEventData extends DeviceTelemetryEventProperties{}; +model IotHubDeviceTelemetryEventData extends DeviceTelemetryEventProperties {} +model PropertiesJson { + @doc("A portion of the properties that can be written only by the application back-end, and read by the device.") + desired?: IoTHub.DeviceTwinProperties; - -model PropertiesJson{ - @doc("A portion of the properties that can be written only by the application back-end, and read by the device.") - desired?:IoTHub.DeviceTwinProperties; - - @doc("A portion of the properties that can be written only by the device, and read by the application back-end.") - reported?:IoTHub.DeviceTwinProperties + @doc("A portion of the properties that can be written only by the device, and read by the application back-end.") + reported?: IoTHub.DeviceTwinProperties; } -model ThumbPrintValue{ - @doc("Primary thumbprint for the x509 certificate.") - primaryThumbprint?:string; +model ThumbPrintValue { + @doc("Primary thumbprint for the x509 certificate.") + primaryThumbprint?: string; - @doc("Secondary thumbprint for the x509 certificate.") - secondaryThumbprint?:string; + @doc("Secondary thumbprint for the x509 certificate.") + secondaryThumbprint?: string; } - diff --git a/specification/eventgrid/data-plane/cadl/KeyVault.cadl b/specification/eventgrid/data-plane/cadl/KeyVault.cadl index dc467f7cf310..22e135d2b14f 100644 --- a/specification/eventgrid/data-plane/cadl/KeyVault.cadl +++ b/specification/eventgrid/data-plane/cadl/KeyVault.cadl @@ -1,59 +1,66 @@ -@service({title:"Schema of Azure Key Vault events published to Azure Event Grid", version:"2018-01-01"}) +@service({ + title: "Schema of Azure Key Vault events published to Azure Event Grid", + version: "2018-01-01", +}) @doc("Describes the schema of the Azure Key Vault events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") -namespace KeyVault{ +namespace KeyVault { + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.CertificateNewVersionCreated event.") + model KeyVaultCertificateNewVersionCreatedEventData + is BaseEvents.KeyVaultCertificateBase; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.CertificateNewVersionCreated event.") -model KeyVaultCertificateNewVersionCreatedEventData is BaseEvents.KeyVaultCertificateBase; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.CertificateNearExpiry event.") + model KeyVaultCertificateNearExpiryEventData + is BaseEvents.KeyVaultCertificateBase; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.CertificateNearExpiry event.") -model KeyVaultCertificateNearExpiryEventData is BaseEvents.KeyVaultCertificateBase; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.CertificateExpired event.") + model KeyVaultCertificateExpiredEventData + is BaseEvents.KeyVaultCertificateBase; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.CertificateExpired event.") -model KeyVaultCertificateExpiredEventData is BaseEvents.KeyVaultCertificateBase; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.KeyNewVersionCreated event.") + model KeyVaultKeyNewVersionCreatedEventData + is BaseEvents.KeyVaultCertificateBase; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.KeyNewVersionCreated event.") -model KeyVaultKeyNewVersionCreatedEventData is BaseEvents.KeyVaultCertificateBase; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.KeyNearExpiry event.") + model KeyVaultKeyNearExpiryEventData is BaseEvents.KeyVaultCertificateBase; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.KeyNearExpiry event.") -model KeyVaultKeyNearExpiryEventData is BaseEvents.KeyVaultCertificateBase; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.KeyExpired event.") + model KeyVaultKeyExpiredEventData is BaseEvents.KeyVaultCertificateBase; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.KeyExpired event.") -model KeyVaultKeyExpiredEventData is BaseEvents.KeyVaultCertificateBase; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.SecretNewVersionCreated event.") + model KeyVaultSecretNewVersionCreatedEventData + is BaseEvents.KeyVaultCertificateBase; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.SecretNewVersionCreated event.") -model KeyVaultSecretNewVersionCreatedEventData is BaseEvents.KeyVaultCertificateBase; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.SecretNearExpiry event.") + model KeyVaultSecretNearExpiryEventData is BaseEvents.KeyVaultCertificateBase; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.SecretNearExpiry event.") -model KeyVaultSecretNearExpiryEventData is BaseEvents.KeyVaultCertificateBase; - -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.SecretExpired event.") -model KeyVaultSecretExpiredEventData is BaseEvents.KeyVaultCertificateBase; - -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.VaultAccessPolicyChanged event.") -model KeyVaultVaultAccessPolicyChangedEventData is BaseEvents.KeyVaultCertificateBase; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.SecretExpired event.") + model KeyVaultSecretExpiredEventData is BaseEvents.KeyVaultCertificateBase; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.VaultAccessPolicyChanged event.") + model KeyVaultVaultAccessPolicyChangedEventData + is BaseEvents.KeyVaultCertificateBase; } -namespace BaseEvents{ +namespace BaseEvents { model KeyVaultCertificateBase { @doc("The id of the object that triggered this event.") Id?: string; - + @doc("Key vault name of the object that triggered this event.") VaultName?: string; - + @doc("The type of the object that triggered this event") ObjectType?: string; - + @doc("The name of the object that triggered this event") ObjectName?: string; - + @doc("The version of the object that triggered this event") Version?: string; - + @doc("Not before date of the object that triggered this event") NBF?: float64; - + @doc("The expiration date of the object that triggered this event") EXP?: float64; } diff --git a/specification/eventgrid/data-plane/cadl/MachineLearningServices.cadl b/specification/eventgrid/data-plane/cadl/MachineLearningServices.cadl index e45cd944af58..eab1364d3146 100644 --- a/specification/eventgrid/data-plane/cadl/MachineLearningServices.cadl +++ b/specification/eventgrid/data-plane/cadl/MachineLearningServices.cadl @@ -1,4 +1,7 @@ -@service({title:"Schema of Azure Machine Learning Services events published to Azure Event Grid", version:"2018-01-01"}) +@service({ + title: "Schema of Azure Machine Learning Services events published to Azure Event Grid", + version: "2018-01-01", +}) @doc("Describes the schema of the Azure Machine Learning Services events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") namespace MachineLearningServices; diff --git a/specification/eventgrid/data-plane/cadl/Maps.cadl b/specification/eventgrid/data-plane/cadl/Maps.cadl index 700a25612b02..0d75e45ec4fe 100644 --- a/specification/eventgrid/data-plane/cadl/Maps.cadl +++ b/specification/eventgrid/data-plane/cadl/Maps.cadl @@ -1,15 +1,18 @@ -@service({title:"Schema of Azure Maps events published to Azure Event Grid", version: "2018-01-01"}) +@service({ + title: "Schema of Azure Maps events published to Azure Event Grid", + version: "2018-01-01", +}) @doc("Describes the schema of the Azure Maps events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") namespace Maps; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Maps.GeofenceEntered event.") -model MapsGeofenceEnteredEventData extends MapsGeofenceEventProperties{}; +model MapsGeofenceEnteredEventData extends MapsGeofenceEventProperties {} @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Maps.GeofenceExited event.") -model MapsGeofenceExitedEventData extends MapsGeofenceEventProperties{}; +model MapsGeofenceExitedEventData extends MapsGeofenceEventProperties {} @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Maps.GeofenceResult event.") -model MapsGeofenceResultEventData extends MapsGeofenceEventProperties{}; +model MapsGeofenceResultEventData extends MapsGeofenceEventProperties {} @doc("Schema of the Data property of an EventGridEvent for a Geofence event (GeofenceEntered, GeofenceExited, GeofenceResult).") model MapsGeofenceEventProperties { diff --git a/specification/eventgrid/data-plane/cadl/MediaServices.cadl b/specification/eventgrid/data-plane/cadl/MediaServices.cadl index 65b7417119af..56e369129012 100644 --- a/specification/eventgrid/data-plane/cadl/MediaServices.cadl +++ b/specification/eventgrid/data-plane/cadl/MediaServices.cadl @@ -1,361 +1,453 @@ -@service({title:"Schema of Azure Media Services events published to Azure Event Grid",version:"2018-01-01"}) +@service({ + title: "Schema of Azure Media Services events published to Azure Event Grid", + version: "2018-01-01", +}) @doc("Describes the schema of the Azure Media Services events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") -namespace MediaServices{ - -enum MediaJobState { - @doc("The job was canceled. This is a final state for the job.") - Canceled, - @doc("The job is in the process of being canceled. This is a transient state for the job.") - Canceling, - @doc("The job has encountered an error. This is a final state for the job.") - Error, - @doc("The job is finished. This is a final state for the job.") - Finished, - @doc("The job is processing. This is a transient state for the job.") - Processing, - @doc("The job is in a queued state, waiting for resources to become available. This is a transient state.") - Queued, - @doc("The job is being scheduled to run on an available resource. This is a transient state, between queued and processing states.") - Scheduled, -} +namespace MediaServices { + enum MediaJobState { + @doc("The job was canceled. This is a final state for the job.") + Canceled, -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Media.JobStateChange event.") -model MediaJobStateChangeEventData { - @doc("The previous state of the Job.") - previousState?: MediaJobState; - @doc("The new state of the Job.") - state?: MediaJobState; - @doc("Gets the Job correlation data.") - correlationData?: Record; -} + @doc("The job is in the process of being canceled. This is a transient state for the job.") + Canceling, -enum MediaJobErrorCode { - @doc("Fatal service error, please contact support.") - ServiceError, - @doc("Transient error, please retry, if retry is unsuccessful, please contact support.") - ServiceTransientError, - @doc("While trying to download the input files, the files were not accessible, please check the availability of the source.") - DownloadNotAccessible, - @doc("While trying to download the input files, there was an issue during transfer (storage service, network errors), see details and check your source.") - DownloadTransientError, - @doc("While trying to upload the output files, the destination was not reachable, please check the availability of the destination.") - UploadNotAccessible, - @doc("While trying to upload the output files, there was an issue during transfer (storage service, network errors), see details and check your destination.") - UploadTransientError, - @doc("There was a problem with the combination of input files and the configuration settings applied, fix the configuration settings and retry with the same input, or change input to match the configuration.") - ConfigurationUnsupported, - @doc("There was a problem with the input content (for example: zero byte files, or corrupt/non-decodable files), check the input files.") - ContentMalformed, - @doc("There was a problem with the format of the input (not valid media file, or an unsupported file/codec), check the validity of the input files.") - ContentUnsupported, - @doc("There is an error verifying to the account identity. Check and fix the identity configurations and retry. If unsuccessful, please contact support.") - IdentityUnsupported, -} + @doc("The job has encountered an error. This is a final state for the job.") + Error, -enum MediaJobErrorCategory { - @doc("The error is service related.") - Service, - @doc("The error is download related.") - Download, - @doc("The error is upload related.") - Upload, - @doc("The error is configuration related.") - Configuration, - @doc("The error is related to data in the input files.") - Content, - @doc("The error is related to account information.") - Account, -} + @doc("The job is finished. This is a final state for the job.") + Finished, -enum MediaJobRetry { - @doc("Issue needs to be investigated and then the job resubmitted with corrections or retried once the underlying issue has been corrected.") - DoNotRetry, - @doc("Issue may be resolved after waiting for a period of time and resubmitting the same Job.") - MayRetry, -} + @doc("The job is processing. This is a transient state for the job.") + Processing, -@doc("Details of JobOutput errors.") -model MediaJobError { - @doc("Error code describing the error.") - code?: MediaJobErrorCode; - @doc("A human-readable language-dependent representation of the error.") - message?: string; - @doc("Helps with categorization of errors.") - category?: MediaJobErrorCategory; - @doc("Indicates that it may be possible to retry the Job. If retry is unsuccessful, please contact Azure support via Azure Portal.") - retry?: MediaJobRetry; - @doc("An array of details about specific errors that led to this reported error.") - details?: MediaJobErrorDetail[]; -} + @doc("The job is in a queued state, waiting for resources to become available. This is a transient state.") + Queued, -@doc("Details of JobOutput errors.") -model MediaJobErrorDetail { - @doc("Code describing the error detail.") - code?: string; - @doc("A human-readable representation of the error.") - message?: string; -} + @doc("The job is being scheduled to run on an available resource. This is a transient state, between queued and processing states.") + Scheduled, + } -@doc("The event data for a Job output.") -@discriminator("@odata.type") -model MediaJobOutput { - @doc("The discriminator for derived types.") - @projectedName("json","@odata.type") - OdataType?: string; - @doc("Gets the Job output error.") - error?: MediaJobError; - @doc("Gets the Job output label.") - label?: string; - @doc("Gets the Job output progress.") - progress: int64; - @doc("Gets the Job output state.") - state: MediaJobState; -} + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Media.JobStateChange event.") + model MediaJobStateChangeEventData { + @doc("The previous state of the Job.") + previousState?: MediaJobState; -@doc("The event data for a Job output asset.") -@discriminator("#Microsoft.Media.JobOutputAsset") -model MediaJobOutputAsset { - @doc("Gets the Job output asset name.") - assetName?: string; -} + @doc("The new state of the Job.") + state?: MediaJobState; -@doc("Job Output Progress Event Data. Schema of the Data property of an EventGridEvent for a Microsoft.Media.JobOutputProgress event.") -@discriminator("#Microsoft.Media.JobOutputProgress") -model MediaJobOutputProgressEventData { - @doc("Gets the Job output label.") - label?: string; - @doc("Gets the Job output progress.") - progress?: int64; - @doc("Gets the Job correlation data.") - jobCorrelationData?: Record; -} + @doc("Gets the Job correlation data.") + correlationData?: Record; + } -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Media.JobOutputStateChange event.") -model MediaJobOutputStateChangeEventData { - @doc("The previous state of the Job.") - previousState?: MediaJobState; - @doc("Gets the output.") - output?: MediaJobOutput; - @doc("Gets the Job correlation data.") - jobCorrelationData?: Record; -} + enum MediaJobErrorCode { + @doc("Fatal service error, please contact support.") + ServiceError, -@doc("Job scheduled event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobScheduled event.") -@discriminator("#Microsoft.Media.JobScheduled") -model MediaJobScheduledEventData extends MediaJobStateChangeEventData{}; + @doc("Transient error, please retry, if retry is unsuccessful, please contact support.") + ServiceTransientError, -@doc("Job processing event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobProcessing event.") -@discriminator("#Microsoft.Media.JobProcessing") -model MediaJobProcessingEventData extends MediaJobStateChangeEventData{}; + @doc("While trying to download the input files, the files were not accessible, please check the availability of the source.") + DownloadNotAccessible, -@doc("Job canceling event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobCanceling event.") -@discriminator("#Microsoft.Media.JobCanceling") -model MediaJobCancelingEventData extends MediaJobStateChangeEventData{}; + @doc("While trying to download the input files, there was an issue during transfer (storage service, network errors), see details and check your source.") + DownloadTransientError, -@doc("Job finished event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobFinished event.") -@discriminator("#Microsoft.Media.JobFinished") -model MediaJobFinishedEventData extends MediaJobStateChangeEventData { - @doc("Gets the Job outputs.") - outputs?: MediaJobOutput[]; -} + @doc("While trying to upload the output files, the destination was not reachable, please check the availability of the destination.") + UploadNotAccessible, -@doc("Job canceled event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobCanceled event.") -@discriminator("#Microsoft.Media.JobCanceled") -model MediaJobCanceledEventData extends MediaJobStateChangeEventData { - @doc("Gets the Job outputs.") - outputs?: MediaJobOutput[]; -} + @doc("While trying to upload the output files, there was an issue during transfer (storage service, network errors), see details and check your destination.") + UploadTransientError, -@doc("Job error state event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobErrored event.") -@discriminator("#Microsoft.Media.JobErrored") -model MediaJobErroredEventData extends MediaJobStateChangeEventData{ - @doc("Gets the Job outputs.") - outputs?: MediaJobOutput[]; -} + @doc("There was a problem with the combination of input files and the configuration settings applied, fix the configuration settings and retry with the same input, or change input to match the configuration.") + ConfigurationUnsupported, -@doc("Job output canceled event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobOutputCanceled event.") -@discriminator("#Microsoft.Media.JobOutputCanceled") -model MediaJobOutputCanceledEventData extends MediaJobOutputStateChangeEventData{}; + @doc("There was a problem with the input content (for example: zero byte files, or corrupt/non-decodable files), check the input files.") + ContentMalformed, -@doc("Job output canceling event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobOutputCanceling event.") -@discriminator("#Microsoft.Media.JobOutputCanceling") -model MediaJobOutputCancelingEventData extends MediaJobOutputStateChangeEventData{}; + @doc("There was a problem with the format of the input (not valid media file, or an unsupported file/codec), check the validity of the input files.") + ContentUnsupported, -@doc("Job output error event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobOutputErrored event.") -@discriminator("#Microsoft.Media.JobOutputErrored") -model MediaJobOutputErroredEventData extends MediaJobOutputStateChangeEventData{}; + @doc("There is an error verifying to the account identity. Check and fix the identity configurations and retry. If unsuccessful, please contact support.") + IdentityUnsupported, + } -@doc("Job output finished event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobOutputFinished event.") -@discriminator("#Microsoft.Media.JobOutputFinished") -model MediaJobOutputFinishedEventData extends MediaJobOutputStateChangeEventData{}; + enum MediaJobErrorCategory { + @doc("The error is service related.") + Service, -@doc("Job output processing event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobOutputProcessing event.") -@discriminator("#Microsoft.Media.JobOutputProcessing") -model MediaJobOutputProcessingEventData extends MediaJobOutputStateChangeEventData{}; + @doc("The error is download related.") + Download, -@doc("Job output scheduled event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobOutputScheduled event.") -@discriminator("#Microsoft.Media.JobOutputCanceled") -model MediaJobOutputScheduledEventData extends MediaJobOutputStateChangeEventData{}; + @doc("The error is upload related.") + Upload, -@doc("Encoder connect event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventEncoderConnected event.") -model MediaLiveEventEncoderConnectedEventData is BaseEvents.MediaLiveEventConnectionBaseData; + @doc("The error is configuration related.") + Configuration, -@doc("Encoder connection rejected event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventConnectionRejected event.") -model MediaLiveEventConnectionRejectedEventData { - ...BaseEvents.MediaLiveEventConnectionBaseData; + @doc("The error is related to data in the input files.") + Content, - @doc("Gets the result code.") - resultCode?: string; -} + @doc("The error is related to account information.") + Account, + } -@doc("Encoder disconnected event data. Schema of the Data property of an EventGridEvent for a Microsoft.Media.LiveEventEncoderDisconnected event.") -model MediaLiveEventEncoderDisconnectedEventData { - ...BaseEvents.MediaLiveEventConnectionBaseData; + enum MediaJobRetry { + @doc("Issue needs to be investigated and then the job resubmitted with corrections or retried once the underlying issue has been corrected.") + DoNotRetry, - @doc("Gets the result code.") - resultCode?: string; -} + @doc("Issue may be resolved after waiting for a period of time and resubmitting the same Job.") + MayRetry, + } -@doc("Encoder connect event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventIncomingStreamReceived event.") -model MediaLiveEventIncomingStreamReceivedEventData { - @doc("Gets the ingest URL provided by the live event.") - ingestUrl?: string; - @doc("Gets the type of the track (Audio / Video).") - trackType?: string; - @doc("Gets the track name.") - trackName?: string; - @doc("Gets the bitrate of the track.") - bitrate?: int64; - @doc("Gets the remote IP.") - encoderIp?: string; - @doc("Gets the remote port.") - encoderPort?: string; - @doc("Gets the first timestamp of the data chunk received.") - timestamp?: string; - @doc("Gets the duration of the first data chunk.") - duration?: string; - @doc("Gets the timescale in which timestamp is represented.") - timescale?: string; -} + @doc("Details of JobOutput errors.") + model MediaJobError { + @doc("Error code describing the error.") + code?: MediaJobErrorCode; -@doc("Incoming streams out of sync event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventIncomingStreamsOutOfSync event.") -model MediaLiveEventIncomingStreamsOutOfSyncEventData { - @doc("Gets the minimum last timestamp received.") - minLastTimestamp?: string; - @doc("Gets the type of stream with minimum last timestamp.") - typeOfStreamWithMinLastTimestamp?: string; - @doc("Gets the maximum timestamp among all the tracks (audio or video).") - maxLastTimestamp?: string; - @doc("Gets the type of stream with maximum last timestamp.") - typeOfStreamWithMaxLastTimestamp?: string; - @doc("Gets the timescale in which \"MinLastTimestamp\" is represented.") - timescaleOfMinLastTimestamp?: string; - @doc("Gets the timescale in which \"MaxLastTimestamp\" is represented.") - timescaleOfMaxLastTimestamp?: string; -} + @doc("A human-readable language-dependent representation of the error.") + message?: string; -@doc("Incoming video stream out of sync event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventIncomingVideoStreamsOutOfSync event.") -model MediaLiveEventIncomingVideoStreamsOutOfSyncEventData { - @doc("Gets the first timestamp received for one of the quality levels.") - firstTimestamp?: string; - @doc("Gets the duration of the data chunk with first timestamp.") - firstDuration?: string; - @doc("Gets the timestamp received for some other quality levels.") - secondTimestamp?: string; - @doc("Gets the duration of the data chunk with second timestamp.") - secondDuration?: string; - @doc("Gets the timescale in which both the timestamps and durations are represented.") - timescale?: string; -} + @doc("Helps with categorization of errors.") + category?: MediaJobErrorCategory; -@doc("Ingest fragment dropped event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventIncomingDataChunkDropped event.") -model MediaLiveEventIncomingDataChunkDroppedEventData { - @doc("Gets the timestamp of the data chunk dropped.") - timestamp?: string; - @doc("Gets the type of the track (Audio / Video).") - trackType?: string; - @doc("Gets the bitrate of the track.") - bitrate?: int64; - @doc("Gets the timescale of the Timestamp.") - timescale?: string; - @doc("Gets the result code for fragment drop operation.") - resultCode?: string; - @doc("Gets the name of the track for which fragment is dropped.") - trackName?: string; -} + @doc("Indicates that it may be possible to retry the Job. If retry is unsuccessful, please contact Azure support via Azure Portal.") + retry?: MediaJobRetry; -@doc("Ingest heartbeat event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventIngestHeartbeat event.") -model MediaLiveEventIngestHeartbeatEventData { - @doc("Gets the type of the track (Audio / Video).") - trackType?: string; - @doc("Gets the track name.") - trackName?: string; - @doc("Gets the Live Transcription language.") - transcriptionLanguage?: string; - @doc("Gets the Live Transcription state.") - transcriptionState?: string; - @doc("Gets the bitrate of the track.") - bitrate?: int64; - @doc("Gets the incoming bitrate.") - incomingBitrate?: int64; - @doc("Gets the track ingest drift value.") - ingestDriftValue?: string; - @doc("Gets the arrival UTC time of the last fragment.") - lastFragmentArrivalTime?: string; - @doc("Gets the last timestamp.") - lastTimestamp?: string; - @doc("Gets the timescale of the last timestamp.") - timescale?: string; - @doc("Gets the fragment Overlap count.") - overlapCount?: int64; - @doc("Gets the fragment Discontinuity count.") - discontinuityCount?: int64; - @doc("Gets Non increasing count.") - nonincreasingCount?: int64; - @doc("Gets a value indicating whether unexpected bitrate is present or not.") - unexpectedBitrate?: boolean; - @doc("Gets the state of the live event.") - state?: string; - @doc("Gets a value indicating whether preview is healthy or not.") - healthy?: boolean; -} + @doc("An array of details about specific errors that led to this reported error.") + details?: MediaJobErrorDetail[]; + } -@doc("Ingest track discontinuity detected event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventTrackDiscontinuityDetected event.") -model MediaLiveEventTrackDiscontinuityDetectedEventData { - @doc("Gets the type of the track (Audio / Video).") - trackType?: string; - @doc("Gets the track name.") - trackName?: string; - @doc("Gets the bitrate.") - bitrate?: int64; - @doc("Gets the timestamp of the previous fragment.") - previousTimestamp?: string; - @doc("Gets the timestamp of the current fragment.") - newTimestamp?: string; - @doc("Gets the timescale in which both timestamps and discontinuity gap are represented.") - timescale?: string; - @doc("Gets the discontinuity gap between PreviousTimestamp and NewTimestamp.") - discontinuityGap?: string; -} + @doc("Details of JobOutput errors.") + model MediaJobErrorDetail { + @doc("Code describing the error detail.") + code?: string; -@doc("Channel Archive heartbeat event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventChannelArchiveHeartbeat event.") -model MediaLiveEventChannelArchiveHeartbeatEventData { - @doc("Gets the channel latency in ms.") - channelLatencyMs: string; - @doc("Gets the latency result code.") - latencyResultCode: string; -} + @doc("A human-readable representation of the error.") + message?: string; + } + + @doc("The event data for a Job output.") + @discriminator("@odata.type") + model MediaJobOutput { + @doc("The discriminator for derived types.") + @projectedName("json", "@odata.type") + OdataType?: string; + + @doc("Gets the Job output error.") + error?: MediaJobError; + + @doc("Gets the Job output label.") + label?: string; + + @doc("Gets the Job output progress.") + progress: int64; + + @doc("Gets the Job output state.") + state: MediaJobState; + } + + @doc("The event data for a Job output asset.") + @discriminator("#Microsoft.Media.JobOutputAsset") + model MediaJobOutputAsset { + @doc("Gets the Job output asset name.") + assetName?: string; + } + + @doc("Job Output Progress Event Data. Schema of the Data property of an EventGridEvent for a Microsoft.Media.JobOutputProgress event.") + @discriminator("#Microsoft.Media.JobOutputProgress") + model MediaJobOutputProgressEventData { + @doc("Gets the Job output label.") + label?: string; + + @doc("Gets the Job output progress.") + progress?: int64; + + @doc("Gets the Job correlation data.") + jobCorrelationData?: Record; + } + + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Media.JobOutputStateChange event.") + model MediaJobOutputStateChangeEventData { + @doc("The previous state of the Job.") + previousState?: MediaJobState; + + @doc("Gets the output.") + output?: MediaJobOutput; + + @doc("Gets the Job correlation data.") + jobCorrelationData?: Record; + } + + @doc("Job scheduled event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobScheduled event.") + @discriminator("#Microsoft.Media.JobScheduled") + model MediaJobScheduledEventData extends MediaJobStateChangeEventData {} + + @doc("Job processing event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobProcessing event.") + @discriminator("#Microsoft.Media.JobProcessing") + model MediaJobProcessingEventData extends MediaJobStateChangeEventData {} + + @doc("Job canceling event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobCanceling event.") + @discriminator("#Microsoft.Media.JobCanceling") + model MediaJobCancelingEventData extends MediaJobStateChangeEventData {} + + @doc("Job finished event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobFinished event.") + @discriminator("#Microsoft.Media.JobFinished") + model MediaJobFinishedEventData extends MediaJobStateChangeEventData { + @doc("Gets the Job outputs.") + outputs?: MediaJobOutput[]; + } + + @doc("Job canceled event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobCanceled event.") + @discriminator("#Microsoft.Media.JobCanceled") + model MediaJobCanceledEventData extends MediaJobStateChangeEventData { + @doc("Gets the Job outputs.") + outputs?: MediaJobOutput[]; + } + + @doc("Job error state event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobErrored event.") + @discriminator("#Microsoft.Media.JobErrored") + model MediaJobErroredEventData extends MediaJobStateChangeEventData { + @doc("Gets the Job outputs.") + outputs?: MediaJobOutput[]; + } + + @doc("Job output canceled event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobOutputCanceled event.") + @discriminator("#Microsoft.Media.JobOutputCanceled") + model MediaJobOutputCanceledEventData + extends MediaJobOutputStateChangeEventData {} + + @doc("Job output canceling event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobOutputCanceling event.") + @discriminator("#Microsoft.Media.JobOutputCanceling") + model MediaJobOutputCancelingEventData + extends MediaJobOutputStateChangeEventData {} + + @doc("Job output error event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobOutputErrored event.") + @discriminator("#Microsoft.Media.JobOutputErrored") + model MediaJobOutputErroredEventData + extends MediaJobOutputStateChangeEventData {} + + @doc("Job output finished event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobOutputFinished event.") + @discriminator("#Microsoft.Media.JobOutputFinished") + model MediaJobOutputFinishedEventData + extends MediaJobOutputStateChangeEventData {} + + @doc("Job output processing event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobOutputProcessing event.") + @discriminator("#Microsoft.Media.JobOutputProcessing") + model MediaJobOutputProcessingEventData + extends MediaJobOutputStateChangeEventData {} + + @doc("Job output scheduled event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobOutputScheduled event.") + @discriminator("#Microsoft.Media.JobOutputCanceled") + model MediaJobOutputScheduledEventData + extends MediaJobOutputStateChangeEventData {} + + @doc("Encoder connect event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventEncoderConnected event.") + model MediaLiveEventEncoderConnectedEventData + is BaseEvents.MediaLiveEventConnectionBaseData; + + @doc("Encoder connection rejected event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventConnectionRejected event.") + model MediaLiveEventConnectionRejectedEventData { + ...BaseEvents.MediaLiveEventConnectionBaseData; + + @doc("Gets the result code.") + resultCode?: string; + } + + @doc("Encoder disconnected event data. Schema of the Data property of an EventGridEvent for a Microsoft.Media.LiveEventEncoderDisconnected event.") + model MediaLiveEventEncoderDisconnectedEventData { + ...BaseEvents.MediaLiveEventConnectionBaseData; + + @doc("Gets the result code.") + resultCode?: string; + } + + @doc("Encoder connect event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventIncomingStreamReceived event.") + model MediaLiveEventIncomingStreamReceivedEventData { + @doc("Gets the ingest URL provided by the live event.") + ingestUrl?: string; + + @doc("Gets the type of the track (Audio / Video).") + trackType?: string; + + @doc("Gets the track name.") + trackName?: string; + + @doc("Gets the bitrate of the track.") + bitrate?: int64; + + @doc("Gets the remote IP.") + encoderIp?: string; + + @doc("Gets the remote port.") + encoderPort?: string; + + @doc("Gets the first timestamp of the data chunk received.") + timestamp?: string; + + @doc("Gets the duration of the first data chunk.") + duration?: string; + + @doc("Gets the timescale in which timestamp is represented.") + timescale?: string; + } + + @doc("Incoming streams out of sync event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventIncomingStreamsOutOfSync event.") + model MediaLiveEventIncomingStreamsOutOfSyncEventData { + @doc("Gets the minimum last timestamp received.") + minLastTimestamp?: string; + + @doc("Gets the type of stream with minimum last timestamp.") + typeOfStreamWithMinLastTimestamp?: string; + + @doc("Gets the maximum timestamp among all the tracks (audio or video).") + maxLastTimestamp?: string; + + @doc("Gets the type of stream with maximum last timestamp.") + typeOfStreamWithMaxLastTimestamp?: string; + + @doc("Gets the timescale in which \"MinLastTimestamp\" is represented.") + timescaleOfMinLastTimestamp?: string; + + @doc("Gets the timescale in which \"MaxLastTimestamp\" is represented.") + timescaleOfMaxLastTimestamp?: string; + } + + @doc("Incoming video stream out of sync event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventIncomingVideoStreamsOutOfSync event.") + model MediaLiveEventIncomingVideoStreamsOutOfSyncEventData { + @doc("Gets the first timestamp received for one of the quality levels.") + firstTimestamp?: string; + + @doc("Gets the duration of the data chunk with first timestamp.") + firstDuration?: string; + + @doc("Gets the timestamp received for some other quality levels.") + secondTimestamp?: string; + + @doc("Gets the duration of the data chunk with second timestamp.") + secondDuration?: string; + + @doc("Gets the timescale in which both the timestamps and durations are represented.") + timescale?: string; + } + + @doc("Ingest fragment dropped event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventIncomingDataChunkDropped event.") + model MediaLiveEventIncomingDataChunkDroppedEventData { + @doc("Gets the timestamp of the data chunk dropped.") + timestamp?: string; + + @doc("Gets the type of the track (Audio / Video).") + trackType?: string; + + @doc("Gets the bitrate of the track.") + bitrate?: int64; + + @doc("Gets the timescale of the Timestamp.") + timescale?: string; + + @doc("Gets the result code for fragment drop operation.") + resultCode?: string; + + @doc("Gets the name of the track for which fragment is dropped.") + trackName?: string; + } + + @doc("Ingest heartbeat event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventIngestHeartbeat event.") + model MediaLiveEventIngestHeartbeatEventData { + @doc("Gets the type of the track (Audio / Video).") + trackType?: string; + + @doc("Gets the track name.") + trackName?: string; + + @doc("Gets the Live Transcription language.") + transcriptionLanguage?: string; + + @doc("Gets the Live Transcription state.") + transcriptionState?: string; + + @doc("Gets the bitrate of the track.") + bitrate?: int64; + + @doc("Gets the incoming bitrate.") + incomingBitrate?: int64; + + @doc("Gets the track ingest drift value.") + ingestDriftValue?: string; + + @doc("Gets the arrival UTC time of the last fragment.") + lastFragmentArrivalTime?: string; + + @doc("Gets the last timestamp.") + lastTimestamp?: string; + + @doc("Gets the timescale of the last timestamp.") + timescale?: string; + + @doc("Gets the fragment Overlap count.") + overlapCount?: int64; + + @doc("Gets the fragment Discontinuity count.") + discontinuityCount?: int64; + + @doc("Gets Non increasing count.") + nonincreasingCount?: int64; + + @doc("Gets a value indicating whether unexpected bitrate is present or not.") + unexpectedBitrate?: boolean; + + @doc("Gets the state of the live event.") + state?: string; + + @doc("Gets a value indicating whether preview is healthy or not.") + healthy?: boolean; + } + + @doc("Ingest track discontinuity detected event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventTrackDiscontinuityDetected event.") + model MediaLiveEventTrackDiscontinuityDetectedEventData { + @doc("Gets the type of the track (Audio / Video).") + trackType?: string; + + @doc("Gets the track name.") + trackName?: string; + + @doc("Gets the bitrate.") + bitrate?: int64; + + @doc("Gets the timestamp of the previous fragment.") + previousTimestamp?: string; + + @doc("Gets the timestamp of the current fragment.") + newTimestamp?: string; + + @doc("Gets the timescale in which both timestamps and discontinuity gap are represented.") + timescale?: string; + + @doc("Gets the discontinuity gap between PreviousTimestamp and NewTimestamp.") + discontinuityGap?: string; + } + + @doc("Channel Archive heartbeat event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventChannelArchiveHeartbeat event.") + model MediaLiveEventChannelArchiveHeartbeatEventData { + @doc("Gets the channel latency in ms.") + channelLatencyMs: string; + + @doc("Gets the latency result code.") + latencyResultCode: string; + } } -namespace BaseEvents{ - model MediaLiveEventConnectionBaseData { - @doc("Gets the ingest URL provided by the live event.") - ingestUrl?: string; - @doc("Gets the stream Id.") - streamId?: string; - @doc("Gets the remote IP.") - encoderIp?: string; - @doc("Gets the remote port.") - encoderPort?: string; - } -} \ No newline at end of file +namespace BaseEvents { + model MediaLiveEventConnectionBaseData { + @doc("Gets the ingest URL provided by the live event.") + ingestUrl?: string; + + @doc("Gets the stream Id.") + streamId?: string; + + @doc("Gets the remote IP.") + encoderIp?: string; + + @doc("Gets the remote port.") + encoderPort?: string; + } +} diff --git a/specification/eventgrid/data-plane/cadl/PolicyInsights.cadl b/specification/eventgrid/data-plane/cadl/PolicyInsights.cadl index 7970b0fad202..a3385451a2e3 100644 --- a/specification/eventgrid/data-plane/cadl/PolicyInsights.cadl +++ b/specification/eventgrid/data-plane/cadl/PolicyInsights.cadl @@ -1,39 +1,43 @@ -@service({title:"Schema of Azure Policy events published to Azure Event Grid",version:"2018-01-01"}) +@service({ + title: "Schema of Azure Policy events published to Azure Event Grid", + version: "2018-01-01", +}) @doc("Describes the schema of the Azure Policy events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") -namespace PolicyInsights{ +namespace PolicyInsights { + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.PolicyInsights.PolicyStateCreated event.") + model PolicyInsightsPolicyStateCreatedEventData + is BaseEvents.PolicyInsightsBaseEventData; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.PolicyInsights.PolicyStateCreated event.") -model PolicyInsightsPolicyStateCreatedEventData is BaseEvents.PolicyInsightsBaseEventData; - -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.PolicyInsights.PolicyStateChanged event.") -model PolicyInsightsPolicyStateChangedEventData is BaseEvents.PolicyInsightsBaseEventData; - -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.PolicyInsights.PolicyStateDeleted event.") -model PolicyInsightsPolicyStateDeletedEventData is BaseEvents.PolicyInsightsBaseEventData; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.PolicyInsights.PolicyStateChanged event.") + model PolicyInsightsPolicyStateChangedEventData + is BaseEvents.PolicyInsightsBaseEventData; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.PolicyInsights.PolicyStateDeleted event.") + model PolicyInsightsPolicyStateDeletedEventData + is BaseEvents.PolicyInsightsBaseEventData; } -namespace BaseEvents{ +namespace BaseEvents { model PolicyInsightsBaseEventData { @doc("The time that the resource was scanned by Azure Policy in the Universal ISO 8601 DateTime format yyyy-MM-ddTHH:mm:ss.fffffffZ.") timestamp?: zonedDateTime; - + @doc("The resource ID of the policy assignment.") policyAssignmentId?: string; - + @doc("The resource ID of the policy definition.") policyDefinitionId?: string; - + @doc("The reference ID for the policy definition inside the initiative definition, if the policy assignment is for an initiative. May be empty.") policyDefinitionReferenceId?: string; - + @doc("The compliance state of the resource with respect to the policy assignment.") complianceState?: string; - + @doc("The subscription ID of the resource.") subscriptionId?: string; - + @doc("The compliance reason code. May be empty.") complianceReasonCode?: string; } -} \ No newline at end of file +} diff --git a/specification/eventgrid/data-plane/cadl/RedisCache.cadl b/specification/eventgrid/data-plane/cadl/RedisCache.cadl index d36d0b7b2971..53cbd02fec72 100644 --- a/specification/eventgrid/data-plane/cadl/RedisCache.cadl +++ b/specification/eventgrid/data-plane/cadl/RedisCache.cadl @@ -1,4 +1,7 @@ -@service({title:"Schema of Redis Cache events published to Azure Event Grid", version:"2018-01-01"}) +@service({ + title: "Schema of Redis Cache events published to Azure Event Grid", + version: "2018-01-01", +}) @doc("Describes the schema of the Redis Cache events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") namespace RedisCache; diff --git a/specification/eventgrid/data-plane/cadl/Resources.cadl b/specification/eventgrid/data-plane/cadl/Resources.cadl index c22369b5792b..304f52396cde 100644 --- a/specification/eventgrid/data-plane/cadl/Resources.cadl +++ b/specification/eventgrid/data-plane/cadl/Resources.cadl @@ -1,95 +1,97 @@ -@service({title:"Schema of Azure resource events published to Azure Event Grid", version: "2018-01-01"}) +@service({ + title: "Schema of Azure resource events published to Azure Event Grid", + version: "2018-01-01", +}) @doc("Describes the schema of the Azure resource events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") -namespace Resources{ +namespace Resources { + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceWriteSuccess event. This is raised when a resource create or update operation succeeds.") + model ResourceWriteSuccessData is BaseEvents.ResourceBaseEventData; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceWriteSuccess event. This is raised when a resource create or update operation succeeds.") -model ResourceWriteSuccessData is BaseEvents.ResourceBaseEventData; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceWriteFailure event. This is raised when a resource create or update operation fails.") + model ResourceWriteFailureData is BaseEvents.ResourceBaseEventData; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceWriteFailure event. This is raised when a resource create or update operation fails.") -model ResourceWriteFailureData is BaseEvents.ResourceBaseEventData; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceWriteCancel event. This is raised when a resource create or update operation is canceled.") + model ResourceWriteCancelData is BaseEvents.ResourceBaseEventData; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceWriteCancel event. This is raised when a resource create or update operation is canceled.") -model ResourceWriteCancelData is BaseEvents.ResourceBaseEventData; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceDeleteSuccess event. This is raised when a resource delete operation succeeds.") + model ResourceDeleteSuccessData is BaseEvents.ResourceBaseEventData; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceDeleteSuccess event. This is raised when a resource delete operation succeeds.") -model ResourceDeleteSuccessData is BaseEvents.ResourceBaseEventData; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceDeleteFailure event. This is raised when a resource delete operation fails.") + model ResourceDeleteFailureData is BaseEvents.ResourceBaseEventData; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceDeleteFailure event. This is raised when a resource delete operation fails.") -model ResourceDeleteFailureData is BaseEvents.ResourceBaseEventData; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceDeleteCancel event. This is raised when a resource delete operation is canceled.") + model ResourceDeleteCancelData is BaseEvents.ResourceBaseEventData; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceDeleteCancel event. This is raised when a resource delete operation is canceled.") -model ResourceDeleteCancelData is BaseEvents.ResourceBaseEventData; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceActionSuccess event. This is raised when a resource action operation succeeds.") + model ResourceActionSuccessData is BaseEvents.ResourceBaseEventData; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceActionSuccess event. This is raised when a resource action operation succeeds.") -model ResourceActionSuccessData is BaseEvents.ResourceBaseEventData; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceActionFailure event. This is raised when a resource action operation fails.") + model ResourceActionFailureData is BaseEvents.ResourceBaseEventData; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceActionFailure event. This is raised when a resource action operation fails.") -model ResourceActionFailureData is BaseEvents.ResourceBaseEventData; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceActionCancel event. This is raised when a resource action operation is canceled.") + model ResourceActionCancelData is BaseEvents.ResourceBaseEventData; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceActionCancel event. This is raised when a resource action operation is canceled.") -model ResourceActionCancelData is BaseEvents.ResourceBaseEventData; + @doc("The details of the HTTP request.") + model ResourceHttpRequest { + @doc("The client request ID.") + clientRequestId?: string; -@doc("The details of the HTTP request.") -model ResourceHttpRequest { - @doc("The client request ID.") - clientRequestId?: string; + @doc("The client IP address.") + clientIpAddress?: string; - @doc("The client IP address.") - clientIpAddress?: string; + @doc("The request method.") + method?: string; - @doc("The request method.") - method?: string; - - @doc("The url used in the request.") - url?: string; -} + @doc("The url used in the request.") + url?: string; + } -@doc("The details of the authorization for the resource.") -model ResourceAuthorization { - @doc("The scope of the authorization.") - scope?: string; + @doc("The details of the authorization for the resource.") + model ResourceAuthorization { + @doc("The scope of the authorization.") + scope?: string; - @doc("The action being requested.") - action?: string; + @doc("The action being requested.") + action?: string; - @doc("The evidence for the authorization.") - evidence?: Record; -} + @doc("The evidence for the authorization.") + evidence?: Record; + } } -namespace BaseEvents{ +namespace BaseEvents { model ResourceBaseEventData { @doc("The tenant ID of the resource.") tenantId?: string; - + @doc("The subscription ID of the resource.") subscriptionId?: string; - + @doc("The resource group of the resource.") resourceGroup?: string; - + @doc("The resource provider performing the operation.") resourceProvider?: string; - + @doc("The URI of the resource in the operation.") resourceUri?: string; - + @doc("The operation that was performed.") operationName?: string; - + @doc("The status of the operation.") status?: string; - + @doc("The requested authorization for the operation.") authorization?: Resources.ResourceAuthorization; - + @doc("The properties of the claims.") claims?: Record; - + @doc("An operation ID used for troubleshooting.") correlationId?: string; - + @doc("The details of the operation.") httpRequest?: Resources.ResourceHttpRequest; } -} \ No newline at end of file +} diff --git a/specification/eventgrid/data-plane/cadl/ServiceBus.cadl b/specification/eventgrid/data-plane/cadl/ServiceBus.cadl index 1a345e0bb330..767e295fd0c4 100644 --- a/specification/eventgrid/data-plane/cadl/ServiceBus.cadl +++ b/specification/eventgrid/data-plane/cadl/ServiceBus.cadl @@ -1,40 +1,44 @@ -@service({title: "Schema of Azure ServiceBus Messaging events published to Azure Event Grid", version:"2018-01-01"}) +@service({ + title: "Schema of Azure ServiceBus Messaging events published to Azure Event Grid", + version: "2018-01-01", +}) @doc("Describes the schema of the Azure ServiceBus Messaging events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") -namespace ServiceBus{ +namespace ServiceBus { + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ServiceBus.ActiveMessagesAvailableWithNoListeners event.") + model ServiceBusActiveMessagesAvailableWithNoListenersEventData + is BaseEvents.ServiceBusBaseEventData; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.ServiceBus.ActiveMessagesAvailableWithNoListeners event.") -model ServiceBusActiveMessagesAvailableWithNoListenersEventData is BaseEvents.ServiceBusBaseEventData; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ServiceBus.DeadletterMessagesAvailableWithNoListeners event.") + model ServiceBusDeadletterMessagesAvailableWithNoListenersEventData + is BaseEvents.ServiceBusBaseEventData; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.ServiceBus.DeadletterMessagesAvailableWithNoListeners event.") -model ServiceBusDeadletterMessagesAvailableWithNoListenersEventData is BaseEvents.ServiceBusBaseEventData; - -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.ServiceBus.ActiveMessagesAvailablePeriodicNotifications event.") -model ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData is BaseEvents.ServiceBusBaseEventData; - -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.ServiceBus.DeadletterMessagesAvailablePeriodicNotifications event.") -model ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData is BaseEvents.ServiceBusBaseEventData; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ServiceBus.ActiveMessagesAvailablePeriodicNotifications event.") + model ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData + is BaseEvents.ServiceBusBaseEventData; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ServiceBus.DeadletterMessagesAvailablePeriodicNotifications event.") + model ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData + is BaseEvents.ServiceBusBaseEventData; } -namespace BaseEvents{ - +namespace BaseEvents { model ServiceBusBaseEventData { @doc("The namespace name of the Microsoft.ServiceBus resource.") namespaceName?: string; - + @doc("The endpoint of the Microsoft.ServiceBus resource.") requestUri?: string; - + @doc("The entity type of the Microsoft.ServiceBus resource. Could be one of 'queue' or 'subscriber'.") entityType?: string; - + @doc("The name of the Microsoft.ServiceBus queue. If the entity type is of type 'subscriber', then this value will be null.") queueName?: string; - + @doc("The name of the Microsoft.ServiceBus topic. If the entity type is of type 'queue', then this value will be null.") topicName?: string; - + @doc("The name of the Microsoft.ServiceBus topic's subscription. If the entity type is of type 'queue', then this value will be null.") subscriptionName?: string; } -} \ No newline at end of file +} diff --git a/specification/eventgrid/data-plane/cadl/SignalRService.cadl b/specification/eventgrid/data-plane/cadl/SignalRService.cadl index b964ef1cabc9..89bd923167bd 100644 --- a/specification/eventgrid/data-plane/cadl/SignalRService.cadl +++ b/specification/eventgrid/data-plane/cadl/SignalRService.cadl @@ -1,33 +1,34 @@ -@service({title:"Schema of Azure SignalR Service events published to Azure Event Grid", version:"2018-01-01"}) +@service({ + title: "Schema of Azure SignalR Service events published to Azure Event Grid", + version: "2018-01-01", +}) @doc("Describes the schema of the Azure SignalR Service events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") -namespace SignalRService{ +namespace SignalRService { + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.SignalRService.ClientConnectionConnected event.") + model SignalRServiceClientConnectionConnectedEventData + is BaseEvents.SignalRServiceBaseEventdata; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.SignalRService.ClientConnectionConnected event.") -model SignalRServiceClientConnectionConnectedEventData is BaseEvents.SignalRServiceBaseEventdata; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.SignalRService.ClientConnectionDisconnected event.") + model SignalRServiceClientConnectionDisconnectedEventData { + ...BaseEvents.SignalRServiceBaseEventdata; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.SignalRService.ClientConnectionDisconnected event.") -model SignalRServiceClientConnectionDisconnectedEventData { - - ...BaseEvents.SignalRServiceBaseEventdata; - - @doc("The message of error that cause the client connection disconnected.") - errorMessage?: string; -} + @doc("The message of error that cause the client connection disconnected.") + errorMessage?: string; + } } -namespace BaseEvents{ +namespace BaseEvents { model SignalRServiceBaseEventdata { @doc("The time at which the event occurred.") timestamp?: zonedDateTime; - + @doc("The hub of connected client connection.") hubName?: string; - + @doc("The connection Id of connected client connection.") connectionId?: string; - + @doc("The user Id of connected client connection.") userId?: string; } } - diff --git a/specification/eventgrid/data-plane/cadl/Storage.cadl b/specification/eventgrid/data-plane/cadl/Storage.cadl index a28f11e7efce..a5d43923c041 100644 --- a/specification/eventgrid/data-plane/cadl/Storage.cadl +++ b/specification/eventgrid/data-plane/cadl/Storage.cadl @@ -1,158 +1,156 @@ -@service({title:"Schema of Azure Storage events published to Azure Event Grid", version: "2018-01-01"}) - +@service({ + title: "Schema of Azure Storage events published to Azure Event Grid", + version: "2018-01-01", +}) @doc("Describes the schema of the Azure Storage events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") -namespace Storage{ - -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Storage.BlobCreated event.") -model StorageBlobCreatedEventData { - @doc("The etag of the blob at the time this event was triggered.") - eTag?: string; - - @doc("The offset of the blob in bytes.") - contentOffset?: int64; - - ...BaseEvents.StorageBaseEventData<"blob">; - ...BaseEvents.StorageUrlBaseEventData; - ...BaseEvents.StorageBaseTypeData; -} - -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Storage.BlobDeleted event.") -model StorageBlobDeletedEventData { - @doc("The path to the blob.") - url?: string; - - ...BaseEvents.StorageBaseEventData<"blob">; - ...BaseEvents.StorageBaseTypeData; -} - -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Storage.DirectoryCreated event.") -model StorageDirectoryCreatedEventData { - @doc("The etag of the directory at the time this event was triggered.") - eTag?: string; - - @doc("The path to the directory.") - url?: string; - - ...BaseEvents.StorageBaseEventData<"directory">; -} - -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Storage.DirectoryDeleted event.") -model StorageDirectoryDeletedEventData { - @doc("The path to the deleted directory.") - url?: string; +namespace Storage { + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Storage.BlobCreated event.") + model StorageBlobCreatedEventData { + @doc("The etag of the blob at the time this event was triggered.") + eTag?: string; + + @doc("The offset of the blob in bytes.") + contentOffset?: int64; + ...BaseEvents.StorageBaseEventData<"blob">; + ...BaseEvents.StorageUrlBaseEventData; + ...BaseEvents.StorageBaseTypeData; + } - @doc("Is this event for a recursive delete operation.") - recursive?: string; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Storage.BlobDeleted event.") + model StorageBlobDeletedEventData { + @doc("The path to the blob.") + url?: string; + ...BaseEvents.StorageBaseEventData<"blob">; + ...BaseEvents.StorageBaseTypeData; + } - ...BaseEvents.StorageBaseEventData<"directory">; -} + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Storage.DirectoryCreated event.") + model StorageDirectoryCreatedEventData { + @doc("The etag of the directory at the time this event was triggered.") + eTag?: string; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Storage.BlobRenamed event.") -model StorageBlobRenamedEventData { - @doc("The path to the blob that was renamed.") - sourceUrl?: string; + @doc("The path to the directory.") + url?: string; + ...BaseEvents.StorageBaseEventData<"directory">; + } - @doc("The new path to the blob after the rename operation.") - destinationUrl?: string; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Storage.DirectoryDeleted event.") + model StorageDirectoryDeletedEventData { + @doc("The path to the deleted directory.") + url?: string; - ...BaseEvents.StorageBaseEventData<"blob">; -} + @doc("Is this event for a recursive delete operation.") + recursive?: string; + ...BaseEvents.StorageBaseEventData<"directory">; + } -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Storage.DirectoryRenamed event.") -model StorageDirectoryRenamedEventData { - @doc("The path to the directory that was renamed.") - sourceUrl?: string; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Storage.BlobRenamed event.") + model StorageBlobRenamedEventData { + @doc("The path to the blob that was renamed.") + sourceUrl?: string; - @doc("The new path to the directory after the rename operation.") - destinationUrl?: string; + @doc("The new path to the blob after the rename operation.") + destinationUrl?: string; + ...BaseEvents.StorageBaseEventData<"blob">; + } - ...BaseEvents.StorageBaseEventData<"directory">; -} + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Storage.DirectoryRenamed event.") + model StorageDirectoryRenamedEventData { + @doc("The path to the directory that was renamed.") + sourceUrl?: string; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Storage.LifecyclePolicyCompleted event.") -model StorageLifecyclePolicyCompletedEventData { - @doc("The time the policy task was scheduled.") - scheduleTime?: string; - deleteSummary?: StorageLifecyclePolicyActionSummaryDetail; - tierToCoolSummary?: StorageLifecyclePolicyActionSummaryDetail; - tierToArchiveSummary?: StorageLifecyclePolicyActionSummaryDetail; -} + @doc("The new path to the directory after the rename operation.") + destinationUrl?: string; + ...BaseEvents.StorageBaseEventData<"directory">; + } -@doc("Execution statistics of a specific policy action in a Blob Management cycle.") -model StorageLifecyclePolicyActionSummaryDetail { - @doc("Total number of objects to be acted on by this action.") - totalObjectsCount?: int64; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Storage.LifecyclePolicyCompleted event.") + model StorageLifecyclePolicyCompletedEventData { + @doc("The time the policy task was scheduled.") + scheduleTime?: string; + deleteSummary?: StorageLifecyclePolicyActionSummaryDetail; + tierToCoolSummary?: StorageLifecyclePolicyActionSummaryDetail; + tierToArchiveSummary?: StorageLifecyclePolicyActionSummaryDetail; + } - @doc("Number of success operations of this action.") - successCount?: int64; + @doc("Execution statistics of a specific policy action in a Blob Management cycle.") + model StorageLifecyclePolicyActionSummaryDetail { + @doc("Total number of objects to be acted on by this action.") + totalObjectsCount?: int64; - @doc("Error messages of this action if any.") - errorList?: string; -} + @doc("Number of success operations of this action.") + successCount?: int64; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Storage.BlobTierChanged event.") -model StorageBlobTierChangedEventData { - ...BaseEvents.StorageBaseEventData<"blob">; - ...BaseEvents.StorageUrlBaseEventData; - ...BaseEvents.StorageBaseTypeData; -} + @doc("Error messages of this action if any.") + errorList?: string; + } -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Storage.AsyncOperationInitiated event.") -model StorageAsyncOperationInitiatedEventData { - ...BaseEvents.StorageBaseEventData<"blob">; - ...BaseEvents.StorageUrlBaseEventData; - ...BaseEvents.StorageBaseTypeData; -} + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Storage.BlobTierChanged event.") + model StorageBlobTierChangedEventData { + ...BaseEvents.StorageBaseEventData<"blob">; + ...BaseEvents.StorageUrlBaseEventData; + ...BaseEvents.StorageBaseTypeData; + } -@doc("Schema of the Data property of an EventGridEvent for an Microsoft.Storage.BlobInventoryPolicyCompleted event.") -model StorageBlobInventoryPolicyCompletedEventData { - @doc("The time at which inventory policy was scheduled.") - scheduleDateTime?: zonedDateTime; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Storage.AsyncOperationInitiated event.") + model StorageAsyncOperationInitiatedEventData { + ...BaseEvents.StorageBaseEventData<"blob">; + ...BaseEvents.StorageUrlBaseEventData; + ...BaseEvents.StorageBaseTypeData; + } - @doc("The account name for which inventory policy is registered.") - accountName?: string; + @doc("Schema of the Data property of an EventGridEvent for an Microsoft.Storage.BlobInventoryPolicyCompleted event.") + model StorageBlobInventoryPolicyCompletedEventData { + @doc("The time at which inventory policy was scheduled.") + scheduleDateTime?: zonedDateTime; - @doc("The rule name for inventory policy.") - ruleName?: string; + @doc("The account name for which inventory policy is registered.") + accountName?: string; - @doc("The status of inventory run, it can be Succeeded/PartiallySucceeded/Failed.") - policyRunStatus?: string; + @doc("The rule name for inventory policy.") + ruleName?: string; - @doc("The status message for inventory run.") - policyRunStatusMessage?: string; + @doc("The status of inventory run, it can be Succeeded/PartiallySucceeded/Failed.") + policyRunStatus?: string; - @doc("The policy run id for inventory run.") - policyRunId?: string; + @doc("The status message for inventory run.") + policyRunStatusMessage?: string; - @doc("The blob URL for manifest file for inventory run.") - manifestBlobUrl?: string; -} + @doc("The policy run id for inventory run.") + policyRunId?: string; + @doc("The blob URL for manifest file for inventory run.") + manifestBlobUrl?: string; + } } -namespace BaseEvents{ - enum StorageType{ +namespace BaseEvents { + enum StorageType { blob: "blob", directory: "directory", } - - + model StorageBaseEventData { @doc("The name of the API/operation that triggered this event.") api?: string; - + @doc("A request id provided by the client of the storage API operation that triggered this event.") clientRequestId?: string; - + @doc("The request id generated by the Storage service for the storage API operation that triggered this event.") requestId?: string; - - @doc("An opaque string value representing the logical sequence of events for any particular {name} name. Users can use standard string comparison to understand the relative sequence of two events on the same {name} name.", {name: TStorageType,}) + + @doc( + "An opaque string value representing the logical sequence of events for any particular {name} name. Users can use standard string comparison to understand the relative sequence of two events on the same {name} name.", + { + name: TStorageType, + } + ) sequencer?: string; - + @doc("The identity of the requester that triggered this event.") identity?: string; - + @doc("For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers.") storageDiagnostics?: Record; } @@ -160,18 +158,16 @@ namespace BaseEvents{ model StorageBaseTypeData { @doc("The content type of the blob. This is the same as what would be returned in the Content-Type header from the blob.") contentType?: string; - + @doc("The type of blob.") blobType?: string; } - + model StorageUrlBaseEventData { @doc("The size of the blob in bytes. This is the same as what would be returned in the Content-Length header from the blob.") contentLength?: int64; - + @doc("The path to the blob.") url?: string; } - - -} \ No newline at end of file +} diff --git a/specification/eventgrid/data-plane/cadl/Web.cadl b/specification/eventgrid/data-plane/cadl/Web.cadl index 3532c0fd1660..42cfa9ec16cb 100644 --- a/specification/eventgrid/data-plane/cadl/Web.cadl +++ b/specification/eventgrid/data-plane/cadl/Web.cadl @@ -1,123 +1,121 @@ -@service({title:"Schema of Azure App Service events published to Azure Event Grid", version: "2018-01-01"}) +@service({ + title: "Schema of Azure App Service events published to Azure Event Grid", + version: "2018-01-01", +}) @doc("Describes the schema of the Azure App Service events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") -namespace Web{ - -@doc("Detail of action on the app.") -model AppEventTypeDetail { - @doc("Type of action of the operation.") - action?: AppAction; -} - - -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.AppUpdated event.") -model WebAppUpdatedEventData is BaseEvents.WebAppBaseEventData; - -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.BackupOperationStarted event.") -model WebBackupOperationStartedEventData is BaseEvents.WebAppBaseEventData; +namespace Web { + @doc("Detail of action on the app.") + model AppEventTypeDetail { + @doc("Type of action of the operation.") + action?: AppAction; + } -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.BackupOperationCompleted event.") -model WebBackupOperationCompletedEventData is BaseEvents.WebAppBaseEventData; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.AppUpdated event.") + model WebAppUpdatedEventData is BaseEvents.WebAppBaseEventData; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.BackupOperationFailed event.") -model WebBackupOperationFailedEventData is BaseEvents.WebAppBaseEventData; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.BackupOperationStarted event.") + model WebBackupOperationStartedEventData is BaseEvents.WebAppBaseEventData; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.RestoreOperationStarted event.") -model WebRestoreOperationStartedEventData is BaseEvents.WebAppBaseEventData; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.BackupOperationCompleted event.") + model WebBackupOperationCompletedEventData is BaseEvents.WebAppBaseEventData; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.RestoreOperationCompleted event.") -model WebRestoreOperationCompletedEventData is BaseEvents.WebAppBaseEventData; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.BackupOperationFailed event.") + model WebBackupOperationFailedEventData is BaseEvents.WebAppBaseEventData; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.RestoreOperationFailed event.") -model WebRestoreOperationFailedEventData is BaseEvents.WebAppBaseEventData; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.RestoreOperationStarted event.") + model WebRestoreOperationStartedEventData is BaseEvents.WebAppBaseEventData; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapStarted event.") -model WebSlotSwapStartedEventData is BaseEvents.WebAppBaseEventData; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.RestoreOperationCompleted event.") + model WebRestoreOperationCompletedEventData is BaseEvents.WebAppBaseEventData; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapCompleted event.") -model WebSlotSwapCompletedEventData is BaseEvents.WebAppBaseEventData; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.RestoreOperationFailed event.") + model WebRestoreOperationFailedEventData is BaseEvents.WebAppBaseEventData; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapFailed event.") -model WebSlotSwapFailedEventData is BaseEvents.WebAppBaseEventData; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapStarted event.") + model WebSlotSwapStartedEventData is BaseEvents.WebAppBaseEventData; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapWithPreviewStarted event.") -model WebSlotSwapWithPreviewStartedEventData is BaseEvents.WebAppBaseEventData; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapCompleted event.") + model WebSlotSwapCompletedEventData is BaseEvents.WebAppBaseEventData; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapWithPreviewCancelled event.") -model WebSlotSwapWithPreviewCancelledEventData is BaseEvents.WebAppBaseEventData; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapFailed event.") + model WebSlotSwapFailedEventData is BaseEvents.WebAppBaseEventData; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.AppServicePlanUpdated event.") -model WebAppServicePlanUpdatedEventData { - appServicePlanEventTypeDetail?: AppServicePlanEventTypeDetail; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapWithPreviewStarted event.") + model WebSlotSwapWithPreviewStartedEventData + is BaseEvents.WebAppBaseEventData; - @doc("name of the app service plan that had this event.") - name?: string; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapWithPreviewCancelled event.") + model WebSlotSwapWithPreviewCancelledEventData + is BaseEvents.WebAppBaseEventData; - @doc("The client request id generated by the app service for the app service plan API operation that triggered this event.") - clientRequestId?: string; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.AppServicePlanUpdated event.") + model WebAppServicePlanUpdatedEventData { + appServicePlanEventTypeDetail?: AppServicePlanEventTypeDetail; - @doc("The correlation request id generated by the app service for the app service plan API operation that triggered this event.") - correlationRequestId?: string; + @doc("name of the app service plan that had this event.") + name?: string; - @doc("The request id generated by the app service for the app service plan API operation that triggered this event.") - requestId?: string; + @doc("The client request id generated by the app service for the app service plan API operation that triggered this event.") + clientRequestId?: string; - @doc("HTTP request URL of this operation.") - address?: string; + @doc("The correlation request id generated by the app service for the app service plan API operation that triggered this event.") + correlationRequestId?: string; - @doc("HTTP verb of this operation.") - verb?: string; + @doc("The request id generated by the app service for the app service plan API operation that triggered this event.") + requestId?: string; - @doc("sku of app service plan.") - sku?: BaseEvents.sku; -} + @doc("HTTP request URL of this operation.") + address?: string; -@knownValues(BaseEvents.AppActionKV) -model AppAction is string {} + @doc("HTTP verb of this operation.") + verb?: string; -@knownValues(BaseEvents.StampKindKV) -model StampKind is string {} + @doc("sku of app service plan.") + sku?: BaseEvents.sku; + } -@knownValues(BaseEvents.AppServicePlanActionKV) -model AppServicePlanAction is string {} + @knownValues(BaseEvents.AppActionKV) + model AppAction is string; -@doc("Detail of action on the app service plan.") -model AppServicePlanEventTypeDetail { - @doc("Kind of environment where app service plan is.") - stampKind?: StampKind; + @knownValues(BaseEvents.StampKindKV) + model StampKind is string; - @doc("Type of action on the app service plan.") - action?: AppServicePlanAction; - status?: AsyncStatus; -} + @knownValues(BaseEvents.AppServicePlanActionKV) + model AppServicePlanAction is string; -@knownValues(BaseEvents.AsyncStatusKV) -model AsyncStatus is string {} + @doc("Detail of action on the app service plan.") + model AppServicePlanEventTypeDetail { + @doc("Kind of environment where app service plan is.") + stampKind?: StampKind; + @doc("Type of action on the app service plan.") + action?: AppServicePlanAction; + status?: AsyncStatus; + } + @knownValues(BaseEvents.AsyncStatusKV) + model AsyncStatus is string; } - - -namespace BaseEvents{ - +namespace BaseEvents { model WebAppBaseEventData { appEventTypeDetail?: Web.AppEventTypeDetail; - + @doc("name of the web site that had this event.") name?: string; - + @doc("The client request id generated by the app service for the site API operation that triggered this event.") clientRequestId?: string; - + @doc("The correlation request id generated by the app service for the site API operation that triggered this event.") correlationRequestId?: string; - + @doc("The request id generated by the app service for the site API operation that triggered this event.") requestId?: string; - + @doc("HTTP request URL of this operation.") address?: string; - + @doc("HTTP verb of this operation.") verb?: string; } @@ -128,30 +126,34 @@ namespace BaseEvents{ name?: string; @doc("tier of app service plan sku.") - Tier?:string; + Tier?: string; @doc("size of app service plan sku.") - Size?:string; + Size?: string; @doc("family of app service plan sku.") - Family?:string; + Family?: string; @doc("capacity of app service plan sku.") - Capacity?:string; + Capacity?: string; } - enum AppActionKV { @doc("Web app was restarted.") Restarted, + @doc("Web app was stopped.") Stopped, + @doc("There was an operation to change app setting on the web app.") ChangedAppSettings, + @doc("The job has started.") Started, + @doc("The job has completed.") Completed, + @doc("The job has failed to complete.") Failed, } @@ -159,13 +161,14 @@ namespace BaseEvents{ enum StampKindKV { @doc("App Service Plan is running on a public stamp.") Public, + @doc("App Service Plan is running on an App Service Environment V1.") AseV1, + @doc("App Service Plan is running on an App Service Environment V2.") AseV2, } - enum AppServicePlanActionKV { @doc("App Service plan is being updated.") Updated, @@ -174,8 +177,10 @@ namespace BaseEvents{ enum AsyncStatusKV { @doc("Async operation has started.") Started, + @doc("Async operation has completed.") Completed, + @doc("Async operation failed to complete.") Failed, } diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/openapi.json b/specification/eventgrid/data-plane/cadl/cadl-output/openapi.json new file mode 100644 index 000000000000..34ef65d43850 --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/cadl-output/openapi.json @@ -0,0 +1,188 @@ +{ + "swagger": "2.0", + "info": { + "title": "EventGridClient", + "version": "2018-01-01", + "description": "Azure EventGrid Client", + "x-cadl-generated": [ + { + "emitter": "@azure-tools/cadl-autorest" + } + ] + }, + "schemes": [ + "https" + ], + "x-ms-parameterized-host": { + "hostTemplate": "{topicHostname}", + "useSchemePrefix": false, + "parameters": [ + { + "name": "topicHostname", + "in": "path", + "required": true, + "description": "The host name of the topic, e.g. topic1.westus2-1.eventgrid.azure.net", + "type": "string" + } + ] + }, + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "tags": [], + "paths": {}, + "definitions": { + "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 Event Grid topic using the CloudEvent 1.0 Schema", + "required": [ + "id", + "source", + "type", + "specversion" + ] + }, + "CustomEventEvent": { + "type": "object", + "properties": {}, + "description": "Properties of an event published to an Event Grid topic using a custom schema" + }, + "EventGridEvent": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "An unique identifier for the event." + }, + "topic": { + "type": "string", + "description": "The resource path of the event source." + }, + "subject": { + "type": "string", + "description": "A resource path relative to the topic path." + }, + "data": { + "$ref": "#/definitions/object", + "description": "Event data specific to the event type." + }, + "eventType": { + "type": "string", + "description": "The type of the event that occurred." + }, + "eventTime": { + "type": "string", + "format": "date-time", + "description": "The time (in UTC) the event was generated." + }, + "metadataVersion": { + "type": "string", + "description": "The schema version of the event metadata.", + "readOnly": true + }, + "dataVersion": { + "type": "string", + "description": "The schema version of the data object." + } + }, + "description": "Properties of an event published to an Event Grid topic using the EventGrid Schema.", + "required": [ + "id", + "subject", + "data", + "eventType", + "eventTime", + "dataVersion" + ] + }, + "SubscriptionDeletedEventData": { + "type": "object", + "properties": { + "eventSubscriptionId": { + "type": "string", + "description": "The Azure resource ID of the deleted event subscription.", + "readOnly": true + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.EventGrid.SubscriptionDeletedEvent event." + }, + "SubscriptionValidationEventData": { + "type": "object", + "properties": { + "validationCode": { + "type": "string", + "description": "The validation code sent by Azure Event Grid to validate an event subscription. To complete the validation handshake, the subscriber must either respond with this validation code as part of the validation response, or perform a GET request on the validationUrl (available starting version 2018-05-01-preview).", + "readOnly": true + }, + "validationUrl": { + "type": "string", + "description": "The validation URL sent by Azure Event Grid (available starting version 2018-05-01-preview). To complete the validation handshake, the subscriber must either respond with the validationCode as part of the validation response, or perform a GET request on the validationUrl (available starting version 2018-05-01-preview).", + "readOnly": true + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.EventGrid.SubscriptionValidationEvent event." + }, + "SubscriptionValidationResponse": { + "type": "object", + "properties": { + "validationResponse": { + "type": "string", + "description": "The validation response sent by the subscriber to Azure Event Grid to complete the validation of an event subscription." + } + }, + "description": "To complete an event subscription validation handshake, a subscriber can use either the validationCode or the validationUrl received in a SubscriptionValidationEvent. When the validationCode is used, the SubscriptionValidationResponse can be used to build the response." + }, + "object": { + "type": "object", + "properties": {} + } + }, + "parameters": {} +} diff --git a/specification/eventgrid/data-plane/cadl/package-lock.json b/specification/eventgrid/data-plane/cadl/package-lock.json index 3c0504d3208c..681ffdfd828a 100644 --- a/specification/eventgrid/data-plane/cadl/package-lock.json +++ b/specification/eventgrid/data-plane/cadl/package-lock.json @@ -12,6 +12,10 @@ "@cadl-lang/compiler": "latest", "@cadl-lang/openapi3": "latest", "@cadl-lang/rest": "latest" + }, + "devDependencies": { + "@cadl-lang/prettier-plugin-cadl": "^0.5.17", + "prettier": "^2.8.0" } }, "node_modules/@azure-tools/cadl-autorest": { @@ -142,6 +146,20 @@ "node": ">=16.0.0" } }, + "node_modules/@cadl-lang/compiler/node_modules/prettier": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", + "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "node_modules/@cadl-lang/lint": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/@cadl-lang/lint/-/lint-0.3.0.tgz", @@ -180,6 +198,30 @@ "@cadl-lang/versioning": "~0.10.0" } }, + "node_modules/@cadl-lang/prettier-plugin-cadl": { + "version": "0.5.17", + "resolved": "https://registry.npmjs.org/@cadl-lang/prettier-plugin-cadl/-/prettier-plugin-cadl-0.5.17.tgz", + "integrity": "sha512-s1poDYYGJBfnz76lU82wKS6HdlBxz9Cd3/54QOudOiKn9elFsXA4LwWI2BiCPOqlJhcGTgZayrvth6cGh1mqLQ==", + "dev": true, + "dependencies": { + "prettier": "~2.7.1" + } + }, + "node_modules/@cadl-lang/prettier-plugin-cadl/node_modules/prettier": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", + "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", + "dev": true, + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "node_modules/@cadl-lang/rest": { "version": "0.19.0", "resolved": "https://registry.npmjs.org/@cadl-lang/rest/-/rest-0.19.0.tgz", @@ -767,9 +809,10 @@ } }, "node_modules/prettier": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", - "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.0.tgz", + "integrity": "sha512-9Lmg8hTFZKG0Asr/kW9Bp8tJjRVluO8EJQVfY2T7FMw9T5jy4I/Uvx0Rca/XWf50QQ1/SS48+6IJWnrb+2yemA==", + "dev": true, "bin": { "prettier": "bin-prettier.js" }, @@ -1175,6 +1218,13 @@ "vscode-languageserver": "~7.0.0", "vscode-languageserver-textdocument": "~1.0.1", "yargs": "~17.3.1" + }, + "dependencies": { + "prettier": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", + "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==" + } } }, "@cadl-lang/lint": { @@ -1196,6 +1246,23 @@ "integrity": "sha512-O7qx81jmz4p3IbQk+au7LC98DV7noeGq/8herJ/A+H2heZ/c0Z0wyoVhENk69QHhoPsKUiGxLeWH/yNie0qsiQ==", "requires": {} }, + "@cadl-lang/prettier-plugin-cadl": { + "version": "0.5.17", + "resolved": "https://registry.npmjs.org/@cadl-lang/prettier-plugin-cadl/-/prettier-plugin-cadl-0.5.17.tgz", + "integrity": "sha512-s1poDYYGJBfnz76lU82wKS6HdlBxz9Cd3/54QOudOiKn9elFsXA4LwWI2BiCPOqlJhcGTgZayrvth6cGh1mqLQ==", + "dev": true, + "requires": { + "prettier": "~2.7.1" + }, + "dependencies": { + "prettier": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", + "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", + "dev": true + } + } + }, "@cadl-lang/rest": { "version": "0.19.0", "resolved": "https://registry.npmjs.org/@cadl-lang/rest/-/rest-0.19.0.tgz", @@ -1633,9 +1700,10 @@ "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" }, "prettier": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", - "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==" + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.0.tgz", + "integrity": "sha512-9Lmg8hTFZKG0Asr/kW9Bp8tJjRVluO8EJQVfY2T7FMw9T5jy4I/Uvx0Rca/XWf50QQ1/SS48+6IJWnrb+2yemA==", + "dev": true }, "prompts": { "version": "2.4.2", diff --git a/specification/eventgrid/data-plane/cadl/package.json b/specification/eventgrid/data-plane/cadl/package.json index 31513350918b..aec573137534 100644 --- a/specification/eventgrid/data-plane/cadl/package.json +++ b/specification/eventgrid/data-plane/cadl/package.json @@ -8,5 +8,9 @@ "@cadl-lang/openapi3": "latest", "@cadl-lang/rest": "latest" }, - "private": true + "private": true, + "devDependencies": { + "@cadl-lang/prettier-plugin-cadl": "^0.5.17", + "prettier": "^2.8.0" + } } From 9e2c10eb18bb4ca48332fbe23d54415ec387f595 Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Tue, 6 Dec 2022 15:09:47 -0800 Subject: [PATCH 38/65] working on adding publish to EG cadl --- .../eventgrid/data-plane/cadl/EventGrid.cadl | 198 +++++++++++------- .../eventgrid/data-plane/cadl/IotHub.cadl | 2 + 2 files changed, 127 insertions(+), 73 deletions(-) diff --git a/specification/eventgrid/data-plane/cadl/EventGrid.cadl b/specification/eventgrid/data-plane/cadl/EventGrid.cadl index 266ebe67798b..2da21728efbe 100644 --- a/specification/eventgrid/data-plane/cadl/EventGrid.cadl +++ b/specification/eventgrid/data-plane/cadl/EventGrid.cadl @@ -2,114 +2,166 @@ import "@cadl-lang/rest"; import "@cadl-lang/versioning"; import "@azure-tools/cadl-providerhub"; import "@azure-tools/cadl-azure-core"; +import "@azure-tools/cadl-azure-resource-manager"; @service({ title: "EventGridClient", version: "2018-01-01", }) @server( - "{topicHostname}", - "example", + "https://{topicHostname}", + "The host name of the topic", { @doc("The host name of the topic, e.g. topic1.westus2-1.eventgrid.azure.net") topicHostname: string, } ) @doc("Azure EventGrid Client") -namespace Microsoft.EventGrid; +namespace Microsoft.EventGrid { -using Cadl.Http; -using Cadl.Rest; -using Cadl.Versioning; -using Azure.Core; + using Cadl.Http; + using Cadl.Rest; + using Cadl.Versioning; + using Azure.Core; -//TODO: add in publish here + @doc("Properties of an event published to an Event Grid topic using the EventGrid Schema.") + model EventGridEvent { + @doc("An unique identifier for the event.") + id: string; -@doc("Properties of an event published to an Event Grid topic using the EventGrid Schema.") -model EventGridEvent { - @doc("An unique identifier for the event.") - id: string; + @doc("The resource path of the event source.") + topic?: string; - @doc("The resource path of the event source.") - topic?: string; + @doc("A resource path relative to the topic path.") + subject: string; - @doc("A resource path relative to the topic path.") - subject: string; + @doc("Event data specific to the event type.") + data: object; - @doc("Event data specific to the event type.") - data: object; + @doc("The type of the event that occurred.") + eventType: string; - @doc("The type of the event that occurred.") - eventType: string; + @doc("The time (in UTC) the event was generated.") + eventTime: zonedDateTime; - @doc("The time (in UTC) the event was generated.") - eventTime: zonedDateTime; + @doc("The schema version of the event metadata.") + @visibility("read") + metadataVersion?: string; - @doc("The schema version of the event metadata.") - @visibility("read") - metadataVersion?: string; + @doc("The schema version of the data object.") + dataVersion: string; + } - @doc("The schema version of the data object.") - dataVersion: string; -} + @doc("Properties of an event published to an Event Grid 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; -//TODO: how to get additional properties true? -@doc("Properties of an event published to an Event Grid 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("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.") - data?: object; + @doc("Event data specific to the event type, encoded as a base64 string.") + data_base64?: bytes; - @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; - @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 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("The version of the CloudEvents specification which the event uses.") - specversion: string; + @doc("Identifies the schema that data adheres to.") + dataschema?: string; - @doc("Identifies the schema that data adheres to.") - dataschema?: string; + @doc("Content type of data value.") + datacontenttype?: 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("This describes the subject of the event in the context of the event producer (identified by source).") - subject?: string; -} + @doc("Properties of an event published to an Event Grid topic using a custom schema") + model CustomEventEvent {} -@doc("Properties of an event published to an Event Grid topic using a custom schema") -model CustomEventEvent {} + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.EventGrid.SubscriptionValidationEvent event.") + model SubscriptionValidationEventData { + @doc("The validation code sent by Azure Event Grid to validate an event subscription. To complete the validation handshake, the subscriber must either respond with this validation code as part of the validation response, or perform a GET request on the validationUrl (available starting version 2018-05-01-preview).") + @visibility("read") + validationCode?: string; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.EventGrid.SubscriptionValidationEvent event.") -model SubscriptionValidationEventData { - @doc("The validation code sent by Azure Event Grid to validate an event subscription. To complete the validation handshake, the subscriber must either respond with this validation code as part of the validation response, or perform a GET request on the validationUrl (available starting version 2018-05-01-preview).") - @visibility("read") - validationCode?: string; + @doc("The validation URL sent by Azure Event Grid (available starting version 2018-05-01-preview). To complete the validation handshake, the subscriber must either respond with the validationCode as part of the validation response, or perform a GET request on the validationUrl (available starting version 2018-05-01-preview).") + @visibility("read") + validationUrl?: string; + } - @doc("The validation URL sent by Azure Event Grid (available starting version 2018-05-01-preview). To complete the validation handshake, the subscriber must either respond with the validationCode as part of the validation response, or perform a GET request on the validationUrl (available starting version 2018-05-01-preview).") - @visibility("read") - validationUrl?: string; -} + @doc("To complete an event subscription validation handshake, a subscriber can use either the validationCode or the validationUrl received in a SubscriptionValidationEvent. When the validationCode is used, the SubscriptionValidationResponse can be used to build the response.") + model SubscriptionValidationResponse { + @doc("The validation response sent by the subscriber to Azure Event Grid to complete the validation of an event subscription.") + validationResponse?: string; + } -@doc("To complete an event subscription validation handshake, a subscriber can use either the validationCode or the validationUrl received in a SubscriptionValidationEvent. When the validationCode is used, the SubscriptionValidationResponse can be used to build the response.") -model SubscriptionValidationResponse { - @doc("The validation response sent by the subscriber to Azure Event Grid to complete the validation of an event subscription.") - validationResponse?: string; -} + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.EventGrid.SubscriptionDeletedEvent event.") + model SubscriptionDeletedEventData { + @doc("The Azure resource ID of the deleted event subscription.") + @visibility("read") + eventSubscriptionId?: string; + } + + model ApiVersionParameter { + @doc("Version of the API to be used with the client request.") + @query + "api-version": string; + } + + model ChannelNameParameter { + @doc("Required only when publishing to partner namespaces with partner topic routing mode ChannelNameHeader.") + @query + "aeg-channel-name"?: string; + } + + @post + @route("?overload=EventGridEvent") + @tag("Events") + @doc("Publishes a batch of events to an Azure Event Grid topic.") + op PublishEventGridEvents( + @doc("An array of events to be published to Event Grid.") + @body + events: EventGridEvent[], + ...ApiVersionParameter, + ): OkResponse; + // missing default response + + @post + @route("?overload=cloudEvent") + @tag("Events") + @doc("Publishes a batch of events to an Azure Event Grid topic.") + op PublishCloudEventEvents( + @doc("An array of events to be published to Event Grid.") + @body + events: CloudEventEvent[], + ...ApiVersionParameter, + ...ChannelNameParameter, + ): OkResponse; + // missing default response + + @post + @route("?overload=customEvent") + @tag("Events") + @doc("Publishes a batch of events to an Azure Event Grid topic.") + op PublishCustomEventEvents( + @doc("An array of events to be published to Event Grid.") + @body + events: CustomEventEvent[], + ...ApiVersionParameter, + ): OkResponse; + // missing default response -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.EventGrid.SubscriptionDeletedEvent event.") -model SubscriptionDeletedEventData { - @doc("The Azure resource ID of the deleted event subscription.") - @visibility("read") - eventSubscriptionId?: string; } + + + diff --git a/specification/eventgrid/data-plane/cadl/IotHub.cadl b/specification/eventgrid/data-plane/cadl/IotHub.cadl index b0c7459e33c1..135d02a1c7fd 100644 --- a/specification/eventgrid/data-plane/cadl/IotHub.cadl +++ b/specification/eventgrid/data-plane/cadl/IotHub.cadl @@ -38,6 +38,7 @@ model DeviceTwinInfo { lastActivityTime?: string; //TODO: something here needs to change + @doc("Properties JSON element.") properties?: PropertiesJson; @@ -51,6 +52,7 @@ model DeviceTwinInfo { version?: integer; //TODO: also here + @doc("The thumbprint is a unique value for the x509 certificate, commonly used to find a particular certificate in a certificate store. The thumbprint is dynamically generated using the SHA1 algorithm, and does not physically exist in the certificate.") x509Thumbprint?: ThumbPrintValue; } From 5846e93099a021a79704cf7bbccfc2c014a88abd Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Tue, 6 Dec 2022 15:48:37 -0800 Subject: [PATCH 39/65] updating EG cadl --- .../eventgrid/data-plane/cadl/EventGrid.cadl | 12 +++++++----- .../eventgrid/data-plane/cadl/package-lock.json | 3 +-- specification/eventgrid/data-plane/cadl/package.json | 1 + 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/specification/eventgrid/data-plane/cadl/EventGrid.cadl b/specification/eventgrid/data-plane/cadl/EventGrid.cadl index 2da21728efbe..e533c4481731 100644 --- a/specification/eventgrid/data-plane/cadl/EventGrid.cadl +++ b/specification/eventgrid/data-plane/cadl/EventGrid.cadl @@ -1,15 +1,14 @@ import "@cadl-lang/rest"; +import "@cadl-lang/openapi"; import "@cadl-lang/versioning"; import "@azure-tools/cadl-providerhub"; -import "@azure-tools/cadl-azure-core"; -import "@azure-tools/cadl-azure-resource-manager"; @service({ title: "EventGridClient", version: "2018-01-01", }) @server( - "https://{topicHostname}", + "{topicHostname}", "The host name of the topic", { @doc("The host name of the topic, e.g. topic1.westus2-1.eventgrid.azure.net") @@ -22,7 +21,7 @@ namespace Microsoft.EventGrid { using Cadl.Http; using Cadl.Rest; using Cadl.Versioning; - using Azure.Core; + using OpenAPI; @doc("Properties of an event published to an Event Grid topic using the EventGrid Schema.") model EventGridEvent { @@ -154,14 +153,17 @@ namespace Microsoft.EventGrid { @tag("Events") @doc("Publishes a batch of events to an Azure Event Grid topic.") op PublishCustomEventEvents( + @extension("x-ms-identifiers", []) @doc("An array of events to be published to Event Grid.") @body events: CustomEventEvent[], ...ApiVersionParameter, ): OkResponse; // missing default response - + } + + diff --git a/specification/eventgrid/data-plane/cadl/package-lock.json b/specification/eventgrid/data-plane/cadl/package-lock.json index 681ffdfd828a..4d10060726bf 100644 --- a/specification/eventgrid/data-plane/cadl/package-lock.json +++ b/specification/eventgrid/data-plane/cadl/package-lock.json @@ -10,6 +10,7 @@ "@azure-tools/cadl-azure-core": "^0.9.0", "@azure-tools/cadl-providerhub": "^0.23.0", "@cadl-lang/compiler": "latest", + "@cadl-lang/openapi": "^0.14.0", "@cadl-lang/openapi3": "latest", "@cadl-lang/rest": "latest" }, @@ -175,7 +176,6 @@ "version": "0.14.0", "resolved": "https://registry.npmjs.org/@cadl-lang/openapi/-/openapi-0.14.0.tgz", "integrity": "sha512-jjjTKVLC1OGJeDstDPfLgRzcnaGlt9LtJz3brheJMTX9l8eItUq+bJi5+dWo6TG4P5oqcX6HHPxeh8oRREoM7Q==", - "peer": true, "engines": { "node": ">=16.0.0" }, @@ -1237,7 +1237,6 @@ "version": "0.14.0", "resolved": "https://registry.npmjs.org/@cadl-lang/openapi/-/openapi-0.14.0.tgz", "integrity": "sha512-jjjTKVLC1OGJeDstDPfLgRzcnaGlt9LtJz3brheJMTX9l8eItUq+bJi5+dWo6TG4P5oqcX6HHPxeh8oRREoM7Q==", - "peer": true, "requires": {} }, "@cadl-lang/openapi3": { diff --git a/specification/eventgrid/data-plane/cadl/package.json b/specification/eventgrid/data-plane/cadl/package.json index aec573137534..0cf73d6194e5 100644 --- a/specification/eventgrid/data-plane/cadl/package.json +++ b/specification/eventgrid/data-plane/cadl/package.json @@ -5,6 +5,7 @@ "@azure-tools/cadl-azure-core": "^0.9.0", "@azure-tools/cadl-providerhub": "^0.23.0", "@cadl-lang/compiler": "latest", + "@cadl-lang/openapi": "^0.14.0", "@cadl-lang/openapi3": "latest", "@cadl-lang/rest": "latest" }, From 730a4ee2bbd8c4682455f9e9b63648b8449a3190 Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Wed, 7 Dec 2022 14:38:49 -0800 Subject: [PATCH 40/65] updated cadl version --- .../cadl/AzureCommunicationServices.cadl | 14 +-- .../cadl/AzureCommunicationServicesCore.cadl | 5 +- .../data-plane/cadl/HealthcareApis.cadl | 32 +++--- .../eventgrid/data-plane/cadl/Web.cadl | 97 ++++++++----------- .../eventgrid/data-plane/cadl/package.json | 32 +++--- 5 files changed, 84 insertions(+), 96 deletions(-) diff --git a/specification/eventgrid/data-plane/cadl/AzureCommunicationServices.cadl b/specification/eventgrid/data-plane/cadl/AzureCommunicationServices.cadl index 80db802a3d87..b1c27d79bf7d 100644 --- a/specification/eventgrid/data-plane/cadl/AzureCommunicationServices.cadl +++ b/specification/eventgrid/data-plane/cadl/AzureCommunicationServices.cadl @@ -210,23 +210,19 @@ model AcsSmsReceivedEventData extends AcsSmsEventBaseProperties { receivedTimestamp?: zonedDateTime; } -@knownValues(recordingContentTypeKV) -model recordingContentType is string; -enum recordingContentTypeKV { +// @knownValues(recordingContentTypeKV) +// model recordingContentType is string; +enum recordingContentType { AudioVideo, Audio, } -@knownValues(recordingChannelTypeKV) -model recordingChannelType is string; -enum recordingChannelTypeKV { +enum recordingChannelType { Mixed, Unmixed, } -@knownValues(recordingFormatTypeKV) -model recordingFormatType is string; -enum recordingFormatTypeKV { +enum recordingFormatType { Wav, Mp3, Mp4, diff --git a/specification/eventgrid/data-plane/cadl/AzureCommunicationServicesCore.cadl b/specification/eventgrid/data-plane/cadl/AzureCommunicationServicesCore.cadl index a51e3ae774dc..e2c79bf48f27 100644 --- a/specification/eventgrid/data-plane/cadl/AzureCommunicationServicesCore.cadl +++ b/specification/eventgrid/data-plane/cadl/AzureCommunicationServicesCore.cadl @@ -37,10 +37,7 @@ model CommunicationUserIdentifierModel { id: string; } -@knownValues(CommunicationCloudEnvironmentModelKV) -@doc("The cloud that the identifier belongs to.") -model CommunicationCloudEnvironmentModel is string; -enum CommunicationCloudEnvironmentModelKV { +enum CommunicationCloudEnvironmentModel { public, dod, gcch, diff --git a/specification/eventgrid/data-plane/cadl/HealthcareApis.cadl b/specification/eventgrid/data-plane/cadl/HealthcareApis.cadl index 6c67332049d1..2a9031ccf0f6 100644 --- a/specification/eventgrid/data-plane/cadl/HealthcareApis.cadl +++ b/specification/eventgrid/data-plane/cadl/HealthcareApis.cadl @@ -63,24 +63,8 @@ namespace HealthCareApis { // model HealthcareFhirResourceType is string {} - @knownValues(BaseEvent.HealthcareFhirResourceTypeKV) @doc("Schema of FHIR resource type enumeration.") - model HealthcareFhirResourceType is string; -} - -namespace BaseEvent { - model HealthcareFhirResourceBaseEventData { - @doc("Domain name of FHIR account for this resource.") - resourceFhirAccount?: string; - - @doc("Id of HL7 FHIR resource.") - resourceFhirId?: string; - - @doc("VersionId of HL7 FHIR resource. It changes when the resource is created, updated, or deleted(soft-deletion).") - resourceVersionId?: int64; - } - - enum HealthcareFhirResourceTypeKV { + enum HealthcareFhirResourceType { @doc("The FHIR resource type defined in STU3 and R4.") Account, @@ -564,4 +548,18 @@ namespace BaseEvent { @doc("The FHIR resource type defined in STU3 and R4.") VisionPrescription, } + +} + +namespace BaseEvent { + model HealthcareFhirResourceBaseEventData { + @doc("Domain name of FHIR account for this resource.") + resourceFhirAccount?: string; + + @doc("Id of HL7 FHIR resource.") + resourceFhirId?: string; + + @doc("VersionId of HL7 FHIR resource. It changes when the resource is created, updated, or deleted(soft-deletion).") + resourceVersionId?: int64; + } } diff --git a/specification/eventgrid/data-plane/cadl/Web.cadl b/specification/eventgrid/data-plane/cadl/Web.cadl index 42cfa9ec16cb..0fbf58900f9f 100644 --- a/specification/eventgrid/data-plane/cadl/Web.cadl +++ b/specification/eventgrid/data-plane/cadl/Web.cadl @@ -74,14 +74,41 @@ namespace Web { sku?: BaseEvents.sku; } - @knownValues(BaseEvents.AppActionKV) - model AppAction is string; + enum AppAction { + @doc("Web app was restarted.") + Restarted, - @knownValues(BaseEvents.StampKindKV) - model StampKind is string; + @doc("Web app was stopped.") + Stopped, - @knownValues(BaseEvents.AppServicePlanActionKV) - model AppServicePlanAction is string; + @doc("There was an operation to change app setting on the web app.") + ChangedAppSettings, + + @doc("The job has started.") + Started, + + @doc("The job has completed.") + Completed, + + @doc("The job has failed to complete.") + Failed, + } + + enum StampKind { + @doc("App Service Plan is running on a public stamp.") + Public, + + @doc("App Service Plan is running on an App Service Environment V1.") + AseV1, + + @doc("App Service Plan is running on an App Service Environment V2.") + AseV2, + } + + enum AppServicePlanAction { + @doc("App Service plan is being updated.") + Updated, + } @doc("Detail of action on the app service plan.") model AppServicePlanEventTypeDetail { @@ -93,8 +120,16 @@ namespace Web { status?: AsyncStatus; } - @knownValues(BaseEvents.AsyncStatusKV) - model AsyncStatus is string; + enum AsyncStatus { + @doc("Async operation has started.") + Started, + + @doc("Async operation has completed.") + Completed, + + @doc("Async operation failed to complete.") + Failed, + } } namespace BaseEvents { @@ -138,50 +173,4 @@ namespace BaseEvents { Capacity?: string; } - enum AppActionKV { - @doc("Web app was restarted.") - Restarted, - - @doc("Web app was stopped.") - Stopped, - - @doc("There was an operation to change app setting on the web app.") - ChangedAppSettings, - - @doc("The job has started.") - Started, - - @doc("The job has completed.") - Completed, - - @doc("The job has failed to complete.") - Failed, - } - - enum StampKindKV { - @doc("App Service Plan is running on a public stamp.") - Public, - - @doc("App Service Plan is running on an App Service Environment V1.") - AseV1, - - @doc("App Service Plan is running on an App Service Environment V2.") - AseV2, - } - - enum AppServicePlanActionKV { - @doc("App Service plan is being updated.") - Updated, - } - - enum AsyncStatusKV { - @doc("Async operation has started.") - Started, - - @doc("Async operation has completed.") - Completed, - - @doc("Async operation failed to complete.") - Failed, - } } diff --git a/specification/eventgrid/data-plane/cadl/package.json b/specification/eventgrid/data-plane/cadl/package.json index 0cf73d6194e5..1a957a3ee182 100644 --- a/specification/eventgrid/data-plane/cadl/package.json +++ b/specification/eventgrid/data-plane/cadl/package.json @@ -1,17 +1,25 @@ { "name": "cadl", - "dependencies": { - "@azure-tools/cadl-autorest": "^0.22.0", - "@azure-tools/cadl-azure-core": "^0.9.0", - "@azure-tools/cadl-providerhub": "^0.23.0", - "@cadl-lang/compiler": "latest", - "@cadl-lang/openapi": "^0.14.0", - "@cadl-lang/openapi3": "latest", - "@cadl-lang/rest": "latest" + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" }, - "private": true, - "devDependencies": { - "@cadl-lang/prettier-plugin-cadl": "^0.5.17", - "prettier": "^2.8.0" + "author": "", + "license": "ISC", + "dependencies": { + "@azure-tools/cadl-autorest": "latest", + "@azure-tools/cadl-azure-core": "^0.24.0", + "@azure-tools/cadl-providerhub": "^0.24.0", + "@cadl-lang/compiler": "^0.38.0", + "@cadl-lang/openapi": "^0.38.0", + "@cadl-lang/openapi3": "^0.38.0", + "@cadl-lang/prettier-plugin-cadl": "^0.38.0", + "@cadl-lang/rest": "^0.38.0", + "@cadl-lang/versioning": "^0.38.0", + "cadl-vs": "^0.38.0", + "cadl-vscode": "^0.38.0", + "tmlanguage-generator": "^0.3.2" } } From bbfce94dee9b1532cf6213e907018c8fa92112fa Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Fri, 9 Dec 2022 13:28:58 -0800 Subject: [PATCH 41/65] remove service --- specification/eventgrid/data-plane/cadl/ApiManagement.cadl | 4 ---- specification/eventgrid/data-plane/cadl/AppConfiguration.cadl | 4 ---- .../eventgrid/data-plane/cadl/AzureCommunicationServices.cadl | 4 ---- .../eventgrid/data-plane/cadl/ContainerRegistry.cadl | 4 ---- specification/eventgrid/data-plane/cadl/ContainerService.cadl | 4 ---- specification/eventgrid/data-plane/cadl/EventHub.cadl | 4 ---- specification/eventgrid/data-plane/cadl/HealthcareApis.cadl | 4 ---- specification/eventgrid/data-plane/cadl/IotHub.cadl | 4 ---- specification/eventgrid/data-plane/cadl/KeyVault.cadl | 4 ---- .../eventgrid/data-plane/cadl/MachineLearningServices.cadl | 4 ---- specification/eventgrid/data-plane/cadl/Maps.cadl | 4 ---- specification/eventgrid/data-plane/cadl/MediaServices.cadl | 4 ---- specification/eventgrid/data-plane/cadl/PolicyInsights.cadl | 4 ---- specification/eventgrid/data-plane/cadl/RedisCache.cadl | 4 ---- specification/eventgrid/data-plane/cadl/Resources.cadl | 4 ---- specification/eventgrid/data-plane/cadl/ServiceBus.cadl | 4 ---- specification/eventgrid/data-plane/cadl/SignalRService.cadl | 4 ---- specification/eventgrid/data-plane/cadl/Storage.cadl | 4 ---- specification/eventgrid/data-plane/cadl/Web.cadl | 4 ---- 19 files changed, 76 deletions(-) diff --git a/specification/eventgrid/data-plane/cadl/ApiManagement.cadl b/specification/eventgrid/data-plane/cadl/ApiManagement.cadl index 2ce1cd719cbb..a0acca58762b 100644 --- a/specification/eventgrid/data-plane/cadl/ApiManagement.cadl +++ b/specification/eventgrid/data-plane/cadl/ApiManagement.cadl @@ -1,7 +1,3 @@ -@service({ - title: "Schema of Azure API Management events published to Azure Event Grid", - version: "2018-01-01", -}) @doc("Describes the schema of the Azure API Management events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") namespace ApiManagement { @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.UserCreated event.") diff --git a/specification/eventgrid/data-plane/cadl/AppConfiguration.cadl b/specification/eventgrid/data-plane/cadl/AppConfiguration.cadl index 2488d50e4363..e23c1d536ac3 100644 --- a/specification/eventgrid/data-plane/cadl/AppConfiguration.cadl +++ b/specification/eventgrid/data-plane/cadl/AppConfiguration.cadl @@ -1,7 +1,3 @@ -@service({ - title: "Schema of Azure App Configuration events published to Azure Event Grid", - version: "2018-01-01", -}) @doc("Describes the schema of the Azure App Configuration events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") namespace AppConfiguration; diff --git a/specification/eventgrid/data-plane/cadl/AzureCommunicationServices.cadl b/specification/eventgrid/data-plane/cadl/AzureCommunicationServices.cadl index b1c27d79bf7d..1f25d5c08e70 100644 --- a/specification/eventgrid/data-plane/cadl/AzureCommunicationServices.cadl +++ b/specification/eventgrid/data-plane/cadl/AzureCommunicationServices.cadl @@ -1,9 +1,5 @@ import "./AzureCommunicationServicesCore.cadl"; -@service({ - title: "Schema of Azure Communication Services events published to Azure Event Grid", - version: "2018-01-01", -}) @doc("Describes the schema of the Azure Communication Services events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") namespace AzureCommunicationServices; diff --git a/specification/eventgrid/data-plane/cadl/ContainerRegistry.cadl b/specification/eventgrid/data-plane/cadl/ContainerRegistry.cadl index 9a8aaf5dbfb3..6b5a9e1188c0 100644 --- a/specification/eventgrid/data-plane/cadl/ContainerRegistry.cadl +++ b/specification/eventgrid/data-plane/cadl/ContainerRegistry.cadl @@ -1,7 +1,3 @@ -@service({ - title: "Schema of Azure Container Registry events published to Azure Event Grid", - version: "2018-01-01", -}) @doc("Describes the schema of the Azure Container Registry events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") namespace ContainerRegistry { @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ContainerRegistry.ImagePushed event.") diff --git a/specification/eventgrid/data-plane/cadl/ContainerService.cadl b/specification/eventgrid/data-plane/cadl/ContainerService.cadl index d539bc8775e0..255331a1d55a 100644 --- a/specification/eventgrid/data-plane/cadl/ContainerService.cadl +++ b/specification/eventgrid/data-plane/cadl/ContainerService.cadl @@ -1,7 +1,3 @@ -@service({ - title: "Schema of Azure Kubernetes Service events published to Azure Event Grid", - version: "2018-01-01", -}) @doc("Describes the schema of the Azure Kubernetes Service events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent") namespace ContainerService; diff --git a/specification/eventgrid/data-plane/cadl/EventHub.cadl b/specification/eventgrid/data-plane/cadl/EventHub.cadl index 91cfd50c72d1..65ea4052ccea 100644 --- a/specification/eventgrid/data-plane/cadl/EventHub.cadl +++ b/specification/eventgrid/data-plane/cadl/EventHub.cadl @@ -1,7 +1,3 @@ -@service({ - title: "Schema of Azure EventHub events published to Azure Event Grid", - version: "2018-01-01", -}) @doc("Describes the schema of the Azure EventHub events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") namespace EventHub; diff --git a/specification/eventgrid/data-plane/cadl/HealthcareApis.cadl b/specification/eventgrid/data-plane/cadl/HealthcareApis.cadl index 2a9031ccf0f6..30e8f4890db5 100644 --- a/specification/eventgrid/data-plane/cadl/HealthcareApis.cadl +++ b/specification/eventgrid/data-plane/cadl/HealthcareApis.cadl @@ -1,7 +1,3 @@ -@service({ - title: "Schema of Azure HealthcareApis events published to Azure Event Grid.", - version: "2018-01-01", -}) @doc("Describes the schema of the Azure HealthcareApis events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") namespace HealthCareApis { @doc("Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.FhirResourceCreated event.") diff --git a/specification/eventgrid/data-plane/cadl/IotHub.cadl b/specification/eventgrid/data-plane/cadl/IotHub.cadl index 135d02a1c7fd..ba2f246bc08e 100644 --- a/specification/eventgrid/data-plane/cadl/IotHub.cadl +++ b/specification/eventgrid/data-plane/cadl/IotHub.cadl @@ -1,7 +1,3 @@ -@service({ - title: "Schema of Azure IoT Hub events published to Azure Event Grid", - version: "2018-01-01", -}) @doc("Describes the schema of the Azure IoT Hub events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") namespace IoTHub; diff --git a/specification/eventgrid/data-plane/cadl/KeyVault.cadl b/specification/eventgrid/data-plane/cadl/KeyVault.cadl index 22e135d2b14f..62abb4b562ae 100644 --- a/specification/eventgrid/data-plane/cadl/KeyVault.cadl +++ b/specification/eventgrid/data-plane/cadl/KeyVault.cadl @@ -1,7 +1,3 @@ -@service({ - title: "Schema of Azure Key Vault events published to Azure Event Grid", - version: "2018-01-01", -}) @doc("Describes the schema of the Azure Key Vault events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") namespace KeyVault { @doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.CertificateNewVersionCreated event.") diff --git a/specification/eventgrid/data-plane/cadl/MachineLearningServices.cadl b/specification/eventgrid/data-plane/cadl/MachineLearningServices.cadl index eab1364d3146..e7aabfbc784d 100644 --- a/specification/eventgrid/data-plane/cadl/MachineLearningServices.cadl +++ b/specification/eventgrid/data-plane/cadl/MachineLearningServices.cadl @@ -1,7 +1,3 @@ -@service({ - title: "Schema of Azure Machine Learning Services events published to Azure Event Grid", - version: "2018-01-01", -}) @doc("Describes the schema of the Azure Machine Learning Services events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") namespace MachineLearningServices; diff --git a/specification/eventgrid/data-plane/cadl/Maps.cadl b/specification/eventgrid/data-plane/cadl/Maps.cadl index 0d75e45ec4fe..8b378ba4d3ae 100644 --- a/specification/eventgrid/data-plane/cadl/Maps.cadl +++ b/specification/eventgrid/data-plane/cadl/Maps.cadl @@ -1,7 +1,3 @@ -@service({ - title: "Schema of Azure Maps events published to Azure Event Grid", - version: "2018-01-01", -}) @doc("Describes the schema of the Azure Maps events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") namespace Maps; diff --git a/specification/eventgrid/data-plane/cadl/MediaServices.cadl b/specification/eventgrid/data-plane/cadl/MediaServices.cadl index 56e369129012..d68cf2938b06 100644 --- a/specification/eventgrid/data-plane/cadl/MediaServices.cadl +++ b/specification/eventgrid/data-plane/cadl/MediaServices.cadl @@ -1,7 +1,3 @@ -@service({ - title: "Schema of Azure Media Services events published to Azure Event Grid", - version: "2018-01-01", -}) @doc("Describes the schema of the Azure Media Services events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") namespace MediaServices { enum MediaJobState { diff --git a/specification/eventgrid/data-plane/cadl/PolicyInsights.cadl b/specification/eventgrid/data-plane/cadl/PolicyInsights.cadl index a3385451a2e3..b7323ef32730 100644 --- a/specification/eventgrid/data-plane/cadl/PolicyInsights.cadl +++ b/specification/eventgrid/data-plane/cadl/PolicyInsights.cadl @@ -1,7 +1,3 @@ -@service({ - title: "Schema of Azure Policy events published to Azure Event Grid", - version: "2018-01-01", -}) @doc("Describes the schema of the Azure Policy events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") namespace PolicyInsights { @doc("Schema of the Data property of an EventGridEvent for a Microsoft.PolicyInsights.PolicyStateCreated event.") diff --git a/specification/eventgrid/data-plane/cadl/RedisCache.cadl b/specification/eventgrid/data-plane/cadl/RedisCache.cadl index 53cbd02fec72..27a964cbfe97 100644 --- a/specification/eventgrid/data-plane/cadl/RedisCache.cadl +++ b/specification/eventgrid/data-plane/cadl/RedisCache.cadl @@ -1,7 +1,3 @@ -@service({ - title: "Schema of Redis Cache events published to Azure Event Grid", - version: "2018-01-01", -}) @doc("Describes the schema of the Redis Cache events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") namespace RedisCache; diff --git a/specification/eventgrid/data-plane/cadl/Resources.cadl b/specification/eventgrid/data-plane/cadl/Resources.cadl index 304f52396cde..a9501b129d5c 100644 --- a/specification/eventgrid/data-plane/cadl/Resources.cadl +++ b/specification/eventgrid/data-plane/cadl/Resources.cadl @@ -1,7 +1,3 @@ -@service({ - title: "Schema of Azure resource events published to Azure Event Grid", - version: "2018-01-01", -}) @doc("Describes the schema of the Azure resource events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") namespace Resources { @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceWriteSuccess event. This is raised when a resource create or update operation succeeds.") diff --git a/specification/eventgrid/data-plane/cadl/ServiceBus.cadl b/specification/eventgrid/data-plane/cadl/ServiceBus.cadl index 767e295fd0c4..7238bd8146bf 100644 --- a/specification/eventgrid/data-plane/cadl/ServiceBus.cadl +++ b/specification/eventgrid/data-plane/cadl/ServiceBus.cadl @@ -1,7 +1,3 @@ -@service({ - title: "Schema of Azure ServiceBus Messaging events published to Azure Event Grid", - version: "2018-01-01", -}) @doc("Describes the schema of the Azure ServiceBus Messaging events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") namespace ServiceBus { @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ServiceBus.ActiveMessagesAvailableWithNoListeners event.") diff --git a/specification/eventgrid/data-plane/cadl/SignalRService.cadl b/specification/eventgrid/data-plane/cadl/SignalRService.cadl index 89bd923167bd..6861a3eee007 100644 --- a/specification/eventgrid/data-plane/cadl/SignalRService.cadl +++ b/specification/eventgrid/data-plane/cadl/SignalRService.cadl @@ -1,7 +1,3 @@ -@service({ - title: "Schema of Azure SignalR Service events published to Azure Event Grid", - version: "2018-01-01", -}) @doc("Describes the schema of the Azure SignalR Service events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") namespace SignalRService { @doc("Schema of the Data property of an EventGridEvent for a Microsoft.SignalRService.ClientConnectionConnected event.") diff --git a/specification/eventgrid/data-plane/cadl/Storage.cadl b/specification/eventgrid/data-plane/cadl/Storage.cadl index a5d43923c041..e12ec6dd3288 100644 --- a/specification/eventgrid/data-plane/cadl/Storage.cadl +++ b/specification/eventgrid/data-plane/cadl/Storage.cadl @@ -1,7 +1,3 @@ -@service({ - title: "Schema of Azure Storage events published to Azure Event Grid", - version: "2018-01-01", -}) @doc("Describes the schema of the Azure Storage events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") namespace Storage { @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Storage.BlobCreated event.") diff --git a/specification/eventgrid/data-plane/cadl/Web.cadl b/specification/eventgrid/data-plane/cadl/Web.cadl index 0fbf58900f9f..e0afc8996bee 100644 --- a/specification/eventgrid/data-plane/cadl/Web.cadl +++ b/specification/eventgrid/data-plane/cadl/Web.cadl @@ -1,7 +1,3 @@ -@service({ - title: "Schema of Azure App Service events published to Azure Event Grid", - version: "2018-01-01", -}) @doc("Describes the schema of the Azure App Service events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") namespace Web { @doc("Detail of action on the app.") From d2334bc3c0a40a797b055ff5f802cba82a69ed78 Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Fri, 9 Dec 2022 13:51:48 -0800 Subject: [PATCH 42/65] remove repo level files --- .../data-plane/cadl/package-lock.json | 1936 ----------------- .../eventgrid/data-plane/cadl/package.json | 25 - 2 files changed, 1961 deletions(-) delete mode 100644 specification/eventgrid/data-plane/cadl/package-lock.json delete mode 100644 specification/eventgrid/data-plane/cadl/package.json diff --git a/specification/eventgrid/data-plane/cadl/package-lock.json b/specification/eventgrid/data-plane/cadl/package-lock.json deleted file mode 100644 index 4d10060726bf..000000000000 --- a/specification/eventgrid/data-plane/cadl/package-lock.json +++ /dev/null @@ -1,1936 +0,0 @@ -{ - "name": "cadl", - "lockfileVersion": 2, - "requires": true, - "packages": { - "": { - "name": "cadl", - "dependencies": { - "@azure-tools/cadl-autorest": "^0.22.0", - "@azure-tools/cadl-azure-core": "^0.9.0", - "@azure-tools/cadl-providerhub": "^0.23.0", - "@cadl-lang/compiler": "latest", - "@cadl-lang/openapi": "^0.14.0", - "@cadl-lang/openapi3": "latest", - "@cadl-lang/rest": "latest" - }, - "devDependencies": { - "@cadl-lang/prettier-plugin-cadl": "^0.5.17", - "prettier": "^2.8.0" - } - }, - "node_modules/@azure-tools/cadl-autorest": { - "version": "0.22.0", - "resolved": "https://registry.npmjs.org/@azure-tools/cadl-autorest/-/cadl-autorest-0.22.0.tgz", - "integrity": "sha512-O1uoFav6UzkkU5r28nbrQXkE94Cw2N6RFtqZso+VJQV3rvcLXQygvLxA+GA0WBCSkqLyQXfPg8JV0uWq4JDPsQ==", - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@azure-tools/cadl-azure-core": "~0.9.0", - "@cadl-lang/compiler": "~0.37.0", - "@cadl-lang/openapi": "~0.14.0", - "@cadl-lang/rest": "~0.19.0", - "@cadl-lang/versioning": "~0.10.0" - } - }, - "node_modules/@azure-tools/cadl-azure-core": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/@azure-tools/cadl-azure-core/-/cadl-azure-core-0.9.0.tgz", - "integrity": "sha512-iGBI9YmRIoUpM0aDC0jhv9IIDQgA3f32h3af/8dBZ38b8TPmFkWaA3nw9BVsG5sPiTNfxUDEwLqKI+/wKo5H8A==", - "dependencies": { - "@cadl-lang/lint": "~0.3.0" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@cadl-lang/compiler": "~0.37.0", - "@cadl-lang/rest": "~0.19.0" - } - }, - "node_modules/@azure-tools/cadl-azure-resource-manager": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/@azure-tools/cadl-azure-resource-manager/-/cadl-azure-resource-manager-0.12.0.tgz", - "integrity": "sha512-bewwKbRr2JJgG9337K8ceEdGa1ycWlO174ywbN3F1IHqs1MuJeG3Bg8czTSbfGGl5ew0kcD9DaqV5FLvPytLuQ==", - "peer": true, - "dependencies": { - "@cadl-lang/lint": "~0.3.0" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@azure-tools/cadl-autorest": "~0.22.0", - "@azure-tools/cadl-azure-core": "~0.9.0", - "@cadl-lang/compiler": "~0.37.0", - "@cadl-lang/openapi": "~0.14.0", - "@cadl-lang/rest": "~0.19.0", - "@cadl-lang/versioning": "~0.10.0" - } - }, - "node_modules/@azure-tools/cadl-providerhub": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@azure-tools/cadl-providerhub/-/cadl-providerhub-0.23.0.tgz", - "integrity": "sha512-8B/U3vVgpNKa/At77iuiCSIqs6mCThY1xqP9V3YcEeOIJIEjb2B/hyLKS5KfC4qE0BeI5b3obHDhJGz+5hvRFw==", - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@azure-tools/cadl-autorest": "~0.22.0", - "@azure-tools/cadl-azure-core": "~0.9.0", - "@azure-tools/cadl-azure-resource-manager": "~0.12.0", - "@cadl-lang/compiler": "~0.37.0", - "@cadl-lang/openapi": "~0.14.0", - "@cadl-lang/rest": "~0.19.0", - "@cadl-lang/versioning": "~0.10.0" - } - }, - "node_modules/@babel/code-frame": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", - "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", - "dependencies": { - "@babel/highlight": "^7.16.7" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-validator-identifier": { - "version": "7.19.1", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", - "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/highlight": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", - "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", - "dependencies": { - "@babel/helper-validator-identifier": "^7.18.6", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@cadl-lang/compiler": { - "version": "0.37.0", - "resolved": "https://registry.npmjs.org/@cadl-lang/compiler/-/compiler-0.37.0.tgz", - "integrity": "sha512-jHMqPZmM4evQlu7oY9vj6PEM+f+OhnfPqAdwxALrU2gwsLcwYG1h8rkjX/iK2KfeewCbXuRT/hztOTo3pcbYWA==", - "dependencies": { - "@babel/code-frame": "~7.16.7", - "ajv": "~8.9.0", - "change-case": "~4.1.2", - "globby": "~13.1.1", - "js-yaml": "~4.1.0", - "mkdirp": "~1.0.4", - "mustache": "~4.2.0", - "node-fetch": "3.2.8", - "node-watch": "~0.7.1", - "picocolors": "~1.0.0", - "prettier": "~2.7.1", - "prompts": "~2.4.1", - "vscode-languageserver": "~7.0.0", - "vscode-languageserver-textdocument": "~1.0.1", - "yargs": "~17.3.1" - }, - "bin": { - "cadl": "cmd/cadl.js", - "cadl-server": "cmd/cadl-server.js" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@cadl-lang/compiler/node_modules/prettier": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", - "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", - "bin": { - "prettier": "bin-prettier.js" - }, - "engines": { - "node": ">=10.13.0" - }, - "funding": { - "url": "https://github.com/prettier/prettier?sponsor=1" - } - }, - "node_modules/@cadl-lang/lint": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@cadl-lang/lint/-/lint-0.3.0.tgz", - "integrity": "sha512-CWqkD+O/sltXzuFcc2ucPf4b1E3ozIqukkFlhwDUXs5DvQIGDTEeekPVBn2kJAFj15kKHGDssp7tAQGzucmPdQ==", - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@cadl-lang/compiler": "~0.37.0" - } - }, - "node_modules/@cadl-lang/openapi": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/@cadl-lang/openapi/-/openapi-0.14.0.tgz", - "integrity": "sha512-jjjTKVLC1OGJeDstDPfLgRzcnaGlt9LtJz3brheJMTX9l8eItUq+bJi5+dWo6TG4P5oqcX6HHPxeh8oRREoM7Q==", - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@cadl-lang/compiler": "~0.37.0", - "@cadl-lang/rest": "~0.19.0" - } - }, - "node_modules/@cadl-lang/openapi3": { - "version": "0.17.0", - "resolved": "https://registry.npmjs.org/@cadl-lang/openapi3/-/openapi3-0.17.0.tgz", - "integrity": "sha512-O7qx81jmz4p3IbQk+au7LC98DV7noeGq/8herJ/A+H2heZ/c0Z0wyoVhENk69QHhoPsKUiGxLeWH/yNie0qsiQ==", - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@cadl-lang/compiler": "~0.37.0", - "@cadl-lang/openapi": "~0.14.0", - "@cadl-lang/rest": "~0.19.0", - "@cadl-lang/versioning": "~0.10.0" - } - }, - "node_modules/@cadl-lang/prettier-plugin-cadl": { - "version": "0.5.17", - "resolved": "https://registry.npmjs.org/@cadl-lang/prettier-plugin-cadl/-/prettier-plugin-cadl-0.5.17.tgz", - "integrity": "sha512-s1poDYYGJBfnz76lU82wKS6HdlBxz9Cd3/54QOudOiKn9elFsXA4LwWI2BiCPOqlJhcGTgZayrvth6cGh1mqLQ==", - "dev": true, - "dependencies": { - "prettier": "~2.7.1" - } - }, - "node_modules/@cadl-lang/prettier-plugin-cadl/node_modules/prettier": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", - "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", - "dev": true, - "bin": { - "prettier": "bin-prettier.js" - }, - "engines": { - "node": ">=10.13.0" - }, - "funding": { - "url": "https://github.com/prettier/prettier?sponsor=1" - } - }, - "node_modules/@cadl-lang/rest": { - "version": "0.19.0", - "resolved": "https://registry.npmjs.org/@cadl-lang/rest/-/rest-0.19.0.tgz", - "integrity": "sha512-3vMDvr8huQcH03oGYlt5uhRu5TKn6rb+rK0tmPfWgZ9EfZDMn0lR4CAjQOukFv2d93s7KE2IBVtXvQ/Z0C7kdQ==", - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@cadl-lang/compiler": "~0.37.0" - } - }, - "node_modules/@cadl-lang/versioning": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/@cadl-lang/versioning/-/versioning-0.10.0.tgz", - "integrity": "sha512-+9gdn2N1a3VyOu1ou12U9Uq5Mfvp/1A4nfEPOoZzDDm3U2GZZuRR4ZMUU1MqlJy0jrQdpW1yBNQD3ZYy0ngS7Q==", - "peer": true, - "dependencies": { - "@cadl-lang/compiler": "~0.37.0" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/ajv": { - "version": "8.9.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.9.0.tgz", - "integrity": "sha512-qOKJyNj/h+OWx7s5DePL6Zu1KeM9jPZhwBqs+7DzP6bGOvqzVCSf0xueYmVuaC/oQ/VtS2zLMLHdQFbkka+XDQ==", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" - }, - "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dependencies": { - "fill-range": "^7.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/camel-case": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-4.1.2.tgz", - "integrity": "sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw==", - "dependencies": { - "pascal-case": "^3.1.2", - "tslib": "^2.0.3" - } - }, - "node_modules/capital-case": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/capital-case/-/capital-case-1.0.4.tgz", - "integrity": "sha512-ds37W8CytHgwnhGGTi88pcPyR15qoNkOpYwmMMfnWqqWgESapLqvDx6huFjQ5vqWSn2Z06173XNA7LtMOeUh1A==", - "dependencies": { - "no-case": "^3.0.4", - "tslib": "^2.0.3", - "upper-case-first": "^2.0.2" - } - }, - "node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/change-case": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/change-case/-/change-case-4.1.2.tgz", - "integrity": "sha512-bSxY2ws9OtviILG1EiY5K7NNxkqg/JnRnFxLtKQ96JaviiIxi7djMrSd0ECT9AC+lttClmYwKw53BWpOMblo7A==", - "dependencies": { - "camel-case": "^4.1.2", - "capital-case": "^1.0.4", - "constant-case": "^3.0.4", - "dot-case": "^3.0.4", - "header-case": "^2.0.4", - "no-case": "^3.0.4", - "param-case": "^3.0.4", - "pascal-case": "^3.1.2", - "path-case": "^3.0.4", - "sentence-case": "^3.0.4", - "snake-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, - "node_modules/cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - } - }, - "node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" - }, - "node_modules/constant-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/constant-case/-/constant-case-3.0.4.tgz", - "integrity": "sha512-I2hSBi7Vvs7BEuJDr5dDHfzb/Ruj3FyvFyh7KLilAjNQw3Be+xgqUBA2W6scVEcL0hL1dwPRtIqEPVUCKkSsyQ==", - "dependencies": { - "no-case": "^3.0.4", - "tslib": "^2.0.3", - "upper-case": "^2.0.2" - } - }, - "node_modules/data-uri-to-buffer": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.0.tgz", - "integrity": "sha512-Vr3mLBA8qWmcuschSLAOogKgQ/Jwxulv3RNE4FXnYWRGujzrRWQI4m12fQqRkwX06C0KanhLr4hK+GydchZsaA==", - "engines": { - "node": ">= 12" - } - }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dependencies": { - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/dot-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz", - "integrity": "sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==", - "dependencies": { - "no-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, - "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" - }, - "node_modules/escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", - "engines": { - "node": ">=6" - } - }, - "node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" - }, - "node_modules/fast-glob": { - "version": "3.2.12", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", - "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, - "engines": { - "node": ">=8.6.0" - } - }, - "node_modules/fastq": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", - "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", - "dependencies": { - "reusify": "^1.0.4" - } - }, - "node_modules/fetch-blob": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", - "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/jimmywarting" - }, - { - "type": "paypal", - "url": "https://paypal.me/jimmywarting" - } - ], - "dependencies": { - "node-domexception": "^1.0.0", - "web-streams-polyfill": "^3.0.3" - }, - "engines": { - "node": "^12.20 || >= 14.13" - } - }, - "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/formdata-polyfill": { - "version": "4.0.10", - "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", - "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", - "dependencies": { - "fetch-blob": "^3.1.2" - }, - "engines": { - "node": ">=12.20.0" - } - }, - "node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "engines": { - "node": "6.* || 8.* || >= 10.*" - } - }, - "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/globby": { - "version": "13.1.2", - "resolved": "https://registry.npmjs.org/globby/-/globby-13.1.2.tgz", - "integrity": "sha512-LKSDZXToac40u8Q1PQtZihbNdTYSNMuWe+K5l+oa6KgDzSvVrHXlJy40hUP522RjAIoNLJYBJi7ow+rbFpIhHQ==", - "dependencies": { - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.11", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "engines": { - "node": ">=4" - } - }, - "node_modules/header-case": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/header-case/-/header-case-2.0.4.tgz", - "integrity": "sha512-H/vuk5TEEVZwrR0lp2zed9OCo1uAILMlx0JEMgC26rzyJJ3N1v6XkwHHXJQdR2doSjcGPM6OKPYoJgf0plJ11Q==", - "dependencies": { - "capital-case": "^1.0.4", - "tslib": "^2.0.3" - } - }, - "node_modules/ignore": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", - "engines": { - "node": ">= 4" - } - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "engines": { - "node": ">=8" - } - }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" - }, - "node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" - }, - "node_modules/kleur": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", - "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", - "engines": { - "node": ">=6" - } - }, - "node_modules/lower-case": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", - "integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==", - "dependencies": { - "tslib": "^2.0.3" - } - }, - "node_modules/merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "engines": { - "node": ">= 8" - } - }, - "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dependencies": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "bin": { - "mkdirp": "bin/cmd.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/mustache": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz", - "integrity": "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==", - "bin": { - "mustache": "bin/mustache" - } - }, - "node_modules/no-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz", - "integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==", - "dependencies": { - "lower-case": "^2.0.2", - "tslib": "^2.0.3" - } - }, - "node_modules/node-domexception": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", - "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/jimmywarting" - }, - { - "type": "github", - "url": "https://paypal.me/jimmywarting" - } - ], - "engines": { - "node": ">=10.5.0" - } - }, - "node_modules/node-fetch": { - "version": "3.2.8", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.2.8.tgz", - "integrity": "sha512-KtpD1YhGszhntMpBDyp5lyagk8KIMopC1LEb7cQUAh7zcosaX5uK8HnbNb2i3NTQK3sIawCItS0uFC3QzcLHdg==", - "dependencies": { - "data-uri-to-buffer": "^4.0.0", - "fetch-blob": "^3.1.4", - "formdata-polyfill": "^4.0.10" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/node-fetch" - } - }, - "node_modules/node-watch": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/node-watch/-/node-watch-0.7.3.tgz", - "integrity": "sha512-3l4E8uMPY1HdMMryPRUAl+oIHtXtyiTlIiESNSVSNxcPfzAFzeTbXFQkZfAwBbo0B1qMSG8nUABx+Gd+YrbKrQ==", - "engines": { - "node": ">=6" - } - }, - "node_modules/param-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/param-case/-/param-case-3.0.4.tgz", - "integrity": "sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A==", - "dependencies": { - "dot-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, - "node_modules/pascal-case": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/pascal-case/-/pascal-case-3.1.2.tgz", - "integrity": "sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g==", - "dependencies": { - "no-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, - "node_modules/path-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/path-case/-/path-case-3.0.4.tgz", - "integrity": "sha512-qO4qCFjXqVTrcbPt/hQfhTQ+VhFsqNKOPtytgNKkKxSoEp3XPUQ8ObFuePylOIok5gjn69ry8XiULxCwot3Wfg==", - "dependencies": { - "dot-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, - "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "engines": { - "node": ">=8" - } - }, - "node_modules/picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" - }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/prettier": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.0.tgz", - "integrity": "sha512-9Lmg8hTFZKG0Asr/kW9Bp8tJjRVluO8EJQVfY2T7FMw9T5jy4I/Uvx0Rca/XWf50QQ1/SS48+6IJWnrb+2yemA==", - "dev": true, - "bin": { - "prettier": "bin-prettier.js" - }, - "engines": { - "node": ">=10.13.0" - }, - "funding": { - "url": "https://github.com/prettier/prettier?sponsor=1" - } - }, - "node_modules/prompts": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", - "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", - "dependencies": { - "kleur": "^3.0.3", - "sisteransi": "^1.0.5" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "engines": { - "node": ">=6" - } - }, - "node_modules/queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } - }, - "node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, - "node_modules/sentence-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/sentence-case/-/sentence-case-3.0.4.tgz", - "integrity": "sha512-8LS0JInaQMCRoQ7YUytAo/xUu5W2XnQxV2HI/6uM6U7CITS1RqPElr30V6uIqyMKM9lJGRVFy5/4CuzcixNYSg==", - "dependencies": { - "no-case": "^3.0.4", - "tslib": "^2.0.3", - "upper-case-first": "^2.0.2" - } - }, - "node_modules/sisteransi": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", - "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==" - }, - "node_modules/slash": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", - "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/snake-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/snake-case/-/snake-case-3.0.4.tgz", - "integrity": "sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==", - "dependencies": { - "dot-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, - "node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, - "node_modules/tslib": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", - "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==" - }, - "node_modules/upper-case": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/upper-case/-/upper-case-2.0.2.tgz", - "integrity": "sha512-KgdgDGJt2TpuwBUIjgG6lzw2GWFRCW9Qkfkiv0DxqHHLYJHmtmdUIKcZd8rHgFSjopVTlw6ggzCm1b8MFQwikg==", - "dependencies": { - "tslib": "^2.0.3" - } - }, - "node_modules/upper-case-first": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/upper-case-first/-/upper-case-first-2.0.2.tgz", - "integrity": "sha512-514ppYHBaKwfJRK/pNC6c/OxfGa0obSnAl106u97Ed0I625Nin96KAjttZF6ZL3e1XLtphxnqrOi9iWgm+u+bg==", - "dependencies": { - "tslib": "^2.0.3" - } - }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dependencies": { - "punycode": "^2.1.0" - } - }, - "node_modules/vscode-jsonrpc": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-6.0.0.tgz", - "integrity": "sha512-wnJA4BnEjOSyFMvjZdpiOwhSq9uDoK8e/kpRJDTaMYzwlkrhG1fwDIZI94CLsLzlCK5cIbMMtFlJlfR57Lavmg==", - "engines": { - "node": ">=8.0.0 || >=10.0.0" - } - }, - "node_modules/vscode-languageserver": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-7.0.0.tgz", - "integrity": "sha512-60HTx5ID+fLRcgdHfmz0LDZAXYEV68fzwG0JWwEPBode9NuMYTIxuYXPg4ngO8i8+Ou0lM7y6GzaYWbiDL0drw==", - "dependencies": { - "vscode-languageserver-protocol": "3.16.0" - }, - "bin": { - "installServerIntoExtension": "bin/installServerIntoExtension" - } - }, - "node_modules/vscode-languageserver-protocol": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.16.0.tgz", - "integrity": "sha512-sdeUoAawceQdgIfTI+sdcwkiK2KU+2cbEYA0agzM2uqaUy2UpnnGHtWTHVEtS0ES4zHU0eMFRGN+oQgDxlD66A==", - "dependencies": { - "vscode-jsonrpc": "6.0.0", - "vscode-languageserver-types": "3.16.0" - } - }, - "node_modules/vscode-languageserver-textdocument": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.7.tgz", - "integrity": "sha512-bFJH7UQxlXT8kKeyiyu41r22jCZXG8kuuVVA33OEJn1diWOZK5n8zBSPZFHVBOu8kXZ6h0LIRhf5UnCo61J4Hg==" - }, - "node_modules/vscode-languageserver-types": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.16.0.tgz", - "integrity": "sha512-k8luDIWJWyenLc5ToFQQMaSrqCHiLwyKPHKPQZ5zz21vM+vIVUSvsRpcbiECH4WR88K2XZqc4ScRcZ7nk/jbeA==" - }, - "node_modules/web-streams-polyfill": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz", - "integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==", - "engines": { - "node": ">= 8" - } - }, - "node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/wrap-ansi/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/wrap-ansi/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/wrap-ansi/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "node_modules/y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs": { - "version": "17.3.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.3.1.tgz", - "integrity": "sha512-WUANQeVgjLbNsEmGk20f+nlHgOqzRFpiGWVaBrYGYIGANIIu3lWjoyi0fNlFmJkvfhCZ6BXINe7/W2O2bV4iaA==", - "dependencies": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", - "engines": { - "node": ">=12" - } - } - }, - "dependencies": { - "@azure-tools/cadl-autorest": { - "version": "0.22.0", - "resolved": "https://registry.npmjs.org/@azure-tools/cadl-autorest/-/cadl-autorest-0.22.0.tgz", - "integrity": "sha512-O1uoFav6UzkkU5r28nbrQXkE94Cw2N6RFtqZso+VJQV3rvcLXQygvLxA+GA0WBCSkqLyQXfPg8JV0uWq4JDPsQ==", - "requires": {} - }, - "@azure-tools/cadl-azure-core": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/@azure-tools/cadl-azure-core/-/cadl-azure-core-0.9.0.tgz", - "integrity": "sha512-iGBI9YmRIoUpM0aDC0jhv9IIDQgA3f32h3af/8dBZ38b8TPmFkWaA3nw9BVsG5sPiTNfxUDEwLqKI+/wKo5H8A==", - "requires": { - "@cadl-lang/lint": "~0.3.0" - } - }, - "@azure-tools/cadl-azure-resource-manager": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/@azure-tools/cadl-azure-resource-manager/-/cadl-azure-resource-manager-0.12.0.tgz", - "integrity": "sha512-bewwKbRr2JJgG9337K8ceEdGa1ycWlO174ywbN3F1IHqs1MuJeG3Bg8czTSbfGGl5ew0kcD9DaqV5FLvPytLuQ==", - "peer": true, - "requires": { - "@cadl-lang/lint": "~0.3.0" - } - }, - "@azure-tools/cadl-providerhub": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@azure-tools/cadl-providerhub/-/cadl-providerhub-0.23.0.tgz", - "integrity": "sha512-8B/U3vVgpNKa/At77iuiCSIqs6mCThY1xqP9V3YcEeOIJIEjb2B/hyLKS5KfC4qE0BeI5b3obHDhJGz+5hvRFw==", - "requires": {} - }, - "@babel/code-frame": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", - "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", - "requires": { - "@babel/highlight": "^7.16.7" - } - }, - "@babel/helper-validator-identifier": { - "version": "7.19.1", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", - "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==" - }, - "@babel/highlight": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", - "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", - "requires": { - "@babel/helper-validator-identifier": "^7.18.6", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - } - }, - "@cadl-lang/compiler": { - "version": "0.37.0", - "resolved": "https://registry.npmjs.org/@cadl-lang/compiler/-/compiler-0.37.0.tgz", - "integrity": "sha512-jHMqPZmM4evQlu7oY9vj6PEM+f+OhnfPqAdwxALrU2gwsLcwYG1h8rkjX/iK2KfeewCbXuRT/hztOTo3pcbYWA==", - "requires": { - "@babel/code-frame": "~7.16.7", - "ajv": "~8.9.0", - "change-case": "~4.1.2", - "globby": "~13.1.1", - "js-yaml": "~4.1.0", - "mkdirp": "~1.0.4", - "mustache": "~4.2.0", - "node-fetch": "3.2.8", - "node-watch": "~0.7.1", - "picocolors": "~1.0.0", - "prettier": "~2.7.1", - "prompts": "~2.4.1", - "vscode-languageserver": "~7.0.0", - "vscode-languageserver-textdocument": "~1.0.1", - "yargs": "~17.3.1" - }, - "dependencies": { - "prettier": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", - "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==" - } - } - }, - "@cadl-lang/lint": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@cadl-lang/lint/-/lint-0.3.0.tgz", - "integrity": "sha512-CWqkD+O/sltXzuFcc2ucPf4b1E3ozIqukkFlhwDUXs5DvQIGDTEeekPVBn2kJAFj15kKHGDssp7tAQGzucmPdQ==", - "requires": {} - }, - "@cadl-lang/openapi": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/@cadl-lang/openapi/-/openapi-0.14.0.tgz", - "integrity": "sha512-jjjTKVLC1OGJeDstDPfLgRzcnaGlt9LtJz3brheJMTX9l8eItUq+bJi5+dWo6TG4P5oqcX6HHPxeh8oRREoM7Q==", - "requires": {} - }, - "@cadl-lang/openapi3": { - "version": "0.17.0", - "resolved": "https://registry.npmjs.org/@cadl-lang/openapi3/-/openapi3-0.17.0.tgz", - "integrity": "sha512-O7qx81jmz4p3IbQk+au7LC98DV7noeGq/8herJ/A+H2heZ/c0Z0wyoVhENk69QHhoPsKUiGxLeWH/yNie0qsiQ==", - "requires": {} - }, - "@cadl-lang/prettier-plugin-cadl": { - "version": "0.5.17", - "resolved": "https://registry.npmjs.org/@cadl-lang/prettier-plugin-cadl/-/prettier-plugin-cadl-0.5.17.tgz", - "integrity": "sha512-s1poDYYGJBfnz76lU82wKS6HdlBxz9Cd3/54QOudOiKn9elFsXA4LwWI2BiCPOqlJhcGTgZayrvth6cGh1mqLQ==", - "dev": true, - "requires": { - "prettier": "~2.7.1" - }, - "dependencies": { - "prettier": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", - "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", - "dev": true - } - } - }, - "@cadl-lang/rest": { - "version": "0.19.0", - "resolved": "https://registry.npmjs.org/@cadl-lang/rest/-/rest-0.19.0.tgz", - "integrity": "sha512-3vMDvr8huQcH03oGYlt5uhRu5TKn6rb+rK0tmPfWgZ9EfZDMn0lR4CAjQOukFv2d93s7KE2IBVtXvQ/Z0C7kdQ==", - "requires": {} - }, - "@cadl-lang/versioning": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/@cadl-lang/versioning/-/versioning-0.10.0.tgz", - "integrity": "sha512-+9gdn2N1a3VyOu1ou12U9Uq5Mfvp/1A4nfEPOoZzDDm3U2GZZuRR4ZMUU1MqlJy0jrQdpW1yBNQD3ZYy0ngS7Q==", - "peer": true, - "requires": { - "@cadl-lang/compiler": "~0.37.0" - } - }, - "@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "requires": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - } - }, - "@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==" - }, - "@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "requires": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - } - }, - "ajv": { - "version": "8.9.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.9.0.tgz", - "integrity": "sha512-qOKJyNj/h+OWx7s5DePL6Zu1KeM9jPZhwBqs+7DzP6bGOvqzVCSf0xueYmVuaC/oQ/VtS2zLMLHdQFbkka+XDQ==", - "requires": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - } - }, - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "requires": { - "color-convert": "^1.9.0" - } - }, - "argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" - }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "requires": { - "fill-range": "^7.0.1" - } - }, - "camel-case": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-4.1.2.tgz", - "integrity": "sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw==", - "requires": { - "pascal-case": "^3.1.2", - "tslib": "^2.0.3" - } - }, - "capital-case": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/capital-case/-/capital-case-1.0.4.tgz", - "integrity": "sha512-ds37W8CytHgwnhGGTi88pcPyR15qoNkOpYwmMMfnWqqWgESapLqvDx6huFjQ5vqWSn2Z06173XNA7LtMOeUh1A==", - "requires": { - "no-case": "^3.0.4", - "tslib": "^2.0.3", - "upper-case-first": "^2.0.2" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "change-case": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/change-case/-/change-case-4.1.2.tgz", - "integrity": "sha512-bSxY2ws9OtviILG1EiY5K7NNxkqg/JnRnFxLtKQ96JaviiIxi7djMrSd0ECT9AC+lttClmYwKw53BWpOMblo7A==", - "requires": { - "camel-case": "^4.1.2", - "capital-case": "^1.0.4", - "constant-case": "^3.0.4", - "dot-case": "^3.0.4", - "header-case": "^2.0.4", - "no-case": "^3.0.4", - "param-case": "^3.0.4", - "pascal-case": "^3.1.2", - "path-case": "^3.0.4", - "sentence-case": "^3.0.4", - "snake-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, - "cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", - "requires": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" - }, - "constant-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/constant-case/-/constant-case-3.0.4.tgz", - "integrity": "sha512-I2hSBi7Vvs7BEuJDr5dDHfzb/Ruj3FyvFyh7KLilAjNQw3Be+xgqUBA2W6scVEcL0hL1dwPRtIqEPVUCKkSsyQ==", - "requires": { - "no-case": "^3.0.4", - "tslib": "^2.0.3", - "upper-case": "^2.0.2" - } - }, - "data-uri-to-buffer": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.0.tgz", - "integrity": "sha512-Vr3mLBA8qWmcuschSLAOogKgQ/Jwxulv3RNE4FXnYWRGujzrRWQI4m12fQqRkwX06C0KanhLr4hK+GydchZsaA==" - }, - "dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "requires": { - "path-type": "^4.0.0" - } - }, - "dot-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz", - "integrity": "sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==", - "requires": { - "no-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" - }, - "escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==" - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==" - }, - "fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" - }, - "fast-glob": { - "version": "3.2.12", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", - "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", - "requires": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - } - }, - "fastq": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", - "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", - "requires": { - "reusify": "^1.0.4" - } - }, - "fetch-blob": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", - "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", - "requires": { - "node-domexception": "^1.0.0", - "web-streams-polyfill": "^3.0.3" - } - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "formdata-polyfill": { - "version": "4.0.10", - "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", - "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", - "requires": { - "fetch-blob": "^3.1.2" - } - }, - "get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" - }, - "glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "requires": { - "is-glob": "^4.0.1" - } - }, - "globby": { - "version": "13.1.2", - "resolved": "https://registry.npmjs.org/globby/-/globby-13.1.2.tgz", - "integrity": "sha512-LKSDZXToac40u8Q1PQtZihbNdTYSNMuWe+K5l+oa6KgDzSvVrHXlJy40hUP522RjAIoNLJYBJi7ow+rbFpIhHQ==", - "requires": { - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.11", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^4.0.0" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==" - }, - "header-case": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/header-case/-/header-case-2.0.4.tgz", - "integrity": "sha512-H/vuk5TEEVZwrR0lp2zed9OCo1uAILMlx0JEMgC26rzyJJ3N1v6XkwHHXJQdR2doSjcGPM6OKPYoJgf0plJ11Q==", - "requires": { - "capital-case": "^1.0.4", - "tslib": "^2.0.3" - } - }, - "ignore": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==" - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==" - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" - }, - "is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" - }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" - }, - "js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "requires": { - "argparse": "^2.0.1" - } - }, - "json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" - }, - "kleur": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", - "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==" - }, - "lower-case": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", - "integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==", - "requires": { - "tslib": "^2.0.3" - } - }, - "merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==" - }, - "micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "requires": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - } - }, - "mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==" - }, - "mustache": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz", - "integrity": "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==" - }, - "no-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz", - "integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==", - "requires": { - "lower-case": "^2.0.2", - "tslib": "^2.0.3" - } - }, - "node-domexception": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", - "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==" - }, - "node-fetch": { - "version": "3.2.8", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.2.8.tgz", - "integrity": "sha512-KtpD1YhGszhntMpBDyp5lyagk8KIMopC1LEb7cQUAh7zcosaX5uK8HnbNb2i3NTQK3sIawCItS0uFC3QzcLHdg==", - "requires": { - "data-uri-to-buffer": "^4.0.0", - "fetch-blob": "^3.1.4", - "formdata-polyfill": "^4.0.10" - } - }, - "node-watch": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/node-watch/-/node-watch-0.7.3.tgz", - "integrity": "sha512-3l4E8uMPY1HdMMryPRUAl+oIHtXtyiTlIiESNSVSNxcPfzAFzeTbXFQkZfAwBbo0B1qMSG8nUABx+Gd+YrbKrQ==" - }, - "param-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/param-case/-/param-case-3.0.4.tgz", - "integrity": "sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A==", - "requires": { - "dot-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, - "pascal-case": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/pascal-case/-/pascal-case-3.1.2.tgz", - "integrity": "sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g==", - "requires": { - "no-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, - "path-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/path-case/-/path-case-3.0.4.tgz", - "integrity": "sha512-qO4qCFjXqVTrcbPt/hQfhTQ+VhFsqNKOPtytgNKkKxSoEp3XPUQ8ObFuePylOIok5gjn69ry8XiULxCwot3Wfg==", - "requires": { - "dot-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, - "path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==" - }, - "picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" - }, - "picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" - }, - "prettier": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.0.tgz", - "integrity": "sha512-9Lmg8hTFZKG0Asr/kW9Bp8tJjRVluO8EJQVfY2T7FMw9T5jy4I/Uvx0Rca/XWf50QQ1/SS48+6IJWnrb+2yemA==", - "dev": true - }, - "prompts": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", - "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", - "requires": { - "kleur": "^3.0.3", - "sisteransi": "^1.0.5" - } - }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" - }, - "queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==" - }, - "require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==" - }, - "require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==" - }, - "reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==" - }, - "run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "requires": { - "queue-microtask": "^1.2.2" - } - }, - "sentence-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/sentence-case/-/sentence-case-3.0.4.tgz", - "integrity": "sha512-8LS0JInaQMCRoQ7YUytAo/xUu5W2XnQxV2HI/6uM6U7CITS1RqPElr30V6uIqyMKM9lJGRVFy5/4CuzcixNYSg==", - "requires": { - "no-case": "^3.0.4", - "tslib": "^2.0.3", - "upper-case-first": "^2.0.2" - } - }, - "sisteransi": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", - "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==" - }, - "slash": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", - "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==" - }, - "snake-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/snake-case/-/snake-case-3.0.4.tgz", - "integrity": "sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==", - "requires": { - "dot-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, - "string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "requires": { - "ansi-regex": "^5.0.1" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "requires": { - "has-flag": "^3.0.0" - } - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "requires": { - "is-number": "^7.0.0" - } - }, - "tslib": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", - "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==" - }, - "upper-case": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/upper-case/-/upper-case-2.0.2.tgz", - "integrity": "sha512-KgdgDGJt2TpuwBUIjgG6lzw2GWFRCW9Qkfkiv0DxqHHLYJHmtmdUIKcZd8rHgFSjopVTlw6ggzCm1b8MFQwikg==", - "requires": { - "tslib": "^2.0.3" - } - }, - "upper-case-first": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/upper-case-first/-/upper-case-first-2.0.2.tgz", - "integrity": "sha512-514ppYHBaKwfJRK/pNC6c/OxfGa0obSnAl106u97Ed0I625Nin96KAjttZF6ZL3e1XLtphxnqrOi9iWgm+u+bg==", - "requires": { - "tslib": "^2.0.3" - } - }, - "uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "requires": { - "punycode": "^2.1.0" - } - }, - "vscode-jsonrpc": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-6.0.0.tgz", - "integrity": "sha512-wnJA4BnEjOSyFMvjZdpiOwhSq9uDoK8e/kpRJDTaMYzwlkrhG1fwDIZI94CLsLzlCK5cIbMMtFlJlfR57Lavmg==" - }, - "vscode-languageserver": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-7.0.0.tgz", - "integrity": "sha512-60HTx5ID+fLRcgdHfmz0LDZAXYEV68fzwG0JWwEPBode9NuMYTIxuYXPg4ngO8i8+Ou0lM7y6GzaYWbiDL0drw==", - "requires": { - "vscode-languageserver-protocol": "3.16.0" - } - }, - "vscode-languageserver-protocol": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.16.0.tgz", - "integrity": "sha512-sdeUoAawceQdgIfTI+sdcwkiK2KU+2cbEYA0agzM2uqaUy2UpnnGHtWTHVEtS0ES4zHU0eMFRGN+oQgDxlD66A==", - "requires": { - "vscode-jsonrpc": "6.0.0", - "vscode-languageserver-types": "3.16.0" - } - }, - "vscode-languageserver-textdocument": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.7.tgz", - "integrity": "sha512-bFJH7UQxlXT8kKeyiyu41r22jCZXG8kuuVVA33OEJn1diWOZK5n8zBSPZFHVBOu8kXZ6h0LIRhf5UnCo61J4Hg==" - }, - "vscode-languageserver-types": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.16.0.tgz", - "integrity": "sha512-k8luDIWJWyenLc5ToFQQMaSrqCHiLwyKPHKPQZ5zz21vM+vIVUSvsRpcbiECH4WR88K2XZqc4ScRcZ7nk/jbeA==" - }, - "web-streams-polyfill": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz", - "integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==" - }, - "wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "requires": { - "color-convert": "^2.0.1" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - } - } - }, - "y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==" - }, - "yargs": { - "version": "17.3.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.3.1.tgz", - "integrity": "sha512-WUANQeVgjLbNsEmGk20f+nlHgOqzRFpiGWVaBrYGYIGANIIu3lWjoyi0fNlFmJkvfhCZ6BXINe7/W2O2bV4iaA==", - "requires": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.0.0" - } - }, - "yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==" - } - } -} diff --git a/specification/eventgrid/data-plane/cadl/package.json b/specification/eventgrid/data-plane/cadl/package.json deleted file mode 100644 index 1a957a3ee182..000000000000 --- a/specification/eventgrid/data-plane/cadl/package.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "cadl", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "", - "license": "ISC", - "dependencies": { - "@azure-tools/cadl-autorest": "latest", - "@azure-tools/cadl-azure-core": "^0.24.0", - "@azure-tools/cadl-providerhub": "^0.24.0", - "@cadl-lang/compiler": "^0.38.0", - "@cadl-lang/openapi": "^0.38.0", - "@cadl-lang/openapi3": "^0.38.0", - "@cadl-lang/prettier-plugin-cadl": "^0.38.0", - "@cadl-lang/rest": "^0.38.0", - "@cadl-lang/versioning": "^0.38.0", - "cadl-vs": "^0.38.0", - "cadl-vscode": "^0.38.0", - "tmlanguage-generator": "^0.3.2" - } -} From 5bed832f048d9df42308648f497c8651ce2ae258 Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Fri, 9 Dec 2022 14:08:13 -0800 Subject: [PATCH 43/65] remove repo level --- package-lock.json | 1648 ++------------------------------------------- package.json | 3 - 2 files changed, 68 insertions(+), 1583 deletions(-) diff --git a/package-lock.json b/package-lock.json index aa86f51be07b..b420236240e4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,9 +9,6 @@ "version": "0.1.0", "hasInstallScript": true, "license": "MIT", - "dependencies": { - "@cadl-lang/rest": "^0.19.0" - }, "devDependencies": { "@azure/avocado": "^0.8.4", "@ts-common/commonmark-to-markdown": "^2.0.2", @@ -118,235 +115,6 @@ "integrity": "sha512-oc6OHLdoLlOpO5GjMcOFETEhJi45CI3MVIhvVY/yqyGw9AtaqOYw5HzO3wTuYgYFeGS4v9iqFah0SNLZrpk3Sg==", "dev": true }, - "node_modules/@babel/code-frame": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", - "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", - "peer": true, - "dependencies": { - "@babel/highlight": "^7.16.7" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-validator-identifier": { - "version": "7.19.1", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", - "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", - "peer": true, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/highlight": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", - "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", - "peer": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.18.6", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/highlight/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "peer": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "peer": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "peer": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/@babel/highlight/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "peer": true - }, - "node_modules/@babel/highlight/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "peer": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/@babel/highlight/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "peer": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "peer": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@cadl-lang/compiler": { - "version": "0.37.0", - "resolved": "https://registry.npmjs.org/@cadl-lang/compiler/-/compiler-0.37.0.tgz", - "integrity": "sha512-jHMqPZmM4evQlu7oY9vj6PEM+f+OhnfPqAdwxALrU2gwsLcwYG1h8rkjX/iK2KfeewCbXuRT/hztOTo3pcbYWA==", - "peer": true, - "dependencies": { - "@babel/code-frame": "~7.16.7", - "ajv": "~8.9.0", - "change-case": "~4.1.2", - "globby": "~13.1.1", - "js-yaml": "~4.1.0", - "mkdirp": "~1.0.4", - "mustache": "~4.2.0", - "node-fetch": "3.2.8", - "node-watch": "~0.7.1", - "picocolors": "~1.0.0", - "prettier": "~2.7.1", - "prompts": "~2.4.1", - "vscode-languageserver": "~7.0.0", - "vscode-languageserver-textdocument": "~1.0.1", - "yargs": "~17.3.1" - }, - "bin": { - "cadl": "cmd/cadl.js", - "cadl-server": "cmd/cadl-server.js" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@cadl-lang/compiler/node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "peer": true - }, - "node_modules/@cadl-lang/compiler/node_modules/cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", - "peer": true, - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - } - }, - "node_modules/@cadl-lang/compiler/node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "peer": true, - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/@cadl-lang/compiler/node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "peer": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/@cadl-lang/compiler/node_modules/y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "peer": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/@cadl-lang/compiler/node_modules/yargs": { - "version": "17.3.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.3.1.tgz", - "integrity": "sha512-WUANQeVgjLbNsEmGk20f+nlHgOqzRFpiGWVaBrYGYIGANIIu3lWjoyi0fNlFmJkvfhCZ6BXINe7/W2O2bV4iaA==", - "peer": true, - "dependencies": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@cadl-lang/compiler/node_modules/yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", - "peer": true, - "engines": { - "node": ">=12" - } - }, - "node_modules/@cadl-lang/rest": { - "version": "0.19.0", - "resolved": "https://registry.npmjs.org/@cadl-lang/rest/-/rest-0.19.0.tgz", - "integrity": "sha512-3vMDvr8huQcH03oGYlt5uhRu5TKn6rb+rK0tmPfWgZ9EfZDMn0lR4CAjQOukFv2d93s7KE2IBVtXvQ/Z0C7kdQ==", - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@cadl-lang/compiler": "~0.37.0" - } - }, "node_modules/@cspotcode/source-map-support": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", @@ -384,41 +152,6 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "peer": true, - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "peer": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "peer": true, - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/@ts-common/add-position": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/@ts-common/add-position/-/add-position-0.0.2.tgz", @@ -704,22 +437,6 @@ "node": ">=0.4.0" } }, - "node_modules/ajv": { - "version": "8.9.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.9.0.tgz", - "integrity": "sha512-qOKJyNj/h+OWx7s5DePL6Zu1KeM9jPZhwBqs+7DzP6bGOvqzVCSf0xueYmVuaC/oQ/VtS2zLMLHdQFbkka+XDQ==", - "peer": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, "node_modules/ansi-colors": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", @@ -733,6 +450,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, "engines": { "node": ">=8" } @@ -741,6 +459,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -823,6 +542,7 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, "dependencies": { "fill-range": "^7.0.1" }, @@ -842,22 +562,6 @@ "integrity": "sha512-wCyFsDQkKPwwF8BDwOiWNx/9K45L/hvggQiDbve+viMNMQnWhrlYIuBk09offfwCRtCO9P6XwUttufzU11WCVw==", "dev": true }, - "node_modules/camel-case": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-4.1.2.tgz", - "integrity": "sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw==", - "peer": true, - "dependencies": { - "pascal-case": "^3.1.2", - "tslib": "^2.0.3" - } - }, - "node_modules/camel-case/node_modules/tslib": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", - "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", - "peer": true - }, "node_modules/camelcase": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", @@ -870,23 +574,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/capital-case": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/capital-case/-/capital-case-1.0.4.tgz", - "integrity": "sha512-ds37W8CytHgwnhGGTi88pcPyR15qoNkOpYwmMMfnWqqWgESapLqvDx6huFjQ5vqWSn2Z06173XNA7LtMOeUh1A==", - "peer": true, - "dependencies": { - "no-case": "^3.0.4", - "tslib": "^2.0.3", - "upper-case-first": "^2.0.2" - } - }, - "node_modules/capital-case/node_modules/tslib": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", - "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", - "peer": true - }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -915,32 +602,6 @@ "node": ">=8" } }, - "node_modules/change-case": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/change-case/-/change-case-4.1.2.tgz", - "integrity": "sha512-bSxY2ws9OtviILG1EiY5K7NNxkqg/JnRnFxLtKQ96JaviiIxi7djMrSd0ECT9AC+lttClmYwKw53BWpOMblo7A==", - "peer": true, - "dependencies": { - "camel-case": "^4.1.2", - "capital-case": "^1.0.4", - "constant-case": "^3.0.4", - "dot-case": "^3.0.4", - "header-case": "^2.0.4", - "no-case": "^3.0.4", - "param-case": "^3.0.4", - "pascal-case": "^3.1.2", - "path-case": "^3.0.4", - "sentence-case": "^3.0.4", - "snake-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, - "node_modules/change-case/node_modules/tslib": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", - "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", - "peer": true - }, "node_modules/chokidar": { "version": "3.5.3", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", @@ -983,6 +644,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, "dependencies": { "color-name": "~1.1.4" }, @@ -993,7 +655,8 @@ "node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true }, "node_modules/combined-stream": { "version": "1.0.8", @@ -1031,23 +694,6 @@ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, - "node_modules/constant-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/constant-case/-/constant-case-3.0.4.tgz", - "integrity": "sha512-I2hSBi7Vvs7BEuJDr5dDHfzb/Ruj3FyvFyh7KLilAjNQw3Be+xgqUBA2W6scVEcL0hL1dwPRtIqEPVUCKkSsyQ==", - "peer": true, - "dependencies": { - "no-case": "^3.0.4", - "tslib": "^2.0.3", - "upper-case": "^2.0.2" - } - }, - "node_modules/constant-case/node_modules/tslib": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", - "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", - "peer": true - }, "node_modules/create-require": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", @@ -1058,6 +704,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.0.tgz", "integrity": "sha512-Vr3mLBA8qWmcuschSLAOogKgQ/Jwxulv3RNE4FXnYWRGujzrRWQI4m12fQqRkwX06C0KanhLr4hK+GydchZsaA==", + "dev": true, "engines": { "node": ">= 12" } @@ -1112,38 +759,11 @@ "node": ">=0.3.1" } }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "peer": true, - "dependencies": { - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/dot-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz", - "integrity": "sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==", - "peer": true, - "dependencies": { - "no-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, - "node_modules/dot-case/node_modules/tslib": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", - "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", - "peer": true - }, "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true }, "node_modules/entities": { "version": "2.0.3", @@ -1155,6 +775,7 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true, "engines": { "node": ">=6" } @@ -1184,41 +805,11 @@ "node": ">=4" } }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "peer": true - }, - "node_modules/fast-glob": { - "version": "3.2.12", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", - "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", - "peer": true, - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, - "engines": { - "node": ">=8.6.0" - } - }, - "node_modules/fastq": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", - "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", - "peer": true, - "dependencies": { - "reusify": "^1.0.4" - } - }, "node_modules/fetch-blob": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", + "dev": true, "funding": [ { "type": "github", @@ -1241,6 +832,7 @@ "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, "dependencies": { "to-regex-range": "^5.0.1" }, @@ -1297,6 +889,7 @@ "version": "4.0.10", "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", + "dev": true, "dependencies": { "fetch-blob": "^3.1.2" }, @@ -1337,6 +930,7 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, "engines": { "node": "6.* || 8.* || >= 10.*" } @@ -1365,6 +959,7 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, "dependencies": { "is-glob": "^4.0.1" }, @@ -1372,25 +967,6 @@ "node": ">= 6" } }, - "node_modules/globby": { - "version": "13.1.2", - "resolved": "https://registry.npmjs.org/globby/-/globby-13.1.2.tgz", - "integrity": "sha512-LKSDZXToac40u8Q1PQtZihbNdTYSNMuWe+K5l+oa6KgDzSvVrHXlJy40hUP522RjAIoNLJYBJi7ow+rbFpIhHQ==", - "peer": true, - "dependencies": { - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.11", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/growl": { "version": "1.10.5", "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", @@ -1424,31 +1000,6 @@ "he": "bin/he" } }, - "node_modules/header-case": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/header-case/-/header-case-2.0.4.tgz", - "integrity": "sha512-H/vuk5TEEVZwrR0lp2zed9OCo1uAILMlx0JEMgC26rzyJJ3N1v6XkwHHXJQdR2doSjcGPM6OKPYoJgf0plJ11Q==", - "peer": true, - "dependencies": { - "capital-case": "^1.0.4", - "tslib": "^2.0.3" - } - }, - "node_modules/header-case/node_modules/tslib": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", - "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", - "peer": true - }, - "node_modules/ignore": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", - "peer": true, - "engines": { - "node": ">= 4" - } - }, "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -1496,6 +1047,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -1504,6 +1056,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, "engines": { "node": ">=8" } @@ -1512,6 +1065,7 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, "dependencies": { "is-extglob": "^2.1.1" }, @@ -1523,6 +1077,7 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, "engines": { "node": ">=0.12.0" } @@ -1566,12 +1121,6 @@ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true }, - "node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "peer": true - }, "node_modules/js-yaml": { "version": "3.14.1", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", @@ -1596,12 +1145,6 @@ "ono": "^4.0.11" } }, - "node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "peer": true - }, "node_modules/jsonpath-plus": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/jsonpath-plus/-/jsonpath-plus-6.0.1.tgz", @@ -1611,15 +1154,6 @@ "node": ">=10.0.0" } }, - "node_modules/kleur": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", - "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", - "peer": true, - "engines": { - "node": ">=6" - } - }, "node_modules/locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", @@ -1651,21 +1185,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/lower-case": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", - "integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==", - "peer": true, - "dependencies": { - "tslib": "^2.0.3" - } - }, - "node_modules/lower-case/node_modules/tslib": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", - "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", - "peer": true - }, "node_modules/lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -1690,28 +1209,6 @@ "integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==", "dev": true }, - "node_modules/merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "peer": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "peer": true, - "dependencies": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - }, - "engines": { - "node": ">=8.6" - } - }, "node_modules/mime-db": { "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", @@ -1751,18 +1248,6 @@ "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", "dev": true }, - "node_modules/mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "peer": true, - "bin": { - "mkdirp": "bin/cmd.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/mocha": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.2.2.tgz", @@ -1929,15 +1414,6 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, - "node_modules/mustache": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz", - "integrity": "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==", - "peer": true, - "bin": { - "mustache": "bin/mustache" - } - }, "node_modules/nanoid": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.1.tgz", @@ -1950,26 +1426,11 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, - "node_modules/no-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz", - "integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==", - "peer": true, - "dependencies": { - "lower-case": "^2.0.2", - "tslib": "^2.0.3" - } - }, - "node_modules/no-case/node_modules/tslib": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", - "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", - "peer": true - }, "node_modules/node-domexception": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", + "dev": true, "funding": [ { "type": "github", @@ -1988,6 +1449,7 @@ "version": "3.2.8", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.2.8.tgz", "integrity": "sha512-KtpD1YhGszhntMpBDyp5lyagk8KIMopC1LEb7cQUAh7zcosaX5uK8HnbNb2i3NTQK3sIawCItS0uFC3QzcLHdg==", + "dev": true, "dependencies": { "data-uri-to-buffer": "^4.0.0", "fetch-blob": "^3.1.4", @@ -2024,15 +1486,6 @@ "node": ">=0.10.0" } }, - "node_modules/node-watch": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/node-watch/-/node-watch-0.7.3.tgz", - "integrity": "sha512-3l4E8uMPY1HdMMryPRUAl+oIHtXtyiTlIiESNSVSNxcPfzAFzeTbXFQkZfAwBbo0B1qMSG8nUABx+Gd+YrbKrQ==", - "peer": true, - "engines": { - "node": ">=6" - } - }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -2099,54 +1552,6 @@ "node": ">=6" } }, - "node_modules/param-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/param-case/-/param-case-3.0.4.tgz", - "integrity": "sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A==", - "peer": true, - "dependencies": { - "dot-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, - "node_modules/param-case/node_modules/tslib": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", - "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", - "peer": true - }, - "node_modules/pascal-case": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/pascal-case/-/pascal-case-3.1.2.tgz", - "integrity": "sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g==", - "peer": true, - "dependencies": { - "no-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, - "node_modules/pascal-case/node_modules/tslib": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", - "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", - "peer": true - }, - "node_modules/path-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/path-case/-/path-case-3.0.4.tgz", - "integrity": "sha512-qO4qCFjXqVTrcbPt/hQfhTQ+VhFsqNKOPtytgNKkKxSoEp3XPUQ8ObFuePylOIok5gjn69ry8XiULxCwot3Wfg==", - "peer": true, - "dependencies": { - "dot-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, - "node_modules/path-case/node_modules/tslib": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", - "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", - "peer": true - }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -2165,25 +1570,11 @@ "node": ">=0.10.0" } }, - "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", - "peer": true - }, "node_modules/picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, "engines": { "node": ">=8.6" }, @@ -2195,6 +1586,7 @@ "version": "2.7.1", "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", + "dev": true, "bin": { "prettier": "bin-prettier.js" }, @@ -2205,48 +1597,6 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, - "node_modules/prompts": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", - "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", - "peer": true, - "dependencies": { - "kleur": "^3.0.3", - "sisteransi": "^1.0.5" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "peer": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "peer": true - }, "node_modules/randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -2272,15 +1622,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "peer": true, + "dev": true, "engines": { "node": ">=0.10.0" } @@ -2300,39 +1642,6 @@ "node": ">= 4" } }, - "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "peer": true, - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } - }, - "node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "peer": true, - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -2368,23 +1677,6 @@ "node": ">=10" } }, - "node_modules/sentence-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/sentence-case/-/sentence-case-3.0.4.tgz", - "integrity": "sha512-8LS0JInaQMCRoQ7YUytAo/xUu5W2XnQxV2HI/6uM6U7CITS1RqPElr30V6uIqyMKM9lJGRVFy5/4CuzcixNYSg==", - "peer": true, - "dependencies": { - "no-case": "^3.0.4", - "tslib": "^2.0.3", - "upper-case-first": "^2.0.2" - } - }, - "node_modules/sentence-case/node_modules/tslib": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", - "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", - "peer": true - }, "node_modules/serialize-javascript": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", @@ -2406,40 +1698,6 @@ "integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==", "dev": true }, - "node_modules/sisteransi": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", - "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", - "peer": true - }, - "node_modules/slash": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", - "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", - "peer": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/snake-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/snake-case/-/snake-case-3.0.4.tgz", - "integrity": "sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==", - "peer": true, - "dependencies": { - "dot-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, - "node_modules/snake-case/node_modules/tslib": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", - "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", - "peer": true - }, "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -2450,6 +1708,7 @@ "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -2469,6 +1728,7 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -2507,6 +1767,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, "dependencies": { "is-number": "^7.0.0" }, @@ -2591,45 +1852,6 @@ "node": ">=4.2.0" } }, - "node_modules/upper-case": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/upper-case/-/upper-case-2.0.2.tgz", - "integrity": "sha512-KgdgDGJt2TpuwBUIjgG6lzw2GWFRCW9Qkfkiv0DxqHHLYJHmtmdUIKcZd8rHgFSjopVTlw6ggzCm1b8MFQwikg==", - "peer": true, - "dependencies": { - "tslib": "^2.0.3" - } - }, - "node_modules/upper-case-first": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/upper-case-first/-/upper-case-first-2.0.2.tgz", - "integrity": "sha512-514ppYHBaKwfJRK/pNC6c/OxfGa0obSnAl106u97Ed0I625Nin96KAjttZF6ZL3e1XLtphxnqrOi9iWgm+u+bg==", - "peer": true, - "dependencies": { - "tslib": "^2.0.3" - } - }, - "node_modules/upper-case-first/node_modules/tslib": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", - "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", - "peer": true - }, - "node_modules/upper-case/node_modules/tslib": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", - "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", - "peer": true - }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "peer": true, - "dependencies": { - "punycode": "^2.1.0" - } - }, "node_modules/uuid": { "version": "8.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", @@ -2645,53 +1867,11 @@ "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", "dev": true }, - "node_modules/vscode-jsonrpc": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-6.0.0.tgz", - "integrity": "sha512-wnJA4BnEjOSyFMvjZdpiOwhSq9uDoK8e/kpRJDTaMYzwlkrhG1fwDIZI94CLsLzlCK5cIbMMtFlJlfR57Lavmg==", - "peer": true, - "engines": { - "node": ">=8.0.0 || >=10.0.0" - } - }, - "node_modules/vscode-languageserver": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-7.0.0.tgz", - "integrity": "sha512-60HTx5ID+fLRcgdHfmz0LDZAXYEV68fzwG0JWwEPBode9NuMYTIxuYXPg4ngO8i8+Ou0lM7y6GzaYWbiDL0drw==", - "peer": true, - "dependencies": { - "vscode-languageserver-protocol": "3.16.0" - }, - "bin": { - "installServerIntoExtension": "bin/installServerIntoExtension" - } - }, - "node_modules/vscode-languageserver-protocol": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.16.0.tgz", - "integrity": "sha512-sdeUoAawceQdgIfTI+sdcwkiK2KU+2cbEYA0agzM2uqaUy2UpnnGHtWTHVEtS0ES4zHU0eMFRGN+oQgDxlD66A==", - "peer": true, - "dependencies": { - "vscode-jsonrpc": "6.0.0", - "vscode-languageserver-types": "3.16.0" - } - }, - "node_modules/vscode-languageserver-textdocument": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.7.tgz", - "integrity": "sha512-bFJH7UQxlXT8kKeyiyu41r22jCZXG8kuuVVA33OEJn1diWOZK5n8zBSPZFHVBOu8kXZ6h0LIRhf5UnCo61J4Hg==", - "peer": true - }, - "node_modules/vscode-languageserver-types": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.16.0.tgz", - "integrity": "sha512-k8luDIWJWyenLc5ToFQQMaSrqCHiLwyKPHKPQZ5zz21vM+vIVUSvsRpcbiECH4WR88K2XZqc4ScRcZ7nk/jbeA==", - "peer": true - }, "node_modules/web-streams-polyfill": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz", "integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==", + "dev": true, "engines": { "node": ">= 8" } @@ -3008,185 +2188,6 @@ "integrity": "sha512-oc6OHLdoLlOpO5GjMcOFETEhJi45CI3MVIhvVY/yqyGw9AtaqOYw5HzO3wTuYgYFeGS4v9iqFah0SNLZrpk3Sg==", "dev": true }, - "@babel/code-frame": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", - "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", - "peer": true, - "requires": { - "@babel/highlight": "^7.16.7" - } - }, - "@babel/helper-validator-identifier": { - "version": "7.19.1", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", - "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", - "peer": true - }, - "@babel/highlight": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", - "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", - "peer": true, - "requires": { - "@babel/helper-validator-identifier": "^7.18.6", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "peer": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "peer": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "peer": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "peer": true - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "peer": true - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "peer": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "peer": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "@cadl-lang/compiler": { - "version": "0.37.0", - "resolved": "https://registry.npmjs.org/@cadl-lang/compiler/-/compiler-0.37.0.tgz", - "integrity": "sha512-jHMqPZmM4evQlu7oY9vj6PEM+f+OhnfPqAdwxALrU2gwsLcwYG1h8rkjX/iK2KfeewCbXuRT/hztOTo3pcbYWA==", - "peer": true, - "requires": { - "@babel/code-frame": "~7.16.7", - "ajv": "~8.9.0", - "change-case": "~4.1.2", - "globby": "~13.1.1", - "js-yaml": "~4.1.0", - "mkdirp": "~1.0.4", - "mustache": "~4.2.0", - "node-fetch": "3.2.8", - "node-watch": "~0.7.1", - "picocolors": "~1.0.0", - "prettier": "~2.7.1", - "prompts": "~2.4.1", - "vscode-languageserver": "~7.0.0", - "vscode-languageserver-textdocument": "~1.0.1", - "yargs": "~17.3.1" - }, - "dependencies": { - "argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "peer": true - }, - "cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", - "peer": true, - "requires": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - } - }, - "js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "peer": true, - "requires": { - "argparse": "^2.0.1" - } - }, - "wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "peer": true, - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - } - }, - "y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "peer": true - }, - "yargs": { - "version": "17.3.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.3.1.tgz", - "integrity": "sha512-WUANQeVgjLbNsEmGk20f+nlHgOqzRFpiGWVaBrYGYIGANIIu3lWjoyi0fNlFmJkvfhCZ6BXINe7/W2O2bV4iaA==", - "peer": true, - "requires": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.0.0" - } - }, - "yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", - "peer": true - } - } - }, - "@cadl-lang/rest": { - "version": "0.19.0", - "resolved": "https://registry.npmjs.org/@cadl-lang/rest/-/rest-0.19.0.tgz", - "integrity": "sha512-3vMDvr8huQcH03oGYlt5uhRu5TKn6rb+rK0tmPfWgZ9EfZDMn0lR4CAjQOukFv2d93s7KE2IBVtXvQ/Z0C7kdQ==", - "requires": {} - }, "@cspotcode/source-map-support": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", @@ -3218,32 +2219,6 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, - "@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "peer": true, - "requires": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - } - }, - "@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "peer": true - }, - "@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "peer": true, - "requires": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - } - }, "@ts-common/add-position": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/@ts-common/add-position/-/add-position-0.0.2.tgz", @@ -3507,18 +2482,6 @@ "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", "dev": true }, - "ajv": { - "version": "8.9.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.9.0.tgz", - "integrity": "sha512-qOKJyNj/h+OWx7s5DePL6Zu1KeM9jPZhwBqs+7DzP6bGOvqzVCSf0xueYmVuaC/oQ/VtS2zLMLHdQFbkka+XDQ==", - "peer": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - } - }, "ansi-colors": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", @@ -3528,12 +2491,14 @@ "ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true }, "ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, "requires": { "color-convert": "^2.0.1" } @@ -3604,6 +2569,7 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, "requires": { "fill-range": "^7.0.1" } @@ -3620,49 +2586,12 @@ "integrity": "sha512-wCyFsDQkKPwwF8BDwOiWNx/9K45L/hvggQiDbve+viMNMQnWhrlYIuBk09offfwCRtCO9P6XwUttufzU11WCVw==", "dev": true }, - "camel-case": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-4.1.2.tgz", - "integrity": "sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw==", - "peer": true, - "requires": { - "pascal-case": "^3.1.2", - "tslib": "^2.0.3" - }, - "dependencies": { - "tslib": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", - "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", - "peer": true - } - } - }, "camelcase": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", "dev": true }, - "capital-case": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/capital-case/-/capital-case-1.0.4.tgz", - "integrity": "sha512-ds37W8CytHgwnhGGTi88pcPyR15qoNkOpYwmMMfnWqqWgESapLqvDx6huFjQ5vqWSn2Z06173XNA7LtMOeUh1A==", - "peer": true, - "requires": { - "no-case": "^3.0.4", - "tslib": "^2.0.3", - "upper-case-first": "^2.0.2" - }, - "dependencies": { - "tslib": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", - "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", - "peer": true - } - } - }, "chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -3684,34 +2613,6 @@ } } }, - "change-case": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/change-case/-/change-case-4.1.2.tgz", - "integrity": "sha512-bSxY2ws9OtviILG1EiY5K7NNxkqg/JnRnFxLtKQ96JaviiIxi7djMrSd0ECT9AC+lttClmYwKw53BWpOMblo7A==", - "peer": true, - "requires": { - "camel-case": "^4.1.2", - "capital-case": "^1.0.4", - "constant-case": "^3.0.4", - "dot-case": "^3.0.4", - "header-case": "^2.0.4", - "no-case": "^3.0.4", - "param-case": "^3.0.4", - "pascal-case": "^3.1.2", - "path-case": "^3.0.4", - "sentence-case": "^3.0.4", - "snake-case": "^3.0.4", - "tslib": "^2.0.3" - }, - "dependencies": { - "tslib": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", - "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", - "peer": true - } - } - }, "chokidar": { "version": "3.5.3", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", @@ -3743,6 +2644,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, "requires": { "color-name": "~1.1.4" } @@ -3750,7 +2652,8 @@ "color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true }, "combined-stream": { "version": "1.0.8", @@ -3779,25 +2682,6 @@ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, - "constant-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/constant-case/-/constant-case-3.0.4.tgz", - "integrity": "sha512-I2hSBi7Vvs7BEuJDr5dDHfzb/Ruj3FyvFyh7KLilAjNQw3Be+xgqUBA2W6scVEcL0hL1dwPRtIqEPVUCKkSsyQ==", - "peer": true, - "requires": { - "no-case": "^3.0.4", - "tslib": "^2.0.3", - "upper-case": "^2.0.2" - }, - "dependencies": { - "tslib": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", - "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", - "peer": true - } - } - }, "create-require": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", @@ -3807,7 +2691,8 @@ "data-uri-to-buffer": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.0.tgz", - "integrity": "sha512-Vr3mLBA8qWmcuschSLAOogKgQ/Jwxulv3RNE4FXnYWRGujzrRWQI4m12fQqRkwX06C0KanhLr4hK+GydchZsaA==" + "integrity": "sha512-Vr3mLBA8qWmcuschSLAOogKgQ/Jwxulv3RNE4FXnYWRGujzrRWQI4m12fQqRkwX06C0KanhLr4hK+GydchZsaA==", + "dev": true }, "debug": { "version": "4.3.3", @@ -3844,37 +2729,11 @@ "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", "dev": true }, - "dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "peer": true, - "requires": { - "path-type": "^4.0.0" - } - }, - "dot-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz", - "integrity": "sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==", - "peer": true, - "requires": { - "no-case": "^3.0.4", - "tslib": "^2.0.3" - }, - "dependencies": { - "tslib": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", - "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", - "peer": true - } - } - }, "emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true }, "entities": { "version": "2.0.3", @@ -3885,7 +2744,8 @@ "escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==" + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true }, "escape-string-regexp": { "version": "4.0.0", @@ -3899,38 +2759,11 @@ "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "dev": true }, - "fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "peer": true - }, - "fast-glob": { - "version": "3.2.12", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", - "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", - "peer": true, - "requires": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - } - }, - "fastq": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", - "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", - "peer": true, - "requires": { - "reusify": "^1.0.4" - } - }, "fetch-blob": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", + "dev": true, "requires": { "node-domexception": "^1.0.0", "web-streams-polyfill": "^3.0.3" @@ -3940,6 +2773,7 @@ "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, "requires": { "to-regex-range": "^5.0.1" } @@ -3981,6 +2815,7 @@ "version": "4.0.10", "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", + "dev": true, "requires": { "fetch-blob": "^3.1.2" } @@ -4010,7 +2845,8 @@ "get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true }, "glob": { "version": "7.2.3", @@ -4030,23 +2866,11 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, "requires": { "is-glob": "^4.0.1" } }, - "globby": { - "version": "13.1.2", - "resolved": "https://registry.npmjs.org/globby/-/globby-13.1.2.tgz", - "integrity": "sha512-LKSDZXToac40u8Q1PQtZihbNdTYSNMuWe+K5l+oa6KgDzSvVrHXlJy40hUP522RjAIoNLJYBJi7ow+rbFpIhHQ==", - "peer": true, - "requires": { - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.11", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^4.0.0" - } - }, "growl": { "version": "1.10.5", "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", @@ -4071,30 +2895,6 @@ "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", "dev": true }, - "header-case": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/header-case/-/header-case-2.0.4.tgz", - "integrity": "sha512-H/vuk5TEEVZwrR0lp2zed9OCo1uAILMlx0JEMgC26rzyJJ3N1v6XkwHHXJQdR2doSjcGPM6OKPYoJgf0plJ11Q==", - "peer": true, - "requires": { - "capital-case": "^1.0.4", - "tslib": "^2.0.3" - }, - "dependencies": { - "tslib": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", - "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", - "peer": true - } - } - }, - "ignore": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", - "peer": true - }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -4129,17 +2929,20 @@ "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==" + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true }, "is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true }, "is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, "requires": { "is-extglob": "^2.1.1" } @@ -4147,7 +2950,8 @@ "is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true }, "is-plain-obj": { "version": "2.1.0", @@ -4176,12 +2980,6 @@ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "peer": true - }, "js-yaml": { "version": "3.14.1", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", @@ -4203,24 +3001,12 @@ "ono": "^4.0.11" } }, - "json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "peer": true - }, "jsonpath-plus": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/jsonpath-plus/-/jsonpath-plus-6.0.1.tgz", "integrity": "sha512-EvGovdvau6FyLexFH2OeXfIITlgIbgZoAZe3usiySeaIDm5QS+A10DKNpaPBBqqRSZr2HN6HVNXxtwUAr2apEw==", "dev": true }, - "kleur": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", - "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", - "peer": true - }, "locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", @@ -4240,23 +3026,6 @@ "is-unicode-supported": "^0.1.0" } }, - "lower-case": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", - "integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==", - "peer": true, - "requires": { - "tslib": "^2.0.3" - }, - "dependencies": { - "tslib": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", - "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", - "peer": true - } - } - }, "lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -4278,22 +3047,6 @@ "integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==", "dev": true }, - "merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "peer": true - }, - "micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "peer": true, - "requires": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - } - }, "mime-db": { "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", @@ -4324,12 +3077,6 @@ "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", "dev": true }, - "mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "peer": true - }, "mocha": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.2.2.tgz", @@ -4462,45 +3209,23 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, - "mustache": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz", - "integrity": "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==", - "peer": true - }, "nanoid": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.1.tgz", "integrity": "sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw==", "dev": true }, - "no-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz", - "integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==", - "peer": true, - "requires": { - "lower-case": "^2.0.2", - "tslib": "^2.0.3" - }, - "dependencies": { - "tslib": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", - "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", - "peer": true - } - } - }, "node-domexception": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", - "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==" + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", + "dev": true }, "node-fetch": { "version": "3.2.8", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.2.8.tgz", "integrity": "sha512-KtpD1YhGszhntMpBDyp5lyagk8KIMopC1LEb7cQUAh7zcosaX5uK8HnbNb2i3NTQK3sIawCItS0uFC3QzcLHdg==", + "dev": true, "requires": { "data-uri-to-buffer": "^4.0.0", "fetch-blob": "^3.1.4", @@ -4527,12 +3252,6 @@ "integrity": "sha512-UdS4swXs85fCGWWf6t6DMGgpN/vnlKeSGEQ7hJcrs7PBFoxoKLmibc3QRb7fwiYsjdL7PX8iI/TMSlZ90dgHhQ==", "dev": true }, - "node-watch": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/node-watch/-/node-watch-0.7.3.tgz", - "integrity": "sha512-3l4E8uMPY1HdMMryPRUAl+oIHtXtyiTlIiESNSVSNxcPfzAFzeTbXFQkZfAwBbo0B1qMSG8nUABx+Gd+YrbKrQ==", - "peer": true - }, "normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -4581,60 +3300,6 @@ "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true }, - "param-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/param-case/-/param-case-3.0.4.tgz", - "integrity": "sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A==", - "peer": true, - "requires": { - "dot-case": "^3.0.4", - "tslib": "^2.0.3" - }, - "dependencies": { - "tslib": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", - "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", - "peer": true - } - } - }, - "pascal-case": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/pascal-case/-/pascal-case-3.1.2.tgz", - "integrity": "sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g==", - "peer": true, - "requires": { - "no-case": "^3.0.4", - "tslib": "^2.0.3" - }, - "dependencies": { - "tslib": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", - "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", - "peer": true - } - } - }, - "path-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/path-case/-/path-case-3.0.4.tgz", - "integrity": "sha512-qO4qCFjXqVTrcbPt/hQfhTQ+VhFsqNKOPtytgNKkKxSoEp3XPUQ8ObFuePylOIok5gjn69ry8XiULxCwot3Wfg==", - "peer": true, - "requires": { - "dot-case": "^3.0.4", - "tslib": "^2.0.3" - }, - "dependencies": { - "tslib": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", - "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", - "peer": true - } - } - }, "path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -4647,49 +3312,17 @@ "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "dev": true }, - "path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "peer": true - }, - "picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", - "peer": true - }, "picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true }, "prettier": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", - "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==" - }, - "prompts": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", - "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", - "peer": true, - "requires": { - "kleur": "^3.0.3", - "sisteransi": "^1.0.5" - } - }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "peer": true - }, - "queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "peer": true + "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", + "dev": true }, "randombytes": { "version": "2.1.0", @@ -4712,13 +3345,8 @@ "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==" - }, - "require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "peer": true + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true }, "require-main-filename": { "version": "2.0.0", @@ -4732,21 +3360,6 @@ "integrity": "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==", "dev": true }, - "reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "peer": true - }, - "run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "peer": true, - "requires": { - "queue-microtask": "^1.2.2" - } - }, "safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -4762,25 +3375,6 @@ "lru-cache": "^6.0.0" } }, - "sentence-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/sentence-case/-/sentence-case-3.0.4.tgz", - "integrity": "sha512-8LS0JInaQMCRoQ7YUytAo/xUu5W2XnQxV2HI/6uM6U7CITS1RqPElr30V6uIqyMKM9lJGRVFy5/4CuzcixNYSg==", - "peer": true, - "requires": { - "no-case": "^3.0.4", - "tslib": "^2.0.3", - "upper-case-first": "^2.0.2" - }, - "dependencies": { - "tslib": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", - "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", - "peer": true - } - } - }, "serialize-javascript": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", @@ -4802,36 +3396,6 @@ "integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==", "dev": true }, - "sisteransi": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", - "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", - "peer": true - }, - "slash": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", - "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", - "peer": true - }, - "snake-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/snake-case/-/snake-case-3.0.4.tgz", - "integrity": "sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==", - "peer": true, - "requires": { - "dot-case": "^3.0.4", - "tslib": "^2.0.3" - }, - "dependencies": { - "tslib": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", - "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", - "peer": true - } - } - }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -4842,6 +3406,7 @@ "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, "requires": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -4858,6 +3423,7 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, "requires": { "ansi-regex": "^5.0.1" } @@ -4881,6 +3447,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, "requires": { "is-number": "^7.0.0" } @@ -4932,49 +3499,6 @@ "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==", "dev": true }, - "upper-case": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/upper-case/-/upper-case-2.0.2.tgz", - "integrity": "sha512-KgdgDGJt2TpuwBUIjgG6lzw2GWFRCW9Qkfkiv0DxqHHLYJHmtmdUIKcZd8rHgFSjopVTlw6ggzCm1b8MFQwikg==", - "peer": true, - "requires": { - "tslib": "^2.0.3" - }, - "dependencies": { - "tslib": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", - "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", - "peer": true - } - } - }, - "upper-case-first": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/upper-case-first/-/upper-case-first-2.0.2.tgz", - "integrity": "sha512-514ppYHBaKwfJRK/pNC6c/OxfGa0obSnAl106u97Ed0I625Nin96KAjttZF6ZL3e1XLtphxnqrOi9iWgm+u+bg==", - "peer": true, - "requires": { - "tslib": "^2.0.3" - }, - "dependencies": { - "tslib": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", - "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", - "peer": true - } - } - }, - "uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "peer": true, - "requires": { - "punycode": "^2.1.0" - } - }, "uuid": { "version": "8.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", @@ -4987,47 +3511,11 @@ "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", "dev": true }, - "vscode-jsonrpc": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-6.0.0.tgz", - "integrity": "sha512-wnJA4BnEjOSyFMvjZdpiOwhSq9uDoK8e/kpRJDTaMYzwlkrhG1fwDIZI94CLsLzlCK5cIbMMtFlJlfR57Lavmg==", - "peer": true - }, - "vscode-languageserver": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-7.0.0.tgz", - "integrity": "sha512-60HTx5ID+fLRcgdHfmz0LDZAXYEV68fzwG0JWwEPBode9NuMYTIxuYXPg4ngO8i8+Ou0lM7y6GzaYWbiDL0drw==", - "peer": true, - "requires": { - "vscode-languageserver-protocol": "3.16.0" - } - }, - "vscode-languageserver-protocol": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.16.0.tgz", - "integrity": "sha512-sdeUoAawceQdgIfTI+sdcwkiK2KU+2cbEYA0agzM2uqaUy2UpnnGHtWTHVEtS0ES4zHU0eMFRGN+oQgDxlD66A==", - "peer": true, - "requires": { - "vscode-jsonrpc": "6.0.0", - "vscode-languageserver-types": "3.16.0" - } - }, - "vscode-languageserver-textdocument": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.7.tgz", - "integrity": "sha512-bFJH7UQxlXT8kKeyiyu41r22jCZXG8kuuVVA33OEJn1diWOZK5n8zBSPZFHVBOu8kXZ6h0LIRhf5UnCo61J4Hg==", - "peer": true - }, - "vscode-languageserver-types": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.16.0.tgz", - "integrity": "sha512-k8luDIWJWyenLc5ToFQQMaSrqCHiLwyKPHKPQZ5zz21vM+vIVUSvsRpcbiECH4WR88K2XZqc4ScRcZ7nk/jbeA==", - "peer": true - }, "web-streams-polyfill": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz", - "integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==" + "integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==", + "dev": true }, "webidl-conversions": { "version": "3.0.1", diff --git a/package.json b/package.json index e7c683dcbf1e..c96a4693c2f4 100644 --- a/package.json +++ b/package.json @@ -41,8 +41,5 @@ "prettier": "prettier", "tsc": "tsc", "multiapi": "ts-node ./scripts/multiapi.ts" - }, - "dependencies": { - "@cadl-lang/rest": "^0.19.0" } } From 9753a3e241f7b915a8830ddde9803a14f030440c Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Mon, 12 Dec 2022 10:54:32 -0800 Subject: [PATCH 44/65] changing baseEvents to alias --- .../data-plane/cadl/ApiManagement.cadl | 69 ++++++--- .../cadl/ApiManagementTypedReference.cadl | 134 ++++++++++++++++++ .../data-plane/cadl/AppConfiguration.cadl | 72 +++++----- .../cadl/AzureCommunicationServices.cadl | 21 +-- .../data-plane/cadl/ContainerRegistry.cadl | 20 ++- .../eventgrid/data-plane/cadl/EventGrid.cadl | 2 +- .../data-plane/cadl/HealthcareApis.cadl | 19 ++- .../eventgrid/data-plane/cadl/KeyVault.cadl | 52 ++++--- .../data-plane/cadl/MediaServices.cadl | 15 +- .../data-plane/cadl/PolicyInsights.cadl | 22 +-- .../eventgrid/data-plane/cadl/RedisCache.cadl | 44 +++--- .../eventgrid/data-plane/cadl/Resources.cadl | 42 ++++-- .../eventgrid/data-plane/cadl/ServiceBus.cadl | 26 ++-- .../data-plane/cadl/SignalRService.cadl | 13 +- .../eventgrid/data-plane/cadl/Storage.cadl | 49 +++---- .../eventgrid/data-plane/cadl/main.cadl | 42 ++++++ 16 files changed, 436 insertions(+), 206 deletions(-) create mode 100644 specification/eventgrid/data-plane/cadl/ApiManagementTypedReference.cadl diff --git a/specification/eventgrid/data-plane/cadl/ApiManagement.cadl b/specification/eventgrid/data-plane/cadl/ApiManagement.cadl index a0acca58762b..8caa05370ba1 100644 --- a/specification/eventgrid/data-plane/cadl/ApiManagement.cadl +++ b/specification/eventgrid/data-plane/cadl/ApiManagement.cadl @@ -1,57 +1,82 @@ @doc("Describes the schema of the Azure API Management events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") namespace ApiManagement { @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.UserCreated event.") - model ApiManagementUserCreatedEventData is BaseEvents.ApiManagementBase; + model ApiManagementUserCreatedEventData{ + ...ApiManagementBase; + } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.UserUpdated event.") - model ApiManagementUserUpdatedEventData is BaseEvents.ApiManagementBase; + model ApiManagementUserUpdatedEventData{ + ...ApiManagementBase; + } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.UserDeleted event.") - model ApiManagementUserDeletedEventData is BaseEvents.ApiManagementBase; + model ApiManagementUserDeletedEventData{ + ...ApiManagementBase; + } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.SubscriptionCreated event.") - model ApiManagementSubscriptionCreatedEventData - is BaseEvents.ApiManagementBase; + model ApiManagementSubscriptionCreatedEventData{ + ...ApiManagementBase; + } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.SubscriptionUpdated event.") - model ApiManagementSubscriptionUpdatedEventData - is BaseEvents.ApiManagementBase; + model ApiManagementSubscriptionUpdatedEventData{ + ...ApiManagementBase; + } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.SubscriptionDeleted event.") - model ApiManagementSubscriptionDeletedEventData - is BaseEvents.ApiManagementBase; + model ApiManagementSubscriptionDeletedEventData{ + ...ApiManagementBase; + } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.ProductCreated event.") - model ApiManagementProductCreatedEventData is BaseEvents.ApiManagementBase; + model ApiManagementProductCreatedEventData{ + ...ApiManagementBase; + } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.ProductUpdated event.") - model ApiManagementProductUpdatedEventData is BaseEvents.ApiManagementBase; + model ApiManagementProductUpdatedEventData{ + ...ApiManagementBase; + } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.ProductDeleted event.") - model ApiManagementProductDeletedEventData is BaseEvents.ApiManagementBase; + model ApiManagementProductDeletedEventData{ + ...ApiManagementBase; + } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APICreated event.") - model ApiManagementApiCreatedEventData is BaseEvents.ApiManagementBase; + model ApiManagementApiCreatedEventData{ + ...ApiManagementBase; + } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIUpdated event.") - model ApiManagementApiUpdatedEventData is BaseEvents.ApiManagementBase; + model ApiManagementApiUpdatedEventData{ + ...ApiManagementBase; + } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIDeleted event.") - model ApiManagementApiDeletedEventData is BaseEvents.ApiManagementBase; + model ApiManagementApiDeletedEventData{ + ...ApiManagementBase; + } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIReleaseCreated event.") - model ApiManagementApiReleaseCreatedEventData is BaseEvents.ApiManagementBase; + model ApiManagementApiReleaseCreatedEventData{ + ...ApiManagementBase; + } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIReleaseUpdated event.") - model ApiManagementApiReleaseUpdatedEventData is BaseEvents.ApiManagementBase; + model ApiManagementApiReleaseUpdatedEventData{ + ...ApiManagementBase; + } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIReleaseDeleted event.") - model ApiManagementApiReleaseDeletedEventData is BaseEvents.ApiManagementBase; -} + model ApiManagementApiReleaseDeletedEventData{ + ...ApiManagementBase; + } -namespace BaseEvents { - model ApiManagementBase { + alias ApiManagementBase = { @doc("The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions//resourceGroups//Microsoft.ApiManagement/service///`") resourceUri?: string; - } + }; } diff --git a/specification/eventgrid/data-plane/cadl/ApiManagementTypedReference.cadl b/specification/eventgrid/data-plane/cadl/ApiManagementTypedReference.cadl new file mode 100644 index 000000000000..c24eb8fe0110 --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/ApiManagementTypedReference.cadl @@ -0,0 +1,134 @@ +@doc("Describes the schema of the Azure API Management events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") +namespace EventGrid.ApiManagement { + + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.UserCreated event.") + model ApiManagementUserCreatedEventData{ + ...BaseEventData; + }; + + model ApiManagementUserCreatedEvent is EventGrid.TypedEventGridEvent<"Microsoft.ApiManagement.UserCreated", ApiManagementUserCreatedEventData>; + model ApiManagementUserCreatedEventCloud is EventGrid.TypedCloudEvent<"Microsoft.ApiManagement.UserCreated", ApiManagementUserCreatedEventData>; + + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.UserUpdated event.") + model ApiManagementUserUpdatedEventData{ + ...BaseEventData; + }; + + model ApiManagementUserUpdatedEvent is EventGrid.TypedEventGridEvent<"Microsoft.ApiManagement.UserUpdated", ApiManagementUserUpdatedEventData>; + model ApiManagementUserUpdatedEventCloud is EventGrid.TypedCloudEvent<"Microsoft.ApiManagement.UserUpdated", ApiManagementUserUpdatedEventData>; + + + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.UserDeleted event.") + model ApiManagementUserDeletedEventData{ + ...BaseEventData; + }; + + model ApiManagementUserDeletedEvent is EventGrid.TypedEventGridEvent<"Microsoft.ApiManagement.UserDeleted", ApiManagementUserDeletedEventData>; + model ApiManagementUserDeletedEventCloud is EventGrid.TypedCloudEvent<"Microsoft.ApiManagement.UserDeleted", ApiManagementUserDeletedEventData>; + + + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.SubscriptionCreated event.") + model ApiManagementSubscriptionCreatedEventData{ + ...BaseEventData; + }; + + model ApiManagementSubscriptionCreatedEvent is EventGrid.TypedEventGridEvent<"Microsoft.ApiManagement.SubscriptionCreated", ApiManagementSubscriptionCreatedEventData>; + model ApiManagementSubscriptionCreatedEventCloud is EventGrid.TypedCloudEvent<"Microsoft.ApiManagement.SubscriptionCreated", ApiManagementSubscriptionCreatedEventData>; + + + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.SubscriptionUpdated event.") + model ApiManagementSubscriptionUpdatedEventData{ + ...BaseEventData; + }; + + model ApiManagementSubscriptionUpdatedEvent is EventGrid.TypedEventGridEvent<"Microsoft.ApiManagement.SubscriptionUpdated", ApiManagementSubscriptionUpdatedEventData>; + model ApiManagementSubscriptionUpdatedEventCloud is EventGrid.TypedCloudEvent<"Microsoft.ApiManagement.SubscriptionUpdated", ApiManagementSubscriptionUpdatedEventData>; + + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.SubscriptionDeleted event.") + model ApiManagementSubscriptionDeletedEventData{ + ...BaseEventData; + }; + + model ApiManagementSubscriptionDeletedEvent is EventGrid.TypedEventGridEvent<"Microsoft.ApiManagement.SubscriptionDeleted", ApiManagementSubscriptionDeletedEventData>; + model ApiManagementSubscriptionDeletedEventCloud is EventGrid.TypedCloudEvent<"Microsoft.ApiManagement.SubscriptionDeleted", ApiManagementSubscriptionDeletedEventData>; + + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.ProductCreated event.") + model ApiManagementProductCreatedEventData{ + ...BaseEventData; + }; + + model ApiManagementProductCreatedEvent is EventGrid.TypedEventGridEvent<"Microsoft.ApiManagement.ProductCreated", ApiManagementProductCreatedEventData>; + model ApiManagementProductCreatedEventCloud is EventGrid.TypedCloudEvent<"Microsoft.ApiManagement.ProductCreated", ApiManagementProductCreatedEventData>; + + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.ProductUpdated event.") + model ApiManagementProductUpdatedEventData{ + ...BaseEventData; + }; + + model ApiManagementProductUpdatedEvent is EventGrid.TypedEventGridEvent<"Microsoft.ApiManagement.ProductUpdated", ApiManagementProductUpdatedEventData>; + model ApiManagementProductUpdatedEventCloud is EventGrid.TypedCloudEvent<"Microsoft.ApiManagement.ProductUpdated", ApiManagementProductUpdatedEventData>; + + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.ProductDeleted event.") + model ApiManagementProductDeletedEventData{ + ...BaseEventData; + }; + + model ApiManagementProductDeletedEvent is EventGrid.TypedEventGridEvent<"Microsoft.ApiManagement.ProductDeleted", ApiManagementProductDeletedEventData>; + model ApiManagementProductDeletedEventCloud is EventGrid.TypedCloudEvent<"Microsoft.ApiManagement.ProductDeleted", ApiManagementProductDeletedEventData>; + + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APICreated event.") + model ApiManagementApiCreatedEventData{ + ...BaseEventData; + }; + + model ApiManagementApiCreatedEvent is EventGrid.TypedEventGridEvent<"Microsoft.ApiManagement.ApiCreated", ApiManagementApiCreatedEventData>; + model ApiManagementApiCreatedEventCloud is EventGrid.TypedCloudEvent<"Microsoft.ApiManagement.ApiCreated", ApiManagementApiCreatedEventData>; + + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIUpdated event.") + model ApiManagementApiUpdatedEventData{ + ...BaseEventData; + }; + + model ApiManagementApiUpdatedEvent is EventGrid.TypedEventGridEvent<"Microsoft.ApiManagement.ApiUpdated", ApiManagementApiUpdatedEventData>; + model ApiManagementApiUpdatedEventCloud is EventGrid.TypedCloudEvent<"Microsoft.ApiManagement.ApiUpdated", ApiManagementApiUpdatedEventData>; + + + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIDeleted event.") + model ApiManagementApiDeletedEventData{ + ...BaseEventData; + }; + + model ApiManagementApiDeletedEvent is EventGrid.TypedEventGridEvent<"Microsoft.ApiManagement.ApiDeleted", ApiManagementApiDeletedEventData>; + model ApiManagementApiDeletedEventCloud is EventGrid.TypedCloudEvent<"Microsoft.ApiManagement.ApiDeleted", ApiManagementApiDeletedEventData>; + + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIReleaseCreated event.") + model ApiManagementApiReleaseCreatedEventData{ + ...BaseEventData; + }; + + model ApiManagementApiReleaseCreatedEvent is EventGrid.TypedEventGridEvent<"Microsoft.ApiManagement.ApiReleaseCreated", ApiManagementApiReleaseCreatedEventData>; + model ApiManagementApiReleaseCreatedEventCloud is EventGrid.TypedCloudEvent<"Microsoft.ApiManagement.ApiReleaseCreated", ApiManagementApiReleaseCreatedEventData>; + + + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIReleaseUpdated event.") + model ApiManagementApiReleaseUpdatedEventData{ + ...BaseEventData; + }; + + model ApiManagementApiReleaseUpdatedEvent is EventGrid.TypedEventGridEvent<"Microsoft.ApiManagement.ApiReleaseUpdated", ApiManagementApiReleaseUpdatedEventData>; + model ApiManagementApiReleaseUpdatedEventCloud is EventGrid.TypedCloudEvent<"Microsoft.ApiManagement.ApiReleaseUpdated", ApiManagementApiReleaseUpdatedEventData>; + + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIReleaseDeleted event.") + model ApiManagementApiReleaseDeletedEventData{ + ...BaseEventData; + }; + + model ApiManagementApiReleaseDeletedEvent is EventGrid.TypedEventGridEvent<"Microsoft.ApiManagement.ApiReleaseDeleted", ApiManagementApiReleaseDeletedEventData>; + model ApiManagementApiReleaseDeletedEventCloud is EventGrid.TypedCloudEvent<"Microsoft.ApiManagement.ApiReleaseDeleted", ApiManagementApiReleaseDeletedEventData>; + + alias BaseEventData = { + @doc("The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions//resourceGroups//Microsoft.ApiManagement/service///`") + resourceUri?: string; + }; + +} diff --git a/specification/eventgrid/data-plane/cadl/AppConfiguration.cadl b/specification/eventgrid/data-plane/cadl/AppConfiguration.cadl index e23c1d536ac3..cdc41a0c1484 100644 --- a/specification/eventgrid/data-plane/cadl/AppConfiguration.cadl +++ b/specification/eventgrid/data-plane/cadl/AppConfiguration.cadl @@ -1,44 +1,44 @@ @doc("Describes the schema of the Azure App Configuration events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") -namespace AppConfiguration; +namespace AppConfiguration{ -enum AppConfigurationEventTypes { - "modified", - "deleted", -} + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.AppConfiguration.KeyValueModified event.") + model AppConfigurationKeyValueModifiedEventData{ + ...AppConfigurationBase<"modified">; + }; -model AppConfigurationBase { - @doc( - "The key used to identify the key-value that was {name}.", - { - name: TEventType, - } - ) - key?: string; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.AppConfiguration.KeyValueDeleted event.") + model AppConfigurationKeyValueDeletedEventData{ + ...AppConfigurationBase<"deleted">; + }; - @doc( - "The label, if any, used to identify the key-value that was {name}.", - { - name: TEventType, - } - ) - label?: string; - @doc( - "The etag representing the key-value that was {name}.", - { - name: TEventType, - } - ) - etag?: string; + alias AppConfigurationBase = { + @doc( + "The key used to identify the key-value that was {name}.", + { + name: TEventType, + } + ) + key?: string; - @doc("The sync token representing the server state after the event.") - syncToken?: string; -} + @doc( + "The label, if any, used to identify the key-value that was {name}.", + { + name: TEventType, + } + ) + label?: string; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.AppConfiguration.KeyValueModified event.") -model AppConfigurationKeyValueModifiedEventData - is AppConfigurationBase; + @doc( + "The etag representing the key-value that was {name}.", + { + name: TEventType, + } + ) + etag?: string; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.AppConfiguration.KeyValueDeleted event.") -model AppConfigurationKeyValueDeletedEventData - is AppConfigurationBase; + @doc("The sync token representing the server state after the event.") + syncToken?: string; + }; + +} \ No newline at end of file diff --git a/specification/eventgrid/data-plane/cadl/AzureCommunicationServices.cadl b/specification/eventgrid/data-plane/cadl/AzureCommunicationServices.cadl index 1f25d5c08e70..d384623fda80 100644 --- a/specification/eventgrid/data-plane/cadl/AzureCommunicationServices.cadl +++ b/specification/eventgrid/data-plane/cadl/AzureCommunicationServices.cadl @@ -9,13 +9,14 @@ model AcsUserDisconnectedEventData { userCommunicationIdentifier?: CommunicationIdentifierModel; } -model AcsChatMessageBaseEventData { +alias AcsChatMessageBaseEventData = { @doc("The body of the chat message") messageBody?: string; @doc("The chat message metadata") metadata?: Record; -} +}; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageReceived event.") model AcsChatMessageReceivedEventData extends AcsChatMessageEventBaseProperties { @@ -58,7 +59,7 @@ model AcsChatMessageDeletedInThreadEventData deleteTime?: zonedDateTime; } -model AcsChatThreadBaseEventData { +alias AcsChatThreadBaseEventData = { @doc("The communication identifier of the user who created the thread") createdByCommunicationIdentifier?: CommunicationIdentifierModel; @@ -67,7 +68,7 @@ model AcsChatThreadBaseEventData { @doc("The list of properties of participants who are part of the thread") participants?: AcsChatThreadParticipantProperties[]; -} +}; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadCreatedWithUser event.") model AcsChatThreadCreatedWithUserEventData @@ -81,13 +82,13 @@ model AcsChatThreadCreatedEventData ...AcsChatThreadBaseEventData; } -model AcsChatThreadDeletedBaseEventData { +alias AcsChatThreadDeletedBaseEventData = { @doc("The communication identifier of the user who deleted the thread") deletedByCommunicationIdentifier?: CommunicationIdentifierModel; @doc("The deletion time of the thread") deleteTime?: zonedDateTime; -} +}; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadWithUserDeleted event.") model AcsChatThreadWithUserDeletedEventData @@ -101,7 +102,7 @@ model AcsChatThreadDeletedEventData ...AcsChatThreadDeletedBaseEventData; } -model AcsChatThredPropertiesBaseEventData { +alias AcsChatThredPropertiesBaseEventData = { @doc("The communication identifier of the user who updated the thread properties") editedByCommunicationIdentifier?: CommunicationIdentifierModel; @@ -110,7 +111,7 @@ model AcsChatThredPropertiesBaseEventData { @doc("The updated thread properties") properties?: Record; -} +}; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadPropertiesUpdatedPerUser event.") model AcsChatThreadPropertiesUpdatedPerUserEventData @@ -124,7 +125,7 @@ model AcsChatThreadPropertiesUpdatedEventData ...AcsChatThredPropertiesBaseEventData; } -model AcsChatParticipantBaseEventData { +alias AcsChatParticipantBaseEventData = { @doc("The time at which the user was added to the thread") time?: zonedDateTime; @@ -133,7 +134,7 @@ model AcsChatParticipantBaseEventData { @doc("The details of the user who was added") participantAdded?: AcsChatThreadParticipantProperties; -} +}; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatParticipantAddedToThreadWithUser event.") model AcsChatParticipantAddedToThreadWithUserEventData diff --git a/specification/eventgrid/data-plane/cadl/ContainerRegistry.cadl b/specification/eventgrid/data-plane/cadl/ContainerRegistry.cadl index 6b5a9e1188c0..ce53c5c207e1 100644 --- a/specification/eventgrid/data-plane/cadl/ContainerRegistry.cadl +++ b/specification/eventgrid/data-plane/cadl/ContainerRegistry.cadl @@ -62,14 +62,14 @@ namespace ContainerRegistry { } @doc("The target of the event.") - model ContainerRegistryEventTarget - is BaseEvent.ContainerRegistryBaseEventTarget< + model ContainerRegistryEventTarget{ + ...ContainerRegistryBaseEventTarget< "The MIME type of the referenced object.", "The number of bytes of the content. Same as Length field.", "The digest of the content, as defined by the Registry V2 HTTP API Specification.", "The repository name.", "The tag name." - > { + >; @doc("The number of bytes of the content. Same as Size field.") length?: int64; @@ -78,14 +78,14 @@ namespace ContainerRegistry { } @doc("The target of the event.") - model ContainerRegistryArtifactEventTarget - is BaseEvent.ContainerRegistryBaseEventTarget< + model ContainerRegistryArtifactEventTarget { + ...ContainerRegistryBaseEventTarget< "The MIME type of the artifact.", "The size in bytes of the artifact.", "The digest of the artifact.", "The repository name of the artifact.", "The tag of the artifact." - > { + >; @doc("The name of the artifact.") name?: string; @@ -131,16 +131,14 @@ namespace ContainerRegistry { @doc("The name of the connected registry that generated this event.") name?: string; } -} -namespace BaseEvent { - model ContainerRegistryBaseEventTarget< + alias ContainerRegistryBaseEventTarget< TmediaType extends string, Tsize extends string, Tdigest extends string, Trepository extends string, Ttag extends string - > { + > = { @doc(TmediaType) mediaType?: string; @@ -155,5 +153,5 @@ namespace BaseEvent { @doc(Ttag) tag?: string; - } + }; } diff --git a/specification/eventgrid/data-plane/cadl/EventGrid.cadl b/specification/eventgrid/data-plane/cadl/EventGrid.cadl index e533c4481731..7207902c8a29 100644 --- a/specification/eventgrid/data-plane/cadl/EventGrid.cadl +++ b/specification/eventgrid/data-plane/cadl/EventGrid.cadl @@ -16,7 +16,7 @@ import "@azure-tools/cadl-providerhub"; } ) @doc("Azure EventGrid Client") -namespace Microsoft.EventGrid { +namespace EventGrid { using Cadl.Http; using Cadl.Rest; diff --git a/specification/eventgrid/data-plane/cadl/HealthcareApis.cadl b/specification/eventgrid/data-plane/cadl/HealthcareApis.cadl index 30e8f4890db5..3349f425ffba 100644 --- a/specification/eventgrid/data-plane/cadl/HealthcareApis.cadl +++ b/specification/eventgrid/data-plane/cadl/HealthcareApis.cadl @@ -1,22 +1,22 @@ @doc("Describes the schema of the Azure HealthcareApis events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") namespace HealthCareApis { @doc("Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.FhirResourceCreated event.") - model HealthcareFhirResourceCreatedEventData - is BaseEvent.HealthcareFhirResourceBaseEventData { + model HealthcareFhirResourceCreatedEventData { + ...HealthcareFhirResourceBaseEventData; @doc("Type of HL7 FHIR resource.") resourceType?: HealthcareFhirResourceType; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.FhirResourceUpdated event.") - model HealthcareFhirResourceUpdatedEventData - is BaseEvent.HealthcareFhirResourceBaseEventData { + model HealthcareFhirResourceUpdatedEventData { + ...HealthcareFhirResourceBaseEventData; @doc("Type of HL7 FHIR resource.") resourceType?: HealthcareFhirResourceType; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.FhirResourceDeleted event.") - model HealthcareFhirResourceDeletedEventData - is BaseEvent.HealthcareFhirResourceBaseEventData { + model HealthcareFhirResourceDeletedEventData { + ...HealthcareFhirResourceBaseEventData; @doc("Type of HL7 FHIR resource.") resourceType?: HealthcareFhirResourceType; } @@ -545,10 +545,7 @@ namespace HealthCareApis { VisionPrescription, } -} - -namespace BaseEvent { - model HealthcareFhirResourceBaseEventData { + alias HealthcareFhirResourceBaseEventData = { @doc("Domain name of FHIR account for this resource.") resourceFhirAccount?: string; @@ -557,5 +554,5 @@ namespace BaseEvent { @doc("VersionId of HL7 FHIR resource. It changes when the resource is created, updated, or deleted(soft-deletion).") resourceVersionId?: int64; - } + }; } diff --git a/specification/eventgrid/data-plane/cadl/KeyVault.cadl b/specification/eventgrid/data-plane/cadl/KeyVault.cadl index 62abb4b562ae..ab9a843b05aa 100644 --- a/specification/eventgrid/data-plane/cadl/KeyVault.cadl +++ b/specification/eventgrid/data-plane/cadl/KeyVault.cadl @@ -1,44 +1,56 @@ @doc("Describes the schema of the Azure Key Vault events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") namespace KeyVault { @doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.CertificateNewVersionCreated event.") - model KeyVaultCertificateNewVersionCreatedEventData - is BaseEvents.KeyVaultCertificateBase; + model KeyVaultCertificateNewVersionCreatedEventData{ + ...KeyVaultCertificateBase; + } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.CertificateNearExpiry event.") - model KeyVaultCertificateNearExpiryEventData - is BaseEvents.KeyVaultCertificateBase; + model KeyVaultCertificateNearExpiryEventData{ + ...KeyVaultCertificateBase; + } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.CertificateExpired event.") - model KeyVaultCertificateExpiredEventData - is BaseEvents.KeyVaultCertificateBase; + model KeyVaultCertificateExpiredEventData{ + ...KeyVaultCertificateBase; + } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.KeyNewVersionCreated event.") - model KeyVaultKeyNewVersionCreatedEventData - is BaseEvents.KeyVaultCertificateBase; + model KeyVaultKeyNewVersionCreatedEventData{ + ...KeyVaultCertificateBase; + } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.KeyNearExpiry event.") - model KeyVaultKeyNearExpiryEventData is BaseEvents.KeyVaultCertificateBase; + model KeyVaultKeyNearExpiryEventData{ + ...KeyVaultCertificateBase; + } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.KeyExpired event.") - model KeyVaultKeyExpiredEventData is BaseEvents.KeyVaultCertificateBase; + model KeyVaultKeyExpiredEventData{ + ...KeyVaultCertificateBase; + } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.SecretNewVersionCreated event.") - model KeyVaultSecretNewVersionCreatedEventData - is BaseEvents.KeyVaultCertificateBase; + model KeyVaultSecretNewVersionCreatedEventData{ + ...KeyVaultCertificateBase; + } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.SecretNearExpiry event.") - model KeyVaultSecretNearExpiryEventData is BaseEvents.KeyVaultCertificateBase; + model KeyVaultSecretNearExpiryEventData{ + ...KeyVaultCertificateBase; + } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.SecretExpired event.") - model KeyVaultSecretExpiredEventData is BaseEvents.KeyVaultCertificateBase; + model KeyVaultSecretExpiredEventData{ + ...KeyVaultCertificateBase; + } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.VaultAccessPolicyChanged event.") - model KeyVaultVaultAccessPolicyChangedEventData - is BaseEvents.KeyVaultCertificateBase; -} + model KeyVaultVaultAccessPolicyChangedEventData{ + ...KeyVaultCertificateBase; + } -namespace BaseEvents { - model KeyVaultCertificateBase { + alias KeyVaultCertificateBase = { @doc("The id of the object that triggered this event.") Id?: string; @@ -59,5 +71,5 @@ namespace BaseEvents { @doc("The expiration date of the object that triggered this event") EXP?: float64; - } + }; } diff --git a/specification/eventgrid/data-plane/cadl/MediaServices.cadl b/specification/eventgrid/data-plane/cadl/MediaServices.cadl index d68cf2938b06..4bc96cf8c935 100644 --- a/specification/eventgrid/data-plane/cadl/MediaServices.cadl +++ b/specification/eventgrid/data-plane/cadl/MediaServices.cadl @@ -238,12 +238,13 @@ namespace MediaServices { extends MediaJobOutputStateChangeEventData {} @doc("Encoder connect event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventEncoderConnected event.") - model MediaLiveEventEncoderConnectedEventData - is BaseEvents.MediaLiveEventConnectionBaseData; + model MediaLiveEventEncoderConnectedEventData{ + ...MediaLiveEventConnectionBaseData; + } @doc("Encoder connection rejected event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventConnectionRejected event.") model MediaLiveEventConnectionRejectedEventData { - ...BaseEvents.MediaLiveEventConnectionBaseData; + ...MediaLiveEventConnectionBaseData; @doc("Gets the result code.") resultCode?: string; @@ -251,7 +252,7 @@ namespace MediaServices { @doc("Encoder disconnected event data. Schema of the Data property of an EventGridEvent for a Microsoft.Media.LiveEventEncoderDisconnected event.") model MediaLiveEventEncoderDisconnectedEventData { - ...BaseEvents.MediaLiveEventConnectionBaseData; + ...MediaLiveEventConnectionBaseData; @doc("Gets the result code.") resultCode?: string; @@ -430,10 +431,8 @@ namespace MediaServices { @doc("Gets the latency result code.") latencyResultCode: string; } -} -namespace BaseEvents { - model MediaLiveEventConnectionBaseData { + alias MediaLiveEventConnectionBaseData = { @doc("Gets the ingest URL provided by the live event.") ingestUrl?: string; @@ -445,5 +444,5 @@ namespace BaseEvents { @doc("Gets the remote port.") encoderPort?: string; - } + }; } diff --git a/specification/eventgrid/data-plane/cadl/PolicyInsights.cadl b/specification/eventgrid/data-plane/cadl/PolicyInsights.cadl index b7323ef32730..845b03694ec2 100644 --- a/specification/eventgrid/data-plane/cadl/PolicyInsights.cadl +++ b/specification/eventgrid/data-plane/cadl/PolicyInsights.cadl @@ -1,20 +1,22 @@ @doc("Describes the schema of the Azure Policy events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") namespace PolicyInsights { @doc("Schema of the Data property of an EventGridEvent for a Microsoft.PolicyInsights.PolicyStateCreated event.") - model PolicyInsightsPolicyStateCreatedEventData - is BaseEvents.PolicyInsightsBaseEventData; + model PolicyInsightsPolicyStateCreatedEventData{ + ...PolicyInsightsBaseEventData; + } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.PolicyInsights.PolicyStateChanged event.") - model PolicyInsightsPolicyStateChangedEventData - is BaseEvents.PolicyInsightsBaseEventData; + model PolicyInsightsPolicyStateChangedEventData{ + ...PolicyInsightsBaseEventData; + } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.PolicyInsights.PolicyStateDeleted event.") - model PolicyInsightsPolicyStateDeletedEventData - is BaseEvents.PolicyInsightsBaseEventData; -} + model PolicyInsightsPolicyStateDeletedEventData{ + ...PolicyInsightsBaseEventData; + } + -namespace BaseEvents { - model PolicyInsightsBaseEventData { + alias PolicyInsightsBaseEventData = { @doc("The time that the resource was scanned by Azure Policy in the Universal ISO 8601 DateTime format yyyy-MM-ddTHH:mm:ss.fffffffZ.") timestamp?: zonedDateTime; @@ -35,5 +37,5 @@ namespace BaseEvents { @doc("The compliance reason code. May be empty.") complianceReasonCode?: string; - } + }; } diff --git a/specification/eventgrid/data-plane/cadl/RedisCache.cadl b/specification/eventgrid/data-plane/cadl/RedisCache.cadl index 27a964cbfe97..df6cf370c012 100644 --- a/specification/eventgrid/data-plane/cadl/RedisCache.cadl +++ b/specification/eventgrid/data-plane/cadl/RedisCache.cadl @@ -1,25 +1,35 @@ @doc("Describes the schema of the Redis Cache events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") -namespace RedisCache; +namespace RedisCache{ -model RedisBaseEventData { - @doc("The time at which the event occurred.") - timestamp?: zonedDateTime; + alias RedisBaseEventData = { + @doc("The time at which the event occurred.") + timestamp?: zonedDateTime; - @doc("The name of this event.") - name?: string; + @doc("The name of this event.") + name?: string; - @doc("The status of this event. Failed or succeeded ") - status?: string; -} + @doc("The status of this event. Failed or succeeded ") + status?: string; + }; -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Cache.PatchingCompleted event.") -model RedisPatchingCompletedEventData is RedisBaseEventData; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Cache.PatchingCompleted event.") + model RedisPatchingCompletedEventData{ + ...RedisBaseEventData; + } -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Cache.ScalingCompleted event.") -model RedisScalingCompletedEventData is RedisBaseEventData; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Cache.ScalingCompleted event.") + model RedisScalingCompletedEventData{ + ...RedisBaseEventData; + } -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Cache.ExportRDBCompleted event.") -model RedisExportRDBCompletedEventData is RedisBaseEventData; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Cache.ExportRDBCompleted event.") + model RedisExportRDBCompletedEventData{ + ...RedisBaseEventData; + } -@doc("Schema of the Data property of an EventGridEvent for a Microsoft.Cache.ImportRDBCompleted event.") -model RedisImportRDBCompletedEventData is RedisBaseEventData; + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Cache.ImportRDBCompleted event.") + model RedisImportRDBCompletedEventData{ + ...RedisBaseEventData; + } + +} \ No newline at end of file diff --git a/specification/eventgrid/data-plane/cadl/Resources.cadl b/specification/eventgrid/data-plane/cadl/Resources.cadl index a9501b129d5c..75f5809611b6 100644 --- a/specification/eventgrid/data-plane/cadl/Resources.cadl +++ b/specification/eventgrid/data-plane/cadl/Resources.cadl @@ -1,31 +1,49 @@ @doc("Describes the schema of the Azure resource events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") namespace Resources { @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceWriteSuccess event. This is raised when a resource create or update operation succeeds.") - model ResourceWriteSuccessData is BaseEvents.ResourceBaseEventData; + model ResourceWriteSuccessData{ + ...ResourceBaseEventData; + } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceWriteFailure event. This is raised when a resource create or update operation fails.") - model ResourceWriteFailureData is BaseEvents.ResourceBaseEventData; + model ResourceWriteFailureData{ + ...ResourceBaseEventData; + } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceWriteCancel event. This is raised when a resource create or update operation is canceled.") - model ResourceWriteCancelData is BaseEvents.ResourceBaseEventData; + model ResourceWriteCancelData{ + ...ResourceBaseEventData; + } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceDeleteSuccess event. This is raised when a resource delete operation succeeds.") - model ResourceDeleteSuccessData is BaseEvents.ResourceBaseEventData; + model ResourceDeleteSuccessData{ + ...ResourceBaseEventData; + } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceDeleteFailure event. This is raised when a resource delete operation fails.") - model ResourceDeleteFailureData is BaseEvents.ResourceBaseEventData; + model ResourceDeleteFailureData{ + ...ResourceBaseEventData; + } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceDeleteCancel event. This is raised when a resource delete operation is canceled.") - model ResourceDeleteCancelData is BaseEvents.ResourceBaseEventData; + model ResourceDeleteCancelData{ + ...ResourceBaseEventData; + } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceActionSuccess event. This is raised when a resource action operation succeeds.") - model ResourceActionSuccessData is BaseEvents.ResourceBaseEventData; + model ResourceActionSuccessData{ + ...ResourceBaseEventData; + } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceActionFailure event. This is raised when a resource action operation fails.") - model ResourceActionFailureData is BaseEvents.ResourceBaseEventData; + model ResourceActionFailureData{ + ...ResourceBaseEventData; + } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceActionCancel event. This is raised when a resource action operation is canceled.") - model ResourceActionCancelData is BaseEvents.ResourceBaseEventData; + model ResourceActionCancelData{ + ...ResourceBaseEventData; + } @doc("The details of the HTTP request.") model ResourceHttpRequest { @@ -53,10 +71,8 @@ namespace Resources { @doc("The evidence for the authorization.") evidence?: Record; } -} -namespace BaseEvents { - model ResourceBaseEventData { + alias ResourceBaseEventData = { @doc("The tenant ID of the resource.") tenantId?: string; @@ -89,5 +105,5 @@ namespace BaseEvents { @doc("The details of the operation.") httpRequest?: Resources.ResourceHttpRequest; - } + }; } diff --git a/specification/eventgrid/data-plane/cadl/ServiceBus.cadl b/specification/eventgrid/data-plane/cadl/ServiceBus.cadl index 7238bd8146bf..b48277988848 100644 --- a/specification/eventgrid/data-plane/cadl/ServiceBus.cadl +++ b/specification/eventgrid/data-plane/cadl/ServiceBus.cadl @@ -1,24 +1,26 @@ @doc("Describes the schema of the Azure ServiceBus Messaging events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") namespace ServiceBus { @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ServiceBus.ActiveMessagesAvailableWithNoListeners event.") - model ServiceBusActiveMessagesAvailableWithNoListenersEventData - is BaseEvents.ServiceBusBaseEventData; + model ServiceBusActiveMessagesAvailableWithNoListenersEventData{ + ...ServiceBusBaseEventData; + } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ServiceBus.DeadletterMessagesAvailableWithNoListeners event.") - model ServiceBusDeadletterMessagesAvailableWithNoListenersEventData - is BaseEvents.ServiceBusBaseEventData; + model ServiceBusDeadletterMessagesAvailableWithNoListenersEventData{ + ...ServiceBusBaseEventData; + } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ServiceBus.ActiveMessagesAvailablePeriodicNotifications event.") - model ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData - is BaseEvents.ServiceBusBaseEventData; + model ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData{ + ...ServiceBusBaseEventData; + } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ServiceBus.DeadletterMessagesAvailablePeriodicNotifications event.") - model ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData - is BaseEvents.ServiceBusBaseEventData; -} + model ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData{ + ...ServiceBusBaseEventData; + } -namespace BaseEvents { - model ServiceBusBaseEventData { + alias ServiceBusBaseEventData = { @doc("The namespace name of the Microsoft.ServiceBus resource.") namespaceName?: string; @@ -36,5 +38,5 @@ namespace BaseEvents { @doc("The name of the Microsoft.ServiceBus topic's subscription. If the entity type is of type 'queue', then this value will be null.") subscriptionName?: string; - } + }; } diff --git a/specification/eventgrid/data-plane/cadl/SignalRService.cadl b/specification/eventgrid/data-plane/cadl/SignalRService.cadl index 6861a3eee007..fc7ec26dd8fd 100644 --- a/specification/eventgrid/data-plane/cadl/SignalRService.cadl +++ b/specification/eventgrid/data-plane/cadl/SignalRService.cadl @@ -1,20 +1,19 @@ @doc("Describes the schema of the Azure SignalR Service events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") namespace SignalRService { @doc("Schema of the Data property of an EventGridEvent for a Microsoft.SignalRService.ClientConnectionConnected event.") - model SignalRServiceClientConnectionConnectedEventData - is BaseEvents.SignalRServiceBaseEventdata; + model SignalRServiceClientConnectionConnectedEventData{ + ...SignalRServiceBaseEventdata; + } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.SignalRService.ClientConnectionDisconnected event.") model SignalRServiceClientConnectionDisconnectedEventData { - ...BaseEvents.SignalRServiceBaseEventdata; + ...SignalRServiceBaseEventdata; @doc("The message of error that cause the client connection disconnected.") errorMessage?: string; } -} -namespace BaseEvents { - model SignalRServiceBaseEventdata { + alias SignalRServiceBaseEventdata = { @doc("The time at which the event occurred.") timestamp?: zonedDateTime; @@ -26,5 +25,5 @@ namespace BaseEvents { @doc("The user Id of connected client connection.") userId?: string; - } + }; } diff --git a/specification/eventgrid/data-plane/cadl/Storage.cadl b/specification/eventgrid/data-plane/cadl/Storage.cadl index e12ec6dd3288..9341e308ad58 100644 --- a/specification/eventgrid/data-plane/cadl/Storage.cadl +++ b/specification/eventgrid/data-plane/cadl/Storage.cadl @@ -7,17 +7,17 @@ namespace Storage { @doc("The offset of the blob in bytes.") contentOffset?: int64; - ...BaseEvents.StorageBaseEventData<"blob">; - ...BaseEvents.StorageUrlBaseEventData; - ...BaseEvents.StorageBaseTypeData; + ...StorageBaseEventData<"blob">; + ...StorageUrlBaseEventData; + ...StorageBaseTypeData; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Storage.BlobDeleted event.") model StorageBlobDeletedEventData { @doc("The path to the blob.") url?: string; - ...BaseEvents.StorageBaseEventData<"blob">; - ...BaseEvents.StorageBaseTypeData; + ...StorageBaseEventData<"blob">; + ...StorageBaseTypeData; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Storage.DirectoryCreated event.") @@ -27,7 +27,7 @@ namespace Storage { @doc("The path to the directory.") url?: string; - ...BaseEvents.StorageBaseEventData<"directory">; + ...StorageBaseEventData<"directory">; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Storage.DirectoryDeleted event.") @@ -37,7 +37,7 @@ namespace Storage { @doc("Is this event for a recursive delete operation.") recursive?: string; - ...BaseEvents.StorageBaseEventData<"directory">; + ...StorageBaseEventData<"directory">; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Storage.BlobRenamed event.") @@ -47,7 +47,7 @@ namespace Storage { @doc("The new path to the blob after the rename operation.") destinationUrl?: string; - ...BaseEvents.StorageBaseEventData<"blob">; + ...StorageBaseEventData<"blob">; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Storage.DirectoryRenamed event.") @@ -57,7 +57,7 @@ namespace Storage { @doc("The new path to the directory after the rename operation.") destinationUrl?: string; - ...BaseEvents.StorageBaseEventData<"directory">; + ...StorageBaseEventData<"directory">; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Storage.LifecyclePolicyCompleted event.") @@ -83,16 +83,16 @@ namespace Storage { @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Storage.BlobTierChanged event.") model StorageBlobTierChangedEventData { - ...BaseEvents.StorageBaseEventData<"blob">; - ...BaseEvents.StorageUrlBaseEventData; - ...BaseEvents.StorageBaseTypeData; + ...StorageBaseEventData<"blob">; + ...StorageUrlBaseEventData; + ...StorageBaseTypeData; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Storage.AsyncOperationInitiated event.") model StorageAsyncOperationInitiatedEventData { - ...BaseEvents.StorageBaseEventData<"blob">; - ...BaseEvents.StorageUrlBaseEventData; - ...BaseEvents.StorageBaseTypeData; + ...StorageBaseEventData<"blob">; + ...StorageUrlBaseEventData; + ...StorageBaseTypeData; } @doc("Schema of the Data property of an EventGridEvent for an Microsoft.Storage.BlobInventoryPolicyCompleted event.") @@ -118,15 +118,8 @@ namespace Storage { @doc("The blob URL for manifest file for inventory run.") manifestBlobUrl?: string; } -} - -namespace BaseEvents { - enum StorageType { - blob: "blob", - directory: "directory", - } - model StorageBaseEventData { + alias StorageBaseEventData = { @doc("The name of the API/operation that triggered this event.") api?: string; @@ -149,21 +142,21 @@ namespace BaseEvents { @doc("For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers.") storageDiagnostics?: Record; - } + }; - model StorageBaseTypeData { + alias StorageBaseTypeData = { @doc("The content type of the blob. This is the same as what would be returned in the Content-Type header from the blob.") contentType?: string; @doc("The type of blob.") blobType?: string; - } + }; - model StorageUrlBaseEventData { + alias StorageUrlBaseEventData = { @doc("The size of the blob in bytes. This is the same as what would be returned in the Content-Length header from the blob.") contentLength?: int64; @doc("The path to the blob.") url?: string; - } + }; } diff --git a/specification/eventgrid/data-plane/cadl/main.cadl b/specification/eventgrid/data-plane/cadl/main.cadl index e69de29bb2d1..f46cfab9c100 100644 --- a/specification/eventgrid/data-plane/cadl/main.cadl +++ b/specification/eventgrid/data-plane/cadl/main.cadl @@ -0,0 +1,42 @@ +import "./ApiManagementTypedReference.cadl"; + +//Testing out typed events with ApiManagement +@service({ title: "Glory to the event grid!" }) +namespace EventGrid { + @discriminator("eventType") + model EventGridEvent { + id: string; + topic: string; + subject: string; + eventType: string; + dataVersion: string; + metadataVersion: string, + eventTime: zonedDateTime; + } + + model TypedEventGridEvent extends EventGridEvent { + eventType: TEventType; + dataType: TData; + } + + @discriminator("type") + model CloudEvent { + id: string; + source: string; + data?: string; + data_base64?: bytes; + type: string; + time?: zonedDateTime; + specversion: string; + dataschema?: string; + datacontenttype?: string; + subject?: string; + } + + model TypedCloudEvent extends CloudEvent { + type: TEventType; + dataType: TData; + } + + +} \ No newline at end of file From a7bcbf55e850e7ab6cfadc108a5bed862a109269 Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Tue, 13 Dec 2022 13:44:22 -0800 Subject: [PATCH 45/65] adding evnetgrid subnamespace to all files --- .../data-plane/cadl/ApiManagement.cadl | 2 +- .../data-plane/cadl/AppConfiguration.cadl | 3 +- .../cadl/AzureCommunicationServices.cadl | 2 +- .../data-plane/cadl/ContainerRegistry.cadl | 2 +- .../data-plane/cadl/ContainerService.cadl | 2 +- .../eventgrid/data-plane/cadl/EventHub.cadl | 2 +- .../data-plane/cadl/HealthcareApis.cadl | 2 +- .../eventgrid/data-plane/cadl/IotHub.cadl | 2 +- .../eventgrid/data-plane/cadl/KeyVault.cadl | 3 +- .../cadl/MachineLearningServices.cadl | 2 +- .../eventgrid/data-plane/cadl/Maps.cadl | 2 +- .../data-plane/cadl/MediaServices.cadl | 2 +- .../data-plane/cadl/PolicyInsights.cadl | 2 +- .../eventgrid/data-plane/cadl/RedisCache.cadl | 2 +- .../eventgrid/data-plane/cadl/Resources.cadl | 2 +- .../eventgrid/data-plane/cadl/ServiceBus.cadl | 2 +- .../data-plane/cadl/SignalRService.cadl | 2 +- .../eventgrid/data-plane/cadl/Storage.cadl | 2 +- .../eventgrid/data-plane/cadl/Web.cadl | 68 ++++++++---- .../eventgrid/data-plane/cadl/main.cadl | 104 +++++++++++------- 20 files changed, 126 insertions(+), 84 deletions(-) diff --git a/specification/eventgrid/data-plane/cadl/ApiManagement.cadl b/specification/eventgrid/data-plane/cadl/ApiManagement.cadl index 8caa05370ba1..d8d480325d5d 100644 --- a/specification/eventgrid/data-plane/cadl/ApiManagement.cadl +++ b/specification/eventgrid/data-plane/cadl/ApiManagement.cadl @@ -1,5 +1,5 @@ @doc("Describes the schema of the Azure API Management events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") -namespace ApiManagement { +namespace EventGrid.ApiManagement { @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.UserCreated event.") model ApiManagementUserCreatedEventData{ ...ApiManagementBase; diff --git a/specification/eventgrid/data-plane/cadl/AppConfiguration.cadl b/specification/eventgrid/data-plane/cadl/AppConfiguration.cadl index cdc41a0c1484..6c6b648c5990 100644 --- a/specification/eventgrid/data-plane/cadl/AppConfiguration.cadl +++ b/specification/eventgrid/data-plane/cadl/AppConfiguration.cadl @@ -1,5 +1,5 @@ @doc("Describes the schema of the Azure App Configuration events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") -namespace AppConfiguration{ +namespace EventGrid.AppConfiguration{ @doc("Schema of the Data property of an EventGridEvent for a Microsoft.AppConfiguration.KeyValueModified event.") model AppConfigurationKeyValueModifiedEventData{ @@ -12,6 +12,7 @@ namespace AppConfiguration{ }; + // need to figure out an alternative to this method --- should we pass in docstring here or should we just copy/paste and see what happens alias AppConfigurationBase = { @doc( "The key used to identify the key-value that was {name}.", diff --git a/specification/eventgrid/data-plane/cadl/AzureCommunicationServices.cadl b/specification/eventgrid/data-plane/cadl/AzureCommunicationServices.cadl index d384623fda80..ba7408a626e2 100644 --- a/specification/eventgrid/data-plane/cadl/AzureCommunicationServices.cadl +++ b/specification/eventgrid/data-plane/cadl/AzureCommunicationServices.cadl @@ -1,7 +1,7 @@ import "./AzureCommunicationServicesCore.cadl"; @doc("Describes the schema of the Azure Communication Services events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") -namespace AzureCommunicationServices; +namespace EventGrid.AzureCommunicationServices; @doc("Schema of the Data property of an EventGridEvent for an Microsoft.Communication.UserDisconnected event.") model AcsUserDisconnectedEventData { diff --git a/specification/eventgrid/data-plane/cadl/ContainerRegistry.cadl b/specification/eventgrid/data-plane/cadl/ContainerRegistry.cadl index ce53c5c207e1..7565c571b3f1 100644 --- a/specification/eventgrid/data-plane/cadl/ContainerRegistry.cadl +++ b/specification/eventgrid/data-plane/cadl/ContainerRegistry.cadl @@ -1,5 +1,5 @@ @doc("Describes the schema of the Azure Container Registry events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") -namespace ContainerRegistry { +namespace EventGrid.ContainerRegistry { @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ContainerRegistry.ImagePushed event.") model ContainerRegistryImagePushedEventData extends ContainerRegistryEventData {} diff --git a/specification/eventgrid/data-plane/cadl/ContainerService.cadl b/specification/eventgrid/data-plane/cadl/ContainerService.cadl index 255331a1d55a..4c49ea0c7d91 100644 --- a/specification/eventgrid/data-plane/cadl/ContainerService.cadl +++ b/specification/eventgrid/data-plane/cadl/ContainerService.cadl @@ -1,5 +1,5 @@ @doc("Describes the schema of the Azure Kubernetes Service events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent") -namespace ContainerService; +namespace EventGrid.ContainerService; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ContainerService.NewKubernetesVersionAvailable event") model ContainerServiceNewKubernetesVersionAvailableEventData { diff --git a/specification/eventgrid/data-plane/cadl/EventHub.cadl b/specification/eventgrid/data-plane/cadl/EventHub.cadl index 65ea4052ccea..03b45a8bec65 100644 --- a/specification/eventgrid/data-plane/cadl/EventHub.cadl +++ b/specification/eventgrid/data-plane/cadl/EventHub.cadl @@ -1,5 +1,5 @@ @doc("Describes the schema of the Azure EventHub events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") -namespace EventHub; +namespace EventGrid.EventHub; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.EventHub.CaptureFileCreated event.") model EventHubCaptureFileCreatedEventData { diff --git a/specification/eventgrid/data-plane/cadl/HealthcareApis.cadl b/specification/eventgrid/data-plane/cadl/HealthcareApis.cadl index 3349f425ffba..584c4cf3503d 100644 --- a/specification/eventgrid/data-plane/cadl/HealthcareApis.cadl +++ b/specification/eventgrid/data-plane/cadl/HealthcareApis.cadl @@ -1,5 +1,5 @@ @doc("Describes the schema of the Azure HealthcareApis events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") -namespace HealthCareApis { +namespace EventGrid.HealthCareApis { @doc("Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.FhirResourceCreated event.") model HealthcareFhirResourceCreatedEventData { ...HealthcareFhirResourceBaseEventData; diff --git a/specification/eventgrid/data-plane/cadl/IotHub.cadl b/specification/eventgrid/data-plane/cadl/IotHub.cadl index ba2f246bc08e..9ed674c5afd4 100644 --- a/specification/eventgrid/data-plane/cadl/IotHub.cadl +++ b/specification/eventgrid/data-plane/cadl/IotHub.cadl @@ -1,5 +1,5 @@ @doc("Describes the schema of the Azure IoT Hub events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") -namespace IoTHub; +namespace EventGrid.IoTHub; @doc("Schema of the Data property of an EventGridEvent for a device life cycle event (DeviceCreated, DeviceDeleted).") model DeviceLifeCycleEventProperties { diff --git a/specification/eventgrid/data-plane/cadl/KeyVault.cadl b/specification/eventgrid/data-plane/cadl/KeyVault.cadl index ab9a843b05aa..ffdecf99e1dc 100644 --- a/specification/eventgrid/data-plane/cadl/KeyVault.cadl +++ b/specification/eventgrid/data-plane/cadl/KeyVault.cadl @@ -1,5 +1,5 @@ @doc("Describes the schema of the Azure Key Vault events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") -namespace KeyVault { +namespace EventGrid.KeyVault { @doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.CertificateNewVersionCreated event.") model KeyVaultCertificateNewVersionCreatedEventData{ ...KeyVaultCertificateBase; @@ -72,4 +72,5 @@ namespace KeyVault { @doc("The expiration date of the object that triggered this event") EXP?: float64; }; + } diff --git a/specification/eventgrid/data-plane/cadl/MachineLearningServices.cadl b/specification/eventgrid/data-plane/cadl/MachineLearningServices.cadl index e7aabfbc784d..023dbb80112e 100644 --- a/specification/eventgrid/data-plane/cadl/MachineLearningServices.cadl +++ b/specification/eventgrid/data-plane/cadl/MachineLearningServices.cadl @@ -1,5 +1,5 @@ @doc("Describes the schema of the Azure Machine Learning Services events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") -namespace MachineLearningServices; +namespace EventGrid.MachineLearningServices; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.MachineLearningServices.ModelRegistered event.") model MachineLearningServicesModelRegisteredEventData { diff --git a/specification/eventgrid/data-plane/cadl/Maps.cadl b/specification/eventgrid/data-plane/cadl/Maps.cadl index 8b378ba4d3ae..0f2405e67465 100644 --- a/specification/eventgrid/data-plane/cadl/Maps.cadl +++ b/specification/eventgrid/data-plane/cadl/Maps.cadl @@ -1,5 +1,5 @@ @doc("Describes the schema of the Azure Maps events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") -namespace Maps; +namespace EventGrid.Maps; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Maps.GeofenceEntered event.") model MapsGeofenceEnteredEventData extends MapsGeofenceEventProperties {} diff --git a/specification/eventgrid/data-plane/cadl/MediaServices.cadl b/specification/eventgrid/data-plane/cadl/MediaServices.cadl index 4bc96cf8c935..8b992db311ac 100644 --- a/specification/eventgrid/data-plane/cadl/MediaServices.cadl +++ b/specification/eventgrid/data-plane/cadl/MediaServices.cadl @@ -1,5 +1,5 @@ @doc("Describes the schema of the Azure Media Services events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") -namespace MediaServices { +namespace EventGrid.MediaServices { enum MediaJobState { @doc("The job was canceled. This is a final state for the job.") Canceled, diff --git a/specification/eventgrid/data-plane/cadl/PolicyInsights.cadl b/specification/eventgrid/data-plane/cadl/PolicyInsights.cadl index 845b03694ec2..1e14a4889640 100644 --- a/specification/eventgrid/data-plane/cadl/PolicyInsights.cadl +++ b/specification/eventgrid/data-plane/cadl/PolicyInsights.cadl @@ -1,5 +1,5 @@ @doc("Describes the schema of the Azure Policy events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") -namespace PolicyInsights { +namespace EventGrid.PolicyInsights { @doc("Schema of the Data property of an EventGridEvent for a Microsoft.PolicyInsights.PolicyStateCreated event.") model PolicyInsightsPolicyStateCreatedEventData{ ...PolicyInsightsBaseEventData; diff --git a/specification/eventgrid/data-plane/cadl/RedisCache.cadl b/specification/eventgrid/data-plane/cadl/RedisCache.cadl index df6cf370c012..4fa848e06fc7 100644 --- a/specification/eventgrid/data-plane/cadl/RedisCache.cadl +++ b/specification/eventgrid/data-plane/cadl/RedisCache.cadl @@ -1,5 +1,5 @@ @doc("Describes the schema of the Redis Cache events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") -namespace RedisCache{ +namespace EventGrid.RedisCache{ alias RedisBaseEventData = { @doc("The time at which the event occurred.") diff --git a/specification/eventgrid/data-plane/cadl/Resources.cadl b/specification/eventgrid/data-plane/cadl/Resources.cadl index 75f5809611b6..c3e020dbc398 100644 --- a/specification/eventgrid/data-plane/cadl/Resources.cadl +++ b/specification/eventgrid/data-plane/cadl/Resources.cadl @@ -1,5 +1,5 @@ @doc("Describes the schema of the Azure resource events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") -namespace Resources { +namespace EventGrid.Resources { @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceWriteSuccess event. This is raised when a resource create or update operation succeeds.") model ResourceWriteSuccessData{ ...ResourceBaseEventData; diff --git a/specification/eventgrid/data-plane/cadl/ServiceBus.cadl b/specification/eventgrid/data-plane/cadl/ServiceBus.cadl index b48277988848..184ec8533d11 100644 --- a/specification/eventgrid/data-plane/cadl/ServiceBus.cadl +++ b/specification/eventgrid/data-plane/cadl/ServiceBus.cadl @@ -1,5 +1,5 @@ @doc("Describes the schema of the Azure ServiceBus Messaging events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") -namespace ServiceBus { +namespace EventGrid.ServiceBus { @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ServiceBus.ActiveMessagesAvailableWithNoListeners event.") model ServiceBusActiveMessagesAvailableWithNoListenersEventData{ ...ServiceBusBaseEventData; diff --git a/specification/eventgrid/data-plane/cadl/SignalRService.cadl b/specification/eventgrid/data-plane/cadl/SignalRService.cadl index fc7ec26dd8fd..95c676f73c88 100644 --- a/specification/eventgrid/data-plane/cadl/SignalRService.cadl +++ b/specification/eventgrid/data-plane/cadl/SignalRService.cadl @@ -1,5 +1,5 @@ @doc("Describes the schema of the Azure SignalR Service events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") -namespace SignalRService { +namespace EventGrid.SignalRService { @doc("Schema of the Data property of an EventGridEvent for a Microsoft.SignalRService.ClientConnectionConnected event.") model SignalRServiceClientConnectionConnectedEventData{ ...SignalRServiceBaseEventdata; diff --git a/specification/eventgrid/data-plane/cadl/Storage.cadl b/specification/eventgrid/data-plane/cadl/Storage.cadl index 9341e308ad58..4805930105c2 100644 --- a/specification/eventgrid/data-plane/cadl/Storage.cadl +++ b/specification/eventgrid/data-plane/cadl/Storage.cadl @@ -1,5 +1,5 @@ @doc("Describes the schema of the Azure Storage events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") -namespace Storage { +namespace EventGrid.Storage { @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Storage.BlobCreated event.") model StorageBlobCreatedEventData { @doc("The etag of the blob at the time this event was triggered.") diff --git a/specification/eventgrid/data-plane/cadl/Web.cadl b/specification/eventgrid/data-plane/cadl/Web.cadl index e0afc8996bee..0f3b4a3c88a0 100644 --- a/specification/eventgrid/data-plane/cadl/Web.cadl +++ b/specification/eventgrid/data-plane/cadl/Web.cadl @@ -1,5 +1,5 @@ @doc("Describes the schema of the Azure App Service events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") -namespace Web { +namespace EventGrid.Web { @doc("Detail of action on the app.") model AppEventTypeDetail { @doc("Type of action of the operation.") @@ -7,42 +7,64 @@ namespace Web { } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.AppUpdated event.") - model WebAppUpdatedEventData is BaseEvents.WebAppBaseEventData; + model WebAppUpdatedEventData{ + ...WebAppBaseEventData; + } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.BackupOperationStarted event.") - model WebBackupOperationStartedEventData is BaseEvents.WebAppBaseEventData; + model WebBackupOperationStartedEventData{ + ...WebAppBaseEventData; + } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.BackupOperationCompleted event.") - model WebBackupOperationCompletedEventData is BaseEvents.WebAppBaseEventData; + model WebBackupOperationCompletedEventData{ + ...WebAppBaseEventData; + } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.BackupOperationFailed event.") - model WebBackupOperationFailedEventData is BaseEvents.WebAppBaseEventData; + model WebBackupOperationFailedEventData{ + ...WebAppBaseEventData; + } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.RestoreOperationStarted event.") - model WebRestoreOperationStartedEventData is BaseEvents.WebAppBaseEventData; + model WebRestoreOperationStartedEventData{ + ...WebAppBaseEventData; + } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.RestoreOperationCompleted event.") - model WebRestoreOperationCompletedEventData is BaseEvents.WebAppBaseEventData; + model WebRestoreOperationCompletedEventData{ + ...WebAppBaseEventData; + } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.RestoreOperationFailed event.") - model WebRestoreOperationFailedEventData is BaseEvents.WebAppBaseEventData; + model WebRestoreOperationFailedEventData{ + ...WebAppBaseEventData; + } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapStarted event.") - model WebSlotSwapStartedEventData is BaseEvents.WebAppBaseEventData; + model WebSlotSwapStartedEventData{ + ...WebAppBaseEventData; + } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapCompleted event.") - model WebSlotSwapCompletedEventData is BaseEvents.WebAppBaseEventData; + model WebSlotSwapCompletedEventData{ + ...WebAppBaseEventData; + } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapFailed event.") - model WebSlotSwapFailedEventData is BaseEvents.WebAppBaseEventData; + model WebSlotSwapFailedEventData{ + ...WebAppBaseEventData; + } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapWithPreviewStarted event.") - model WebSlotSwapWithPreviewStartedEventData - is BaseEvents.WebAppBaseEventData; + model WebSlotSwapWithPreviewStartedEventData{ + ...WebAppBaseEventData; + } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapWithPreviewCancelled event.") - model WebSlotSwapWithPreviewCancelledEventData - is BaseEvents.WebAppBaseEventData; + model WebSlotSwapWithPreviewCancelledEventData{ + ...WebAppBaseEventData; + } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.AppServicePlanUpdated event.") model WebAppServicePlanUpdatedEventData { @@ -67,7 +89,7 @@ namespace Web { verb?: string; @doc("sku of app service plan.") - sku?: BaseEvents.sku; + sku?: sku; } enum AppAction { @@ -126,11 +148,9 @@ namespace Web { @doc("Async operation failed to complete.") Failed, } -} -namespace BaseEvents { - model WebAppBaseEventData { - appEventTypeDetail?: Web.AppEventTypeDetail; + alias WebAppBaseEventData = { + appEventTypeDetail?: AppEventTypeDetail; @doc("name of the web site that had this event.") name?: string; @@ -149,10 +169,10 @@ namespace BaseEvents { @doc("HTTP verb of this operation.") verb?: string; - } + }; - @doc("sku of app service plan.") - model sku { + // @doc("sku of app service plan.") + alias sku = { @doc("name of app service plan sku.") name?: string; @@ -167,6 +187,6 @@ namespace BaseEvents { @doc("capacity of app service plan sku.") Capacity?: string; - } + }; } diff --git a/specification/eventgrid/data-plane/cadl/main.cadl b/specification/eventgrid/data-plane/cadl/main.cadl index f46cfab9c100..95133e9a6326 100644 --- a/specification/eventgrid/data-plane/cadl/main.cadl +++ b/specification/eventgrid/data-plane/cadl/main.cadl @@ -1,42 +1,62 @@ -import "./ApiManagementTypedReference.cadl"; - -//Testing out typed events with ApiManagement -@service({ title: "Glory to the event grid!" }) -namespace EventGrid { - @discriminator("eventType") - model EventGridEvent { - id: string; - topic: string; - subject: string; - eventType: string; - dataVersion: string; - metadataVersion: string, - eventTime: zonedDateTime; - } - - model TypedEventGridEvent extends EventGridEvent { - eventType: TEventType; - dataType: TData; - } - - @discriminator("type") - model CloudEvent { - id: string; - source: string; - data?: string; - data_base64?: bytes; - type: string; - time?: zonedDateTime; - specversion: string; - dataschema?: string; - datacontenttype?: string; - subject?: string; - } - - model TypedCloudEvent extends CloudEvent { - type: TEventType; - dataType: TData; - } - - -} \ No newline at end of file +import "./ApiManagement.cadl"; +import "./AppConfiguration.cadl"; +import "./AzureCommunicationServices.cadl"; +import "./ContainerRegistry.cadl"; +import "./ContainerService.cadl"; +import "./EventHub.cadl"; +import "./Maps.cadl"; +import "./MediaServices.cadl"; +import "./PolicyInsights.cadl"; +import "./RedisCache.cadl"; +import "./Resources.cadl"; +import "./ServiceBus.cadl"; +import "./SignalRService.cadl"; +import "./Storage.cadl"; +import "./Web.cadl"; +import "./EventGrid.cadl"; + + + +//Uncomment for testing out typed events with ApiManagement + +// import "./ApiManagementTypedReference.cadl"; + +// @service({ title: "Glory to the event grid!" }) +// namespace EventGrid { +// @discriminator("eventType") +// model EventGridEvent { +// id: string; +// topic: string; +// subject: string; +// eventType: string; +// dataVersion: string; +// metadataVersion: string, +// eventTime: zonedDateTime; +// } + +// model TypedEventGridEvent extends EventGridEvent { +// eventType: TEventType; +// dataType: TData; +// } + +// @discriminator("type") +// model CloudEvent { +// id: string; +// source: string; +// data?: string; +// data_base64?: bytes; +// type: string; +// time?: zonedDateTime; +// specversion: string; +// dataschema?: string; +// datacontenttype?: string; +// subject?: string; +// } + +// model TypedCloudEvent extends CloudEvent { +// type: TEventType; +// dataType: TData; +// } + + +// } \ No newline at end of file From f5ea629f2c0aba319c66a3c6818e4b102132b5bf Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Mon, 19 Dec 2022 15:53:27 -0500 Subject: [PATCH 46/65] inital generated swagger files from cadl --- .../cadl/swagger/ApiManagement.json | 177 +++ .../cadl/swagger/AppConfiguration.json | 71 ++ .../swagger/AzureCommunicationServices.json | 888 +++++++++++++ .../cadl/swagger/ContainerRegistry.json | 294 +++++ .../cadl/swagger/ContainerService.json | 49 + .../data-plane/cadl/swagger/EventGrid.json | 320 +++++ .../data-plane/cadl/swagger/EventHub.json | 75 ++ .../cadl/swagger/HealthcareApis.json | 1128 +++++++++++++++++ .../data-plane/cadl/swagger/IotHub.json | 256 ++++ .../data-plane/cadl/swagger/KeyVault.json | 387 ++++++ .../cadl/swagger/MachineLearningServices.json | 212 ++++ .../data-plane/cadl/swagger/Maps.json | 125 ++ .../cadl/swagger/MediaServices.json | 980 ++++++++++++++ .../cadl/swagger/PolicyInsights.json | 132 ++ .../data-plane/cadl/swagger/RedisCache.json | 103 ++ .../data-plane/cadl/swagger/Resources.json | 557 ++++++++ .../data-plane/cadl/swagger/ServiceBus.json | 147 +++ .../cadl/swagger/SignalRService.json | 77 ++ .../data-plane/cadl/swagger/Storage.json | 477 +++++++ .../data-plane/cadl/swagger/Web.json | 632 +++++++++ 20 files changed, 7087 insertions(+) create mode 100644 specification/eventgrid/data-plane/cadl/swagger/ApiManagement.json create mode 100644 specification/eventgrid/data-plane/cadl/swagger/AppConfiguration.json create mode 100644 specification/eventgrid/data-plane/cadl/swagger/AzureCommunicationServices.json create mode 100644 specification/eventgrid/data-plane/cadl/swagger/ContainerRegistry.json create mode 100644 specification/eventgrid/data-plane/cadl/swagger/ContainerService.json create mode 100644 specification/eventgrid/data-plane/cadl/swagger/EventGrid.json create mode 100644 specification/eventgrid/data-plane/cadl/swagger/EventHub.json create mode 100644 specification/eventgrid/data-plane/cadl/swagger/HealthcareApis.json create mode 100644 specification/eventgrid/data-plane/cadl/swagger/IotHub.json create mode 100644 specification/eventgrid/data-plane/cadl/swagger/KeyVault.json create mode 100644 specification/eventgrid/data-plane/cadl/swagger/MachineLearningServices.json create mode 100644 specification/eventgrid/data-plane/cadl/swagger/Maps.json create mode 100644 specification/eventgrid/data-plane/cadl/swagger/MediaServices.json create mode 100644 specification/eventgrid/data-plane/cadl/swagger/PolicyInsights.json create mode 100644 specification/eventgrid/data-plane/cadl/swagger/RedisCache.json create mode 100644 specification/eventgrid/data-plane/cadl/swagger/Resources.json create mode 100644 specification/eventgrid/data-plane/cadl/swagger/ServiceBus.json create mode 100644 specification/eventgrid/data-plane/cadl/swagger/SignalRService.json create mode 100644 specification/eventgrid/data-plane/cadl/swagger/Storage.json create mode 100644 specification/eventgrid/data-plane/cadl/swagger/Web.json diff --git a/specification/eventgrid/data-plane/cadl/swagger/ApiManagement.json b/specification/eventgrid/data-plane/cadl/swagger/ApiManagement.json new file mode 100644 index 000000000000..cb09e53513c5 --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/swagger/ApiManagement.json @@ -0,0 +1,177 @@ +{ + "swagger": "2.0", + "info": { + "title": "Schema of Azure API Management events published to Azure Event Grid", + "version": "2018-01-01", + "description": "Describes the schema of the Azure API Management events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.", + "x-cadl-generated": [ + { + "emitter": "@azure-tools/cadl-autorest" + } + ] + }, + "schemes": [ + "https" + ], + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "tags": [], + "paths": {}, + "definitions": { + "ApiManagementApiCreatedEventData": { + "type": "object", + "properties": { + "resourceUri": { + "type": "string", + "description": "The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions//resourceGroups//Microsoft.ApiManagement/service///`" + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APICreated event." + }, + "ApiManagementApiDeletedEventData": { + "type": "object", + "properties": { + "resourceUri": { + "type": "string", + "description": "The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions//resourceGroups//Microsoft.ApiManagement/service///`" + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIDeleted event." + }, + "ApiManagementApiReleaseCreatedEventData": { + "type": "object", + "properties": { + "resourceUri": { + "type": "string", + "description": "The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions//resourceGroups//Microsoft.ApiManagement/service///`" + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIReleaseCreated event." + }, + "ApiManagementApiReleaseDeletedEventData": { + "type": "object", + "properties": { + "resourceUri": { + "type": "string", + "description": "The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions//resourceGroups//Microsoft.ApiManagement/service///`" + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIReleaseDeleted event." + }, + "ApiManagementApiReleaseUpdatedEventData": { + "type": "object", + "properties": { + "resourceUri": { + "type": "string", + "description": "The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions//resourceGroups//Microsoft.ApiManagement/service///`" + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIReleaseUpdated event." + }, + "ApiManagementApiUpdatedEventData": { + "type": "object", + "properties": { + "resourceUri": { + "type": "string", + "description": "The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions//resourceGroups//Microsoft.ApiManagement/service///`" + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIUpdated event." + }, + "ApiManagementProductCreatedEventData": { + "type": "object", + "properties": { + "resourceUri": { + "type": "string", + "description": "The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions//resourceGroups//Microsoft.ApiManagement/service///`" + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.ProductCreated event." + }, + "ApiManagementProductDeletedEventData": { + "type": "object", + "properties": { + "resourceUri": { + "type": "string", + "description": "The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions//resourceGroups//Microsoft.ApiManagement/service///`" + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.ProductDeleted event." + }, + "ApiManagementProductUpdatedEventData": { + "type": "object", + "properties": { + "resourceUri": { + "type": "string", + "description": "The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions//resourceGroups//Microsoft.ApiManagement/service///`" + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.ProductUpdated event." + }, + "ApiManagementSubscriptionCreatedEventData": { + "type": "object", + "properties": { + "resourceUri": { + "type": "string", + "description": "The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions//resourceGroups//Microsoft.ApiManagement/service///`" + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.SubscriptionCreated event." + }, + "ApiManagementSubscriptionDeletedEventData": { + "type": "object", + "properties": { + "resourceUri": { + "type": "string", + "description": "The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions//resourceGroups//Microsoft.ApiManagement/service///`" + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.SubscriptionDeleted event." + }, + "ApiManagementSubscriptionUpdatedEventData": { + "type": "object", + "properties": { + "resourceUri": { + "type": "string", + "description": "The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions//resourceGroups//Microsoft.ApiManagement/service///`" + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.SubscriptionUpdated event." + }, + "ApiManagementUserCreatedEventData": { + "type": "object", + "properties": { + "resourceUri": { + "type": "string", + "description": "The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions//resourceGroups//Microsoft.ApiManagement/service///`" + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.UserCreated event." + }, + "ApiManagementUserDeletedEventData": { + "type": "object", + "properties": { + "resourceUri": { + "type": "string", + "description": "The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions//resourceGroups//Microsoft.ApiManagement/service///`" + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.UserDeleted event." + }, + "ApiManagementUserUpdatedEventData": { + "type": "object", + "properties": { + "resourceUri": { + "type": "string", + "description": "The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions//resourceGroups//Microsoft.ApiManagement/service///`" + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.UserUpdated event." + } + }, + "parameters": {} +} diff --git a/specification/eventgrid/data-plane/cadl/swagger/AppConfiguration.json b/specification/eventgrid/data-plane/cadl/swagger/AppConfiguration.json new file mode 100644 index 000000000000..55973071127d --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/swagger/AppConfiguration.json @@ -0,0 +1,71 @@ +{ + "swagger": "2.0", + "info": { + "title": "Schema of Azure App Configuration events published to Azure Event Grid", + "version": "2018-01-01", + "description": "Describes the schema of the Azure App Configuration events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.", + "x-cadl-generated": [ + { + "emitter": "@azure-tools/cadl-autorest" + } + ] + }, + "schemes": [ + "https" + ], + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "tags": [], + "paths": {}, + "definitions": { + "AppConfigurationKeyValueDeletedEventData": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "The key used to identify the key-value that was ." + }, + "label": { + "type": "string", + "description": "The label, if any, used to identify the key-value that was ." + }, + "etag": { + "type": "string", + "description": "The etag representing the key-value that was ." + }, + "syncToken": { + "type": "string", + "description": "The sync token representing the server state after the event." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.AppConfiguration.KeyValueDeleted event." + }, + "AppConfigurationKeyValueModifiedEventData": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "The key used to identify the key-value that was ." + }, + "label": { + "type": "string", + "description": "The label, if any, used to identify the key-value that was ." + }, + "etag": { + "type": "string", + "description": "The etag representing the key-value that was ." + }, + "syncToken": { + "type": "string", + "description": "The sync token representing the server state after the event." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.AppConfiguration.KeyValueModified event." + } + }, + "parameters": {} +} diff --git a/specification/eventgrid/data-plane/cadl/swagger/AzureCommunicationServices.json b/specification/eventgrid/data-plane/cadl/swagger/AzureCommunicationServices.json new file mode 100644 index 000000000000..1cc20cbd4748 --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/swagger/AzureCommunicationServices.json @@ -0,0 +1,888 @@ +{ + "swagger": "2.0", + "info": { + "title": "Schema of Azure Communication Services events published to Azure Event Grid", + "version": "2018-01-01", + "description": "Describes the schema of the Azure Communication Services events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.", + "x-cadl-generated": [ + { + "emitter": "@azure-tools/cadl-autorest" + } + ] + }, + "schemes": [ + "https" + ], + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "tags": [], + "paths": {}, + "definitions": { + "AcsChatEventBaseProperties": { + "type": "object", + "properties": { + "recipientCommunicationIdentifier": { + "$ref": "#/definitions/CommunicationIdentifierModel", + "description": "The communication identifier of the target user" + }, + "transactionId": { + "type": "string", + "description": "The transaction id will be used as co-relation vector" + }, + "threadId": { + "type": "string", + "description": "The chat thread id" + } + }, + "description": "Schema of common properties of all chat events" + }, + "AcsChatEventInThreadBaseProperties": { + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "description": "The transaction id will be used as co-relation vector" + }, + "threadId": { + "type": "string", + "description": "The chat thread id" + } + }, + "description": "Schema of common properties of all thread-level chat events" + }, + "AcsChatMessageDeletedEventData": { + "type": "object", + "properties": { + "deleteTime": { + "type": "string", + "format": "date-time", + "description": "The time at which the message was deleted" + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageDeleted event.", + "allOf": [ + { + "$ref": "#/definitions/AcsChatMessageEventBaseProperties" + } + ] + }, + "AcsChatMessageDeletedInThreadEventData": { + "type": "object", + "properties": { + "deleteTime": { + "type": "string", + "format": "date-time", + "description": "The time at which the message was deleted" + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageDeletedInThread event.", + "allOf": [ + { + "$ref": "#/definitions/AcsChatMessageEventInThreadBaseProperties" + } + ] + }, + "AcsChatMessageEditedEventData": { + "type": "object", + "properties": { + "messageBody": { + "type": "string", + "description": "The body of the chat message" + }, + "metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-cadl-name": "Record", + "description": "The chat message metadata" + }, + "editTime": { + "type": "string", + "format": "date-time", + "description": "The time at which the message was edited" + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageEdited event.", + "allOf": [ + { + "$ref": "#/definitions/AcsChatMessageEventBaseProperties" + } + ] + }, + "AcsChatMessageEditedInThreadEventData": { + "type": "object", + "properties": { + "messageBody": { + "type": "string", + "description": "The body of the chat message" + }, + "metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-cadl-name": "Record", + "description": "The chat message metadata" + }, + "editTime": { + "type": "string", + "format": "date-time", + "description": "The time at which the message was edited" + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageEditedInThread event.", + "allOf": [ + { + "$ref": "#/definitions/AcsChatMessageEventInThreadBaseProperties" + } + ] + }, + "AcsChatMessageEventBaseProperties": { + "type": "object", + "properties": { + "messageId": { + "type": "string", + "description": "The chat message id" + }, + "senderCommunicationIdentifier": { + "$ref": "#/definitions/CommunicationIdentifierModel", + "description": "The communication identifier of the sender" + }, + "senderDisplayName": { + "type": "string", + "description": "The display name of the sender" + }, + "composeTime": { + "type": "string", + "format": "date-time", + "description": "The original compose time of the message" + }, + "type": { + "type": "string", + "description": "The type of the message" + }, + "version": { + "type": "integer", + "format": "int64", + "description": "The version of the message" + } + }, + "description": "Schema of common properties of all chat message events", + "allOf": [ + { + "$ref": "#/definitions/AcsChatEventBaseProperties" + } + ] + }, + "AcsChatMessageEventInThreadBaseProperties": { + "type": "object", + "properties": { + "messageId": { + "type": "string", + "description": "The chat message id" + }, + "senderCommunicationIdentifier": { + "$ref": "#/definitions/CommunicationIdentifierModel", + "description": "The communication identifier of the sender" + }, + "senderDisplayName": { + "type": "string", + "description": "The display name of the sender" + }, + "composeTime": { + "type": "string", + "format": "date-time", + "description": "The original compose time of the message" + }, + "type": { + "type": "string", + "description": "The type of the message" + }, + "version": { + "type": "integer", + "format": "int64", + "description": "The version of the message" + } + }, + "description": "Schema of common properties of all thread-level chat message events", + "allOf": [ + { + "$ref": "#/definitions/AcsChatEventInThreadBaseProperties" + } + ] + }, + "AcsChatMessageReceivedEventData": { + "type": "object", + "properties": { + "messageBody": { + "type": "string", + "description": "The body of the chat message" + }, + "metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-cadl-name": "Record", + "description": "The chat message metadata" + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageReceived event.", + "allOf": [ + { + "$ref": "#/definitions/AcsChatMessageEventBaseProperties" + } + ] + }, + "AcsChatMessageReceivedInThreadEventData": { + "type": "object", + "properties": { + "messageBody": { + "type": "string", + "description": "The body of the chat message" + }, + "metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-cadl-name": "Record", + "description": "The chat message metadata" + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageReceivedInThread event.", + "allOf": [ + { + "$ref": "#/definitions/AcsChatMessageEventInThreadBaseProperties" + } + ] + }, + "AcsChatParticipantAddedToThreadEventData": { + "type": "object", + "properties": { + "time": { + "type": "string", + "format": "date-time", + "description": "The time at which the user was added to the thread" + }, + "addedByCommunicationIdentifier": { + "$ref": "#/definitions/CommunicationIdentifierModel", + "description": "The communication identifier of the user who added the user" + }, + "participantAdded": { + "$ref": "#/definitions/AcsChatThreadParticipantProperties", + "description": "The details of the user who was added" + }, + "version": { + "type": "integer", + "format": "int64", + "description": "The version of the thread" + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadParticipantAdded event.", + "allOf": [ + { + "$ref": "#/definitions/AcsChatEventInThreadBaseProperties" + } + ] + }, + "AcsChatParticipantAddedToThreadWithUserEventData": { + "type": "object", + "properties": { + "time": { + "type": "string", + "format": "date-time", + "description": "The time at which the user was added to the thread" + }, + "addedByCommunicationIdentifier": { + "$ref": "#/definitions/CommunicationIdentifierModel", + "description": "The communication identifier of the user who added the user" + }, + "participantAdded": { + "$ref": "#/definitions/AcsChatThreadParticipantProperties", + "description": "The details of the user who was added" + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatParticipantAddedToThreadWithUser event.", + "allOf": [ + { + "$ref": "#/definitions/AcsChatThreadEventBaseProperties" + } + ] + }, + "AcsChatParticipantRemovedFromThreadEventData": { + "type": "object", + "properties": { + "time": { + "type": "string", + "format": "date-time", + "description": "The time at which the user was removed to the thread" + }, + "removedByCommunicationIdentifier": { + "$ref": "#/definitions/CommunicationIdentifierModel", + "description": "The communication identifier of the user who removed the user" + }, + "participantRemoved": { + "$ref": "#/definitions/AcsChatThreadParticipantProperties", + "description": "The details of the user who was removed" + }, + "version": { + "type": "integer", + "format": "int64", + "description": "The version of the thread" + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadParticipantRemoved event.", + "allOf": [ + { + "$ref": "#/definitions/AcsChatEventInThreadBaseProperties" + } + ] + }, + "AcsChatParticipantRemovedFromThreadWithUserEventData": { + "type": "object", + "properties": { + "time": { + "type": "string", + "format": "date-time", + "description": "The time at which the user was removed to the thread" + }, + "removedByCommunicationIdentifier": { + "$ref": "#/definitions/CommunicationIdentifierModel", + "description": "The communication identifier of the user who removed the user" + }, + "participantRemoved": { + "$ref": "#/definitions/AcsChatThreadParticipantProperties", + "description": "The details of the user who was removed" + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatParticipantRemovedFromThreadWithUser event.", + "allOf": [ + { + "$ref": "#/definitions/AcsChatThreadEventBaseProperties" + } + ] + }, + "AcsChatThreadCreatedEventData": { + "type": "object", + "properties": { + "createdByCommunicationIdentifier": { + "$ref": "#/definitions/CommunicationIdentifierModel", + "description": "The communication identifier of the user who created the thread" + }, + "properties": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-cadl-name": "Record", + "description": "The thread properties" + }, + "participants": { + "type": "array", + "items": { + "$ref": "#/definitions/AcsChatThreadParticipantProperties" + }, + "x-ms-identifiers": [], + "x-cadl-name": "AcsChatThreadParticipantProperties[]", + "description": "The list of properties of participants who are part of the thread" + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadCreated event.", + "allOf": [ + { + "$ref": "#/definitions/AcsChatThreadEventInThreadBaseProperties" + } + ] + }, + "AcsChatThreadCreatedWithUserEventData": { + "type": "object", + "properties": { + "createdByCommunicationIdentifier": { + "$ref": "#/definitions/CommunicationIdentifierModel", + "description": "The communication identifier of the user who created the thread" + }, + "properties": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-cadl-name": "Record", + "description": "The thread properties" + }, + "participants": { + "type": "array", + "items": { + "$ref": "#/definitions/AcsChatThreadParticipantProperties" + }, + "x-ms-identifiers": [], + "x-cadl-name": "AcsChatThreadParticipantProperties[]", + "description": "The list of properties of participants who are part of the thread" + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadCreatedWithUser event.", + "allOf": [ + { + "$ref": "#/definitions/AcsChatThreadEventBaseProperties" + } + ] + }, + "AcsChatThreadDeletedEventData": { + "type": "object", + "properties": { + "deletedByCommunicationIdentifier": { + "$ref": "#/definitions/CommunicationIdentifierModel", + "description": "The communication identifier of the user who deleted the thread" + }, + "deleteTime": { + "type": "string", + "format": "date-time", + "description": "The deletion time of the thread" + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadDeleted event.", + "allOf": [ + { + "$ref": "#/definitions/AcsChatThreadEventInThreadBaseProperties" + } + ] + }, + "AcsChatThreadEventBaseProperties": { + "type": "object", + "properties": { + "createTime": { + "type": "string", + "format": "date-time", + "description": "The original creation time of the thread" + }, + "version": { + "type": "integer", + "format": "int64", + "description": "The version of the thread" + } + }, + "description": "Schema of common properties of all chat thread events", + "allOf": [ + { + "$ref": "#/definitions/AcsChatEventBaseProperties" + } + ] + }, + "AcsChatThreadEventInThreadBaseProperties": { + "type": "object", + "properties": { + "createTime": { + "type": "string", + "format": "date-time", + "description": "The original creation time of the thread" + }, + "version": { + "type": "integer", + "format": "int64", + "description": "The version of the thread" + } + }, + "description": "Schema of common properties of all chat thread events", + "allOf": [ + { + "$ref": "#/definitions/AcsChatEventInThreadBaseProperties" + } + ] + }, + "AcsChatThreadParticipantProperties": { + "type": "object", + "properties": { + "displayName": { + "type": "string", + "description": "The name of the user" + }, + "participantCommunicationIdentifier": { + "$ref": "#/definitions/CommunicationIdentifierModel", + "description": "The communication identifier of the user" + } + }, + "description": "Schema of the chat thread participant" + }, + "AcsChatThreadPropertiesUpdatedEventData": { + "type": "object", + "properties": { + "editedByCommunicationIdentifier": { + "$ref": "#/definitions/CommunicationIdentifierModel", + "description": "The communication identifier of the user who updated the thread properties" + }, + "editTime": { + "type": "string", + "format": "date-time", + "description": "The time at which the properties of the thread were updated" + }, + "properties": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-cadl-name": "Record", + "description": "The updated thread properties" + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadPropertiesUpdated event.", + "allOf": [ + { + "$ref": "#/definitions/AcsChatThreadEventInThreadBaseProperties" + } + ] + }, + "AcsChatThreadPropertiesUpdatedPerUserEventData": { + "type": "object", + "properties": { + "editedByCommunicationIdentifier": { + "$ref": "#/definitions/CommunicationIdentifierModel", + "description": "The communication identifier of the user who updated the thread properties" + }, + "editTime": { + "type": "string", + "format": "date-time", + "description": "The time at which the properties of the thread were updated" + }, + "properties": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-cadl-name": "Record", + "description": "The updated thread properties" + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadPropertiesUpdatedPerUser event.", + "allOf": [ + { + "$ref": "#/definitions/AcsChatThreadEventBaseProperties" + } + ] + }, + "AcsChatThreadWithUserDeletedEventData": { + "type": "object", + "properties": { + "deletedByCommunicationIdentifier": { + "$ref": "#/definitions/CommunicationIdentifierModel", + "description": "The communication identifier of the user who deleted the thread" + }, + "deleteTime": { + "type": "string", + "format": "date-time", + "description": "The deletion time of the thread" + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadWithUserDeleted event.", + "allOf": [ + { + "$ref": "#/definitions/AcsChatThreadEventBaseProperties" + } + ] + }, + "AcsRecordingChunkInfoProperties": { + "type": "object", + "properties": { + "documentId": { + "type": "string", + "description": "The documentId of the recording chunk" + }, + "index": { + "type": "integer", + "format": "int64", + "description": "The index of the recording chunk" + }, + "endReason": { + "type": "string", + "description": "The reason for ending the recording chunk" + }, + "metadataLocation": { + "type": "string", + "description": "The location of the metadata for this chunk" + }, + "contentLocation": { + "type": "string", + "description": "The location of the content for this chunk" + }, + "deleteLocation": { + "type": "string", + "description": "The location to delete all chunk storage" + } + }, + "description": "Schema for all properties of Recording Chunk Information." + }, + "AcsRecordingFileStatusUpdatedEventData": { + "type": "object", + "properties": { + "recordingStorageInfo": { + "$ref": "#/definitions/AcsRecordingStorageInfoProperties", + "description": "The details of recording storage information" + }, + "recordingStartTime": { + "type": "string", + "format": "date-time", + "description": "The time at which the recording started" + }, + "recordingDurationMs": { + "type": "integer", + "format": "int64", + "description": "The recording duration in milliseconds" + }, + "recordingContentType": { + "$ref": "#/definitions/recordingContentType", + "description": "The recording content type- AudioVideo, or Audio" + }, + "recordingChannelType": { + "$ref": "#/definitions/recordingChannelType", + "description": "The recording channel type - Mixed, Unmixed" + }, + "recordingFormatType": { + "$ref": "#/definitions/recordingFormatType", + "description": "The recording format type - Mp4, Mp3, Wav" + }, + "sessionEndReason": { + "type": "string", + "description": "The reason for ending recording session" + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RecordingFileStatusUpdated event." + }, + "AcsRecordingStorageInfoProperties": { + "type": "object", + "properties": { + "recordingChunks": { + "type": "array", + "items": { + "$ref": "#/definitions/AcsRecordingChunkInfoProperties" + }, + "x-ms-identifiers": [], + "x-cadl-name": "AcsRecordingChunkInfoProperties[]", + "description": "List of details of recording chunks information" + } + }, + "description": "Schema for all properties of Recording Storage Information." + }, + "AcsSmsDeliveryAttemptProperties": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "TimeStamp when delivery was attempted" + }, + "segmentsSucceeded": { + "description": "Number of segments that were successfully delivered" + }, + "segmentsFailed": { + "description": "Number of segments whose delivery failed" + } + }, + "description": "Schema for details of a delivery attempt" + }, + "AcsSmsDeliveryReportReceivedEventData": { + "type": "object", + "properties": { + "deliveryStatus": { + "type": "string", + "description": "Status of Delivery" + }, + "deliveryStatusDetails": { + "type": "string", + "description": "Details about Delivery Status" + }, + "deliveryAttempts": { + "type": "array", + "items": { + "$ref": "#/definitions/AcsSmsDeliveryAttemptProperties" + }, + "x-ms-identifiers": [], + "x-cadl-name": "AcsSmsDeliveryAttemptProperties[]", + "description": "List of details of delivery attempts made" + }, + "receivedTimestamp": { + "type": "string", + "format": "date-time", + "description": "The time at which the SMS delivery report was received" + }, + "tag": { + "type": "string", + "description": "Customer Content" + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Communication.SMSDeliveryReportReceived event.", + "allOf": [ + { + "$ref": "#/definitions/AcsSmsEventBaseProperties" + } + ] + }, + "AcsSmsEventBaseProperties": { + "type": "object", + "properties": { + "messageId": { + "type": "string", + "description": "The identity of the SMS message" + }, + "from": { + "type": "string", + "description": "The identity of SMS message sender" + }, + "to": { + "type": "string", + "description": "The identity of SMS message receiver" + } + }, + "description": "Schema of common properties of all SMS events" + }, + "AcsSmsReceivedEventData": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "The SMS content" + }, + "receivedTimestamp": { + "type": "string", + "format": "date-time", + "description": "The time at which the SMS was received" + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Communication.SMSReceived event.", + "allOf": [ + { + "$ref": "#/definitions/AcsSmsEventBaseProperties" + } + ] + }, + "AcsUserDisconnectedEventData": { + "type": "object", + "properties": { + "userCommunicationIdentifier": { + "$ref": "#/definitions/CommunicationIdentifierModel", + "description": "The communication identifier of the user who was disconnected" + } + }, + "description": "Schema of the Data property of an EventGridEvent for an Microsoft.Communication.UserDisconnected event." + }, + "CommunicationCloudEnvironmentModel": { + "type": "string", + "enum": [ + "public", + "dod", + "gcch" + ], + "x-ms-enum": { + "name": "CommunicationCloudEnvironmentModel", + "modelAsString": true + } + }, + "CommunicationIdentifierModel": { + "type": "object", + "properties": { + "rawId": { + "type": "string", + "description": "Raw Id of the identifier. Optional in requests, required in responses." + }, + "communicationUser": { + "$ref": "#/definitions/CommunicationUserIdentifierModel", + "description": "The communication user." + }, + "phoneNumber": { + "$ref": "#/definitions/PhoneNumberIdentifierModel", + "description": "The phone number." + }, + "microsoftTeamsUser": { + "$ref": "#/definitions/MicrosoftTeamsUserIdentifierModel", + "description": "The Microsoft Teams user." + } + }, + "description": "Identifies a participant in Azure Communication services. A participant is, for example, a phone number or an Azure communication user. This model must be interpreted as a union: Apart from rawId, at most one further property may be set." + }, + "CommunicationUserIdentifierModel": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The Id of the communication user." + } + }, + "description": "A user that got created with an Azure Communication Services resource.", + "required": [ + "id" + ] + }, + "MicrosoftTeamsUserIdentifierModel": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "The Id of the Microsoft Teams user. If not anonymous, this is the AAD object Id of the user." + }, + "isAnonymous": { + "type": "boolean", + "description": "True if the Microsoft Teams user is anonymous. By default false if missing." + }, + "cloud": { + "$ref": "#/definitions/CommunicationCloudEnvironmentModel", + "description": "The cloud that the Microsoft Teams user belongs to. By default 'public' if missing." + } + }, + "description": "A Microsoft Teams user.", + "required": [ + "userId" + ] + }, + "PhoneNumberIdentifierModel": { + "type": "object", + "properties": { + "value": { + "type": "string", + "description": "The phone number in E.164 format." + } + }, + "description": "A phone number.", + "required": [ + "value" + ] + }, + "recordingChannelType": { + "type": "string", + "enum": [ + "Mixed", + "Unmixed" + ], + "x-ms-enum": { + "name": "recordingChannelType", + "modelAsString": true + } + }, + "recordingContentType": { + "type": "string", + "enum": [ + "AudioVideo", + "Audio" + ], + "x-ms-enum": { + "name": "recordingContentType", + "modelAsString": true + } + }, + "recordingFormatType": { + "type": "string", + "enum": [ + "Wav", + "Mp3", + "Mp4" + ], + "x-ms-enum": { + "name": "recordingFormatType", + "modelAsString": true + } + } + }, + "parameters": {} +} diff --git a/specification/eventgrid/data-plane/cadl/swagger/ContainerRegistry.json b/specification/eventgrid/data-plane/cadl/swagger/ContainerRegistry.json new file mode 100644 index 000000000000..a0566b043810 --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/swagger/ContainerRegistry.json @@ -0,0 +1,294 @@ +{ + "swagger": "2.0", + "info": { + "title": "Schema of Azure Container Registry events published to Azure Event Grid", + "version": "2018-01-01", + "description": "Describes the schema of the Azure Container Registry events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.", + "x-cadl-generated": [ + { + "emitter": "@azure-tools/cadl-autorest" + } + ] + }, + "schemes": [ + "https" + ], + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "tags": [], + "paths": {}, + "definitions": { + "ContainerRegistryArtifactEventData": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The event ID." + }, + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The time at which the event occurred." + }, + "action": { + "type": "string", + "description": "The action that encompasses the provided event." + }, + "location": { + "type": "string", + "description": "The location of the event." + }, + "target": { + "$ref": "#/definitions/ContainerRegistryArtifactEventTarget", + "description": "The target of the event." + }, + "connectedRegistry": { + "$ref": "#/definitions/ContainerRegistryEventConnectedRegistry", + "description": "The connected registry information if the event is generated by a connected registry." + } + }, + "description": "The content of the event request message." + }, + "ContainerRegistryArtifactEventTarget": { + "type": "object", + "properties": { + "mediaType": { + "type": "string", + "description": "The MIME type of the artifact." + }, + "size": { + "type": "integer", + "format": "int64", + "description": "The size in bytes of the artifact." + }, + "digest": { + "type": "string", + "description": "The digest of the artifact." + }, + "repository": { + "type": "string", + "description": "The repository name of the artifact." + }, + "tag": { + "type": "string", + "description": "The tag of the artifact." + }, + "name": { + "type": "string", + "description": "The name of the artifact." + }, + "version": { + "type": "string", + "description": "The version of the artifact." + } + }, + "description": "The target of the event." + }, + "ContainerRegistryBaseEventData": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The event ID." + }, + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The time at which the event occurred." + }, + "action": { + "type": "string", + "description": "The action that encompasses the provided event." + }, + "location": { + "type": "string", + "description": "The location of the event." + } + } + }, + "ContainerRegistryChartDeletedEventData": { + "type": "object", + "properties": {}, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.ContainerRegistry.ChartDeleted event.", + "allOf": [ + { + "$ref": "#/definitions/ContainerRegistryArtifactEventData" + } + ] + }, + "ContainerRegistryChartPushedEventData": { + "type": "object", + "properties": {}, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.ContainerRegistry.ChartPushed event.", + "allOf": [ + { + "$ref": "#/definitions/ContainerRegistryArtifactEventData" + } + ] + }, + "ContainerRegistryEventActor": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The subject or username associated with the request context that generated the event." + } + }, + "description": "The agent that initiated the event. For most situations, this could be from the authorization context of the request." + }, + "ContainerRegistryEventConnectedRegistry": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the connected registry that generated this event." + } + }, + "description": "The connected registry information if the event is generated by a connected registry." + }, + "ContainerRegistryEventData": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The event ID." + }, + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The time at which the event occurred." + }, + "action": { + "type": "string", + "description": "The action that encompasses the provided event." + }, + "location": { + "type": "string", + "description": "The location of the event." + }, + "target": { + "$ref": "#/definitions/ContainerRegistryEventTarget", + "description": "The target of the event." + }, + "request": { + "$ref": "#/definitions/ContainerRegistryEventRequest", + "description": "The request that generated the event." + }, + "actor": { + "$ref": "#/definitions/ContainerRegistryEventActor", + "description": "The agent that initiated the event. For most situations, this could be from the authorization context of the request." + }, + "source": { + "$ref": "#/definitions/ContainerRegistryEventSource", + "description": "The registry node that generated the event. Put differently, while the actor initiates the event, the source generates it." + }, + "connectedRegistry": { + "$ref": "#/definitions/ContainerRegistryEventConnectedRegistry", + "description": "The connected registry information if the event is generated by a connected registry." + } + }, + "description": "The content of the event request message." + }, + "ContainerRegistryEventRequest": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the request that initiated the event." + }, + "addr": { + "type": "string", + "description": "The IP or hostname and possibly port of the client connection that initiated the event. This is the RemoteAddr from the standard http request." + }, + "host": { + "type": "string", + "description": "The externally accessible hostname of the registry instance, as specified by the http host header on incoming requests." + }, + "method": { + "type": "string", + "description": "The request method that generated the event." + }, + "useragent": { + "type": "string", + "description": "The user agent header of the request." + } + }, + "description": "The request that generated the event." + }, + "ContainerRegistryEventSource": { + "type": "object", + "properties": { + "addr": { + "type": "string", + "description": "The IP or hostname and the port of the registry node that generated the event. Generally, this will be resolved by os.Hostname() along with the running port." + }, + "instanceID": { + "type": "string", + "description": "The running instance of an application. Changes after each restart." + } + }, + "description": "The registry node that generated the event. Put differently, while the actor initiates the event, the source generates it." + }, + "ContainerRegistryEventTarget": { + "type": "object", + "properties": { + "mediaType": { + "type": "string", + "description": "The MIME type of the referenced object." + }, + "size": { + "type": "integer", + "format": "int64", + "description": "The number of bytes of the content. Same as Length field." + }, + "digest": { + "type": "string", + "description": "The digest of the content, as defined by the Registry V2 HTTP API Specification." + }, + "repository": { + "type": "string", + "description": "The repository name." + }, + "tag": { + "type": "string", + "description": "The tag name." + }, + "length": { + "type": "integer", + "format": "int64", + "description": "The number of bytes of the content. Same as Size field." + }, + "url": { + "type": "string", + "description": "The direct URL to the content." + } + }, + "description": "The target of the event." + }, + "ContainerRegistryImageDeletedEventData": { + "type": "object", + "properties": {}, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.ContainerRegistry.ImageDeleted event.", + "allOf": [ + { + "$ref": "#/definitions/ContainerRegistryEventData" + } + ] + }, + "ContainerRegistryImagePushedEventData": { + "type": "object", + "properties": {}, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.ContainerRegistry.ImagePushed event.", + "allOf": [ + { + "$ref": "#/definitions/ContainerRegistryEventData" + } + ] + } + }, + "parameters": {} +} diff --git a/specification/eventgrid/data-plane/cadl/swagger/ContainerService.json b/specification/eventgrid/data-plane/cadl/swagger/ContainerService.json new file mode 100644 index 000000000000..eae7a28d80cc --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/swagger/ContainerService.json @@ -0,0 +1,49 @@ +{ + "swagger": "2.0", + "info": { + "title": "Schema of Azure Kubernetes Service events published to Azure Event Grid", + "version": "2018-01-01", + "description": "Describes the schema of the Azure Kubernetes Service events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent", + "x-cadl-generated": [ + { + "emitter": "@azure-tools/cadl-autorest" + } + ] + }, + "schemes": [ + "https" + ], + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "tags": [], + "paths": {}, + "definitions": { + "ContainerServiceNewKubernetesVersionAvailableEventData": { + "type": "object", + "properties": { + "latestSupportedKubernetesVersion": { + "type": "string", + "description": "The highest PATCH Kubernetes version for the highest MINOR version supported by ManagedCluster resource" + }, + "latestStableKubernetesVersion": { + "type": "string", + "description": "The highest PATCH Kubernetes version for the MINOR version considered stable for the ManagedCluster resource" + }, + "lowestMinorKubernetesVersion": { + "type": "string", + "description": "The highest PATCH Kubernetes version for the lowest applicable MINOR version available for the ManagedCluster resource" + }, + "latestPreviewKubernetesVersion": { + "type": "string", + "description": "The highest PATCH Kubernetes version considered preview for the ManagedCluster resource. There might not be any version in preview at the time of publishing the event" + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.ContainerService.NewKubernetesVersionAvailable event" + } + }, + "parameters": {} +} diff --git a/specification/eventgrid/data-plane/cadl/swagger/EventGrid.json b/specification/eventgrid/data-plane/cadl/swagger/EventGrid.json new file mode 100644 index 000000000000..40f7e97c1fbe --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/swagger/EventGrid.json @@ -0,0 +1,320 @@ +{ + "swagger": "2.0", + "info": { + "title": "EventGridClient", + "version": "2018-01-01", + "description": "Azure EventGrid Client", + "x-cadl-generated": [ + { + "emitter": "@azure-tools/cadl-autorest" + } + ] + }, + "schemes": [ + "https" + ], + "x-ms-parameterized-host": { + "hostTemplate": "{topicHostname}", + "useSchemePrefix": false, + "parameters": [ + { + "name": "topicHostname", + "in": "path", + "required": true, + "description": "The host name of the topic, e.g. topic1.westus2-1.eventgrid.azure.net", + "type": "string" + } + ] + }, + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "tags": [ + { + "name": "Events" + } + ], + "paths": {}, + "x-ms-paths": { + "/?overload=EventGridEvent": { + "post": { + "tags": [ + "Events" + ], + "operationId": "PublishEventGridEvents", + "description": "Publishes a batch of events to an Azure Event Grid topic.", + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "name": "events", + "in": "body", + "required": true, + "description": "An array of events to be published to Event Grid.", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/EventGridEvent" + }, + "x-cadl-name": "EventGridEvent[]" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded." + } + } + } + }, + "/?overload=cloudEvent": { + "post": { + "tags": [ + "Events" + ], + "operationId": "PublishCloudEventEvents", + "description": "Publishes a batch of events to an Azure Event Grid topic.", + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ChannelNameParameter" + }, + { + "name": "events", + "in": "body", + "required": true, + "description": "An array of events to be published to Event Grid.", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/CloudEventEvent" + }, + "x-cadl-name": "CloudEventEvent[]" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded." + } + } + } + }, + "/?overload=customEvent": { + "post": { + "tags": [ + "Events" + ], + "operationId": "PublishCustomEventEvents", + "description": "Publishes a batch of events to an Azure Event Grid topic.", + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "name": "events", + "in": "body", + "required": true, + "description": "An array of events to be published to Event Grid.", + "x-ms-identifiers": [], + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/CustomEventEvent" + }, + "x-ms-identifiers": [], + "x-cadl-name": "CustomEventEvent[]" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded." + } + } + } + } + }, + "definitions": { + "ApiVersionParameter": { + "type": "object", + "properties": {} + }, + "ChannelNameParameter": { + "type": "object", + "properties": {} + }, + "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 Event Grid topic using the CloudEvent 1.0 Schema", + "required": [ + "id", + "source", + "type", + "specversion" + ] + }, + "CustomEventEvent": { + "type": "object", + "properties": {}, + "description": "Properties of an event published to an Event Grid topic using a custom schema" + }, + "EventGridEvent": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "An unique identifier for the event." + }, + "topic": { + "type": "string", + "description": "The resource path of the event source." + }, + "subject": { + "type": "string", + "description": "A resource path relative to the topic path." + }, + "data": { + "$ref": "#/definitions/object", + "description": "Event data specific to the event type." + }, + "eventType": { + "type": "string", + "description": "The type of the event that occurred." + }, + "eventTime": { + "type": "string", + "format": "date-time", + "description": "The time (in UTC) the event was generated." + }, + "metadataVersion": { + "type": "string", + "description": "The schema version of the event metadata.", + "readOnly": true + }, + "dataVersion": { + "type": "string", + "description": "The schema version of the data object." + } + }, + "description": "Properties of an event published to an Event Grid topic using the EventGrid Schema.", + "required": [ + "id", + "subject", + "data", + "eventType", + "eventTime", + "dataVersion" + ] + }, + "SubscriptionDeletedEventData": { + "type": "object", + "properties": { + "eventSubscriptionId": { + "type": "string", + "description": "The Azure resource ID of the deleted event subscription.", + "readOnly": true + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.EventGrid.SubscriptionDeletedEvent event." + }, + "SubscriptionValidationEventData": { + "type": "object", + "properties": { + "validationCode": { + "type": "string", + "description": "The validation code sent by Azure Event Grid to validate an event subscription. To complete the validation handshake, the subscriber must either respond with this validation code as part of the validation response, or perform a GET request on the validationUrl (available starting version 2018-05-01-preview).", + "readOnly": true + }, + "validationUrl": { + "type": "string", + "description": "The validation URL sent by Azure Event Grid (available starting version 2018-05-01-preview). To complete the validation handshake, the subscriber must either respond with the validationCode as part of the validation response, or perform a GET request on the validationUrl (available starting version 2018-05-01-preview).", + "readOnly": true + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.EventGrid.SubscriptionValidationEvent event." + }, + "SubscriptionValidationResponse": { + "type": "object", + "properties": { + "validationResponse": { + "type": "string", + "description": "The validation response sent by the subscriber to Azure Event Grid to complete the validation of an event subscription." + } + }, + "description": "To complete an event subscription validation handshake, a subscriber can use either the validationCode or the validationUrl received in a SubscriptionValidationEvent. When the validationCode is used, the SubscriptionValidationResponse can be used to build the response." + }, + "object": { + "type": "object", + "properties": {} + } + }, + "parameters": { + "ApiVersionParameter": { + "name": "api-version", + "in": "query", + "required": true, + "description": "Version of the API to be used with the client request.", + "type": "string", + "x-ms-parameter-location": "method" + }, + "ChannelNameParameter": { + "name": "aeg-channel-name", + "in": "query", + "required": false, + "description": "Required only when publishing to partner namespaces with partner topic routing mode ChannelNameHeader.", + "type": "string", + "x-ms-parameter-location": "method" + } + } +} diff --git a/specification/eventgrid/data-plane/cadl/swagger/EventHub.json b/specification/eventgrid/data-plane/cadl/swagger/EventHub.json new file mode 100644 index 000000000000..4a74fc94ddd5 --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/swagger/EventHub.json @@ -0,0 +1,75 @@ +{ + "swagger": "2.0", + "info": { + "title": "Schema of Azure EventHub events published to Azure Event Grid", + "version": "2018-01-01", + "description": "Describes the schema of the Azure EventHub events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.", + "x-cadl-generated": [ + { + "emitter": "@azure-tools/cadl-autorest" + } + ] + }, + "schemes": [ + "https" + ], + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "tags": [], + "paths": {}, + "definitions": { + "EventHubCaptureFileCreatedEventData": { + "type": "object", + "properties": { + "fileUrl": { + "type": "string", + "description": "The path to the capture file." + }, + "fileType": { + "type": "string", + "description": "The file type of the capture file." + }, + "partitionId": { + "type": "string", + "description": "The shard ID." + }, + "sizeInBytes": { + "type": "integer", + "format": "int64", + "description": "The file size." + }, + "eventCount": { + "type": "integer", + "format": "int64", + "description": "The number of events in the file." + }, + "firstSequenceNumber": { + "type": "integer", + "format": "int64", + "description": "The smallest sequence number from the queue." + }, + "lastSequenceNumber": { + "type": "integer", + "format": "int64", + "description": "The last sequence number from the queue." + }, + "firstEnqueueTime": { + "type": "string", + "format": "date-time", + "description": "The first time from the queue." + }, + "lastEnqueueTime": { + "type": "string", + "format": "date-time", + "description": "The last time from the queue." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.EventHub.CaptureFileCreated event." + } + }, + "parameters": {} +} diff --git a/specification/eventgrid/data-plane/cadl/swagger/HealthcareApis.json b/specification/eventgrid/data-plane/cadl/swagger/HealthcareApis.json new file mode 100644 index 000000000000..51b19640db45 --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/swagger/HealthcareApis.json @@ -0,0 +1,1128 @@ +{ + "swagger": "2.0", + "info": { + "title": "Schema of Azure HealthcareApis events published to Azure Event Grid.", + "version": "2018-01-01", + "description": "Describes the schema of the Azure HealthcareApis events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.", + "x-cadl-generated": [ + { + "emitter": "@azure-tools/cadl-autorest" + } + ] + }, + "schemes": [ + "https" + ], + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "tags": [], + "paths": {}, + "definitions": { + "HealthcareDicomImageCreatedEventData": { + "type": "object", + "properties": { + "imageStudyInstanceUid": { + "type": "string", + "description": "Unique identifier for the Study" + }, + "imageSeriesInstanceUid": { + "type": "string", + "description": "Unique identifier for the Series" + }, + "imageSopInstanceUid": { + "type": "string", + "description": "Unique identifier for the DICOM Image" + }, + "serviceHostName": { + "type": "string", + "description": "Domain name of the DICOM account for this image." + }, + "sequenceNumber": { + "type": "integer", + "format": "int64", + "description": "Sequence number of the DICOM Service within Azure Health Data Services. It is unique for every image creation and deletion within the service." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.DicomImageCreated event." + }, + "HealthcareDicomImageDeletedEventData": { + "type": "object", + "properties": { + "imageStudyInstanceUid": { + "type": "string", + "description": "Unique identifier for the Study" + }, + "imageSeriesInstanceUid": { + "type": "string", + "description": "Unique identifier for the Series" + }, + "imageSopInstanceUid": { + "type": "string", + "description": "Unique identifier for the DICOM Image" + }, + "serviceHostName": { + "type": "string", + "description": "Host name of the DICOM account for this image." + }, + "sequenceNumber": { + "type": "integer", + "format": "int64", + "description": "Sequence number of the DICOM Service within Azure Health Data Services. It is unique for every image creation and deletion within the service." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.DicomImageDeleted event." + }, + "HealthcareFhirResourceCreatedEventData": { + "type": "object", + "properties": { + "resourceFhirAccount": { + "type": "string", + "description": "Domain name of FHIR account for this resource." + }, + "resourceFhirId": { + "type": "string", + "description": "Id of HL7 FHIR resource." + }, + "resourceVersionId": { + "type": "integer", + "format": "int64", + "description": "VersionId of HL7 FHIR resource. It changes when the resource is created, updated, or deleted(soft-deletion)." + }, + "resourceType": { + "$ref": "#/definitions/HealthcareFhirResourceType", + "description": "Type of HL7 FHIR resource." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.FhirResourceCreated event." + }, + "HealthcareFhirResourceDeletedEventData": { + "type": "object", + "properties": { + "resourceFhirAccount": { + "type": "string", + "description": "Domain name of FHIR account for this resource." + }, + "resourceFhirId": { + "type": "string", + "description": "Id of HL7 FHIR resource." + }, + "resourceVersionId": { + "type": "integer", + "format": "int64", + "description": "VersionId of HL7 FHIR resource. It changes when the resource is created, updated, or deleted(soft-deletion)." + }, + "resourceType": { + "$ref": "#/definitions/HealthcareFhirResourceType", + "description": "Type of HL7 FHIR resource." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.FhirResourceDeleted event." + }, + "HealthcareFhirResourceType": { + "type": "string", + "description": "Schema of FHIR resource type enumeration.", + "enum": [ + "Account", + "ActivityDefinition", + "AdverseEvent", + "AllergyIntolerance", + "Appointment", + "AppointmentResponse", + "AuditEvent", + "Basic", + "Binary", + "BiologicallyDerivedProduct", + "BodySite", + "BodyStructure", + "Bundle", + "CapabilityStatement", + "CarePlan", + "CareTeam", + "CatalogEntry", + "ChargeItem", + "ChargeItemDefinition", + "Claim", + "ClaimResponse", + "ClinicalImpression", + "CodeSystem", + "Communication", + "CommunicationRequest", + "CompartmentDefinition", + "Composition", + "ConceptMap", + "Condition", + "Consent", + "Contract", + "Coverage", + "CoverageEligibilityRequest", + "CoverageEligibilityResponse", + "DataElement", + "DetectedIssue", + "Device", + "DeviceComponent", + "DeviceDefinition", + "DeviceMetric", + "DeviceRequest", + "DeviceUseStatement", + "DiagnosticReport", + "DocumentManifest", + "DocumentReference", + "DomainResource", + "EffectEvidenceSynthesis", + "EligibilityRequest", + "EligibilityResponse", + "Encounter", + "Endpoint", + "EnrollmentRequest", + "EnrollmentResponse", + "EpisodeOfCare", + "EventDefinition", + "Evidence", + "EvidenceVariable", + "ExampleScenario", + "ExpansionProfile", + "ExplanationOfBenefit", + "FamilyMemberHistory", + "Flag", + "Goal", + "GraphDefinition", + "Group", + "GuidanceResponse", + "HealthcareService", + "ImagingManifest", + "ImagingStudy", + "Immunization", + "ImmunizationEvaluation", + "ImmunizationRecommendation", + "ImplementationGuide", + "InsurancePlan", + "Invoice", + "Library", + "Linkage", + "List", + "Location", + "Measure", + "MeasureReport", + "Media", + "Medication", + "MedicationAdministration", + "MedicationDispense", + "MedicationKnowledge", + "MedicationRequest", + "MedicationStatement", + "MedicinalProduct", + "MedicinalProductAuthorization", + "MedicinalProductContraindication", + "MedicinalProductIndication", + "MedicinalProductIngredient", + "MedicinalProductInteraction", + "MedicinalProductManufactured", + "MedicinalProductPackaged", + "MedicinalProductPharmaceutical", + "MedicinalProductUndesirableEffect", + "MessageDefinition", + "MessageHeader", + "MolecularSequence", + "NamingSystem", + "NutritionOrder", + "Observation", + "ObservationDefinition", + "OperationDefinition", + "OperationOutcome", + "Organization", + "OrganizationAffiliation", + "Parameters", + "Patient", + "PaymentNotice", + "PaymentReconciliation", + "Person", + "PlanDefinition", + "Practitioner", + "PractitionerRole", + "Procedure", + "ProcedureRequest", + "ProcessRequest", + "ProcessResponse", + "Provenance", + "Questionnaire", + "QuestionnaireResponse", + "ReferralRequest", + "RelatedPerson", + "RequestGroup", + "ResearchDefinition", + "ResearchElementDefinition", + "ResearchStudy", + "ResearchSubject", + "Resource", + "RiskAssessment", + "RiskEvidenceSynthesis", + "Schedule", + "SearchParameter", + "Sequence", + "ServiceDefinition", + "ServiceRequest", + "Slot", + "Specimen", + "SpecimenDefinition", + "StructureDefinition", + "StructureMap", + "Subscription", + "Substance", + "SubstanceNucleicAcid", + "SubstancePolymer", + "SubstanceProtein", + "SubstanceReferenceInformation", + "SubstanceSourceMaterial", + "SubstanceSpecification", + "SupplyDelivery", + "SupplyRequest", + "Task", + "TerminologyCapabilities", + "TestReport", + "TestScript", + "ValueSet", + "VerificationResult", + "VisionPrescription" + ], + "x-ms-enum": { + "name": "HealthcareFhirResourceType", + "modelAsString": true, + "values": [ + { + "name": "Account", + "value": "Account", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "ActivityDefinition", + "value": "ActivityDefinition", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "AdverseEvent", + "value": "AdverseEvent", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "AllergyIntolerance", + "value": "AllergyIntolerance", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "Appointment", + "value": "Appointment", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "AppointmentResponse", + "value": "AppointmentResponse", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "AuditEvent", + "value": "AuditEvent", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "Basic", + "value": "Basic", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "Binary", + "value": "Binary", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "BiologicallyDerivedProduct", + "value": "BiologicallyDerivedProduct", + "description": "The FHIR resource type defined in R4." + }, + { + "name": "BodySite", + "value": "BodySite", + "description": "The FHIR resource type defined in STU3." + }, + { + "name": "BodyStructure", + "value": "BodyStructure", + "description": "The FHIR resource type defined in R4." + }, + { + "name": "Bundle", + "value": "Bundle", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "CapabilityStatement", + "value": "CapabilityStatement", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "CarePlan", + "value": "CarePlan", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "CareTeam", + "value": "CareTeam", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "CatalogEntry", + "value": "CatalogEntry", + "description": "The FHIR resource type defined in R4." + }, + { + "name": "ChargeItem", + "value": "ChargeItem", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "ChargeItemDefinition", + "value": "ChargeItemDefinition", + "description": "The FHIR resource type defined in R4." + }, + { + "name": "Claim", + "value": "Claim", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "ClaimResponse", + "value": "ClaimResponse", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "ClinicalImpression", + "value": "ClinicalImpression", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "CodeSystem", + "value": "CodeSystem", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "Communication", + "value": "Communication", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "CommunicationRequest", + "value": "CommunicationRequest", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "CompartmentDefinition", + "value": "CompartmentDefinition", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "Composition", + "value": "Composition", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "ConceptMap", + "value": "ConceptMap", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "Condition", + "value": "Condition", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "Consent", + "value": "Consent", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "Contract", + "value": "Contract", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "Coverage", + "value": "Coverage", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "CoverageEligibilityRequest", + "value": "CoverageEligibilityRequest", + "description": "The FHIR resource type defined in R4." + }, + { + "name": "CoverageEligibilityResponse", + "value": "CoverageEligibilityResponse", + "description": "The FHIR resource type defined in R4." + }, + { + "name": "DataElement", + "value": "DataElement", + "description": "The FHIR resource type defined in STU3." + }, + { + "name": "DetectedIssue", + "value": "DetectedIssue", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "Device", + "value": "Device", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "DeviceComponent", + "value": "DeviceComponent", + "description": "The FHIR resource type defined in STU3." + }, + { + "name": "DeviceDefinition", + "value": "DeviceDefinition", + "description": "The FHIR resource type defined in R4." + }, + { + "name": "DeviceMetric", + "value": "DeviceMetric", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "DeviceRequest", + "value": "DeviceRequest", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "DeviceUseStatement", + "value": "DeviceUseStatement", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "DiagnosticReport", + "value": "DiagnosticReport", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "DocumentManifest", + "value": "DocumentManifest", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "DocumentReference", + "value": "DocumentReference", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "DomainResource", + "value": "DomainResource", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "EffectEvidenceSynthesis", + "value": "EffectEvidenceSynthesis", + "description": "The FHIR resource type defined in R4." + }, + { + "name": "EligibilityRequest", + "value": "EligibilityRequest", + "description": "The FHIR resource type defined in STU3." + }, + { + "name": "EligibilityResponse", + "value": "EligibilityResponse", + "description": "The FHIR resource type defined in STU3." + }, + { + "name": "Encounter", + "value": "Encounter", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "Endpoint", + "value": "Endpoint", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "EnrollmentRequest", + "value": "EnrollmentRequest", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "EnrollmentResponse", + "value": "EnrollmentResponse", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "EpisodeOfCare", + "value": "EpisodeOfCare", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "EventDefinition", + "value": "EventDefinition", + "description": "The FHIR resource type defined in R4." + }, + { + "name": "Evidence", + "value": "Evidence", + "description": "The FHIR resource type defined in R4." + }, + { + "name": "EvidenceVariable", + "value": "EvidenceVariable", + "description": "The FHIR resource type defined in R4." + }, + { + "name": "ExampleScenario", + "value": "ExampleScenario", + "description": "The FHIR resource type defined in R4." + }, + { + "name": "ExpansionProfile", + "value": "ExpansionProfile", + "description": "The FHIR resource type defined in STU3." + }, + { + "name": "ExplanationOfBenefit", + "value": "ExplanationOfBenefit", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "FamilyMemberHistory", + "value": "FamilyMemberHistory", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "Flag", + "value": "Flag", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "Goal", + "value": "Goal", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "GraphDefinition", + "value": "GraphDefinition", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "Group", + "value": "Group", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "GuidanceResponse", + "value": "GuidanceResponse", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "HealthcareService", + "value": "HealthcareService", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "ImagingManifest", + "value": "ImagingManifest", + "description": "The FHIR resource type defined in STU3." + }, + { + "name": "ImagingStudy", + "value": "ImagingStudy", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "Immunization", + "value": "Immunization", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "ImmunizationEvaluation", + "value": "ImmunizationEvaluation", + "description": "The FHIR resource type defined in R4." + }, + { + "name": "ImmunizationRecommendation", + "value": "ImmunizationRecommendation", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "ImplementationGuide", + "value": "ImplementationGuide", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "InsurancePlan", + "value": "InsurancePlan", + "description": "The FHIR resource type defined in R4." + }, + { + "name": "Invoice", + "value": "Invoice", + "description": "The FHIR resource type defined in R4." + }, + { + "name": "Library", + "value": "Library", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "Linkage", + "value": "Linkage", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "List", + "value": "List", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "Location", + "value": "Location", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "Measure", + "value": "Measure", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "MeasureReport", + "value": "MeasureReport", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "Media", + "value": "Media", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "Medication", + "value": "Medication", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "MedicationAdministration", + "value": "MedicationAdministration", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "MedicationDispense", + "value": "MedicationDispense", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "MedicationKnowledge", + "value": "MedicationKnowledge", + "description": "The FHIR resource type defined in R4." + }, + { + "name": "MedicationRequest", + "value": "MedicationRequest", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "MedicationStatement", + "value": "MedicationStatement", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "MedicinalProduct", + "value": "MedicinalProduct", + "description": "The FHIR resource type defined in R4." + }, + { + "name": "MedicinalProductAuthorization", + "value": "MedicinalProductAuthorization", + "description": "The FHIR resource type defined in R4." + }, + { + "name": "MedicinalProductContraindication", + "value": "MedicinalProductContraindication", + "description": "The FHIR resource type defined in R4." + }, + { + "name": "MedicinalProductIndication", + "value": "MedicinalProductIndication", + "description": "The FHIR resource type defined in R4." + }, + { + "name": "MedicinalProductIngredient", + "value": "MedicinalProductIngredient", + "description": "The FHIR resource type defined in R4." + }, + { + "name": "MedicinalProductInteraction", + "value": "MedicinalProductInteraction", + "description": "The FHIR resource type defined in R4." + }, + { + "name": "MedicinalProductManufactured", + "value": "MedicinalProductManufactured", + "description": "The FHIR resource type defined in R4." + }, + { + "name": "MedicinalProductPackaged", + "value": "MedicinalProductPackaged", + "description": "The FHIR resource type defined in R4." + }, + { + "name": "MedicinalProductPharmaceutical", + "value": "MedicinalProductPharmaceutical", + "description": "The FHIR resource type defined in R4." + }, + { + "name": "MedicinalProductUndesirableEffect", + "value": "MedicinalProductUndesirableEffect", + "description": "The FHIR resource type defined in R4." + }, + { + "name": "MessageDefinition", + "value": "MessageDefinition", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "MessageHeader", + "value": "MessageHeader", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "MolecularSequence", + "value": "MolecularSequence", + "description": "The FHIR resource type defined in R4." + }, + { + "name": "NamingSystem", + "value": "NamingSystem", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "NutritionOrder", + "value": "NutritionOrder", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "Observation", + "value": "Observation", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "ObservationDefinition", + "value": "ObservationDefinition", + "description": "The FHIR resource type defined in R4." + }, + { + "name": "OperationDefinition", + "value": "OperationDefinition", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "OperationOutcome", + "value": "OperationOutcome", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "Organization", + "value": "Organization", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "OrganizationAffiliation", + "value": "OrganizationAffiliation", + "description": "The FHIR resource type defined in R4." + }, + { + "name": "Parameters", + "value": "Parameters", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "Patient", + "value": "Patient", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "PaymentNotice", + "value": "PaymentNotice", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "PaymentReconciliation", + "value": "PaymentReconciliation", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "Person", + "value": "Person", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "PlanDefinition", + "value": "PlanDefinition", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "Practitioner", + "value": "Practitioner", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "PractitionerRole", + "value": "PractitionerRole", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "Procedure", + "value": "Procedure", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "ProcedureRequest", + "value": "ProcedureRequest", + "description": "The FHIR resource type defined in STU3." + }, + { + "name": "ProcessRequest", + "value": "ProcessRequest", + "description": "The FHIR resource type defined in STU3." + }, + { + "name": "ProcessResponse", + "value": "ProcessResponse", + "description": "The FHIR resource type defined in STU3." + }, + { + "name": "Provenance", + "value": "Provenance", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "Questionnaire", + "value": "Questionnaire", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "QuestionnaireResponse", + "value": "QuestionnaireResponse", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "ReferralRequest", + "value": "ReferralRequest", + "description": "The FHIR resource type defined in STU3." + }, + { + "name": "RelatedPerson", + "value": "RelatedPerson", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "RequestGroup", + "value": "RequestGroup", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "ResearchDefinition", + "value": "ResearchDefinition", + "description": "The FHIR resource type defined in R4." + }, + { + "name": "ResearchElementDefinition", + "value": "ResearchElementDefinition", + "description": "The FHIR resource type defined in R4." + }, + { + "name": "ResearchStudy", + "value": "ResearchStudy", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "ResearchSubject", + "value": "ResearchSubject", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "Resource", + "value": "Resource", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "RiskAssessment", + "value": "RiskAssessment", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "RiskEvidenceSynthesis", + "value": "RiskEvidenceSynthesis", + "description": "The FHIR resource type defined in R4." + }, + { + "name": "Schedule", + "value": "Schedule", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "SearchParameter", + "value": "SearchParameter", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "Sequence", + "value": "Sequence", + "description": "The FHIR resource type defined in STU3." + }, + { + "name": "ServiceDefinition", + "value": "ServiceDefinition", + "description": "The FHIR resource type defined in STU3." + }, + { + "name": "ServiceRequest", + "value": "ServiceRequest", + "description": "The FHIR resource type defined in R4." + }, + { + "name": "Slot", + "value": "Slot", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "Specimen", + "value": "Specimen", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "SpecimenDefinition", + "value": "SpecimenDefinition", + "description": "The FHIR resource type defined in R4." + }, + { + "name": "StructureDefinition", + "value": "StructureDefinition", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "StructureMap", + "value": "StructureMap", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "Subscription", + "value": "Subscription", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "Substance", + "value": "Substance", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "SubstanceNucleicAcid", + "value": "SubstanceNucleicAcid", + "description": "The FHIR resource type defined in R4." + }, + { + "name": "SubstancePolymer", + "value": "SubstancePolymer", + "description": "The FHIR resource type defined in R4." + }, + { + "name": "SubstanceProtein", + "value": "SubstanceProtein", + "description": "The FHIR resource type defined in R4." + }, + { + "name": "SubstanceReferenceInformation", + "value": "SubstanceReferenceInformation", + "description": "The FHIR resource type defined in R4." + }, + { + "name": "SubstanceSourceMaterial", + "value": "SubstanceSourceMaterial", + "description": "The FHIR resource type defined in R4." + }, + { + "name": "SubstanceSpecification", + "value": "SubstanceSpecification", + "description": "The FHIR resource type defined in R4." + }, + { + "name": "SupplyDelivery", + "value": "SupplyDelivery", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "SupplyRequest", + "value": "SupplyRequest", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "Task", + "value": "Task", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "TerminologyCapabilities", + "value": "TerminologyCapabilities", + "description": "The FHIR resource type defined in R4." + }, + { + "name": "TestReport", + "value": "TestReport", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "TestScript", + "value": "TestScript", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "ValueSet", + "value": "ValueSet", + "description": "The FHIR resource type defined in STU3 and R4." + }, + { + "name": "VerificationResult", + "value": "VerificationResult", + "description": "The FHIR resource type defined in R4." + }, + { + "name": "VisionPrescription", + "value": "VisionPrescription", + "description": "The FHIR resource type defined in STU3 and R4." + } + ] + } + }, + "HealthcareFhirResourceUpdatedEventData": { + "type": "object", + "properties": { + "resourceFhirAccount": { + "type": "string", + "description": "Domain name of FHIR account for this resource." + }, + "resourceFhirId": { + "type": "string", + "description": "Id of HL7 FHIR resource." + }, + "resourceVersionId": { + "type": "integer", + "format": "int64", + "description": "VersionId of HL7 FHIR resource. It changes when the resource is created, updated, or deleted(soft-deletion)." + }, + "resourceType": { + "$ref": "#/definitions/HealthcareFhirResourceType", + "description": "Type of HL7 FHIR resource." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.FhirResourceUpdated event." + } + }, + "parameters": {} +} diff --git a/specification/eventgrid/data-plane/cadl/swagger/IotHub.json b/specification/eventgrid/data-plane/cadl/swagger/IotHub.json new file mode 100644 index 000000000000..f142411cf7ba --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/swagger/IotHub.json @@ -0,0 +1,256 @@ +{ + "swagger": "2.0", + "info": { + "title": "Schema of Azure IoT Hub events published to Azure Event Grid", + "version": "2018-01-01", + "description": "Describes the schema of the Azure IoT Hub events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.", + "x-cadl-generated": [ + { + "emitter": "@azure-tools/cadl-autorest" + } + ] + }, + "schemes": [ + "https" + ], + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "tags": [], + "paths": {}, + "definitions": { + "DeviceConnectionStateEventInfo": { + "type": "object", + "properties": { + "sequenceNumber": { + "type": "string", + "description": "Sequence number is string representation of a hexadecimal number. string compare can be used to identify the larger number because both in ASCII and HEX numbers come after alphabets. If you are converting the string to hex, then the number is a 256 bit number." + } + }, + "description": "Information about the device connection state event." + }, + "DeviceConnectionStateEventProperties": { + "type": "object", + "properties": { + "deviceId": { + "type": "string", + "description": "The unique identifier of the device. This case-sensitive string can be up to 128 characters long, and supports ASCII 7-bit alphanumeric characters plus the following special characters: - : . + % _ # * ? ! ( ) , = @ ; $ '." + }, + "moduleId": { + "type": "string", + "description": "The unique identifier of the module. This case-sensitive string can be up to 128 characters long, and supports ASCII 7-bit alphanumeric characters plus the following special characters: - : . + % _ # * ? ! ( ) , = @ ; $ '." + }, + "hubName": { + "type": "string", + "description": "Name of the IoT Hub where the device was created or deleted." + }, + "deviceConnectionStateEventInfo": { + "$ref": "#/definitions/DeviceConnectionStateEventInfo", + "description": "Information about the device connection state event." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a device connection state event (DeviceConnected, DeviceDisconnected)." + }, + "DeviceLifeCycleEventProperties": { + "type": "object", + "properties": { + "deviceId": { + "type": "string", + "description": "The unique identifier of the device. This case-sensitive string can be up to 128 characters long, and supports ASCII 7-bit alphanumeric characters plus the following special characters: - : . + % _ # * ? ! ( ) , = @ ; $ '." + }, + "hubName": { + "type": "string", + "description": "Name of the IoT Hub where the device was created or deleted." + }, + "twin": { + "$ref": "#/definitions/DeviceTwinInfo", + "description": "Information about the device twin, which is the cloud representation of application device metadata." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a device life cycle event (DeviceCreated, DeviceDeleted)." + }, + "DeviceTelemetryEventProperties": { + "type": "object", + "properties": { + "body": { + "$ref": "#/definitions/object", + "description": "The content of the message from the device." + }, + "properties": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-cadl-name": "Record", + "description": "Application properties are user-defined strings that can be added to the message. These fields are optional." + }, + "systemProperties": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-cadl-name": "Record", + "description": "System properties help identify contents and source of the messages." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a device telemetry event (DeviceTelemetry)." + }, + "DeviceTwinInfo": { + "type": "object", + "properties": { + "authenticationType": { + "type": "string", + "description": "Authentication type used for this device: either SAS, SelfSigned, or CertificateAuthority." + }, + "cloudToDeviceMessageCount": { + "description": "Count of cloud to device messages sent to this device." + }, + "connectionState": { + "type": "string", + "description": "Whether the device is connected or disconnected." + }, + "deviceId": { + "type": "string", + "description": "The unique identifier of the device twin." + }, + "etag": { + "type": "string", + "description": "A piece of information that describes the content of the device twin. Each etag is guaranteed to be unique per device twin." + }, + "lastActivityTime": { + "type": "string", + "description": "The ISO8601 timestamp of the last activity." + }, + "properties": { + "$ref": "#/definitions/PropertiesJson", + "description": "Properties JSON element." + }, + "status": { + "type": "string", + "description": "Whether the device twin is enabled or disabled." + }, + "statusUpdateTime": { + "type": "string", + "description": "The ISO8601 timestamp of the last device twin status update." + }, + "version": { + "description": "An integer that is incremented by one each time the device twin is updated." + }, + "x509Thumbprint": { + "$ref": "#/definitions/ThumbPrintValue", + "description": "The thumbprint is a unique value for the x509 certificate, commonly used to find a particular certificate in a certificate store. The thumbprint is dynamically generated using the SHA1 algorithm, and does not physically exist in the certificate." + } + }, + "description": "Information about the device twin, which is the cloud representation of application device metadata." + }, + "DeviceTwinMetadata": { + "type": "object", + "properties": { + "lastUpdated": { + "type": "string", + "description": "The ISO8601 timestamp of the last time the properties were updated." + } + }, + "description": "Metadata information for the properties JSON document." + }, + "DeviceTwinProperties": { + "type": "object", + "properties": { + "metadata": { + "$ref": "#/definitions/DeviceTwinMetadata", + "description": "Metadata information for the properties JSON document." + }, + "version": { + "type": "number", + "format": "double", + "description": "Version of device twin properties." + } + }, + "description": "A portion of the properties that can be written only by the application back-end, and read by the device." + }, + "IotHubDeviceConnectedEventData": { + "type": "object", + "properties": {}, + "description": "Event data for Microsoft.Devices.DeviceConnected event.", + "allOf": [ + { + "$ref": "#/definitions/DeviceConnectionStateEventProperties" + } + ] + }, + "IotHubDeviceCreatedEventData": { + "type": "object", + "properties": {}, + "description": "Event data for Microsoft.Devices.DeviceCreated event.", + "allOf": [ + { + "$ref": "#/definitions/DeviceLifeCycleEventProperties" + } + ] + }, + "IotHubDeviceDeletedEventData": { + "type": "object", + "properties": {}, + "description": "Event data for Microsoft.Devices.DeviceDeleted event.", + "allOf": [ + { + "$ref": "#/definitions/DeviceLifeCycleEventProperties" + } + ] + }, + "IotHubDeviceDisconnectedEventData": { + "type": "object", + "properties": {}, + "description": "Event data for Microsoft.Devices.DeviceDisconnected event.", + "allOf": [ + { + "$ref": "#/definitions/DeviceConnectionStateEventProperties" + } + ] + }, + "IotHubDeviceTelemetryEventData": { + "type": "object", + "properties": {}, + "description": "Event data for Microsoft.Devices.DeviceTelemetry event.", + "allOf": [ + { + "$ref": "#/definitions/DeviceTelemetryEventProperties" + } + ] + }, + "PropertiesJson": { + "type": "object", + "properties": { + "desired": { + "$ref": "#/definitions/DeviceTwinProperties", + "description": "A portion of the properties that can be written only by the application back-end, and read by the device." + }, + "reported": { + "$ref": "#/definitions/DeviceTwinProperties", + "description": "A portion of the properties that can be written only by the device, and read by the application back-end." + } + } + }, + "ThumbPrintValue": { + "type": "object", + "properties": { + "primaryThumbprint": { + "type": "string", + "description": "Primary thumbprint for the x509 certificate." + }, + "secondaryThumbprint": { + "type": "string", + "description": "Secondary thumbprint for the x509 certificate." + } + } + }, + "object": { + "type": "object", + "properties": {} + } + }, + "parameters": {} +} diff --git a/specification/eventgrid/data-plane/cadl/swagger/KeyVault.json b/specification/eventgrid/data-plane/cadl/swagger/KeyVault.json new file mode 100644 index 000000000000..b41d146bb2b6 --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/swagger/KeyVault.json @@ -0,0 +1,387 @@ +{ + "swagger": "2.0", + "info": { + "title": "Schema of Azure Key Vault events published to Azure Event Grid", + "version": "2018-01-01", + "description": "Describes the schema of the Azure Key Vault events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.", + "x-cadl-generated": [ + { + "emitter": "@azure-tools/cadl-autorest" + } + ] + }, + "schemes": [ + "https" + ], + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "tags": [], + "paths": {}, + "definitions": { + "KeyVaultCertificateExpiredEventData": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "The id of the object that triggered this event." + }, + "VaultName": { + "type": "string", + "description": "Key vault name of the object that triggered this event." + }, + "ObjectType": { + "type": "string", + "description": "The type of the object that triggered this event" + }, + "ObjectName": { + "type": "string", + "description": "The name of the object that triggered this event" + }, + "Version": { + "type": "string", + "description": "The version of the object that triggered this event" + }, + "NBF": { + "type": "number", + "format": "double", + "description": "Not before date of the object that triggered this event" + }, + "EXP": { + "type": "number", + "format": "double", + "description": "The expiration date of the object that triggered this event" + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.CertificateExpired event." + }, + "KeyVaultCertificateNearExpiryEventData": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "The id of the object that triggered this event." + }, + "VaultName": { + "type": "string", + "description": "Key vault name of the object that triggered this event." + }, + "ObjectType": { + "type": "string", + "description": "The type of the object that triggered this event" + }, + "ObjectName": { + "type": "string", + "description": "The name of the object that triggered this event" + }, + "Version": { + "type": "string", + "description": "The version of the object that triggered this event" + }, + "NBF": { + "type": "number", + "format": "double", + "description": "Not before date of the object that triggered this event" + }, + "EXP": { + "type": "number", + "format": "double", + "description": "The expiration date of the object that triggered this event" + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.CertificateNearExpiry event." + }, + "KeyVaultCertificateNewVersionCreatedEventData": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "The id of the object that triggered this event." + }, + "VaultName": { + "type": "string", + "description": "Key vault name of the object that triggered this event." + }, + "ObjectType": { + "type": "string", + "description": "The type of the object that triggered this event" + }, + "ObjectName": { + "type": "string", + "description": "The name of the object that triggered this event" + }, + "Version": { + "type": "string", + "description": "The version of the object that triggered this event" + }, + "NBF": { + "type": "number", + "format": "double", + "description": "Not before date of the object that triggered this event" + }, + "EXP": { + "type": "number", + "format": "double", + "description": "The expiration date of the object that triggered this event" + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.CertificateNewVersionCreated event." + }, + "KeyVaultKeyExpiredEventData": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "The id of the object that triggered this event." + }, + "VaultName": { + "type": "string", + "description": "Key vault name of the object that triggered this event." + }, + "ObjectType": { + "type": "string", + "description": "The type of the object that triggered this event" + }, + "ObjectName": { + "type": "string", + "description": "The name of the object that triggered this event" + }, + "Version": { + "type": "string", + "description": "The version of the object that triggered this event" + }, + "NBF": { + "type": "number", + "format": "double", + "description": "Not before date of the object that triggered this event" + }, + "EXP": { + "type": "number", + "format": "double", + "description": "The expiration date of the object that triggered this event" + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.KeyExpired event." + }, + "KeyVaultKeyNearExpiryEventData": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "The id of the object that triggered this event." + }, + "VaultName": { + "type": "string", + "description": "Key vault name of the object that triggered this event." + }, + "ObjectType": { + "type": "string", + "description": "The type of the object that triggered this event" + }, + "ObjectName": { + "type": "string", + "description": "The name of the object that triggered this event" + }, + "Version": { + "type": "string", + "description": "The version of the object that triggered this event" + }, + "NBF": { + "type": "number", + "format": "double", + "description": "Not before date of the object that triggered this event" + }, + "EXP": { + "type": "number", + "format": "double", + "description": "The expiration date of the object that triggered this event" + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.KeyNearExpiry event." + }, + "KeyVaultKeyNewVersionCreatedEventData": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "The id of the object that triggered this event." + }, + "VaultName": { + "type": "string", + "description": "Key vault name of the object that triggered this event." + }, + "ObjectType": { + "type": "string", + "description": "The type of the object that triggered this event" + }, + "ObjectName": { + "type": "string", + "description": "The name of the object that triggered this event" + }, + "Version": { + "type": "string", + "description": "The version of the object that triggered this event" + }, + "NBF": { + "type": "number", + "format": "double", + "description": "Not before date of the object that triggered this event" + }, + "EXP": { + "type": "number", + "format": "double", + "description": "The expiration date of the object that triggered this event" + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.KeyNewVersionCreated event." + }, + "KeyVaultSecretExpiredEventData": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "The id of the object that triggered this event." + }, + "VaultName": { + "type": "string", + "description": "Key vault name of the object that triggered this event." + }, + "ObjectType": { + "type": "string", + "description": "The type of the object that triggered this event" + }, + "ObjectName": { + "type": "string", + "description": "The name of the object that triggered this event" + }, + "Version": { + "type": "string", + "description": "The version of the object that triggered this event" + }, + "NBF": { + "type": "number", + "format": "double", + "description": "Not before date of the object that triggered this event" + }, + "EXP": { + "type": "number", + "format": "double", + "description": "The expiration date of the object that triggered this event" + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.SecretExpired event." + }, + "KeyVaultSecretNearExpiryEventData": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "The id of the object that triggered this event." + }, + "VaultName": { + "type": "string", + "description": "Key vault name of the object that triggered this event." + }, + "ObjectType": { + "type": "string", + "description": "The type of the object that triggered this event" + }, + "ObjectName": { + "type": "string", + "description": "The name of the object that triggered this event" + }, + "Version": { + "type": "string", + "description": "The version of the object that triggered this event" + }, + "NBF": { + "type": "number", + "format": "double", + "description": "Not before date of the object that triggered this event" + }, + "EXP": { + "type": "number", + "format": "double", + "description": "The expiration date of the object that triggered this event" + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.SecretNearExpiry event." + }, + "KeyVaultSecretNewVersionCreatedEventData": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "The id of the object that triggered this event." + }, + "VaultName": { + "type": "string", + "description": "Key vault name of the object that triggered this event." + }, + "ObjectType": { + "type": "string", + "description": "The type of the object that triggered this event" + }, + "ObjectName": { + "type": "string", + "description": "The name of the object that triggered this event" + }, + "Version": { + "type": "string", + "description": "The version of the object that triggered this event" + }, + "NBF": { + "type": "number", + "format": "double", + "description": "Not before date of the object that triggered this event" + }, + "EXP": { + "type": "number", + "format": "double", + "description": "The expiration date of the object that triggered this event" + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.SecretNewVersionCreated event." + }, + "KeyVaultVaultAccessPolicyChangedEventData": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "description": "The id of the object that triggered this event." + }, + "VaultName": { + "type": "string", + "description": "Key vault name of the object that triggered this event." + }, + "ObjectType": { + "type": "string", + "description": "The type of the object that triggered this event" + }, + "ObjectName": { + "type": "string", + "description": "The name of the object that triggered this event" + }, + "Version": { + "type": "string", + "description": "The version of the object that triggered this event" + }, + "NBF": { + "type": "number", + "format": "double", + "description": "Not before date of the object that triggered this event" + }, + "EXP": { + "type": "number", + "format": "double", + "description": "The expiration date of the object that triggered this event" + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.VaultAccessPolicyChanged event." + } + }, + "parameters": {} +} diff --git a/specification/eventgrid/data-plane/cadl/swagger/MachineLearningServices.json b/specification/eventgrid/data-plane/cadl/swagger/MachineLearningServices.json new file mode 100644 index 000000000000..eccd0282d043 --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/swagger/MachineLearningServices.json @@ -0,0 +1,212 @@ +{ + "swagger": "2.0", + "info": { + "title": "Schema of Azure Machine Learning Services events published to Azure Event Grid", + "version": "2018-01-01", + "description": "Describes the schema of the Azure Machine Learning Services events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.", + "x-cadl-generated": [ + { + "emitter": "@azure-tools/cadl-autorest" + } + ] + }, + "schemes": [ + "https" + ], + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "tags": [], + "paths": {}, + "definitions": { + "MachineLearningServicesDatasetDriftDetectedEventData": { + "type": "object", + "properties": { + "dataDriftId": { + "type": "string", + "description": "The ID of the data drift monitor that triggered the event." + }, + "dataDriftName": { + "type": "string", + "description": "The name of the data drift monitor that triggered the event." + }, + "runId": { + "type": "string", + "description": "The ID of the Run that detected data drift." + }, + "baseDatasetId": { + "type": "string", + "description": "The ID of the base Dataset used to detect drift." + }, + "targetDatasetId": { + "type": "string", + "description": "The ID of the target Dataset used to detect drift." + }, + "driftCoefficient": { + "type": "number", + "format": "double", + "description": "The coefficient result that triggered the event." + }, + "startTime": { + "type": "string", + "format": "date-time", + "description": "The start time of the target dataset time series that resulted in drift detection." + }, + "endTime": { + "type": "string", + "format": "date-time", + "description": "The end time of the target dataset time series that resulted in drift detection." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.MachineLearningServices.DatasetDriftDetected event." + }, + "MachineLearningServicesModelDeployedEventData": { + "type": "object", + "properties": { + "serviceName": { + "type": "string", + "description": "The name of the deployed service." + }, + "serviceComputeType": { + "type": "string", + "description": "The compute type (e.g. ACI, AKS) of the deployed service." + }, + "modelIds": { + "type": "string", + "description": "A common separated list of model IDs. The IDs of the models deployed in the service." + }, + "serviceTags": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-cadl-name": "Record", + "description": "The tags of the deployed service." + }, + "serviceProperties": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-cadl-name": "Record", + "description": "The properties of the deployed service." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.MachineLearningServices.ModelDeployed event." + }, + "MachineLearningServicesModelRegisteredEventData": { + "type": "object", + "properties": { + "modelName": { + "type": "string", + "description": "The name of the model that was registered." + }, + "modelVersion": { + "type": "string", + "description": "The version of the model that was registered." + }, + "modelTags": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-cadl-name": "Record", + "description": "The tags of the model that was registered." + }, + "modelProperties": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-cadl-name": "Record", + "description": "The properties of the model that was registered." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.MachineLearningServices.ModelRegistered event." + }, + "MachineLearningServicesRunCompletedEventData": { + "type": "object", + "properties": { + "experimentId": { + "type": "string", + "description": "The ID of the experiment that the run belongs to." + }, + "experimentName": { + "type": "string", + "description": "The name of the experiment that the run belongs to." + }, + "runId": { + "type": "string", + "description": "The ID of the Run that was completed." + }, + "runType": { + "type": "string", + "description": "The Run Type of the completed Run." + }, + "runTags": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-cadl-name": "Record", + "description": "The tags of the completed Run." + }, + "runProperties": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-cadl-name": "Record", + "description": "The properties of the completed Run." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.MachineLearningServices.RunCompleted event." + }, + "MachineLearningServicesRunStatusChangedEventData": { + "type": "object", + "properties": { + "experimentId": { + "type": "string", + "description": "The ID of the experiment that the Machine Learning Run belongs to." + }, + "experimentName": { + "type": "string", + "description": "The name of the experiment that the Machine Learning Run belongs to." + }, + "runId": { + "type": "string", + "description": "The ID of the Machine Learning Run." + }, + "runType": { + "type": "string", + "description": "The Run Type of the Machine Learning Run." + }, + "runTags": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-cadl-name": "Record", + "description": "The tags of the Machine Learning Run." + }, + "runProperties": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-cadl-name": "Record", + "description": "The properties of the Machine Learning Run." + }, + "runStatus": { + "type": "string", + "description": "The status of the Machine Learning Run." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.MachineLearningServices.RunStatusChanged event." + } + }, + "parameters": {} +} diff --git a/specification/eventgrid/data-plane/cadl/swagger/Maps.json b/specification/eventgrid/data-plane/cadl/swagger/Maps.json new file mode 100644 index 000000000000..3b829de37d9d --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/swagger/Maps.json @@ -0,0 +1,125 @@ +{ + "swagger": "2.0", + "info": { + "title": "Schema of Azure Maps events published to Azure Event Grid", + "version": "2018-01-01", + "description": "Describes the schema of the Azure Maps events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.", + "x-cadl-generated": [ + { + "emitter": "@azure-tools/cadl-autorest" + } + ] + }, + "schemes": [ + "https" + ], + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "tags": [], + "paths": {}, + "definitions": { + "MapsGeofenceEnteredEventData": { + "type": "object", + "properties": {}, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Maps.GeofenceEntered event.", + "allOf": [ + { + "$ref": "#/definitions/MapsGeofenceEventProperties" + } + ] + }, + "MapsGeofenceEventProperties": { + "type": "object", + "properties": { + "expiredGeofenceGeometryId": { + "type": "array", + "items": { + "type": "string" + }, + "x-cadl-name": "string[]", + "description": "Lists of the geometry ID of the geofence which is expired relative to the user time in the request." + }, + "geometries": { + "type": "array", + "items": { + "$ref": "#/definitions/MapsGeofenceGeometry" + }, + "x-ms-identifiers": [], + "x-cadl-name": "MapsGeofenceGeometry[]", + "description": "Lists the fence geometries that either fully contain the coordinate position or have an overlap with the searchBuffer around the fence." + }, + "invalidPeriodGeofenceGeometryId": { + "type": "array", + "items": { + "type": "string" + }, + "x-cadl-name": "string[]", + "description": "Lists of the geometry ID of the geofence which is in invalid period relative to the user time in the request." + }, + "isEventPublished": { + "type": "boolean", + "description": "True if at least one event is published to the Azure Maps event subscriber, false if no event is published to the Azure Maps event subscriber." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Geofence event (GeofenceEntered, GeofenceExited, GeofenceResult)." + }, + "MapsGeofenceExitedEventData": { + "type": "object", + "properties": {}, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Maps.GeofenceExited event.", + "allOf": [ + { + "$ref": "#/definitions/MapsGeofenceEventProperties" + } + ] + }, + "MapsGeofenceGeometry": { + "type": "object", + "properties": { + "deviceId": { + "type": "string", + "description": "ID of the device." + }, + "distance": { + "type": "number", + "format": "double", + "description": "Distance from the coordinate to the closest border of the geofence. Positive means the coordinate is outside of the geofence. If the coordinate is outside of the geofence, but more than the value of searchBuffer away from the closest geofence border, then the value is 999. Negative means the coordinate is inside of the geofence. If the coordinate is inside the polygon, but more than the value of searchBuffer away from the closest geofencing border,then the value is -999. A value of 999 means that there is great confidence the coordinate is well outside the geofence. A value of -999 means that there is great confidence the coordinate is well within the geofence." + }, + "geometryId": { + "type": "string", + "description": "The unique ID for the geofence geometry." + }, + "nearestLat": { + "type": "number", + "format": "double", + "description": "Latitude of the nearest point of the geometry." + }, + "nearestLon": { + "type": "number", + "format": "double", + "description": "Longitude of the nearest point of the geometry." + }, + "udId": { + "type": "string", + "description": "The unique id returned from user upload service when uploading a geofence. Will not be included in geofencing post API." + } + }, + "description": "The geofence geometry." + }, + "MapsGeofenceResultEventData": { + "type": "object", + "properties": {}, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Maps.GeofenceResult event.", + "allOf": [ + { + "$ref": "#/definitions/MapsGeofenceEventProperties" + } + ] + } + }, + "parameters": {} +} diff --git a/specification/eventgrid/data-plane/cadl/swagger/MediaServices.json b/specification/eventgrid/data-plane/cadl/swagger/MediaServices.json new file mode 100644 index 000000000000..706b51101c01 --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/swagger/MediaServices.json @@ -0,0 +1,980 @@ +{ + "swagger": "2.0", + "info": { + "title": "Schema of Azure Media Services events published to Azure Event Grid", + "version": "2018-01-01", + "description": "Describes the schema of the Azure Media Services events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.", + "x-cadl-generated": [ + { + "emitter": "@azure-tools/cadl-autorest" + } + ] + }, + "schemes": [ + "https" + ], + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "tags": [], + "paths": {}, + "definitions": { + "MediaJobCanceledEventData": { + "type": "object", + "properties": { + "#Microsoft.Media.JobCanceled": { + "type": "string", + "description": "Discriminator property for MediaJobCanceledEventData." + }, + "outputs": { + "type": "array", + "items": { + "$ref": "#/definitions/MediaJobOutput" + }, + "x-ms-identifiers": [], + "x-cadl-name": "MediaJobOutput[]", + "description": "Gets the Job outputs." + } + }, + "description": "Job canceled event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobCanceled event.", + "discriminator": "#Microsoft.Media.JobCanceled", + "required": [ + "#Microsoft.Media.JobCanceled" + ], + "allOf": [ + { + "$ref": "#/definitions/MediaJobStateChangeEventData" + } + ] + }, + "MediaJobCancelingEventData": { + "type": "object", + "properties": { + "#Microsoft.Media.JobCanceling": { + "type": "string", + "description": "Discriminator property for MediaJobCancelingEventData." + } + }, + "description": "Job canceling event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobCanceling event.", + "discriminator": "#Microsoft.Media.JobCanceling", + "required": [ + "#Microsoft.Media.JobCanceling" + ], + "allOf": [ + { + "$ref": "#/definitions/MediaJobStateChangeEventData" + } + ] + }, + "MediaJobError": { + "type": "object", + "properties": { + "code": { + "$ref": "#/definitions/MediaJobErrorCode", + "description": "Error code describing the error." + }, + "message": { + "type": "string", + "description": "A human-readable language-dependent representation of the error." + }, + "category": { + "$ref": "#/definitions/MediaJobErrorCategory", + "description": "Helps with categorization of errors." + }, + "retry": { + "$ref": "#/definitions/MediaJobRetry", + "description": "Indicates that it may be possible to retry the Job. If retry is unsuccessful, please contact Azure support via Azure Portal." + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/MediaJobErrorDetail" + }, + "x-ms-identifiers": [], + "x-cadl-name": "MediaJobErrorDetail[]", + "description": "An array of details about specific errors that led to this reported error." + } + }, + "description": "Details of JobOutput errors." + }, + "MediaJobErrorCategory": { + "type": "string", + "enum": [ + "Service", + "Download", + "Upload", + "Configuration", + "Content", + "Account" + ], + "x-ms-enum": { + "name": "MediaJobErrorCategory", + "modelAsString": true, + "values": [ + { + "name": "Service", + "value": "Service", + "description": "The error is service related." + }, + { + "name": "Download", + "value": "Download", + "description": "The error is download related." + }, + { + "name": "Upload", + "value": "Upload", + "description": "The error is upload related." + }, + { + "name": "Configuration", + "value": "Configuration", + "description": "The error is configuration related." + }, + { + "name": "Content", + "value": "Content", + "description": "The error is related to data in the input files." + }, + { + "name": "Account", + "value": "Account", + "description": "The error is related to account information." + } + ] + } + }, + "MediaJobErrorCode": { + "type": "string", + "enum": [ + "ServiceError", + "ServiceTransientError", + "DownloadNotAccessible", + "DownloadTransientError", + "UploadNotAccessible", + "UploadTransientError", + "ConfigurationUnsupported", + "ContentMalformed", + "ContentUnsupported", + "IdentityUnsupported" + ], + "x-ms-enum": { + "name": "MediaJobErrorCode", + "modelAsString": true, + "values": [ + { + "name": "ServiceError", + "value": "ServiceError", + "description": "Fatal service error, please contact support." + }, + { + "name": "ServiceTransientError", + "value": "ServiceTransientError", + "description": "Transient error, please retry, if retry is unsuccessful, please contact support." + }, + { + "name": "DownloadNotAccessible", + "value": "DownloadNotAccessible", + "description": "While trying to download the input files, the files were not accessible, please check the availability of the source." + }, + { + "name": "DownloadTransientError", + "value": "DownloadTransientError", + "description": "While trying to download the input files, there was an issue during transfer (storage service, network errors), see details and check your source." + }, + { + "name": "UploadNotAccessible", + "value": "UploadNotAccessible", + "description": "While trying to upload the output files, the destination was not reachable, please check the availability of the destination." + }, + { + "name": "UploadTransientError", + "value": "UploadTransientError", + "description": "While trying to upload the output files, there was an issue during transfer (storage service, network errors), see details and check your destination." + }, + { + "name": "ConfigurationUnsupported", + "value": "ConfigurationUnsupported", + "description": "There was a problem with the combination of input files and the configuration settings applied, fix the configuration settings and retry with the same input, or change input to match the configuration." + }, + { + "name": "ContentMalformed", + "value": "ContentMalformed", + "description": "There was a problem with the input content (for example: zero byte files, or corrupt/non-decodable files), check the input files." + }, + { + "name": "ContentUnsupported", + "value": "ContentUnsupported", + "description": "There was a problem with the format of the input (not valid media file, or an unsupported file/codec), check the validity of the input files." + }, + { + "name": "IdentityUnsupported", + "value": "IdentityUnsupported", + "description": "There is an error verifying to the account identity. Check and fix the identity configurations and retry. If unsuccessful, please contact support." + } + ] + } + }, + "MediaJobErrorDetail": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Code describing the error detail." + }, + "message": { + "type": "string", + "description": "A human-readable representation of the error." + } + }, + "description": "Details of JobOutput errors." + }, + "MediaJobErroredEventData": { + "type": "object", + "properties": { + "#Microsoft.Media.JobErrored": { + "type": "string", + "description": "Discriminator property for MediaJobErroredEventData." + }, + "outputs": { + "type": "array", + "items": { + "$ref": "#/definitions/MediaJobOutput" + }, + "x-ms-identifiers": [], + "x-cadl-name": "MediaJobOutput[]", + "description": "Gets the Job outputs." + } + }, + "description": "Job error state event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobErrored event.", + "discriminator": "#Microsoft.Media.JobErrored", + "required": [ + "#Microsoft.Media.JobErrored" + ], + "allOf": [ + { + "$ref": "#/definitions/MediaJobStateChangeEventData" + } + ] + }, + "MediaJobFinishedEventData": { + "type": "object", + "properties": { + "#Microsoft.Media.JobFinished": { + "type": "string", + "description": "Discriminator property for MediaJobFinishedEventData." + }, + "outputs": { + "type": "array", + "items": { + "$ref": "#/definitions/MediaJobOutput" + }, + "x-ms-identifiers": [], + "x-cadl-name": "MediaJobOutput[]", + "description": "Gets the Job outputs." + } + }, + "description": "Job finished event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobFinished event.", + "discriminator": "#Microsoft.Media.JobFinished", + "required": [ + "#Microsoft.Media.JobFinished" + ], + "allOf": [ + { + "$ref": "#/definitions/MediaJobStateChangeEventData" + } + ] + }, + "MediaJobOutput": { + "type": "object", + "properties": { + "@odata.type": { + "type": "string", + "description": "The discriminator for derived types.", + "x-ms-client-name": "OdataType" + }, + "error": { + "$ref": "#/definitions/MediaJobError", + "description": "Gets the Job output error." + }, + "label": { + "type": "string", + "description": "Gets the Job output label." + }, + "progress": { + "type": "integer", + "format": "int64", + "description": "Gets the Job output progress." + }, + "state": { + "$ref": "#/definitions/MediaJobState", + "description": "Gets the Job output state." + } + }, + "description": "The event data for a Job output.", + "discriminator": "@odata.type", + "required": [ + "@odata.type", + "progress", + "state" + ] + }, + "MediaJobOutputAsset": { + "type": "object", + "properties": { + "#Microsoft.Media.JobOutputAsset": { + "type": "string", + "description": "Discriminator property for MediaJobOutputAsset." + }, + "assetName": { + "type": "string", + "description": "Gets the Job output asset name." + } + }, + "description": "The event data for a Job output asset.", + "discriminator": "#Microsoft.Media.JobOutputAsset", + "required": [ + "#Microsoft.Media.JobOutputAsset" + ] + }, + "MediaJobOutputCanceledEventData": { + "type": "object", + "properties": { + "#Microsoft.Media.JobOutputCanceled": { + "type": "string", + "description": "Discriminator property for MediaJobOutputCanceledEventData." + } + }, + "description": "Job output canceled event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobOutputCanceled event.", + "discriminator": "#Microsoft.Media.JobOutputCanceled", + "required": [ + "#Microsoft.Media.JobOutputCanceled" + ], + "allOf": [ + { + "$ref": "#/definitions/MediaJobOutputStateChangeEventData" + } + ] + }, + "MediaJobOutputCancelingEventData": { + "type": "object", + "properties": { + "#Microsoft.Media.JobOutputCanceling": { + "type": "string", + "description": "Discriminator property for MediaJobOutputCancelingEventData." + } + }, + "description": "Job output canceling event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobOutputCanceling event.", + "discriminator": "#Microsoft.Media.JobOutputCanceling", + "required": [ + "#Microsoft.Media.JobOutputCanceling" + ], + "allOf": [ + { + "$ref": "#/definitions/MediaJobOutputStateChangeEventData" + } + ] + }, + "MediaJobOutputErroredEventData": { + "type": "object", + "properties": { + "#Microsoft.Media.JobOutputErrored": { + "type": "string", + "description": "Discriminator property for MediaJobOutputErroredEventData." + } + }, + "description": "Job output error event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobOutputErrored event.", + "discriminator": "#Microsoft.Media.JobOutputErrored", + "required": [ + "#Microsoft.Media.JobOutputErrored" + ], + "allOf": [ + { + "$ref": "#/definitions/MediaJobOutputStateChangeEventData" + } + ] + }, + "MediaJobOutputFinishedEventData": { + "type": "object", + "properties": { + "#Microsoft.Media.JobOutputFinished": { + "type": "string", + "description": "Discriminator property for MediaJobOutputFinishedEventData." + } + }, + "description": "Job output finished event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobOutputFinished event.", + "discriminator": "#Microsoft.Media.JobOutputFinished", + "required": [ + "#Microsoft.Media.JobOutputFinished" + ], + "allOf": [ + { + "$ref": "#/definitions/MediaJobOutputStateChangeEventData" + } + ] + }, + "MediaJobOutputProcessingEventData": { + "type": "object", + "properties": { + "#Microsoft.Media.JobOutputProcessing": { + "type": "string", + "description": "Discriminator property for MediaJobOutputProcessingEventData." + } + }, + "description": "Job output processing event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobOutputProcessing event.", + "discriminator": "#Microsoft.Media.JobOutputProcessing", + "required": [ + "#Microsoft.Media.JobOutputProcessing" + ], + "allOf": [ + { + "$ref": "#/definitions/MediaJobOutputStateChangeEventData" + } + ] + }, + "MediaJobOutputProgressEventData": { + "type": "object", + "properties": { + "#Microsoft.Media.JobOutputProgress": { + "type": "string", + "description": "Discriminator property for MediaJobOutputProgressEventData." + }, + "label": { + "type": "string", + "description": "Gets the Job output label." + }, + "progress": { + "type": "integer", + "format": "int64", + "description": "Gets the Job output progress." + }, + "jobCorrelationData": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-cadl-name": "Record", + "description": "Gets the Job correlation data." + } + }, + "description": "Job Output Progress Event Data. Schema of the Data property of an EventGridEvent for a Microsoft.Media.JobOutputProgress event.", + "discriminator": "#Microsoft.Media.JobOutputProgress", + "required": [ + "#Microsoft.Media.JobOutputProgress" + ] + }, + "MediaJobOutputScheduledEventData": { + "type": "object", + "properties": { + "#Microsoft.Media.JobOutputCanceled": { + "type": "string", + "description": "Discriminator property for MediaJobOutputScheduledEventData." + } + }, + "description": "Job output scheduled event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobOutputScheduled event.", + "discriminator": "#Microsoft.Media.JobOutputCanceled", + "required": [ + "#Microsoft.Media.JobOutputCanceled" + ], + "allOf": [ + { + "$ref": "#/definitions/MediaJobOutputStateChangeEventData" + } + ] + }, + "MediaJobOutputStateChangeEventData": { + "type": "object", + "properties": { + "previousState": { + "$ref": "#/definitions/MediaJobState", + "description": "The previous state of the Job." + }, + "output": { + "$ref": "#/definitions/MediaJobOutput", + "description": "Gets the output." + }, + "jobCorrelationData": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-cadl-name": "Record", + "description": "Gets the Job correlation data." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Media.JobOutputStateChange event." + }, + "MediaJobProcessingEventData": { + "type": "object", + "properties": { + "#Microsoft.Media.JobProcessing": { + "type": "string", + "description": "Discriminator property for MediaJobProcessingEventData." + } + }, + "description": "Job processing event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobProcessing event.", + "discriminator": "#Microsoft.Media.JobProcessing", + "required": [ + "#Microsoft.Media.JobProcessing" + ], + "allOf": [ + { + "$ref": "#/definitions/MediaJobStateChangeEventData" + } + ] + }, + "MediaJobRetry": { + "type": "string", + "enum": [ + "DoNotRetry", + "MayRetry" + ], + "x-ms-enum": { + "name": "MediaJobRetry", + "modelAsString": true, + "values": [ + { + "name": "DoNotRetry", + "value": "DoNotRetry", + "description": "Issue needs to be investigated and then the job resubmitted with corrections or retried once the underlying issue has been corrected." + }, + { + "name": "MayRetry", + "value": "MayRetry", + "description": "Issue may be resolved after waiting for a period of time and resubmitting the same Job." + } + ] + } + }, + "MediaJobScheduledEventData": { + "type": "object", + "properties": { + "#Microsoft.Media.JobScheduled": { + "type": "string", + "description": "Discriminator property for MediaJobScheduledEventData." + } + }, + "description": "Job scheduled event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobScheduled event.", + "discriminator": "#Microsoft.Media.JobScheduled", + "required": [ + "#Microsoft.Media.JobScheduled" + ], + "allOf": [ + { + "$ref": "#/definitions/MediaJobStateChangeEventData" + } + ] + }, + "MediaJobState": { + "type": "string", + "enum": [ + "Canceled", + "Canceling", + "Error", + "Finished", + "Processing", + "Queued", + "Scheduled" + ], + "x-ms-enum": { + "name": "MediaJobState", + "modelAsString": true, + "values": [ + { + "name": "Canceled", + "value": "Canceled", + "description": "The job was canceled. This is a final state for the job." + }, + { + "name": "Canceling", + "value": "Canceling", + "description": "The job is in the process of being canceled. This is a transient state for the job." + }, + { + "name": "Error", + "value": "Error", + "description": "The job has encountered an error. This is a final state for the job." + }, + { + "name": "Finished", + "value": "Finished", + "description": "The job is finished. This is a final state for the job." + }, + { + "name": "Processing", + "value": "Processing", + "description": "The job is processing. This is a transient state for the job." + }, + { + "name": "Queued", + "value": "Queued", + "description": "The job is in a queued state, waiting for resources to become available. This is a transient state." + }, + { + "name": "Scheduled", + "value": "Scheduled", + "description": "The job is being scheduled to run on an available resource. This is a transient state, between queued and processing states." + } + ] + } + }, + "MediaJobStateChangeEventData": { + "type": "object", + "properties": { + "previousState": { + "$ref": "#/definitions/MediaJobState", + "description": "The previous state of the Job." + }, + "state": { + "$ref": "#/definitions/MediaJobState", + "description": "The new state of the Job." + }, + "correlationData": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-cadl-name": "Record", + "description": "Gets the Job correlation data." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Media.JobStateChange event." + }, + "MediaLiveEventChannelArchiveHeartbeatEventData": { + "type": "object", + "properties": { + "channelLatencyMs": { + "type": "string", + "description": "Gets the channel latency in ms." + }, + "latencyResultCode": { + "type": "string", + "description": "Gets the latency result code." + } + }, + "description": "Channel Archive heartbeat event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventChannelArchiveHeartbeat event.", + "required": [ + "channelLatencyMs", + "latencyResultCode" + ] + }, + "MediaLiveEventConnectionRejectedEventData": { + "type": "object", + "properties": { + "ingestUrl": { + "type": "string", + "description": "Gets the ingest URL provided by the live event." + }, + "streamId": { + "type": "string", + "description": "Gets the stream Id." + }, + "encoderIp": { + "type": "string", + "description": "Gets the remote IP." + }, + "encoderPort": { + "type": "string", + "description": "Gets the remote port." + }, + "resultCode": { + "type": "string", + "description": "Gets the result code." + } + }, + "description": "Encoder connection rejected event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventConnectionRejected event." + }, + "MediaLiveEventEncoderConnectedEventData": { + "type": "object", + "properties": { + "ingestUrl": { + "type": "string", + "description": "Gets the ingest URL provided by the live event." + }, + "streamId": { + "type": "string", + "description": "Gets the stream Id." + }, + "encoderIp": { + "type": "string", + "description": "Gets the remote IP." + }, + "encoderPort": { + "type": "string", + "description": "Gets the remote port." + } + }, + "description": "Encoder connect event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventEncoderConnected event." + }, + "MediaLiveEventEncoderDisconnectedEventData": { + "type": "object", + "properties": { + "ingestUrl": { + "type": "string", + "description": "Gets the ingest URL provided by the live event." + }, + "streamId": { + "type": "string", + "description": "Gets the stream Id." + }, + "encoderIp": { + "type": "string", + "description": "Gets the remote IP." + }, + "encoderPort": { + "type": "string", + "description": "Gets the remote port." + }, + "resultCode": { + "type": "string", + "description": "Gets the result code." + } + }, + "description": "Encoder disconnected event data. Schema of the Data property of an EventGridEvent for a Microsoft.Media.LiveEventEncoderDisconnected event." + }, + "MediaLiveEventIncomingDataChunkDroppedEventData": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "description": "Gets the timestamp of the data chunk dropped." + }, + "trackType": { + "type": "string", + "description": "Gets the type of the track (Audio / Video)." + }, + "bitrate": { + "type": "integer", + "format": "int64", + "description": "Gets the bitrate of the track." + }, + "timescale": { + "type": "string", + "description": "Gets the timescale of the Timestamp." + }, + "resultCode": { + "type": "string", + "description": "Gets the result code for fragment drop operation." + }, + "trackName": { + "type": "string", + "description": "Gets the name of the track for which fragment is dropped." + } + }, + "description": "Ingest fragment dropped event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventIncomingDataChunkDropped event." + }, + "MediaLiveEventIncomingStreamReceivedEventData": { + "type": "object", + "properties": { + "ingestUrl": { + "type": "string", + "description": "Gets the ingest URL provided by the live event." + }, + "trackType": { + "type": "string", + "description": "Gets the type of the track (Audio / Video)." + }, + "trackName": { + "type": "string", + "description": "Gets the track name." + }, + "bitrate": { + "type": "integer", + "format": "int64", + "description": "Gets the bitrate of the track." + }, + "encoderIp": { + "type": "string", + "description": "Gets the remote IP." + }, + "encoderPort": { + "type": "string", + "description": "Gets the remote port." + }, + "timestamp": { + "type": "string", + "description": "Gets the first timestamp of the data chunk received." + }, + "duration": { + "type": "string", + "description": "Gets the duration of the first data chunk." + }, + "timescale": { + "type": "string", + "description": "Gets the timescale in which timestamp is represented." + } + }, + "description": "Encoder connect event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventIncomingStreamReceived event." + }, + "MediaLiveEventIncomingStreamsOutOfSyncEventData": { + "type": "object", + "properties": { + "minLastTimestamp": { + "type": "string", + "description": "Gets the minimum last timestamp received." + }, + "typeOfStreamWithMinLastTimestamp": { + "type": "string", + "description": "Gets the type of stream with minimum last timestamp." + }, + "maxLastTimestamp": { + "type": "string", + "description": "Gets the maximum timestamp among all the tracks (audio or video)." + }, + "typeOfStreamWithMaxLastTimestamp": { + "type": "string", + "description": "Gets the type of stream with maximum last timestamp." + }, + "timescaleOfMinLastTimestamp": { + "type": "string", + "description": "Gets the timescale in which \"MinLastTimestamp\" is represented." + }, + "timescaleOfMaxLastTimestamp": { + "type": "string", + "description": "Gets the timescale in which \"MaxLastTimestamp\" is represented." + } + }, + "description": "Incoming streams out of sync event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventIncomingStreamsOutOfSync event." + }, + "MediaLiveEventIncomingVideoStreamsOutOfSyncEventData": { + "type": "object", + "properties": { + "firstTimestamp": { + "type": "string", + "description": "Gets the first timestamp received for one of the quality levels." + }, + "firstDuration": { + "type": "string", + "description": "Gets the duration of the data chunk with first timestamp." + }, + "secondTimestamp": { + "type": "string", + "description": "Gets the timestamp received for some other quality levels." + }, + "secondDuration": { + "type": "string", + "description": "Gets the duration of the data chunk with second timestamp." + }, + "timescale": { + "type": "string", + "description": "Gets the timescale in which both the timestamps and durations are represented." + } + }, + "description": "Incoming video stream out of sync event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventIncomingVideoStreamsOutOfSync event." + }, + "MediaLiveEventIngestHeartbeatEventData": { + "type": "object", + "properties": { + "trackType": { + "type": "string", + "description": "Gets the type of the track (Audio / Video)." + }, + "trackName": { + "type": "string", + "description": "Gets the track name." + }, + "transcriptionLanguage": { + "type": "string", + "description": "Gets the Live Transcription language." + }, + "transcriptionState": { + "type": "string", + "description": "Gets the Live Transcription state." + }, + "bitrate": { + "type": "integer", + "format": "int64", + "description": "Gets the bitrate of the track." + }, + "incomingBitrate": { + "type": "integer", + "format": "int64", + "description": "Gets the incoming bitrate." + }, + "ingestDriftValue": { + "type": "string", + "description": "Gets the track ingest drift value." + }, + "lastFragmentArrivalTime": { + "type": "string", + "description": "Gets the arrival UTC time of the last fragment." + }, + "lastTimestamp": { + "type": "string", + "description": "Gets the last timestamp." + }, + "timescale": { + "type": "string", + "description": "Gets the timescale of the last timestamp." + }, + "overlapCount": { + "type": "integer", + "format": "int64", + "description": "Gets the fragment Overlap count." + }, + "discontinuityCount": { + "type": "integer", + "format": "int64", + "description": "Gets the fragment Discontinuity count." + }, + "nonincreasingCount": { + "type": "integer", + "format": "int64", + "description": "Gets Non increasing count." + }, + "unexpectedBitrate": { + "type": "boolean", + "description": "Gets a value indicating whether unexpected bitrate is present or not." + }, + "state": { + "type": "string", + "description": "Gets the state of the live event." + }, + "healthy": { + "type": "boolean", + "description": "Gets a value indicating whether preview is healthy or not." + } + }, + "description": "Ingest heartbeat event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventIngestHeartbeat event." + }, + "MediaLiveEventTrackDiscontinuityDetectedEventData": { + "type": "object", + "properties": { + "trackType": { + "type": "string", + "description": "Gets the type of the track (Audio / Video)." + }, + "trackName": { + "type": "string", + "description": "Gets the track name." + }, + "bitrate": { + "type": "integer", + "format": "int64", + "description": "Gets the bitrate." + }, + "previousTimestamp": { + "type": "string", + "description": "Gets the timestamp of the previous fragment." + }, + "newTimestamp": { + "type": "string", + "description": "Gets the timestamp of the current fragment." + }, + "timescale": { + "type": "string", + "description": "Gets the timescale in which both timestamps and discontinuity gap are represented." + }, + "discontinuityGap": { + "type": "string", + "description": "Gets the discontinuity gap between PreviousTimestamp and NewTimestamp." + } + }, + "description": "Ingest track discontinuity detected event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventTrackDiscontinuityDetected event." + } + }, + "parameters": {} +} diff --git a/specification/eventgrid/data-plane/cadl/swagger/PolicyInsights.json b/specification/eventgrid/data-plane/cadl/swagger/PolicyInsights.json new file mode 100644 index 000000000000..24119130ede3 --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/swagger/PolicyInsights.json @@ -0,0 +1,132 @@ +{ + "swagger": "2.0", + "info": { + "title": "Schema of Azure Policy events published to Azure Event Grid", + "version": "2018-01-01", + "description": "Describes the schema of the Azure Policy events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.", + "x-cadl-generated": [ + { + "emitter": "@azure-tools/cadl-autorest" + } + ] + }, + "schemes": [ + "https" + ], + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "tags": [], + "paths": {}, + "definitions": { + "PolicyInsightsPolicyStateChangedEventData": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The time that the resource was scanned by Azure Policy in the Universal ISO 8601 DateTime format yyyy-MM-ddTHH:mm:ss.fffffffZ." + }, + "policyAssignmentId": { + "type": "string", + "description": "The resource ID of the policy assignment." + }, + "policyDefinitionId": { + "type": "string", + "description": "The resource ID of the policy definition." + }, + "policyDefinitionReferenceId": { + "type": "string", + "description": "The reference ID for the policy definition inside the initiative definition, if the policy assignment is for an initiative. May be empty." + }, + "complianceState": { + "type": "string", + "description": "The compliance state of the resource with respect to the policy assignment." + }, + "subscriptionId": { + "type": "string", + "description": "The subscription ID of the resource." + }, + "complianceReasonCode": { + "type": "string", + "description": "The compliance reason code. May be empty." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.PolicyInsights.PolicyStateChanged event." + }, + "PolicyInsightsPolicyStateCreatedEventData": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The time that the resource was scanned by Azure Policy in the Universal ISO 8601 DateTime format yyyy-MM-ddTHH:mm:ss.fffffffZ." + }, + "policyAssignmentId": { + "type": "string", + "description": "The resource ID of the policy assignment." + }, + "policyDefinitionId": { + "type": "string", + "description": "The resource ID of the policy definition." + }, + "policyDefinitionReferenceId": { + "type": "string", + "description": "The reference ID for the policy definition inside the initiative definition, if the policy assignment is for an initiative. May be empty." + }, + "complianceState": { + "type": "string", + "description": "The compliance state of the resource with respect to the policy assignment." + }, + "subscriptionId": { + "type": "string", + "description": "The subscription ID of the resource." + }, + "complianceReasonCode": { + "type": "string", + "description": "The compliance reason code. May be empty." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.PolicyInsights.PolicyStateCreated event." + }, + "PolicyInsightsPolicyStateDeletedEventData": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The time that the resource was scanned by Azure Policy in the Universal ISO 8601 DateTime format yyyy-MM-ddTHH:mm:ss.fffffffZ." + }, + "policyAssignmentId": { + "type": "string", + "description": "The resource ID of the policy assignment." + }, + "policyDefinitionId": { + "type": "string", + "description": "The resource ID of the policy definition." + }, + "policyDefinitionReferenceId": { + "type": "string", + "description": "The reference ID for the policy definition inside the initiative definition, if the policy assignment is for an initiative. May be empty." + }, + "complianceState": { + "type": "string", + "description": "The compliance state of the resource with respect to the policy assignment." + }, + "subscriptionId": { + "type": "string", + "description": "The subscription ID of the resource." + }, + "complianceReasonCode": { + "type": "string", + "description": "The compliance reason code. May be empty." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.PolicyInsights.PolicyStateDeleted event." + } + }, + "parameters": {} +} diff --git a/specification/eventgrid/data-plane/cadl/swagger/RedisCache.json b/specification/eventgrid/data-plane/cadl/swagger/RedisCache.json new file mode 100644 index 000000000000..5b7d122fb356 --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/swagger/RedisCache.json @@ -0,0 +1,103 @@ +{ + "swagger": "2.0", + "info": { + "title": "Schema of Redis Cache events published to Azure Event Grid", + "version": "2018-01-01", + "description": "Describes the schema of the Redis Cache events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.", + "x-cadl-generated": [ + { + "emitter": "@azure-tools/cadl-autorest" + } + ] + }, + "schemes": [ + "https" + ], + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "tags": [], + "paths": {}, + "definitions": { + "RedisExportRDBCompletedEventData": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The time at which the event occurred." + }, + "name": { + "type": "string", + "description": "The name of this event." + }, + "status": { + "type": "string", + "description": "The status of this event. Failed or succeeded " + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Cache.ExportRDBCompleted event." + }, + "RedisImportRDBCompletedEventData": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The time at which the event occurred." + }, + "name": { + "type": "string", + "description": "The name of this event." + }, + "status": { + "type": "string", + "description": "The status of this event. Failed or succeeded " + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Cache.ImportRDBCompleted event." + }, + "RedisPatchingCompletedEventData": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The time at which the event occurred." + }, + "name": { + "type": "string", + "description": "The name of this event." + }, + "status": { + "type": "string", + "description": "The status of this event. Failed or succeeded " + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Cache.PatchingCompleted event." + }, + "RedisScalingCompletedEventData": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The time at which the event occurred." + }, + "name": { + "type": "string", + "description": "The name of this event." + }, + "status": { + "type": "string", + "description": "The status of this event. Failed or succeeded " + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Cache.ScalingCompleted event." + } + }, + "parameters": {} +} diff --git a/specification/eventgrid/data-plane/cadl/swagger/Resources.json b/specification/eventgrid/data-plane/cadl/swagger/Resources.json new file mode 100644 index 000000000000..8848093c83a4 --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/swagger/Resources.json @@ -0,0 +1,557 @@ +{ + "swagger": "2.0", + "info": { + "title": "Schema of Azure resource events published to Azure Event Grid", + "version": "2018-01-01", + "description": "Describes the schema of the Azure resource events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.", + "x-cadl-generated": [ + { + "emitter": "@azure-tools/cadl-autorest" + } + ] + }, + "schemes": [ + "https" + ], + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "tags": [], + "paths": {}, + "definitions": { + "ResourceActionCancelData": { + "type": "object", + "properties": { + "tenantId": { + "type": "string", + "description": "The tenant ID of the resource." + }, + "subscriptionId": { + "type": "string", + "description": "The subscription ID of the resource." + }, + "resourceGroup": { + "type": "string", + "description": "The resource group of the resource." + }, + "resourceProvider": { + "type": "string", + "description": "The resource provider performing the operation." + }, + "resourceUri": { + "type": "string", + "description": "The URI of the resource in the operation." + }, + "operationName": { + "type": "string", + "description": "The operation that was performed." + }, + "status": { + "type": "string", + "description": "The status of the operation." + }, + "authorization": { + "$ref": "#/definitions/ResourceAuthorization", + "description": "The requested authorization for the operation." + }, + "claims": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-cadl-name": "Record", + "description": "The properties of the claims." + }, + "correlationId": { + "type": "string", + "description": "An operation ID used for troubleshooting." + }, + "httpRequest": { + "$ref": "#/definitions/ResourceHttpRequest", + "description": "The details of the operation." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceActionCancel event. This is raised when a resource action operation is canceled." + }, + "ResourceActionFailureData": { + "type": "object", + "properties": { + "tenantId": { + "type": "string", + "description": "The tenant ID of the resource." + }, + "subscriptionId": { + "type": "string", + "description": "The subscription ID of the resource." + }, + "resourceGroup": { + "type": "string", + "description": "The resource group of the resource." + }, + "resourceProvider": { + "type": "string", + "description": "The resource provider performing the operation." + }, + "resourceUri": { + "type": "string", + "description": "The URI of the resource in the operation." + }, + "operationName": { + "type": "string", + "description": "The operation that was performed." + }, + "status": { + "type": "string", + "description": "The status of the operation." + }, + "authorization": { + "$ref": "#/definitions/ResourceAuthorization", + "description": "The requested authorization for the operation." + }, + "claims": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-cadl-name": "Record", + "description": "The properties of the claims." + }, + "correlationId": { + "type": "string", + "description": "An operation ID used for troubleshooting." + }, + "httpRequest": { + "$ref": "#/definitions/ResourceHttpRequest", + "description": "The details of the operation." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceActionFailure event. This is raised when a resource action operation fails." + }, + "ResourceActionSuccessData": { + "type": "object", + "properties": { + "tenantId": { + "type": "string", + "description": "The tenant ID of the resource." + }, + "subscriptionId": { + "type": "string", + "description": "The subscription ID of the resource." + }, + "resourceGroup": { + "type": "string", + "description": "The resource group of the resource." + }, + "resourceProvider": { + "type": "string", + "description": "The resource provider performing the operation." + }, + "resourceUri": { + "type": "string", + "description": "The URI of the resource in the operation." + }, + "operationName": { + "type": "string", + "description": "The operation that was performed." + }, + "status": { + "type": "string", + "description": "The status of the operation." + }, + "authorization": { + "$ref": "#/definitions/ResourceAuthorization", + "description": "The requested authorization for the operation." + }, + "claims": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-cadl-name": "Record", + "description": "The properties of the claims." + }, + "correlationId": { + "type": "string", + "description": "An operation ID used for troubleshooting." + }, + "httpRequest": { + "$ref": "#/definitions/ResourceHttpRequest", + "description": "The details of the operation." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceActionSuccess event. This is raised when a resource action operation succeeds." + }, + "ResourceAuthorization": { + "type": "object", + "properties": { + "scope": { + "type": "string", + "description": "The scope of the authorization." + }, + "action": { + "type": "string", + "description": "The action being requested." + }, + "evidence": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-cadl-name": "Record", + "description": "The evidence for the authorization." + } + }, + "description": "The details of the authorization for the resource." + }, + "ResourceDeleteCancelData": { + "type": "object", + "properties": { + "tenantId": { + "type": "string", + "description": "The tenant ID of the resource." + }, + "subscriptionId": { + "type": "string", + "description": "The subscription ID of the resource." + }, + "resourceGroup": { + "type": "string", + "description": "The resource group of the resource." + }, + "resourceProvider": { + "type": "string", + "description": "The resource provider performing the operation." + }, + "resourceUri": { + "type": "string", + "description": "The URI of the resource in the operation." + }, + "operationName": { + "type": "string", + "description": "The operation that was performed." + }, + "status": { + "type": "string", + "description": "The status of the operation." + }, + "authorization": { + "$ref": "#/definitions/ResourceAuthorization", + "description": "The requested authorization for the operation." + }, + "claims": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-cadl-name": "Record", + "description": "The properties of the claims." + }, + "correlationId": { + "type": "string", + "description": "An operation ID used for troubleshooting." + }, + "httpRequest": { + "$ref": "#/definitions/ResourceHttpRequest", + "description": "The details of the operation." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceDeleteCancel event. This is raised when a resource delete operation is canceled." + }, + "ResourceDeleteFailureData": { + "type": "object", + "properties": { + "tenantId": { + "type": "string", + "description": "The tenant ID of the resource." + }, + "subscriptionId": { + "type": "string", + "description": "The subscription ID of the resource." + }, + "resourceGroup": { + "type": "string", + "description": "The resource group of the resource." + }, + "resourceProvider": { + "type": "string", + "description": "The resource provider performing the operation." + }, + "resourceUri": { + "type": "string", + "description": "The URI of the resource in the operation." + }, + "operationName": { + "type": "string", + "description": "The operation that was performed." + }, + "status": { + "type": "string", + "description": "The status of the operation." + }, + "authorization": { + "$ref": "#/definitions/ResourceAuthorization", + "description": "The requested authorization for the operation." + }, + "claims": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-cadl-name": "Record", + "description": "The properties of the claims." + }, + "correlationId": { + "type": "string", + "description": "An operation ID used for troubleshooting." + }, + "httpRequest": { + "$ref": "#/definitions/ResourceHttpRequest", + "description": "The details of the operation." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceDeleteFailure event. This is raised when a resource delete operation fails." + }, + "ResourceDeleteSuccessData": { + "type": "object", + "properties": { + "tenantId": { + "type": "string", + "description": "The tenant ID of the resource." + }, + "subscriptionId": { + "type": "string", + "description": "The subscription ID of the resource." + }, + "resourceGroup": { + "type": "string", + "description": "The resource group of the resource." + }, + "resourceProvider": { + "type": "string", + "description": "The resource provider performing the operation." + }, + "resourceUri": { + "type": "string", + "description": "The URI of the resource in the operation." + }, + "operationName": { + "type": "string", + "description": "The operation that was performed." + }, + "status": { + "type": "string", + "description": "The status of the operation." + }, + "authorization": { + "$ref": "#/definitions/ResourceAuthorization", + "description": "The requested authorization for the operation." + }, + "claims": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-cadl-name": "Record", + "description": "The properties of the claims." + }, + "correlationId": { + "type": "string", + "description": "An operation ID used for troubleshooting." + }, + "httpRequest": { + "$ref": "#/definitions/ResourceHttpRequest", + "description": "The details of the operation." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceDeleteSuccess event. This is raised when a resource delete operation succeeds." + }, + "ResourceHttpRequest": { + "type": "object", + "properties": { + "clientRequestId": { + "type": "string", + "description": "The client request ID." + }, + "clientIpAddress": { + "type": "string", + "description": "The client IP address." + }, + "method": { + "type": "string", + "description": "The request method." + }, + "url": { + "type": "string", + "description": "The url used in the request." + } + }, + "description": "The details of the HTTP request." + }, + "ResourceWriteCancelData": { + "type": "object", + "properties": { + "tenantId": { + "type": "string", + "description": "The tenant ID of the resource." + }, + "subscriptionId": { + "type": "string", + "description": "The subscription ID of the resource." + }, + "resourceGroup": { + "type": "string", + "description": "The resource group of the resource." + }, + "resourceProvider": { + "type": "string", + "description": "The resource provider performing the operation." + }, + "resourceUri": { + "type": "string", + "description": "The URI of the resource in the operation." + }, + "operationName": { + "type": "string", + "description": "The operation that was performed." + }, + "status": { + "type": "string", + "description": "The status of the operation." + }, + "authorization": { + "$ref": "#/definitions/ResourceAuthorization", + "description": "The requested authorization for the operation." + }, + "claims": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-cadl-name": "Record", + "description": "The properties of the claims." + }, + "correlationId": { + "type": "string", + "description": "An operation ID used for troubleshooting." + }, + "httpRequest": { + "$ref": "#/definitions/ResourceHttpRequest", + "description": "The details of the operation." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceWriteCancel event. This is raised when a resource create or update operation is canceled." + }, + "ResourceWriteFailureData": { + "type": "object", + "properties": { + "tenantId": { + "type": "string", + "description": "The tenant ID of the resource." + }, + "subscriptionId": { + "type": "string", + "description": "The subscription ID of the resource." + }, + "resourceGroup": { + "type": "string", + "description": "The resource group of the resource." + }, + "resourceProvider": { + "type": "string", + "description": "The resource provider performing the operation." + }, + "resourceUri": { + "type": "string", + "description": "The URI of the resource in the operation." + }, + "operationName": { + "type": "string", + "description": "The operation that was performed." + }, + "status": { + "type": "string", + "description": "The status of the operation." + }, + "authorization": { + "$ref": "#/definitions/ResourceAuthorization", + "description": "The requested authorization for the operation." + }, + "claims": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-cadl-name": "Record", + "description": "The properties of the claims." + }, + "correlationId": { + "type": "string", + "description": "An operation ID used for troubleshooting." + }, + "httpRequest": { + "$ref": "#/definitions/ResourceHttpRequest", + "description": "The details of the operation." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceWriteFailure event. This is raised when a resource create or update operation fails." + }, + "ResourceWriteSuccessData": { + "type": "object", + "properties": { + "tenantId": { + "type": "string", + "description": "The tenant ID of the resource." + }, + "subscriptionId": { + "type": "string", + "description": "The subscription ID of the resource." + }, + "resourceGroup": { + "type": "string", + "description": "The resource group of the resource." + }, + "resourceProvider": { + "type": "string", + "description": "The resource provider performing the operation." + }, + "resourceUri": { + "type": "string", + "description": "The URI of the resource in the operation." + }, + "operationName": { + "type": "string", + "description": "The operation that was performed." + }, + "status": { + "type": "string", + "description": "The status of the operation." + }, + "authorization": { + "$ref": "#/definitions/ResourceAuthorization", + "description": "The requested authorization for the operation." + }, + "claims": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-cadl-name": "Record", + "description": "The properties of the claims." + }, + "correlationId": { + "type": "string", + "description": "An operation ID used for troubleshooting." + }, + "httpRequest": { + "$ref": "#/definitions/ResourceHttpRequest", + "description": "The details of the operation." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceWriteSuccess event. This is raised when a resource create or update operation succeeds." + } + }, + "parameters": {} +} diff --git a/specification/eventgrid/data-plane/cadl/swagger/ServiceBus.json b/specification/eventgrid/data-plane/cadl/swagger/ServiceBus.json new file mode 100644 index 000000000000..76bf25fe7105 --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/swagger/ServiceBus.json @@ -0,0 +1,147 @@ +{ + "swagger": "2.0", + "info": { + "title": "Schema of Azure ServiceBus Messaging events published to Azure Event Grid", + "version": "2018-01-01", + "description": "Describes the schema of the Azure ServiceBus Messaging events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.", + "x-cadl-generated": [ + { + "emitter": "@azure-tools/cadl-autorest" + } + ] + }, + "schemes": [ + "https" + ], + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "tags": [], + "paths": {}, + "definitions": { + "ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData": { + "type": "object", + "properties": { + "namespaceName": { + "type": "string", + "description": "The namespace name of the Microsoft.ServiceBus resource." + }, + "requestUri": { + "type": "string", + "description": "The endpoint of the Microsoft.ServiceBus resource." + }, + "entityType": { + "type": "string", + "description": "The entity type of the Microsoft.ServiceBus resource. Could be one of 'queue' or 'subscriber'." + }, + "queueName": { + "type": "string", + "description": "The name of the Microsoft.ServiceBus queue. If the entity type is of type 'subscriber', then this value will be null." + }, + "topicName": { + "type": "string", + "description": "The name of the Microsoft.ServiceBus topic. If the entity type is of type 'queue', then this value will be null." + }, + "subscriptionName": { + "type": "string", + "description": "The name of the Microsoft.ServiceBus topic's subscription. If the entity type is of type 'queue', then this value will be null." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.ServiceBus.ActiveMessagesAvailablePeriodicNotifications event." + }, + "ServiceBusActiveMessagesAvailableWithNoListenersEventData": { + "type": "object", + "properties": { + "namespaceName": { + "type": "string", + "description": "The namespace name of the Microsoft.ServiceBus resource." + }, + "requestUri": { + "type": "string", + "description": "The endpoint of the Microsoft.ServiceBus resource." + }, + "entityType": { + "type": "string", + "description": "The entity type of the Microsoft.ServiceBus resource. Could be one of 'queue' or 'subscriber'." + }, + "queueName": { + "type": "string", + "description": "The name of the Microsoft.ServiceBus queue. If the entity type is of type 'subscriber', then this value will be null." + }, + "topicName": { + "type": "string", + "description": "The name of the Microsoft.ServiceBus topic. If the entity type is of type 'queue', then this value will be null." + }, + "subscriptionName": { + "type": "string", + "description": "The name of the Microsoft.ServiceBus topic's subscription. If the entity type is of type 'queue', then this value will be null." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.ServiceBus.ActiveMessagesAvailableWithNoListeners event." + }, + "ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData": { + "type": "object", + "properties": { + "namespaceName": { + "type": "string", + "description": "The namespace name of the Microsoft.ServiceBus resource." + }, + "requestUri": { + "type": "string", + "description": "The endpoint of the Microsoft.ServiceBus resource." + }, + "entityType": { + "type": "string", + "description": "The entity type of the Microsoft.ServiceBus resource. Could be one of 'queue' or 'subscriber'." + }, + "queueName": { + "type": "string", + "description": "The name of the Microsoft.ServiceBus queue. If the entity type is of type 'subscriber', then this value will be null." + }, + "topicName": { + "type": "string", + "description": "The name of the Microsoft.ServiceBus topic. If the entity type is of type 'queue', then this value will be null." + }, + "subscriptionName": { + "type": "string", + "description": "The name of the Microsoft.ServiceBus topic's subscription. If the entity type is of type 'queue', then this value will be null." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.ServiceBus.DeadletterMessagesAvailablePeriodicNotifications event." + }, + "ServiceBusDeadletterMessagesAvailableWithNoListenersEventData": { + "type": "object", + "properties": { + "namespaceName": { + "type": "string", + "description": "The namespace name of the Microsoft.ServiceBus resource." + }, + "requestUri": { + "type": "string", + "description": "The endpoint of the Microsoft.ServiceBus resource." + }, + "entityType": { + "type": "string", + "description": "The entity type of the Microsoft.ServiceBus resource. Could be one of 'queue' or 'subscriber'." + }, + "queueName": { + "type": "string", + "description": "The name of the Microsoft.ServiceBus queue. If the entity type is of type 'subscriber', then this value will be null." + }, + "topicName": { + "type": "string", + "description": "The name of the Microsoft.ServiceBus topic. If the entity type is of type 'queue', then this value will be null." + }, + "subscriptionName": { + "type": "string", + "description": "The name of the Microsoft.ServiceBus topic's subscription. If the entity type is of type 'queue', then this value will be null." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.ServiceBus.DeadletterMessagesAvailableWithNoListeners event." + } + }, + "parameters": {} +} diff --git a/specification/eventgrid/data-plane/cadl/swagger/SignalRService.json b/specification/eventgrid/data-plane/cadl/swagger/SignalRService.json new file mode 100644 index 000000000000..8a25e31bc06d --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/swagger/SignalRService.json @@ -0,0 +1,77 @@ +{ + "swagger": "2.0", + "info": { + "title": "Schema of Azure SignalR Service events published to Azure Event Grid", + "version": "2018-01-01", + "description": "Describes the schema of the Azure SignalR Service events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.", + "x-cadl-generated": [ + { + "emitter": "@azure-tools/cadl-autorest" + } + ] + }, + "schemes": [ + "https" + ], + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "tags": [], + "paths": {}, + "definitions": { + "SignalRServiceClientConnectionConnectedEventData": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The time at which the event occurred." + }, + "hubName": { + "type": "string", + "description": "The hub of connected client connection." + }, + "connectionId": { + "type": "string", + "description": "The connection Id of connected client connection." + }, + "userId": { + "type": "string", + "description": "The user Id of connected client connection." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.SignalRService.ClientConnectionConnected event." + }, + "SignalRServiceClientConnectionDisconnectedEventData": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The time at which the event occurred." + }, + "hubName": { + "type": "string", + "description": "The hub of connected client connection." + }, + "connectionId": { + "type": "string", + "description": "The connection Id of connected client connection." + }, + "userId": { + "type": "string", + "description": "The user Id of connected client connection." + }, + "errorMessage": { + "type": "string", + "description": "The message of error that cause the client connection disconnected." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.SignalRService.ClientConnectionDisconnected event." + } + }, + "parameters": {} +} diff --git a/specification/eventgrid/data-plane/cadl/swagger/Storage.json b/specification/eventgrid/data-plane/cadl/swagger/Storage.json new file mode 100644 index 000000000000..ef3107723dc1 --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/swagger/Storage.json @@ -0,0 +1,477 @@ +{ + "swagger": "2.0", + "info": { + "title": "Schema of Azure Storage events published to Azure Event Grid", + "version": "2018-01-01", + "description": "Describes the schema of the Azure Storage events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.", + "x-cadl-generated": [ + { + "emitter": "@azure-tools/cadl-autorest" + } + ] + }, + "schemes": [ + "https" + ], + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "tags": [], + "paths": {}, + "definitions": { + "StorageAsyncOperationInitiatedEventData": { + "type": "object", + "properties": { + "api": { + "type": "string", + "description": "The name of the API/operation that triggered this event." + }, + "clientRequestId": { + "type": "string", + "description": "A request id provided by the client of the storage API operation that triggered this event." + }, + "requestId": { + "type": "string", + "description": "The request id generated by the Storage service for the storage API operation that triggered this event." + }, + "sequencer": { + "type": "string", + "description": "An opaque string value representing the logical sequence of events for any particular name. Users can use standard string comparison to understand the relative sequence of two events on the same name." + }, + "identity": { + "type": "string", + "description": "The identity of the requester that triggered this event." + }, + "storageDiagnostics": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-cadl-name": "Record", + "description": "For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers." + }, + "contentLength": { + "type": "integer", + "format": "int64", + "description": "The size of the blob in bytes. This is the same as what would be returned in the Content-Length header from the blob." + }, + "url": { + "type": "string", + "description": "The path to the blob." + }, + "contentType": { + "type": "string", + "description": "The content type of the blob. This is the same as what would be returned in the Content-Type header from the blob." + }, + "blobType": { + "type": "string", + "description": "The type of blob." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Storage.AsyncOperationInitiated event." + }, + "StorageBlobCreatedEventData": { + "type": "object", + "properties": { + "eTag": { + "type": "string", + "description": "The etag of the blob at the time this event was triggered." + }, + "contentOffset": { + "type": "integer", + "format": "int64", + "description": "The offset of the blob in bytes." + }, + "api": { + "type": "string", + "description": "The name of the API/operation that triggered this event." + }, + "clientRequestId": { + "type": "string", + "description": "A request id provided by the client of the storage API operation that triggered this event." + }, + "requestId": { + "type": "string", + "description": "The request id generated by the Storage service for the storage API operation that triggered this event." + }, + "sequencer": { + "type": "string", + "description": "An opaque string value representing the logical sequence of events for any particular name. Users can use standard string comparison to understand the relative sequence of two events on the same name." + }, + "identity": { + "type": "string", + "description": "The identity of the requester that triggered this event." + }, + "storageDiagnostics": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-cadl-name": "Record", + "description": "For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers." + }, + "contentLength": { + "type": "integer", + "format": "int64", + "description": "The size of the blob in bytes. This is the same as what would be returned in the Content-Length header from the blob." + }, + "url": { + "type": "string", + "description": "The path to the blob." + }, + "contentType": { + "type": "string", + "description": "The content type of the blob. This is the same as what would be returned in the Content-Type header from the blob." + }, + "blobType": { + "type": "string", + "description": "The type of blob." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Storage.BlobCreated event." + }, + "StorageBlobDeletedEventData": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "The path to the blob." + }, + "api": { + "type": "string", + "description": "The name of the API/operation that triggered this event." + }, + "clientRequestId": { + "type": "string", + "description": "A request id provided by the client of the storage API operation that triggered this event." + }, + "requestId": { + "type": "string", + "description": "The request id generated by the Storage service for the storage API operation that triggered this event." + }, + "sequencer": { + "type": "string", + "description": "An opaque string value representing the logical sequence of events for any particular name. Users can use standard string comparison to understand the relative sequence of two events on the same name." + }, + "identity": { + "type": "string", + "description": "The identity of the requester that triggered this event." + }, + "storageDiagnostics": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-cadl-name": "Record", + "description": "For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers." + }, + "contentType": { + "type": "string", + "description": "The content type of the blob. This is the same as what would be returned in the Content-Type header from the blob." + }, + "blobType": { + "type": "string", + "description": "The type of blob." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Storage.BlobDeleted event." + }, + "StorageBlobInventoryPolicyCompletedEventData": { + "type": "object", + "properties": { + "scheduleDateTime": { + "type": "string", + "format": "date-time", + "description": "The time at which inventory policy was scheduled." + }, + "accountName": { + "type": "string", + "description": "The account name for which inventory policy is registered." + }, + "ruleName": { + "type": "string", + "description": "The rule name for inventory policy." + }, + "policyRunStatus": { + "type": "string", + "description": "The status of inventory run, it can be Succeeded/PartiallySucceeded/Failed." + }, + "policyRunStatusMessage": { + "type": "string", + "description": "The status message for inventory run." + }, + "policyRunId": { + "type": "string", + "description": "The policy run id for inventory run." + }, + "manifestBlobUrl": { + "type": "string", + "description": "The blob URL for manifest file for inventory run." + } + }, + "description": "Schema of the Data property of an EventGridEvent for an Microsoft.Storage.BlobInventoryPolicyCompleted event." + }, + "StorageBlobRenamedEventData": { + "type": "object", + "properties": { + "sourceUrl": { + "type": "string", + "description": "The path to the blob that was renamed." + }, + "destinationUrl": { + "type": "string", + "description": "The new path to the blob after the rename operation." + }, + "api": { + "type": "string", + "description": "The name of the API/operation that triggered this event." + }, + "clientRequestId": { + "type": "string", + "description": "A request id provided by the client of the storage API operation that triggered this event." + }, + "requestId": { + "type": "string", + "description": "The request id generated by the Storage service for the storage API operation that triggered this event." + }, + "sequencer": { + "type": "string", + "description": "An opaque string value representing the logical sequence of events for any particular name. Users can use standard string comparison to understand the relative sequence of two events on the same name." + }, + "identity": { + "type": "string", + "description": "The identity of the requester that triggered this event." + }, + "storageDiagnostics": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-cadl-name": "Record", + "description": "For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Storage.BlobRenamed event." + }, + "StorageBlobTierChangedEventData": { + "type": "object", + "properties": { + "api": { + "type": "string", + "description": "The name of the API/operation that triggered this event." + }, + "clientRequestId": { + "type": "string", + "description": "A request id provided by the client of the storage API operation that triggered this event." + }, + "requestId": { + "type": "string", + "description": "The request id generated by the Storage service for the storage API operation that triggered this event." + }, + "sequencer": { + "type": "string", + "description": "An opaque string value representing the logical sequence of events for any particular name. Users can use standard string comparison to understand the relative sequence of two events on the same name." + }, + "identity": { + "type": "string", + "description": "The identity of the requester that triggered this event." + }, + "storageDiagnostics": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-cadl-name": "Record", + "description": "For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers." + }, + "contentLength": { + "type": "integer", + "format": "int64", + "description": "The size of the blob in bytes. This is the same as what would be returned in the Content-Length header from the blob." + }, + "url": { + "type": "string", + "description": "The path to the blob." + }, + "contentType": { + "type": "string", + "description": "The content type of the blob. This is the same as what would be returned in the Content-Type header from the blob." + }, + "blobType": { + "type": "string", + "description": "The type of blob." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Storage.BlobTierChanged event." + }, + "StorageDirectoryCreatedEventData": { + "type": "object", + "properties": { + "eTag": { + "type": "string", + "description": "The etag of the directory at the time this event was triggered." + }, + "url": { + "type": "string", + "description": "The path to the directory." + }, + "api": { + "type": "string", + "description": "The name of the API/operation that triggered this event." + }, + "clientRequestId": { + "type": "string", + "description": "A request id provided by the client of the storage API operation that triggered this event." + }, + "requestId": { + "type": "string", + "description": "The request id generated by the Storage service for the storage API operation that triggered this event." + }, + "sequencer": { + "type": "string", + "description": "An opaque string value representing the logical sequence of events for any particular name. Users can use standard string comparison to understand the relative sequence of two events on the same name." + }, + "identity": { + "type": "string", + "description": "The identity of the requester that triggered this event." + }, + "storageDiagnostics": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-cadl-name": "Record", + "description": "For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Storage.DirectoryCreated event." + }, + "StorageDirectoryDeletedEventData": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "The path to the deleted directory." + }, + "recursive": { + "type": "string", + "description": "Is this event for a recursive delete operation." + }, + "api": { + "type": "string", + "description": "The name of the API/operation that triggered this event." + }, + "clientRequestId": { + "type": "string", + "description": "A request id provided by the client of the storage API operation that triggered this event." + }, + "requestId": { + "type": "string", + "description": "The request id generated by the Storage service for the storage API operation that triggered this event." + }, + "sequencer": { + "type": "string", + "description": "An opaque string value representing the logical sequence of events for any particular name. Users can use standard string comparison to understand the relative sequence of two events on the same name." + }, + "identity": { + "type": "string", + "description": "The identity of the requester that triggered this event." + }, + "storageDiagnostics": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-cadl-name": "Record", + "description": "For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Storage.DirectoryDeleted event." + }, + "StorageDirectoryRenamedEventData": { + "type": "object", + "properties": { + "sourceUrl": { + "type": "string", + "description": "The path to the directory that was renamed." + }, + "destinationUrl": { + "type": "string", + "description": "The new path to the directory after the rename operation." + }, + "api": { + "type": "string", + "description": "The name of the API/operation that triggered this event." + }, + "clientRequestId": { + "type": "string", + "description": "A request id provided by the client of the storage API operation that triggered this event." + }, + "requestId": { + "type": "string", + "description": "The request id generated by the Storage service for the storage API operation that triggered this event." + }, + "sequencer": { + "type": "string", + "description": "An opaque string value representing the logical sequence of events for any particular name. Users can use standard string comparison to understand the relative sequence of two events on the same name." + }, + "identity": { + "type": "string", + "description": "The identity of the requester that triggered this event." + }, + "storageDiagnostics": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-cadl-name": "Record", + "description": "For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Storage.DirectoryRenamed event." + }, + "StorageLifecyclePolicyActionSummaryDetail": { + "type": "object", + "properties": { + "totalObjectsCount": { + "type": "integer", + "format": "int64", + "description": "Total number of objects to be acted on by this action." + }, + "successCount": { + "type": "integer", + "format": "int64", + "description": "Number of success operations of this action." + }, + "errorList": { + "type": "string", + "description": "Error messages of this action if any." + } + }, + "description": "Execution statistics of a specific policy action in a Blob Management cycle." + }, + "StorageLifecyclePolicyCompletedEventData": { + "type": "object", + "properties": { + "scheduleTime": { + "type": "string", + "description": "The time the policy task was scheduled." + }, + "deleteSummary": { + "$ref": "#/definitions/StorageLifecyclePolicyActionSummaryDetail" + }, + "tierToCoolSummary": { + "$ref": "#/definitions/StorageLifecyclePolicyActionSummaryDetail" + }, + "tierToArchiveSummary": { + "$ref": "#/definitions/StorageLifecyclePolicyActionSummaryDetail" + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Storage.LifecyclePolicyCompleted event." + } + }, + "parameters": {} +} diff --git a/specification/eventgrid/data-plane/cadl/swagger/Web.json b/specification/eventgrid/data-plane/cadl/swagger/Web.json new file mode 100644 index 000000000000..d87ee9d6fab3 --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/swagger/Web.json @@ -0,0 +1,632 @@ +{ + "swagger": "2.0", + "info": { + "title": "Schema of Azure App Service events published to Azure Event Grid", + "version": "2018-01-01", + "description": "Describes the schema of the Azure App Service events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.", + "x-cadl-generated": [ + { + "emitter": "@azure-tools/cadl-autorest" + } + ] + }, + "schemes": [ + "https" + ], + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "tags": [], + "paths": {}, + "definitions": { + "AppAction": { + "type": "string", + "enum": [ + "Restarted", + "Stopped", + "ChangedAppSettings", + "Started", + "Completed", + "Failed" + ], + "x-ms-enum": { + "name": "AppAction", + "modelAsString": true, + "values": [ + { + "name": "Restarted", + "value": "Restarted", + "description": "Web app was restarted." + }, + { + "name": "Stopped", + "value": "Stopped", + "description": "Web app was stopped." + }, + { + "name": "ChangedAppSettings", + "value": "ChangedAppSettings", + "description": "There was an operation to change app setting on the web app." + }, + { + "name": "Started", + "value": "Started", + "description": "The job has started." + }, + { + "name": "Completed", + "value": "Completed", + "description": "The job has completed." + }, + { + "name": "Failed", + "value": "Failed", + "description": "The job has failed to complete." + } + ] + } + }, + "AppEventTypeDetail": { + "type": "object", + "properties": { + "action": { + "$ref": "#/definitions/AppAction", + "description": "Type of action of the operation." + } + }, + "description": "Detail of action on the app." + }, + "AppServicePlanAction": { + "type": "string", + "enum": [ + "Updated" + ], + "x-ms-enum": { + "name": "AppServicePlanAction", + "modelAsString": true, + "values": [ + { + "name": "Updated", + "value": "Updated", + "description": "App Service plan is being updated." + } + ] + } + }, + "AppServicePlanEventTypeDetail": { + "type": "object", + "properties": { + "stampKind": { + "$ref": "#/definitions/StampKind", + "description": "Kind of environment where app service plan is." + }, + "action": { + "$ref": "#/definitions/AppServicePlanAction", + "description": "Type of action on the app service plan." + }, + "status": { + "$ref": "#/definitions/AsyncStatus" + } + }, + "description": "Detail of action on the app service plan." + }, + "AsyncStatus": { + "type": "string", + "enum": [ + "Started", + "Completed", + "Failed" + ], + "x-ms-enum": { + "name": "AsyncStatus", + "modelAsString": true, + "values": [ + { + "name": "Started", + "value": "Started", + "description": "Async operation has started." + }, + { + "name": "Completed", + "value": "Completed", + "description": "Async operation has completed." + }, + { + "name": "Failed", + "value": "Failed", + "description": "Async operation failed to complete." + } + ] + } + }, + "StampKind": { + "type": "string", + "enum": [ + "Public", + "AseV1", + "AseV2" + ], + "x-ms-enum": { + "name": "StampKind", + "modelAsString": true, + "values": [ + { + "name": "Public", + "value": "Public", + "description": "App Service Plan is running on a public stamp." + }, + { + "name": "AseV1", + "value": "AseV1", + "description": "App Service Plan is running on an App Service Environment V1." + }, + { + "name": "AseV2", + "value": "AseV2", + "description": "App Service Plan is running on an App Service Environment V2." + } + ] + } + }, + "WebAppServicePlanUpdatedEventData": { + "type": "object", + "properties": { + "appServicePlanEventTypeDetail": { + "$ref": "#/definitions/AppServicePlanEventTypeDetail" + }, + "name": { + "type": "string", + "description": "name of the app service plan that had this event." + }, + "clientRequestId": { + "type": "string", + "description": "The client request id generated by the app service for the app service plan API operation that triggered this event." + }, + "correlationRequestId": { + "type": "string", + "description": "The correlation request id generated by the app service for the app service plan API operation that triggered this event." + }, + "requestId": { + "type": "string", + "description": "The request id generated by the app service for the app service plan API operation that triggered this event." + }, + "address": { + "type": "string", + "description": "HTTP request URL of this operation." + }, + "verb": { + "type": "string", + "description": "HTTP verb of this operation." + }, + "sku": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "name of app service plan sku." + }, + "Tier": { + "type": "string", + "description": "tier of app service plan sku." + }, + "Size": { + "type": "string", + "description": "size of app service plan sku." + }, + "Family": { + "type": "string", + "description": "family of app service plan sku." + }, + "Capacity": { + "type": "string", + "description": "capacity of app service plan sku." + } + }, + "description": "sku of app service plan.", + "x-cadl-name": "(anonymous model)" + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Web.AppServicePlanUpdated event." + }, + "WebAppUpdatedEventData": { + "type": "object", + "properties": { + "appEventTypeDetail": { + "$ref": "#/definitions/AppEventTypeDetail" + }, + "name": { + "type": "string", + "description": "name of the web site that had this event." + }, + "clientRequestId": { + "type": "string", + "description": "The client request id generated by the app service for the site API operation that triggered this event." + }, + "correlationRequestId": { + "type": "string", + "description": "The correlation request id generated by the app service for the site API operation that triggered this event." + }, + "requestId": { + "type": "string", + "description": "The request id generated by the app service for the site API operation that triggered this event." + }, + "address": { + "type": "string", + "description": "HTTP request URL of this operation." + }, + "verb": { + "type": "string", + "description": "HTTP verb of this operation." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Web.AppUpdated event." + }, + "WebBackupOperationCompletedEventData": { + "type": "object", + "properties": { + "appEventTypeDetail": { + "$ref": "#/definitions/AppEventTypeDetail" + }, + "name": { + "type": "string", + "description": "name of the web site that had this event." + }, + "clientRequestId": { + "type": "string", + "description": "The client request id generated by the app service for the site API operation that triggered this event." + }, + "correlationRequestId": { + "type": "string", + "description": "The correlation request id generated by the app service for the site API operation that triggered this event." + }, + "requestId": { + "type": "string", + "description": "The request id generated by the app service for the site API operation that triggered this event." + }, + "address": { + "type": "string", + "description": "HTTP request URL of this operation." + }, + "verb": { + "type": "string", + "description": "HTTP verb of this operation." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Web.BackupOperationCompleted event." + }, + "WebBackupOperationFailedEventData": { + "type": "object", + "properties": { + "appEventTypeDetail": { + "$ref": "#/definitions/AppEventTypeDetail" + }, + "name": { + "type": "string", + "description": "name of the web site that had this event." + }, + "clientRequestId": { + "type": "string", + "description": "The client request id generated by the app service for the site API operation that triggered this event." + }, + "correlationRequestId": { + "type": "string", + "description": "The correlation request id generated by the app service for the site API operation that triggered this event." + }, + "requestId": { + "type": "string", + "description": "The request id generated by the app service for the site API operation that triggered this event." + }, + "address": { + "type": "string", + "description": "HTTP request URL of this operation." + }, + "verb": { + "type": "string", + "description": "HTTP verb of this operation." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Web.BackupOperationFailed event." + }, + "WebBackupOperationStartedEventData": { + "type": "object", + "properties": { + "appEventTypeDetail": { + "$ref": "#/definitions/AppEventTypeDetail" + }, + "name": { + "type": "string", + "description": "name of the web site that had this event." + }, + "clientRequestId": { + "type": "string", + "description": "The client request id generated by the app service for the site API operation that triggered this event." + }, + "correlationRequestId": { + "type": "string", + "description": "The correlation request id generated by the app service for the site API operation that triggered this event." + }, + "requestId": { + "type": "string", + "description": "The request id generated by the app service for the site API operation that triggered this event." + }, + "address": { + "type": "string", + "description": "HTTP request URL of this operation." + }, + "verb": { + "type": "string", + "description": "HTTP verb of this operation." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Web.BackupOperationStarted event." + }, + "WebRestoreOperationCompletedEventData": { + "type": "object", + "properties": { + "appEventTypeDetail": { + "$ref": "#/definitions/AppEventTypeDetail" + }, + "name": { + "type": "string", + "description": "name of the web site that had this event." + }, + "clientRequestId": { + "type": "string", + "description": "The client request id generated by the app service for the site API operation that triggered this event." + }, + "correlationRequestId": { + "type": "string", + "description": "The correlation request id generated by the app service for the site API operation that triggered this event." + }, + "requestId": { + "type": "string", + "description": "The request id generated by the app service for the site API operation that triggered this event." + }, + "address": { + "type": "string", + "description": "HTTP request URL of this operation." + }, + "verb": { + "type": "string", + "description": "HTTP verb of this operation." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Web.RestoreOperationCompleted event." + }, + "WebRestoreOperationFailedEventData": { + "type": "object", + "properties": { + "appEventTypeDetail": { + "$ref": "#/definitions/AppEventTypeDetail" + }, + "name": { + "type": "string", + "description": "name of the web site that had this event." + }, + "clientRequestId": { + "type": "string", + "description": "The client request id generated by the app service for the site API operation that triggered this event." + }, + "correlationRequestId": { + "type": "string", + "description": "The correlation request id generated by the app service for the site API operation that triggered this event." + }, + "requestId": { + "type": "string", + "description": "The request id generated by the app service for the site API operation that triggered this event." + }, + "address": { + "type": "string", + "description": "HTTP request URL of this operation." + }, + "verb": { + "type": "string", + "description": "HTTP verb of this operation." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Web.RestoreOperationFailed event." + }, + "WebRestoreOperationStartedEventData": { + "type": "object", + "properties": { + "appEventTypeDetail": { + "$ref": "#/definitions/AppEventTypeDetail" + }, + "name": { + "type": "string", + "description": "name of the web site that had this event." + }, + "clientRequestId": { + "type": "string", + "description": "The client request id generated by the app service for the site API operation that triggered this event." + }, + "correlationRequestId": { + "type": "string", + "description": "The correlation request id generated by the app service for the site API operation that triggered this event." + }, + "requestId": { + "type": "string", + "description": "The request id generated by the app service for the site API operation that triggered this event." + }, + "address": { + "type": "string", + "description": "HTTP request URL of this operation." + }, + "verb": { + "type": "string", + "description": "HTTP verb of this operation." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Web.RestoreOperationStarted event." + }, + "WebSlotSwapCompletedEventData": { + "type": "object", + "properties": { + "appEventTypeDetail": { + "$ref": "#/definitions/AppEventTypeDetail" + }, + "name": { + "type": "string", + "description": "name of the web site that had this event." + }, + "clientRequestId": { + "type": "string", + "description": "The client request id generated by the app service for the site API operation that triggered this event." + }, + "correlationRequestId": { + "type": "string", + "description": "The correlation request id generated by the app service for the site API operation that triggered this event." + }, + "requestId": { + "type": "string", + "description": "The request id generated by the app service for the site API operation that triggered this event." + }, + "address": { + "type": "string", + "description": "HTTP request URL of this operation." + }, + "verb": { + "type": "string", + "description": "HTTP verb of this operation." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapCompleted event." + }, + "WebSlotSwapFailedEventData": { + "type": "object", + "properties": { + "appEventTypeDetail": { + "$ref": "#/definitions/AppEventTypeDetail" + }, + "name": { + "type": "string", + "description": "name of the web site that had this event." + }, + "clientRequestId": { + "type": "string", + "description": "The client request id generated by the app service for the site API operation that triggered this event." + }, + "correlationRequestId": { + "type": "string", + "description": "The correlation request id generated by the app service for the site API operation that triggered this event." + }, + "requestId": { + "type": "string", + "description": "The request id generated by the app service for the site API operation that triggered this event." + }, + "address": { + "type": "string", + "description": "HTTP request URL of this operation." + }, + "verb": { + "type": "string", + "description": "HTTP verb of this operation." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapFailed event." + }, + "WebSlotSwapStartedEventData": { + "type": "object", + "properties": { + "appEventTypeDetail": { + "$ref": "#/definitions/AppEventTypeDetail" + }, + "name": { + "type": "string", + "description": "name of the web site that had this event." + }, + "clientRequestId": { + "type": "string", + "description": "The client request id generated by the app service for the site API operation that triggered this event." + }, + "correlationRequestId": { + "type": "string", + "description": "The correlation request id generated by the app service for the site API operation that triggered this event." + }, + "requestId": { + "type": "string", + "description": "The request id generated by the app service for the site API operation that triggered this event." + }, + "address": { + "type": "string", + "description": "HTTP request URL of this operation." + }, + "verb": { + "type": "string", + "description": "HTTP verb of this operation." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapStarted event." + }, + "WebSlotSwapWithPreviewCancelledEventData": { + "type": "object", + "properties": { + "appEventTypeDetail": { + "$ref": "#/definitions/AppEventTypeDetail" + }, + "name": { + "type": "string", + "description": "name of the web site that had this event." + }, + "clientRequestId": { + "type": "string", + "description": "The client request id generated by the app service for the site API operation that triggered this event." + }, + "correlationRequestId": { + "type": "string", + "description": "The correlation request id generated by the app service for the site API operation that triggered this event." + }, + "requestId": { + "type": "string", + "description": "The request id generated by the app service for the site API operation that triggered this event." + }, + "address": { + "type": "string", + "description": "HTTP request URL of this operation." + }, + "verb": { + "type": "string", + "description": "HTTP verb of this operation." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapWithPreviewCancelled event." + }, + "WebSlotSwapWithPreviewStartedEventData": { + "type": "object", + "properties": { + "appEventTypeDetail": { + "$ref": "#/definitions/AppEventTypeDetail" + }, + "name": { + "type": "string", + "description": "name of the web site that had this event." + }, + "clientRequestId": { + "type": "string", + "description": "The client request id generated by the app service for the site API operation that triggered this event." + }, + "correlationRequestId": { + "type": "string", + "description": "The correlation request id generated by the app service for the site API operation that triggered this event." + }, + "requestId": { + "type": "string", + "description": "The request id generated by the app service for the site API operation that triggered this event." + }, + "address": { + "type": "string", + "description": "HTTP request URL of this operation." + }, + "verb": { + "type": "string", + "description": "HTTP verb of this operation." + } + }, + "description": "Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapWithPreviewStarted event." + } + }, + "parameters": {} +} From 38b3e01b9aa8f90fc4857737698cba66343ab39b Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Mon, 19 Dec 2022 18:06:02 -0500 Subject: [PATCH 47/65] generation step initial --- .../eventgrid/data-plane/cadl/generation_steps.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 specification/eventgrid/data-plane/cadl/generation_steps.md diff --git a/specification/eventgrid/data-plane/cadl/generation_steps.md b/specification/eventgrid/data-plane/cadl/generation_steps.md new file mode 100644 index 000000000000..44e9fa82313c --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/generation_steps.md @@ -0,0 +1,10 @@ +# CADL Generation + +Modeled after cadl generation steps [here](https://github.com/Azure/cadl-azure#readme) + + +1) Clone azure-rest-api-specs repo, create a new branch and pull this code. + +2) Under ../cadl folder run `npm install @azure-tools/cadl-autorest @azure-tools/cadl-azure-core @azure-tools/cadl-csharp @azure-tools/cadl-providerhub @cadl-lang/compiler @cadl-lang/rest @cadl-lang/versioning` + - You should now have a package.json, and package-lock.json +3) Run `cadl compile main.cadl --emit YourEmitterName` with the emitter of your choice. To generate the swagger file (includes everything into one file) use @azure-tools/cadl-autorest, to generate the CSharp SDK use @azure-tools/cadl-csharp. Output will appear under `cadl-output/YourEmitterName/` \ No newline at end of file From ba33c51c3acfa9adf0a94ceb4c32e8fbc344ef94 Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Mon, 19 Dec 2022 18:06:48 -0500 Subject: [PATCH 48/65] generation step initial2 --- specification/eventgrid/data-plane/cadl/generation_steps.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/eventgrid/data-plane/cadl/generation_steps.md b/specification/eventgrid/data-plane/cadl/generation_steps.md index 44e9fa82313c..7a278fafa75e 100644 --- a/specification/eventgrid/data-plane/cadl/generation_steps.md +++ b/specification/eventgrid/data-plane/cadl/generation_steps.md @@ -3,7 +3,7 @@ Modeled after cadl generation steps [here](https://github.com/Azure/cadl-azure#readme) -1) Clone azure-rest-api-specs repo, create a new branch and pull this code. +1) Clone azure-rest-api-specs repo, create a new branch and pull this code. Make sure npm is installed. 2) Under ../cadl folder run `npm install @azure-tools/cadl-autorest @azure-tools/cadl-azure-core @azure-tools/cadl-csharp @azure-tools/cadl-providerhub @cadl-lang/compiler @cadl-lang/rest @cadl-lang/versioning` - You should now have a package.json, and package-lock.json From ef9764456ce4deb900fe4c431416103d98969ede Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Tue, 20 Dec 2022 08:50:10 -0800 Subject: [PATCH 49/65] changing gen steps --- .../data-plane/cadl/cadl-output/openapi.json | 188 ------------------ .../data-plane/cadl/generation_steps.md | 14 +- .../eventgrid/data-plane/cadl/main.cadl | 4 + 3 files changed, 14 insertions(+), 192 deletions(-) delete mode 100644 specification/eventgrid/data-plane/cadl/cadl-output/openapi.json diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/openapi.json b/specification/eventgrid/data-plane/cadl/cadl-output/openapi.json deleted file mode 100644 index 34ef65d43850..000000000000 --- a/specification/eventgrid/data-plane/cadl/cadl-output/openapi.json +++ /dev/null @@ -1,188 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "EventGridClient", - "version": "2018-01-01", - "description": "Azure EventGrid Client", - "x-cadl-generated": [ - { - "emitter": "@azure-tools/cadl-autorest" - } - ] - }, - "schemes": [ - "https" - ], - "x-ms-parameterized-host": { - "hostTemplate": "{topicHostname}", - "useSchemePrefix": false, - "parameters": [ - { - "name": "topicHostname", - "in": "path", - "required": true, - "description": "The host name of the topic, e.g. topic1.westus2-1.eventgrid.azure.net", - "type": "string" - } - ] - }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ], - "tags": [], - "paths": {}, - "definitions": { - "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 Event Grid topic using the CloudEvent 1.0 Schema", - "required": [ - "id", - "source", - "type", - "specversion" - ] - }, - "CustomEventEvent": { - "type": "object", - "properties": {}, - "description": "Properties of an event published to an Event Grid topic using a custom schema" - }, - "EventGridEvent": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "An unique identifier for the event." - }, - "topic": { - "type": "string", - "description": "The resource path of the event source." - }, - "subject": { - "type": "string", - "description": "A resource path relative to the topic path." - }, - "data": { - "$ref": "#/definitions/object", - "description": "Event data specific to the event type." - }, - "eventType": { - "type": "string", - "description": "The type of the event that occurred." - }, - "eventTime": { - "type": "string", - "format": "date-time", - "description": "The time (in UTC) the event was generated." - }, - "metadataVersion": { - "type": "string", - "description": "The schema version of the event metadata.", - "readOnly": true - }, - "dataVersion": { - "type": "string", - "description": "The schema version of the data object." - } - }, - "description": "Properties of an event published to an Event Grid topic using the EventGrid Schema.", - "required": [ - "id", - "subject", - "data", - "eventType", - "eventTime", - "dataVersion" - ] - }, - "SubscriptionDeletedEventData": { - "type": "object", - "properties": { - "eventSubscriptionId": { - "type": "string", - "description": "The Azure resource ID of the deleted event subscription.", - "readOnly": true - } - }, - "description": "Schema of the Data property of an EventGridEvent for a Microsoft.EventGrid.SubscriptionDeletedEvent event." - }, - "SubscriptionValidationEventData": { - "type": "object", - "properties": { - "validationCode": { - "type": "string", - "description": "The validation code sent by Azure Event Grid to validate an event subscription. To complete the validation handshake, the subscriber must either respond with this validation code as part of the validation response, or perform a GET request on the validationUrl (available starting version 2018-05-01-preview).", - "readOnly": true - }, - "validationUrl": { - "type": "string", - "description": "The validation URL sent by Azure Event Grid (available starting version 2018-05-01-preview). To complete the validation handshake, the subscriber must either respond with the validationCode as part of the validation response, or perform a GET request on the validationUrl (available starting version 2018-05-01-preview).", - "readOnly": true - } - }, - "description": "Schema of the Data property of an EventGridEvent for a Microsoft.EventGrid.SubscriptionValidationEvent event." - }, - "SubscriptionValidationResponse": { - "type": "object", - "properties": { - "validationResponse": { - "type": "string", - "description": "The validation response sent by the subscriber to Azure Event Grid to complete the validation of an event subscription." - } - }, - "description": "To complete an event subscription validation handshake, a subscriber can use either the validationCode or the validationUrl received in a SubscriptionValidationEvent. When the validationCode is used, the SubscriptionValidationResponse can be used to build the response." - }, - "object": { - "type": "object", - "properties": {} - } - }, - "parameters": {} -} diff --git a/specification/eventgrid/data-plane/cadl/generation_steps.md b/specification/eventgrid/data-plane/cadl/generation_steps.md index 7a278fafa75e..c4d26907cad2 100644 --- a/specification/eventgrid/data-plane/cadl/generation_steps.md +++ b/specification/eventgrid/data-plane/cadl/generation_steps.md @@ -2,9 +2,15 @@ Modeled after cadl generation steps [here](https://github.com/Azure/cadl-azure#readme) +## Initial Steps: +1) Fork and clone the azure-rest-api-specs repository, create a new branch and pull this code. Ensure that `npm` is installed. -1) Clone azure-rest-api-specs repo, create a new branch and pull this code. Make sure npm is installed. +## Generate Code: +1) Under the `./cadl` folder run: +``` +npm i @azure-tools/cadl-autorest @azure-tools/cadl-azure-core @azure-tools/cadl-csharp @azure-tools/cadl-providerhub @cadl-lang/compiler @cadl-lang/rest @cadl-lang/versioning +``` +- You should now have a package.json, and package-lock.json -2) Under ../cadl folder run `npm install @azure-tools/cadl-autorest @azure-tools/cadl-azure-core @azure-tools/cadl-csharp @azure-tools/cadl-providerhub @cadl-lang/compiler @cadl-lang/rest @cadl-lang/versioning` - - You should now have a package.json, and package-lock.json -3) Run `cadl compile main.cadl --emit YourEmitterName` with the emitter of your choice. To generate the swagger file (includes everything into one file) use @azure-tools/cadl-autorest, to generate the CSharp SDK use @azure-tools/cadl-csharp. Output will appear under `cadl-output/YourEmitterName/` \ No newline at end of file + +2) Run: `cadl compile main.cadl --emit YourEmitterName` with the emitter of your choice. To generate the swagger file (includes everything into one file) use @azure-tools/cadl-autorest, to generate the CSharp SDK use @azure-tools/cadl-csharp. Output will appear under `cadl-output/YourEmitterName/` \ No newline at end of file diff --git a/specification/eventgrid/data-plane/cadl/main.cadl b/specification/eventgrid/data-plane/cadl/main.cadl index 95133e9a6326..ad50679f609a 100644 --- a/specification/eventgrid/data-plane/cadl/main.cadl +++ b/specification/eventgrid/data-plane/cadl/main.cadl @@ -5,6 +5,10 @@ import "./ContainerRegistry.cadl"; import "./ContainerService.cadl"; import "./EventHub.cadl"; import "./Maps.cadl"; +import "./IotHub.cadl"; +import "./HealthcareApis.cadl"; +import "./KeyVault.cadl"; +import "./MachineLearningServices.cadl"; import "./MediaServices.cadl"; import "./PolicyInsights.cadl"; import "./RedisCache.cadl"; From 6dfca481573f15ca6b908278c2b3d45c60a775fb Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Wed, 21 Dec 2022 11:08:44 -0800 Subject: [PATCH 50/65] change extends to spread --- specification/eventgrid/data-plane/cadl/IotHub.cadl | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/specification/eventgrid/data-plane/cadl/IotHub.cadl b/specification/eventgrid/data-plane/cadl/IotHub.cadl index 9ed674c5afd4..2aa3a3e9e375 100644 --- a/specification/eventgrid/data-plane/cadl/IotHub.cadl +++ b/specification/eventgrid/data-plane/cadl/IotHub.cadl @@ -102,10 +102,14 @@ model DeviceConnectionStateEventInfo { } @doc("Event data for Microsoft.Devices.DeviceCreated event.") -model IotHubDeviceCreatedEventData extends DeviceLifeCycleEventProperties {} +model IotHubDeviceCreatedEventData{ + ...DeviceLifeCycleEventProperties; +} @doc("Event data for Microsoft.Devices.DeviceDeleted event.") -model IotHubDeviceDeletedEventData extends DeviceLifeCycleEventProperties {} +model IotHubDeviceDeletedEventData{ + ...DeviceLifeCycleEventProperties; +} @doc("Event data for Microsoft.Devices.DeviceConnected event.") model IotHubDeviceConnectedEventData @@ -116,7 +120,9 @@ model IotHubDeviceDisconnectedEventData extends DeviceConnectionStateEventProperties {} @doc("Event data for Microsoft.Devices.DeviceTelemetry event.") -model IotHubDeviceTelemetryEventData extends DeviceTelemetryEventProperties {} +model IotHubDeviceTelemetryEventData{ + ...DeviceTelemetryEventProperties; +} model PropertiesJson { @doc("A portion of the properties that can be written only by the application back-end, and read by the device.") From c9204637f8acecf72e7c0b586f28f3189230f60e Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Fri, 20 Jan 2023 16:54:38 -0800 Subject: [PATCH 51/65] added in apimanagementgateway to cadl --- .../data-plane/cadl/ApiManagement.cadl | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/specification/eventgrid/data-plane/cadl/ApiManagement.cadl b/specification/eventgrid/data-plane/cadl/ApiManagement.cadl index d8d480325d5d..463cea827e82 100644 --- a/specification/eventgrid/data-plane/cadl/ApiManagement.cadl +++ b/specification/eventgrid/data-plane/cadl/ApiManagement.cadl @@ -75,8 +75,83 @@ namespace EventGrid.ApiManagement { ...ApiManagementBase; } + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayCreated event.") + model ApiManagementGatewayCreatedEventData{ + ...ApiGatewayBase; + } + + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayUpdated event.") + model ApiManagementGatewayUpdatedEventData{ + ...ApiGatewayBase; + } + + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayDeleted event.") + model ApiManagementGatewayDeletedEventData{ + ...ApiGatewayBase; + } + + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayHostnameConfigurationCreated event.") + model ApiManagementGatewayHostnameConfigurationCreatedEventData{ + ...ApiGatewayHostnameBase; + } + + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayHostnameConfigurationUpdated event.") + model ApiManagementGatewayHostnameConfigurationUpdatedEventData{ + ...ApiGatewayHostnameBase; + } + + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayHostnameConfigurationDeleted event.") + model ApiManagementGatewayHostnameConfigurationDeletedEventData{ + ...ApiGatewayHostnameBase; + } + + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayCertificateAuthorityCreated event.") + model ApiManagementGatewayCertificateAuthorityCreatedEventData{ + ...ApiGatewayCertificateBase; + } + + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayCertificateAuthorityUpdated event.") + model ApiManagementGatewayCertificateAuthorityUpdatedEventData{ + ...ApiGatewayCertificateBase; + } + + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayCertificateAuthorityDeleted event.") + model ApiManagementGatewayCertificateAuthorityDeletedEventData{ + ...ApiGatewayCertificateBase; + } + + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayAPIAdded event.") + model ApiManagementGatewayApiAddedEventData{ + ...ApiGatewayApiBase; + } + + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayAPIRemoved event.") + model ApiManagementGatewayApiRemovedEventData{ + ...ApiGatewayApiBase; + } + alias ApiManagementBase = { @doc("The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions//resourceGroups//Microsoft.ApiManagement/service///`") resourceUri?: string; }; + + alias ApiGatewayBase = { + @doc("The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions//resourceGroups//Microsoft.ApiManagement/service//gateways/`") + resourceUri?: string; + }; + + alias ApiGatewayHostnameBase = { + @doc("The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions//resourceGroups//Microsoft.ApiManagement/service//gateways//hostnameConfigurations/`") + resourceUri?: string; + }; + + alias ApiGatewayCertificateBase = { + @doc("The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions//resourceGroups//Microsoft.ApiManagement/service//gateways//certificateAuthorities/`") + resourceUri?: string; + }; + + alias ApiGatewayApiBase = { + @doc("The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions//resourceGroups//Microsoft.ApiManagement/service//gateways//apis/`") + resourceUri?: string; + }; } From 073408519780c5343bfa3de9e50e1e3d6d4d4053 Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Fri, 20 Jan 2023 17:23:59 -0800 Subject: [PATCH 52/65] cadl databox --- .../eventgrid/data-plane/cadl/DataBox.cadl | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 specification/eventgrid/data-plane/cadl/DataBox.cadl diff --git a/specification/eventgrid/data-plane/cadl/DataBox.cadl b/specification/eventgrid/data-plane/cadl/DataBox.cadl new file mode 100644 index 000000000000..8c4c769c4dbb --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/DataBox.cadl @@ -0,0 +1,41 @@ + + +namespace EventGrid.DataBox { + + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.DataBox.CopyStarted event.") + model DataBoxCopyStartedEventData{ + ...DataBoxBase; + } + + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.DataBox.CopyCompleted event.") + model DataBoxCopyCompletedEventData{ + ...DataBoxBase; + } + + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.DataBox.OrderCompleted event.") + model DataBoxOrderCompletedEventData{ + ...DataBoxBase; + } + + alias DataBoxBase = { + @doc("Serial Number of the device associated with the event. The list is comma separated if more than one serial number is associated.") + serialNumber?: string; + + @doc("Name of the current Stage") + stageName?: DataBoxStageName; + + @doc("The time at which the stage happened.") + stageTime?:string; + }; + + enum DataBoxStageName { + @doc("Copy has started") + "CopyStarted", + @doc("Copy has completed") + "CopyCompleted", + @doc("Order has been completed") + "OrderCompleted", + } + + +}; \ No newline at end of file From 12d2536c3430fd0246faf0db42ddadf96925e24b Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Thu, 16 Feb 2023 15:16:06 -0800 Subject: [PATCH 53/65] updating cadl to align with public client --- .../eventgrid/data-plane/cadl/EventGrid.cadl | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/specification/eventgrid/data-plane/cadl/EventGrid.cadl b/specification/eventgrid/data-plane/cadl/EventGrid.cadl index 7207902c8a29..6bca6bc24469 100644 --- a/specification/eventgrid/data-plane/cadl/EventGrid.cadl +++ b/specification/eventgrid/data-plane/cadl/EventGrid.cadl @@ -1,27 +1,29 @@ -import "@cadl-lang/rest"; -import "@cadl-lang/openapi"; +// import "@cadl-lang/rest"; +// import "@cadl-lang/openapi"; import "@cadl-lang/versioning"; -import "@azure-tools/cadl-providerhub"; +import "@azure-tools/cadl-azure-core"; +// import "@azure-tools/cadl-providerhub"; @service({ title: "EventGridClient", version: "2018-01-01", }) @server( - "{topicHostname}", + "{endpoint}", "The host name of the topic", { @doc("The host name of the topic, e.g. topic1.westus2-1.eventgrid.azure.net") - topicHostname: string, + endpoint: url, } ) @doc("Azure EventGrid Client") namespace EventGrid { using Cadl.Http; - using Cadl.Rest; + using Azure.Core.Foundations; + // using Cadl.Rest; using Cadl.Versioning; - using OpenAPI; + // using OpenAPI; @doc("Properties of an event published to an Event Grid topic using the EventGrid Schema.") model EventGridEvent { @@ -111,11 +113,11 @@ namespace EventGrid { eventSubscriptionId?: string; } - model ApiVersionParameter { - @doc("Version of the API to be used with the client request.") - @query - "api-version": string; - } + // model ApiVersionParameter { + // @doc("Version of the API to be used with the client request.") + // @query + // "api-version"?: string; + // } model ChannelNameParameter { @doc("Required only when publishing to partner namespaces with partner topic routing mode ChannelNameHeader.") @@ -153,7 +155,7 @@ namespace EventGrid { @tag("Events") @doc("Publishes a batch of events to an Azure Event Grid topic.") op PublishCustomEventEvents( - @extension("x-ms-identifiers", []) + // @extension("x-ms-identifiers", []) @doc("An array of events to be published to Event Grid.") @body events: CustomEventEvent[], From bc26bdc54ecf4165cd4122250ecb01c1c7e7eb4d Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Thu, 16 Feb 2023 15:32:08 -0800 Subject: [PATCH 54/65] adding auth and apiversion fix --- .../eventgrid/data-plane/cadl/EventGrid.cadl | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/specification/eventgrid/data-plane/cadl/EventGrid.cadl b/specification/eventgrid/data-plane/cadl/EventGrid.cadl index 6bca6bc24469..dfd909281821 100644 --- a/specification/eventgrid/data-plane/cadl/EventGrid.cadl +++ b/specification/eventgrid/data-plane/cadl/EventGrid.cadl @@ -4,6 +4,20 @@ import "@cadl-lang/versioning"; import "@azure-tools/cadl-azure-core"; // import "@azure-tools/cadl-providerhub"; + +enum ServiceApiVersions { + v2018_01_01: "2018-01-01", +} + + +@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", version: "2018-01-01", @@ -16,6 +30,7 @@ import "@azure-tools/cadl-azure-core"; endpoint: url, } ) +@versioned(ServiceApiVersions) @doc("Azure EventGrid Client") namespace EventGrid { @@ -25,6 +40,9 @@ namespace EventGrid { using Cadl.Versioning; // using OpenAPI; + + + @doc("Properties of an event published to an Event Grid topic using the EventGrid Schema.") model EventGridEvent { @doc("An unique identifier for the event.") From 3ed06db40be4d7476d8aa123dae5936e57f194d7 Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Fri, 17 Feb 2023 09:03:00 -0800 Subject: [PATCH 55/65] adding cadl output and operations file to show overlaod --- .../eventgrid/data-plane/cadl/EventGrid.cadl | 131 +- .../cadl-python/eventgrid/__init__.py | 26 + .../cadl-python/eventgrid/_client.py | 83 + .../cadl-python/eventgrid/_configuration.py | 80 + .../cadl-python/eventgrid/_model_base.py | 714 ++++++ .../eventgrid/_operations/__init__.py | 19 + .../eventgrid/_operations/_operations.py | 154 ++ .../eventgrid/_operations/_patch.py | 20 + .../cadl-python/eventgrid/_patch.py | 20 + .../cadl-python/eventgrid/_serialization.py | 1996 +++++++++++++++++ .../cadl-python/eventgrid/_vendor.py | 26 + .../cadl-python/eventgrid/_version.py | 9 + .../cadl-python/eventgrid/aio/__init__.py | 23 + .../cadl-python/eventgrid/aio/_client.py | 85 + .../eventgrid/aio/_configuration.py | 82 + .../eventgrid/aio/_operations/__init__.py | 19 + .../eventgrid/aio/_operations/_operations.py | 127 ++ .../eventgrid/aio/_operations/_patch.py | 20 + .../cadl-python/eventgrid/aio/_patch.py | 20 + .../cadl-python/eventgrid/aio/_vendor.py | 26 + .../cadl-python/eventgrid/models/__init__.py | 20 + .../cadl-python/eventgrid/models/_models.py | 18 + .../cadl-python/eventgrid/models/_patch.py | 20 + .../cadl-python/eventgrid/py.typed | 1 + .../@azure-tools/cadl-python/setup.py | 31 + 25 files changed, 3726 insertions(+), 44 deletions(-) create mode 100644 specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/__init__.py create mode 100644 specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_client.py create mode 100644 specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_configuration.py create mode 100644 specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_model_base.py create mode 100644 specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_operations/__init__.py create mode 100644 specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_operations/_operations.py create mode 100644 specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_operations/_patch.py create mode 100644 specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_patch.py create mode 100644 specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_serialization.py create mode 100644 specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_vendor.py create mode 100644 specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_version.py create mode 100644 specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/__init__.py create mode 100644 specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_client.py create mode 100644 specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_configuration.py create mode 100644 specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_operations/__init__.py create mode 100644 specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_operations/_operations.py create mode 100644 specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_operations/_patch.py create mode 100644 specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_patch.py create mode 100644 specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_vendor.py create mode 100644 specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/__init__.py create mode 100644 specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/_models.py create mode 100644 specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/_patch.py create mode 100644 specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/py.typed create mode 100644 specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/setup.py diff --git a/specification/eventgrid/data-plane/cadl/EventGrid.cadl b/specification/eventgrid/data-plane/cadl/EventGrid.cadl index dfd909281821..970eb8d64e94 100644 --- a/specification/eventgrid/data-plane/cadl/EventGrid.cadl +++ b/specification/eventgrid/data-plane/cadl/EventGrid.cadl @@ -40,9 +40,6 @@ namespace EventGrid { using Cadl.Versioning; // using OpenAPI; - - - @doc("Properties of an event published to an Event Grid topic using the EventGrid Schema.") model EventGridEvent { @doc("An unique identifier for the event.") @@ -131,11 +128,6 @@ namespace EventGrid { eventSubscriptionId?: string; } - // model ApiVersionParameter { - // @doc("Version of the API to be used with the client request.") - // @query - // "api-version"?: string; - // } model ChannelNameParameter { @doc("Required only when publishing to partner namespaces with partner topic routing mode ChannelNameHeader.") @@ -143,43 +135,94 @@ namespace EventGrid { "aeg-channel-name"?: string; } - @post - @route("?overload=EventGridEvent") - @tag("Events") - @doc("Publishes a batch of events to an Azure Event Grid topic.") - op PublishEventGridEvents( - @doc("An array of events to be published to Event Grid.") - @body - events: EventGridEvent[], - ...ApiVersionParameter, - ): OkResponse; - // missing default response - - @post - @route("?overload=cloudEvent") - @tag("Events") - @doc("Publishes a batch of events to an Azure Event Grid topic.") - op PublishCloudEventEvents( - @doc("An array of events to be published to Event Grid.") - @body - events: CloudEventEvent[], - ...ApiVersionParameter, - ...ChannelNameParameter, - ): OkResponse; - // missing default response - - @post - @route("?overload=customEvent") - @tag("Events") - @doc("Publishes a batch of events to an Azure Event Grid topic.") - op PublishCustomEventEvents( - // @extension("x-ms-identifiers", []) - @doc("An array of events to be published to Event Grid.") + // @post + // // @route("?overload=EventGridEvent") + // // @tag("Events") + // @doc("Publishes a batch of events to an Azure Event Grid topic.") + // op PublishEvents( + // @doc("An array of events to be published to Event Grid.") + // @body + // events: Event, + // ...ApiVersionParameter, + // ): OkResponse; + + model CloudEventRequest{ + @header("content-type") contentType: "application/cloudevents-batch+json; charset=utf-8", + @body _: CloudEventEvent + }; + model EventEventRequest{ + @header("content-type") contentType: "application/json", + @body _: EventGridEvent + }; + + alias InputType = CloudEventRequest | EventEventRequest; + + + // op PublishEvent(...ApiVersionParameter, requests:InputType):OkResponse; + + + op PublishEvent( + ...ApiVersionParameter, @body - events: CustomEventEvent[], - ...ApiVersionParameter, - ): OkResponse; - // missing default response + requests: InputType + ):OkResponse; + + + // { + // ...CloudEventRequest, + // ...ApiVersionParameter, + // }| + // { + // ...EventEventRequest, + // ...ApiVersionParameter, + // } + + + // @overload(PublishEvent) + // @post + // op PublishEventCloud( + // ...ApiVersionParameter, + // @body + // @doc("Cloud") + // requests:CloudEventRequest, + // ):OkResponse; + + // @overload(PublishEvent) + // @post + // op PublishEventEventGrid( + // ...ApiVersionParameter, + // @body + // @doc("Event") + // requests: EventEventRequest, + // ):OkResponse; + + + + +// @post +// @route() +// // @route("?overload=cloudEvent") +// @tag("Events") +// @doc("Publishes a batch of events to an Azure Event Grid topic.") +// op PublishCloudEventEvents( +// @doc("An array of events to be published to Event Grid.") +// @body +// events: CloudEventEvent[], +// ...ApiVersionParameter, +// ...ChannelNameParameter, +// ): OkResponse; + +// @post +// // @route("?overload=customEvent") +// @tag("Events") +// @doc("Publishes a batch of events to an Azure Event Grid topic.") +// op PublishCustomEventEvents( +// // @extension("x-ms-identifiers", []) +// @doc("An array of events to be published to Event Grid.") +// @body +// events: CustomEventEvent[], +// ...ApiVersionParameter, +// ): OkResponse; } diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/__init__.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/__init__.py new file mode 100644 index 000000000000..78d20e5468da --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/__init__.py @@ -0,0 +1,26 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._client import EventGridClient +from ._version import VERSION + +__version__ = VERSION + +try: + from ._patch import __all__ as _patch_all + from ._patch import * # pylint: disable=unused-wildcard-import +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "EventGridClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) + +_patch_sdk() diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_client.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_client.py new file mode 100644 index 000000000000..403f85053544 --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_client.py @@ -0,0 +1,83 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from copy import deepcopy +from typing import Any, TYPE_CHECKING, Union + +from azure.core import PipelineClient +from azure.core.credentials import AzureKeyCredential +from azure.core.rest import HttpRequest, HttpResponse + +from ._configuration import EventGridClientConfiguration +from ._operations import EventGridClientOperationsMixin +from ._serialization import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential + + +class EventGridClient(EventGridClientOperationsMixin): # pylint: disable=client-accepts-api-version-keyword + """Azure EventGrid Client. + + :param endpoint: The host name of the topic, e.g. topic1.westus2-1.eventgrid.azure.net. + Required. + :type endpoint: str + :param credential: Credential needed for the client to connect to Azure. Is either a + AzureKeyCredential type or a TokenCredential type. Required. + :type credential: ~azure.core.credentials.AzureKeyCredential or + ~azure.core.credentials.TokenCredential + :keyword api_version: The API version to use for this operation. Default value is "2018-01-01". + Note that overriding this default value may result in unsupported behavior. + :paramtype api_version: str + """ + + def __init__(self, endpoint: str, credential: Union[AzureKeyCredential, "TokenCredential"], **kwargs: Any) -> None: + _endpoint = "{endpoint}" + self._config = EventGridClientConfiguration(endpoint=endpoint, credential=credential, **kwargs) + self._client = PipelineClient(base_url=_endpoint, config=self._config, **kwargs) + + self._serialize = Serializer() + self._deserialize = Deserializer() + self._serialize.client_side_validation = False + + def send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client.send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.HttpResponse + """ + + request_copy = deepcopy(request) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + + request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) + return self._client.send_request(request_copy, **kwargs) + + def close(self) -> None: + self._client.close() + + def __enter__(self) -> "EventGridClient": + self._client.__enter__() + return self + + def __exit__(self, *exc_details: Any) -> None: + self._client.__exit__(*exc_details) diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_configuration.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_configuration.py new file mode 100644 index 000000000000..bbd17d61bdce --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_configuration.py @@ -0,0 +1,80 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +import sys +from typing import Any, TYPE_CHECKING, Union + +from azure.core.configuration import Configuration +from azure.core.credentials import AzureKeyCredential +from azure.core.pipeline import policies + +from ._version import VERSION + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential + + +class EventGridClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes + """Configuration for EventGridClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param endpoint: The host name of the topic, e.g. topic1.westus2-1.eventgrid.azure.net. + Required. + :type endpoint: str + :param credential: Credential needed for the client to connect to Azure. Is either a + AzureKeyCredential type or a TokenCredential type. Required. + :type credential: ~azure.core.credentials.AzureKeyCredential or + ~azure.core.credentials.TokenCredential + :keyword api_version: The API version to use for this operation. Default value is "2018-01-01". + Note that overriding this default value may result in unsupported behavior. + :paramtype api_version: str + """ + + def __init__(self, endpoint: str, credential: Union[AzureKeyCredential, "TokenCredential"], **kwargs: Any) -> None: + super(EventGridClientConfiguration, self).__init__(**kwargs) + api_version: Literal["2018-01-01"] = kwargs.pop("api_version", "2018-01-01") + + if endpoint is None: + raise ValueError("Parameter 'endpoint' must not be None.") + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + + self.endpoint = endpoint + self.credential = credential + self.api_version = api_version + self.credential_scopes = kwargs.pop("credential_scopes", ["https://eventgrid.azure.net/.default"]) + kwargs.setdefault("sdk_moniker", "eventgridclient/{}".format(VERSION)) + self._configure(**kwargs) + + def _infer_policy(self, **kwargs): + if isinstance(self.credential, AzureKeyCredential): + return policies.AzureKeyCredentialPolicy(self.credential, "aeg-sas-key", **kwargs) + if hasattr(self.credential, "get_token"): + return policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) + raise TypeError(f"Unsupported credential: {self.credential}") + + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or policies.HttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") + if self.credential and not self.authentication_policy: + self.authentication_policy = self._infer_policy(**kwargs) diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_model_base.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_model_base.py new file mode 100644 index 000000000000..c37b9314ab90 --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_model_base.py @@ -0,0 +1,714 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- +# pylint: disable=protected-access, arguments-differ, signature-differs, broad-except +# pyright: reportGeneralTypeIssues=false + +import functools +import sys +import logging +import base64 +import re +import copy +import typing +from datetime import datetime, date, time, timedelta, timezone +from json import JSONEncoder +import isodate +from azure.core.exceptions import DeserializationError +from azure.core import CaseInsensitiveEnumMeta +from azure.core.pipeline import PipelineResponse +from azure.core.serialization import NULL as AzureCoreNull + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping + +_LOGGER = logging.getLogger(__name__) + +__all__ = ["NULL", "AzureJSONEncoder", "Model", "rest_field", "rest_discriminator"] + + +class _Null(object): + """To create a Falsy object""" + + def __bool__(self): + return False + + __nonzero__ = __bool__ # Python2 compatibility + + +NULL = _Null() +""" +A falsy sentinel object which is supposed to be used to specify attributes +with no data. This gets serialized to `null` on the wire. +""" + +TZ_UTC = timezone.utc + + +def _timedelta_as_isostr(td: timedelta) -> str: + """Converts a datetime.timedelta object into an ISO 8601 formatted string, e.g. 'P4DT12H30M05S' + + Function adapted from the Tin Can Python project: https://github.com/RusticiSoftware/TinCanPython + + :param timedelta td: The timedelta to convert + :rtype: str + :return: ISO8601 version of this timedelta + """ + + # Split seconds to larger units + seconds = td.total_seconds() + minutes, seconds = divmod(seconds, 60) + hours, minutes = divmod(minutes, 60) + days, hours = divmod(hours, 24) + + days, hours, minutes = list(map(int, (days, hours, minutes))) + seconds = round(seconds, 6) + + # Build date + date_str = "" + if days: + date_str = "%sD" % days + + # Build time + time_str = "T" + + # Hours + bigger_exists = date_str or hours + if bigger_exists: + time_str += "{:02}H".format(hours) + + # Minutes + bigger_exists = bigger_exists or minutes + if bigger_exists: + time_str += "{:02}M".format(minutes) + + # Seconds + try: + if seconds.is_integer(): + seconds_string = "{:02}".format(int(seconds)) + else: + # 9 chars long w/ leading 0, 6 digits after decimal + seconds_string = "%09.6f" % seconds + # Remove trailing zeros + seconds_string = seconds_string.rstrip("0") + except AttributeError: # int.is_integer() raises + seconds_string = "{:02}".format(seconds) + + time_str += "{}S".format(seconds_string) + + return "P" + date_str + time_str + + +def _datetime_as_isostr(dt: typing.Union[datetime, date, time, timedelta]) -> str: + """Converts a datetime.(datetime|date|time|timedelta) object into an ISO 8601 formatted string + + :param timedelta dt: The date object to convert + :rtype: str + :return: ISO8601 version of this datetime + """ + # First try datetime.datetime + if hasattr(dt, "year") and hasattr(dt, "hour"): + dt = typing.cast(datetime, dt) + # astimezone() fails for naive times in Python 2.7, so make make sure dt is aware (tzinfo is set) + if not dt.tzinfo: + iso_formatted = dt.replace(tzinfo=TZ_UTC).isoformat() + else: + iso_formatted = dt.astimezone(TZ_UTC).isoformat() + # Replace the trailing "+00:00" UTC offset with "Z" (RFC 3339: https://www.ietf.org/rfc/rfc3339.txt) + return iso_formatted.replace("+00:00", "Z") + # Next try datetime.date or datetime.time + try: + dt = typing.cast(typing.Union[date, time], dt) + return dt.isoformat() + # Last, try datetime.timedelta + except AttributeError: + dt = typing.cast(timedelta, dt) + return _timedelta_as_isostr(dt) + + +def _serialize_bytes(o) -> str: + return base64.b64encode(o).decode() + + +def _serialize_datetime(o): + if hasattr(o, "year") and hasattr(o, "hour"): + # astimezone() fails for naive times in Python 2.7, so make make sure o is aware (tzinfo is set) + if not o.tzinfo: + iso_formatted = o.replace(tzinfo=TZ_UTC).isoformat() + else: + iso_formatted = o.astimezone(TZ_UTC).isoformat() + # Replace the trailing "+00:00" UTC offset with "Z" (RFC 3339: https://www.ietf.org/rfc/rfc3339.txt) + return iso_formatted.replace("+00:00", "Z") + # Next try datetime.date or datetime.time + return o.isoformat() + + +def _is_readonly(p): + try: + return p._readonly # pylint: disable=protected-access + except AttributeError: + return False + + +class AzureJSONEncoder(JSONEncoder): + """A JSON encoder that's capable of serializing datetime objects and bytes.""" + + def default(self, o): # pylint: disable=too-many-return-statements + if _is_model(o): + readonly_props = [ + p._rest_name for p in o._attr_to_rest_field.values() if _is_readonly(p) + ] # pylint: disable=protected-access + return {k: v for k, v in o.items() if k not in readonly_props} + if isinstance(o, (bytes, bytearray)): + return base64.b64encode(o).decode() + if o is AzureCoreNull: + return None + try: + return super(AzureJSONEncoder, self).default(o) + except TypeError: + if isinstance(o, (bytes, bytearray)): + return _serialize_bytes(o) + try: + # First try datetime.datetime + return _serialize_datetime(o) + except AttributeError: + pass + # Last, try datetime.timedelta + try: + return _timedelta_as_isostr(o) + except AttributeError: + # This will be raised when it hits value.total_seconds in the method above + pass + return super(AzureJSONEncoder, self).default(o) + + +_VALID_DATE = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" + r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") + + +def _deserialize_datetime(attr: typing.Union[str, datetime]) -> datetime: + """Deserialize ISO-8601 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + attr = attr.upper() + match = _VALID_DATE.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + check_decimal = attr.split(".") + if len(check_decimal) > 1: + decimal_str = "" + for digit in check_decimal[1]: + if digit.isdigit(): + decimal_str += digit + else: + break + if len(decimal_str) > 6: + attr = attr.replace(decimal_str, decimal_str[0:6]) + + date_obj = isodate.parse_datetime(attr) + test_utc = date_obj.utctimetuple() + if test_utc.tm_year > 9999 or test_utc.tm_year < 1: + raise OverflowError("Hit max or min date") + return date_obj + + +def _deserialize_date(attr: typing.Union[str, date]) -> date: + """Deserialize ISO-8601 formatted string into Date object. + :param str attr: response string to be deserialized. + :rtype: date + :returns: The date object from that input + """ + # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. + if isinstance(attr, date): + return attr + return isodate.parse_date(attr, defaultmonth=None, defaultday=None) + + +def _deserialize_time(attr: typing.Union[str, time]) -> time: + """Deserialize ISO-8601 formatted string into time object. + + :param str attr: response string to be deserialized. + :rtype: datetime.time + :returns: The time object from that input + """ + if isinstance(attr, time): + return attr + return isodate.parse_time(attr) + + +def deserialize_bytes(attr): + if isinstance(attr, (bytes, bytearray)): + return attr + return bytes(base64.b64decode(attr)) + + +def deserialize_duration(attr): + if isinstance(attr, timedelta): + return attr + return isodate.parse_duration(attr) + + +_DESERIALIZE_MAPPING = { + datetime: _deserialize_datetime, + date: _deserialize_date, + time: _deserialize_time, + bytes: deserialize_bytes, + timedelta: deserialize_duration, + typing.Any: lambda x: x, +} + + +def _get_model(module_name: str, model_name: str): + models = {k: v for k, v in sys.modules[module_name].__dict__.items() if isinstance(v, type)} + module_end = module_name.rsplit(".", 1)[0] + module = sys.modules[module_end] + models.update({k: v for k, v in module.__dict__.items() if isinstance(v, type)}) + if isinstance(model_name, str): + model_name = model_name.split(".")[-1] + if model_name not in models: + return model_name + return models[model_name] + + +_UNSET = object() + + +class _MyMutableMapping(MutableMapping[str, typing.Any]): # pylint: disable=unsubscriptable-object + def __init__(self, data: typing.Dict[str, typing.Any]) -> None: + self._data = copy.deepcopy(data) + + def __contains__(self, key: typing.Any) -> bool: + return key in self._data + + def __getitem__(self, key: str) -> typing.Any: + return self._data.__getitem__(key) + + def __setitem__(self, key: str, value: typing.Any) -> None: + self._data.__setitem__(key, value) + + def __delitem__(self, key: str) -> None: + self._data.__delitem__(key) + + def __iter__(self) -> typing.Iterator[typing.Any]: + return self._data.__iter__() + + def __len__(self) -> int: + return self._data.__len__() + + def __ne__(self, other: typing.Any) -> bool: + return not self.__eq__(other) + + def keys(self) -> typing.KeysView[str]: + return self._data.keys() + + def values(self) -> typing.ValuesView[typing.Any]: + return self._data.values() + + def items(self) -> typing.ItemsView[str, typing.Any]: + return self._data.items() + + def get(self, key: str, default: typing.Any = None) -> typing.Any: + try: + return self[key] + except KeyError: + return default + + @typing.overload # type: ignore + def pop(self, key: str) -> typing.Any: # pylint: disable=no-member + ... + + @typing.overload + def pop(self, key: str, default: typing.Any) -> typing.Any: + ... + + def pop(self, key: str, default: typing.Any = _UNSET) -> typing.Any: + if default is _UNSET: + return self._data.pop(key) + return self._data.pop(key, default) + + def popitem(self) -> typing.Tuple[str, typing.Any]: + return self._data.popitem() + + def clear(self) -> None: + self._data.clear() + + def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: + self._data.update(*args, **kwargs) + + @typing.overload # type: ignore + def setdefault(self, key: str) -> typing.Any: + ... + + @typing.overload + def setdefault(self, key: str, default: typing.Any) -> typing.Any: + ... + + def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: + if default is _UNSET: + return self._data.setdefault(key) + return self._data.setdefault(key, default) + + def __eq__(self, other: typing.Any) -> bool: + try: + other_model = self.__class__(other) + except Exception: + return False + return self._data == other_model._data + + def __repr__(self) -> str: + return str(self._data) + + +def _is_model(obj: typing.Any) -> bool: + return getattr(obj, "_is_model", False) + + +def _serialize(o): + if isinstance(o, (bytes, bytearray)): + return _serialize_bytes(o) + try: + # First try datetime.datetime + return _serialize_datetime(o) + except AttributeError: + pass + # Last, try datetime.timedelta + try: + return _timedelta_as_isostr(o) + except AttributeError: + # This will be raised when it hits value.total_seconds in the method above + pass + return o + + +def _get_rest_field( + attr_to_rest_field: typing.Dict[str, "_RestField"], rest_name: str +) -> typing.Optional["_RestField"]: + try: + return next(rf for rf in attr_to_rest_field.values() if rf._rest_name == rest_name) + except StopIteration: + return None + + +def _create_value(rf: typing.Optional["_RestField"], value: typing.Any) -> typing.Any: + return _deserialize(rf._type, value) if (rf and rf._is_model) else _serialize(value) + + +class Model(_MyMutableMapping): + _is_model = True + + def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: + class_name = self.__class__.__name__ + if len(args) > 1: + raise TypeError(f"{class_name}.__init__() takes 2 positional arguments but {len(args) + 1} were given") + dict_to_pass = { + rest_field._rest_name: rest_field._default + for rest_field in self._attr_to_rest_field.values() + if rest_field._default is not _UNSET + } + if args: + dict_to_pass.update( + {k: _create_value(_get_rest_field(self._attr_to_rest_field, k), v) for k, v in args[0].items()} + ) + else: + non_attr_kwargs = [k for k in kwargs if k not in self._attr_to_rest_field] + if non_attr_kwargs: + # actual type errors only throw the first wrong keyword arg they see, so following that. + raise TypeError(f"{class_name}.__init__() got an unexpected keyword argument '{non_attr_kwargs[0]}'") + dict_to_pass.update({self._attr_to_rest_field[k]._rest_name: _serialize(v) for k, v in kwargs.items()}) + super().__init__(dict_to_pass) + + def copy(self) -> "Model": + return Model(self.__dict__) + + def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> "Model": # pylint: disable=unused-argument + # we know the last three classes in mro are going to be 'Model', 'dict', and 'object' + mros = cls.__mro__[:-3][::-1] # ignore model, dict, and object parents, and reverse the mro order + attr_to_rest_field: typing.Dict[str, _RestField] = { # map attribute name to rest_field property + k: v for mro_class in mros for k, v in mro_class.__dict__.items() if k[0] != "_" and hasattr(v, "_type") + } + annotations = { + k: v + for mro_class in mros + if hasattr(mro_class, "__annotations__") # pylint: disable=no-member + for k, v in mro_class.__annotations__.items() # pylint: disable=no-member + } + for attr, rf in attr_to_rest_field.items(): + rf._module = cls.__module__ + if not rf._type: + rf._type = rf._get_deserialize_callable_from_annotation(annotations.get(attr, None)) + if not rf._rest_name_input: + rf._rest_name_input = attr + cls._attr_to_rest_field: typing.Dict[str, _RestField] = dict(attr_to_rest_field.items()) + + return super().__new__(cls) # pylint: disable=no-value-for-parameter + + def __init_subclass__(cls, discriminator: typing.Optional[str] = None) -> None: + for base in cls.__bases__: + if hasattr(base, "__mapping__"): # pylint: disable=no-member + base.__mapping__[discriminator or cls.__name__] = cls # type: ignore # pylint: disable=no-member + + @classmethod + def _get_discriminator(cls) -> typing.Optional[str]: + for v in cls.__dict__.values(): + if isinstance(v, _RestField) and v._is_discriminator: # pylint: disable=protected-access + return v._rest_name # pylint: disable=protected-access + return None + + @classmethod + def _deserialize(cls, data): + if not hasattr(cls, "__mapping__"): # pylint: disable=no-member + return cls(data) + discriminator = cls._get_discriminator() + mapped_cls = cls.__mapping__.get(data.get(discriminator), cls) # pylint: disable=no-member + if mapped_cls == cls: + return cls(data) + return mapped_cls._deserialize(data) # pylint: disable=protected-access + + +def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-return-statements, too-many-statements + annotation: typing.Any, module: typing.Optional[str], rf: typing.Optional["_RestField"] = None +) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: + if not annotation or annotation in [int, float]: + return None + + try: + if module and _is_model(_get_model(module, annotation)): + if rf: + rf._is_model = True + + def _deserialize_model(model_deserializer: typing.Optional[typing.Callable], obj): + if _is_model(obj): + return obj + return _deserialize(model_deserializer, obj) + + return functools.partial(_deserialize_model, _get_model(module, annotation)) + except Exception: + pass + + # is it a literal? + try: + if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports + else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + + if annotation.__origin__ == Literal: + return None + except AttributeError: + pass + + if getattr(annotation, "__origin__", None) is typing.Union: + + def _deserialize_with_union(union_annotation, obj): + for t in union_annotation.__args__: + try: + return _deserialize(t, obj, module) + except DeserializationError: + pass + raise DeserializationError() + + return functools.partial(_deserialize_with_union, annotation) + + # is it optional? + try: + # right now, assuming we don't have unions, since we're getting rid of the only + # union we used to have in msrest models, which was union of str and enum + if any(a for a in annotation.__args__ if a == type(None)): + + if_obj_deserializer = _get_deserialize_callable_from_annotation( + next(a for a in annotation.__args__ if a != type(None)), module, rf + ) + + def _deserialize_with_optional(if_obj_deserializer: typing.Optional[typing.Callable], obj): + if obj is None: + return obj + return _deserialize_with_callable(if_obj_deserializer, obj) + + return functools.partial(_deserialize_with_optional, if_obj_deserializer) + except AttributeError: + pass + + # is it a forward ref / in quotes? + if isinstance(annotation, (str, typing.ForwardRef)): + try: + model_name = annotation.__forward_arg__ # type: ignore + except AttributeError: + model_name = annotation + if module is not None: + annotation = _get_model(module, model_name) + + try: + if annotation._name == "Dict": + key_deserializer = _get_deserialize_callable_from_annotation(annotation.__args__[0], module, rf) + value_deserializer = _get_deserialize_callable_from_annotation(annotation.__args__[1], module, rf) + + def _deserialize_dict( + key_deserializer: typing.Optional[typing.Callable], + value_deserializer: typing.Optional[typing.Callable], + obj: typing.Dict[typing.Any, typing.Any], + ): + if obj is None: + return obj + return { + _deserialize(key_deserializer, k, module): _deserialize(value_deserializer, v, module) + for k, v in obj.items() + } + + return functools.partial( + _deserialize_dict, + key_deserializer, + value_deserializer, + ) + except (AttributeError, IndexError): + pass + try: + if annotation._name in ["List", "Set", "Tuple", "Sequence"]: + if len(annotation.__args__) > 1: + + def _deserialize_multiple_sequence( + entry_deserializers: typing.List[typing.Optional[typing.Callable]], obj + ): + if obj is None: + return obj + return type(obj)( + _deserialize(deserializer, entry, module) + for entry, deserializer in zip(obj, entry_deserializers) + ) + + entry_deserializers = [ + _get_deserialize_callable_from_annotation(dt, module, rf) for dt in annotation.__args__ + ] + return functools.partial(_deserialize_multiple_sequence, entry_deserializers) + deserializer = _get_deserialize_callable_from_annotation(annotation.__args__[0], module, rf) + + def _deserialize_sequence( + deserializer: typing.Optional[typing.Callable], + obj, + ): + if obj is None: + return obj + return type(obj)(_deserialize(deserializer, entry, module) for entry in obj) + + return functools.partial(_deserialize_sequence, deserializer) + except (TypeError, IndexError, AttributeError, SyntaxError): + pass + + def _deserialize_default( + annotation, + deserializer_from_mapping, + obj, + ): + if obj is None: + return obj + try: + return _deserialize_with_callable(annotation, obj) + except Exception: + pass + return _deserialize_with_callable(deserializer_from_mapping, obj) + + return functools.partial(_deserialize_default, annotation, _DESERIALIZE_MAPPING.get(annotation)) + + +def _deserialize_with_callable( + deserializer: typing.Optional[typing.Callable[[typing.Any], typing.Any]], value: typing.Any +): + try: + if value is None: + return None + if deserializer is None: + return value + if isinstance(deserializer, CaseInsensitiveEnumMeta): + try: + return deserializer(value) + except ValueError: + # for unknown value, return raw value + return value + if isinstance(deserializer, type) and issubclass(deserializer, Model): + return deserializer._deserialize(value) + return typing.cast(typing.Callable[[typing.Any], typing.Any], deserializer)(value) + except Exception as e: + raise DeserializationError() from e + + +def _deserialize(deserializer: typing.Any, value: typing.Any, module: typing.Optional[str] = None) -> typing.Any: + if isinstance(value, PipelineResponse): + value = value.http_response.json() + deserializer = _get_deserialize_callable_from_annotation(deserializer, module) + return _deserialize_with_callable(deserializer, value) + + +class _RestField: + def __init__( + self, + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, + is_discriminator: bool = False, + readonly: bool = False, + default: typing.Any = _UNSET, + ): + self._type = type + self._rest_name_input = name + self._module: typing.Optional[str] = None + self._is_discriminator = is_discriminator + self._readonly = readonly + self._is_model = False + self._default = default + + @property + def _rest_name(self) -> str: + if self._rest_name_input is None: + raise ValueError("Rest name was never set") + return self._rest_name_input + + def __get__(self, obj: Model, type=None): + # by this point, type and rest_name will have a value bc we default + # them in __new__ of the Model class + item = obj.get(self._rest_name) + if item is None: + return item + return _deserialize(self._type, _serialize(item)) + + def __set__(self, obj: Model, value) -> None: + if value is None: + # we want to wipe out entries if users set attr to None + try: + obj.__delitem__(self._rest_name) + except KeyError: + pass + return + if self._is_model and not _is_model(value): + obj.__setitem__(self._rest_name, _deserialize(self._type, value)) + obj.__setitem__(self._rest_name, _serialize(value)) + + def _get_deserialize_callable_from_annotation( + self, annotation: typing.Any + ) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: + return _get_deserialize_callable_from_annotation(annotation, self._module, self) + + +def rest_field( + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, + readonly: bool = False, + default: typing.Any = _UNSET, +) -> typing.Any: + return _RestField(name=name, type=type, readonly=readonly, default=default) + + +def rest_discriminator( + *, name: typing.Optional[str] = None, type: typing.Optional[typing.Callable] = None +) -> typing.Any: + return _RestField(name=name, type=type, is_discriminator=True) diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_operations/__init__.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_operations/__init__.py new file mode 100644 index 000000000000..51bf5a7f3dcf --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_operations/__init__.py @@ -0,0 +1,19 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import EventGridClientOperationsMixin + +from ._patch import __all__ as _patch_all +from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "EventGridClientOperationsMixin", +] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_operations/_operations.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_operations/_operations.py new file mode 100644 index 000000000000..a02d4f14e6a2 --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_operations/_operations.py @@ -0,0 +1,154 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import json +import sys +from typing import Any, Callable, Dict, Optional, TypeVar, Union, overload + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict + +from .. import models as _models +from .._model_base import AzureJSONEncoder +from .._serialization import Serializer +from .._vendor import EventGridClientMixinABC + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_event_grid_publish_event_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: Literal["2018-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) + # Construct URL + _url = "/" + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +class EventGridClientOperationsMixin(EventGridClientMixinABC): + @overload + def publish_event( # pylint: disable=inconsistent-return-statements + self, requests: _models.CloudEventRequest, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """publish_event. + + :param requests: Required. + :type requests: ~eventgrid.models.CloudEventRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def publish_event( # pylint: disable=inconsistent-return-statements + self, requests: _models.EventEventRequest, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """publish_event. + + :param requests: Required. + :type requests: ~eventgrid.models.EventEventRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def publish_event( # pylint: disable=inconsistent-return-statements + self, requests: Union[_models.CloudEventRequest, _models.EventEventRequest], **kwargs: Any + ) -> None: + """publish_event. + + :param requests: Is either a CloudEventRequest type or a EventEventRequest type. Required. + :type requests: ~eventgrid.models.CloudEventRequest or ~eventgrid.models.EventEventRequest + :keyword content_type: Body parameter Content-Type. Known values are: application/json. Default + value is None. + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(requests, _model_base.Model): + _content = json.dumps(requests, cls=AzureJSONEncoder) # type: ignore + elif isinstance(requests, _model_base.Model): + _content = json.dumps(requests, cls=AzureJSONEncoder) # type: ignore + + request = build_event_grid_publish_event_request( + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_operations/_patch.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_operations/_patch.py new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_patch.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_patch.py new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_serialization.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_serialization.py new file mode 100644 index 000000000000..f17c068e833e --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_serialization.py @@ -0,0 +1,1996 @@ +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# pylint: skip-file +# pyright: reportUnnecessaryTypeIgnoreComment=false + +from base64 import b64decode, b64encode +import calendar +import datetime +import decimal +import email +from enum import Enum +import json +import logging +import re +import sys +import codecs +from typing import ( + Dict, + Any, + cast, + Optional, + Union, + AnyStr, + IO, + Mapping, + Callable, + TypeVar, + MutableMapping, + Type, + List, + Mapping, +) + +try: + from urllib import quote # type: ignore +except ImportError: + from urllib.parse import quote +import xml.etree.ElementTree as ET + +import isodate # type: ignore + +from azure.core.exceptions import DeserializationError, SerializationError, raise_with_traceback +from azure.core.serialization import NULL as AzureCoreNull + +_BOM = codecs.BOM_UTF8.decode(encoding="utf-8") + +ModelType = TypeVar("ModelType", bound="Model") +JSON = MutableMapping[str, Any] + + +class RawDeserializer: + + # Accept "text" because we're open minded people... + JSON_REGEXP = re.compile(r"^(application|text)/([a-z+.]+\+)?json$") + + # Name used in context + CONTEXT_NAME = "deserialized_data" + + @classmethod + def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: Optional[str] = None) -> Any: + """Decode data according to content-type. + + Accept a stream of data as well, but will be load at once in memory for now. + + If no content-type, will return the string version (not bytes, not stream) + + :param data: Input, could be bytes or stream (will be decoded with UTF8) or text + :type data: str or bytes or IO + :param str content_type: The content type. + """ + if hasattr(data, "read"): + # Assume a stream + data = cast(IO, data).read() + + if isinstance(data, bytes): + data_as_str = data.decode(encoding="utf-8-sig") + else: + # Explain to mypy the correct type. + data_as_str = cast(str, data) + + # Remove Byte Order Mark if present in string + data_as_str = data_as_str.lstrip(_BOM) + + if content_type is None: + return data + + if cls.JSON_REGEXP.match(content_type): + try: + return json.loads(data_as_str) + except ValueError as err: + raise DeserializationError("JSON is invalid: {}".format(err), err) + elif "xml" in (content_type or []): + try: + + try: + if isinstance(data, unicode): # type: ignore + # If I'm Python 2.7 and unicode XML will scream if I try a "fromstring" on unicode string + data_as_str = data_as_str.encode(encoding="utf-8") # type: ignore + except NameError: + pass + + return ET.fromstring(data_as_str) # nosec + except ET.ParseError: + # It might be because the server has an issue, and returned JSON with + # content-type XML.... + # So let's try a JSON load, and if it's still broken + # let's flow the initial exception + def _json_attemp(data): + try: + return True, json.loads(data) + except ValueError: + return False, None # Don't care about this one + + success, json_result = _json_attemp(data) + if success: + return json_result + # If i'm here, it's not JSON, it's not XML, let's scream + # and raise the last context in this block (the XML exception) + # The function hack is because Py2.7 messes up with exception + # context otherwise. + _LOGGER.critical("Wasn't XML not JSON, failing") + raise_with_traceback(DeserializationError, "XML is invalid") + raise DeserializationError("Cannot deserialize content-type: {}".format(content_type)) + + @classmethod + def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], headers: Mapping) -> Any: + """Deserialize from HTTP response. + + Use bytes and headers to NOT use any requests/aiohttp or whatever + specific implementation. + Headers will tested for "content-type" + """ + # Try to use content-type from headers if available + content_type = None + if "content-type" in headers: + content_type = headers["content-type"].split(";")[0].strip().lower() + # Ouch, this server did not declare what it sent... + # Let's guess it's JSON... + # Also, since Autorest was considering that an empty body was a valid JSON, + # need that test as well.... + else: + content_type = "application/json" + + if body_bytes: + return cls.deserialize_from_text(body_bytes, content_type) + return None + + +try: + basestring # type: ignore + unicode_str = unicode # type: ignore +except NameError: + basestring = str + unicode_str = str + +_LOGGER = logging.getLogger(__name__) + +try: + _long_type = long # type: ignore +except NameError: + _long_type = int + + +class UTC(datetime.tzinfo): + """Time Zone info for handling UTC""" + + def utcoffset(self, dt): + """UTF offset for UTC is 0.""" + return datetime.timedelta(0) + + def tzname(self, dt): + """Timestamp representation.""" + return "Z" + + def dst(self, dt): + """No daylight saving for UTC.""" + return datetime.timedelta(hours=1) + + +try: + from datetime import timezone as _FixedOffset # type: ignore +except ImportError: # Python 2.7 + + class _FixedOffset(datetime.tzinfo): # type: ignore + """Fixed offset in minutes east from UTC. + Copy/pasted from Python doc + :param datetime.timedelta offset: offset in timedelta format + """ + + def __init__(self, offset): + self.__offset = offset + + def utcoffset(self, dt): + return self.__offset + + def tzname(self, dt): + return str(self.__offset.total_seconds() / 3600) + + def __repr__(self): + return "".format(self.tzname(None)) + + def dst(self, dt): + return datetime.timedelta(0) + + def __getinitargs__(self): + return (self.__offset,) + + +try: + from datetime import timezone + + TZ_UTC = timezone.utc +except ImportError: + TZ_UTC = UTC() # type: ignore + +_FLATTEN = re.compile(r"(? None: + self.additional_properties: Dict[str, Any] = {} + for k in kwargs: + if k not in self._attribute_map: + _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) + elif k in self._validation and self._validation[k].get("readonly", False): + _LOGGER.warning("Readonly attribute %s will be ignored in class %s", k, self.__class__) + else: + setattr(self, k, kwargs[k]) + + def __eq__(self, other: Any) -> bool: + """Compare objects by comparing all attributes.""" + if isinstance(other, self.__class__): + return self.__dict__ == other.__dict__ + return False + + def __ne__(self, other: Any) -> bool: + """Compare objects by comparing all attributes.""" + return not self.__eq__(other) + + def __str__(self) -> str: + return str(self.__dict__) + + @classmethod + def enable_additional_properties_sending(cls) -> None: + cls._attribute_map["additional_properties"] = {"key": "", "type": "{object}"} + + @classmethod + def is_xml_model(cls) -> bool: + try: + cls._xml_map # type: ignore + except AttributeError: + return False + return True + + @classmethod + def _create_xml_node(cls): + """Create XML node.""" + try: + xml_map = cls._xml_map # type: ignore + except AttributeError: + xml_map = {} + + return _create_xml_node(xml_map.get("name", cls.__name__), xml_map.get("prefix", None), xml_map.get("ns", None)) + + def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: + """Return the JSON that would be sent to azure from this model. + + This is an alias to `as_dict(full_restapi_key_transformer, keep_readonly=False)`. + + If you want XML serialization, you can pass the kwargs is_xml=True. + + :param bool keep_readonly: If you want to serialize the readonly attributes + :returns: A dict JSON compatible object + :rtype: dict + """ + serializer = Serializer(self._infer_class_models()) + return serializer._serialize(self, keep_readonly=keep_readonly, **kwargs) + + def as_dict( + self, + keep_readonly: bool = True, + key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer, + **kwargs: Any + ) -> JSON: + """Return a dict that can be serialized using json.dump. + + Advanced usage might optionally use a callback as parameter: + + .. code::python + + def my_key_transformer(key, attr_desc, value): + return key + + Key is the attribute name used in Python. Attr_desc + is a dict of metadata. Currently contains 'type' with the + msrest type and 'key' with the RestAPI encoded key. + Value is the current value in this object. + + The string returned will be used to serialize the key. + If the return type is a list, this is considered hierarchical + result dict. + + See the three examples in this file: + + - attribute_transformer + - full_restapi_key_transformer + - last_restapi_key_transformer + + If you want XML serialization, you can pass the kwargs is_xml=True. + + :param function key_transformer: A key transformer function. + :returns: A dict JSON compatible object + :rtype: dict + """ + serializer = Serializer(self._infer_class_models()) + return serializer._serialize(self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs) + + @classmethod + def _infer_class_models(cls): + try: + str_models = cls.__module__.rsplit(".", 1)[0] + models = sys.modules[str_models] + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + if cls.__name__ not in client_models: + raise ValueError("Not Autorest generated code") + except Exception: + # Assume it's not Autorest generated (tests?). Add ourselves as dependencies. + client_models = {cls.__name__: cls} + return client_models + + @classmethod + def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> ModelType: + """Parse a str using the RestAPI syntax and return a model. + + :param str data: A str using RestAPI structure. JSON by default. + :param str content_type: JSON by default, set application/xml if XML. + :returns: An instance of this model + :raises: DeserializationError if something went wrong + """ + deserializer = Deserializer(cls._infer_class_models()) + return deserializer(cls.__name__, data, content_type=content_type) + + @classmethod + def from_dict( + cls: Type[ModelType], + data: Any, + key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, + content_type: Optional[str] = None, + ) -> ModelType: + """Parse a dict using given key extractor return a model. + + By default consider key + extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor + and last_rest_key_case_insensitive_extractor) + + :param dict data: A dict using RestAPI structure + :param str content_type: JSON by default, set application/xml if XML. + :returns: An instance of this model + :raises: DeserializationError if something went wrong + """ + deserializer = Deserializer(cls._infer_class_models()) + deserializer.key_extractors = ( # type: ignore + [ # type: ignore + attribute_key_case_insensitive_extractor, + rest_key_case_insensitive_extractor, + last_rest_key_case_insensitive_extractor, + ] + if key_extractors is None + else key_extractors + ) + return deserializer(cls.__name__, data, content_type=content_type) + + @classmethod + def _flatten_subtype(cls, key, objects): + if "_subtype_map" not in cls.__dict__: + return {} + result = dict(cls._subtype_map[key]) + for valuetype in cls._subtype_map[key].values(): + result.update(objects[valuetype]._flatten_subtype(key, objects)) + return result + + @classmethod + def _classify(cls, response, objects): + """Check the class _subtype_map for any child classes. + We want to ignore any inherited _subtype_maps. + Remove the polymorphic key from the initial data. + """ + for subtype_key in cls.__dict__.get("_subtype_map", {}).keys(): + subtype_value = None + + if not isinstance(response, ET.Element): + rest_api_response_key = cls._get_rest_key_parts(subtype_key)[-1] + subtype_value = response.pop(rest_api_response_key, None) or response.pop(subtype_key, None) + else: + subtype_value = xml_key_extractor(subtype_key, cls._attribute_map[subtype_key], response) + if subtype_value: + # Try to match base class. Can be class name only + # (bug to fix in Autorest to support x-ms-discriminator-name) + if cls.__name__ == subtype_value: + return cls + flatten_mapping_type = cls._flatten_subtype(subtype_key, objects) + try: + return objects[flatten_mapping_type[subtype_value]] # type: ignore + except KeyError: + _LOGGER.warning( + "Subtype value %s has no mapping, use base class %s.", + subtype_value, + cls.__name__, + ) + break + else: + _LOGGER.warning("Discriminator %s is absent or null, use base class %s.", subtype_key, cls.__name__) + break + return cls + + @classmethod + def _get_rest_key_parts(cls, attr_key): + """Get the RestAPI key of this attr, split it and decode part + :param str attr_key: Attribute key must be in attribute_map. + :returns: A list of RestAPI part + :rtype: list + """ + rest_split_key = _FLATTEN.split(cls._attribute_map[attr_key]["key"]) + return [_decode_attribute_map_key(key_part) for key_part in rest_split_key] + + +def _decode_attribute_map_key(key): + """This decode a key in an _attribute_map to the actual key we want to look at + inside the received data. + + :param str key: A key string from the generated code + """ + return key.replace("\\.", ".") + + +class Serializer(object): + """Request object model serializer.""" + + basic_types = {str: "str", int: "int", bool: "bool", float: "float"} + + _xml_basic_types_serializers = {"bool": lambda x: str(x).lower()} + days = {0: "Mon", 1: "Tue", 2: "Wed", 3: "Thu", 4: "Fri", 5: "Sat", 6: "Sun"} + months = { + 1: "Jan", + 2: "Feb", + 3: "Mar", + 4: "Apr", + 5: "May", + 6: "Jun", + 7: "Jul", + 8: "Aug", + 9: "Sep", + 10: "Oct", + 11: "Nov", + 12: "Dec", + } + validation = { + "min_length": lambda x, y: len(x) < y, + "max_length": lambda x, y: len(x) > y, + "minimum": lambda x, y: x < y, + "maximum": lambda x, y: x > y, + "minimum_ex": lambda x, y: x <= y, + "maximum_ex": lambda x, y: x >= y, + "min_items": lambda x, y: len(x) < y, + "max_items": lambda x, y: len(x) > y, + "pattern": lambda x, y: not re.match(y, x, re.UNICODE), + "unique": lambda x, y: len(x) != len(set(x)), + "multiple": lambda x, y: x % y != 0, + } + + def __init__(self, classes: Optional[Mapping[str, Type[ModelType]]] = None): + self.serialize_type = { + "iso-8601": Serializer.serialize_iso, + "rfc-1123": Serializer.serialize_rfc, + "unix-time": Serializer.serialize_unix, + "duration": Serializer.serialize_duration, + "date": Serializer.serialize_date, + "time": Serializer.serialize_time, + "decimal": Serializer.serialize_decimal, + "long": Serializer.serialize_long, + "bytearray": Serializer.serialize_bytearray, + "base64": Serializer.serialize_base64, + "object": self.serialize_object, + "[]": self.serialize_iter, + "{}": self.serialize_dict, + } + self.dependencies: Dict[str, Type[ModelType]] = dict(classes) if classes else {} + self.key_transformer = full_restapi_key_transformer + self.client_side_validation = True + + def _serialize(self, target_obj, data_type=None, **kwargs): + """Serialize data into a string according to type. + + :param target_obj: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str, dict + :raises: SerializationError if serialization fails. + """ + key_transformer = kwargs.get("key_transformer", self.key_transformer) + keep_readonly = kwargs.get("keep_readonly", False) + if target_obj is None: + return None + + attr_name = None + class_name = target_obj.__class__.__name__ + + if data_type: + return self.serialize_data(target_obj, data_type, **kwargs) + + if not hasattr(target_obj, "_attribute_map"): + data_type = type(target_obj).__name__ + if data_type in self.basic_types.values(): + return self.serialize_data(target_obj, data_type, **kwargs) + + # Force "is_xml" kwargs if we detect a XML model + try: + is_xml_model_serialization = kwargs["is_xml"] + except KeyError: + is_xml_model_serialization = kwargs.setdefault("is_xml", target_obj.is_xml_model()) + + serialized = {} + if is_xml_model_serialization: + serialized = target_obj._create_xml_node() + try: + attributes = target_obj._attribute_map + for attr, attr_desc in attributes.items(): + attr_name = attr + if not keep_readonly and target_obj._validation.get(attr_name, {}).get("readonly", False): + continue + + if attr_name == "additional_properties" and attr_desc["key"] == "": + if target_obj.additional_properties is not None: + serialized.update(target_obj.additional_properties) + continue + try: + + orig_attr = getattr(target_obj, attr) + if is_xml_model_serialization: + pass # Don't provide "transformer" for XML for now. Keep "orig_attr" + else: # JSON + keys, orig_attr = key_transformer(attr, attr_desc.copy(), orig_attr) + keys = keys if isinstance(keys, list) else [keys] + + kwargs["serialization_ctxt"] = attr_desc + new_attr = self.serialize_data(orig_attr, attr_desc["type"], **kwargs) + + if is_xml_model_serialization: + xml_desc = attr_desc.get("xml", {}) + xml_name = xml_desc.get("name", attr_desc["key"]) + xml_prefix = xml_desc.get("prefix", None) + xml_ns = xml_desc.get("ns", None) + if xml_desc.get("attr", False): + if xml_ns: + ET.register_namespace(xml_prefix, xml_ns) + xml_name = "{}{}".format(xml_ns, xml_name) + serialized.set(xml_name, new_attr) # type: ignore + continue + if xml_desc.get("text", False): + serialized.text = new_attr # type: ignore + continue + if isinstance(new_attr, list): + serialized.extend(new_attr) # type: ignore + elif isinstance(new_attr, ET.Element): + # If the down XML has no XML/Name, we MUST replace the tag with the local tag. But keeping the namespaces. + if "name" not in getattr(orig_attr, "_xml_map", {}): + splitted_tag = new_attr.tag.split("}") + if len(splitted_tag) == 2: # Namespace + new_attr.tag = "}".join([splitted_tag[0], xml_name]) + else: + new_attr.tag = xml_name + serialized.append(new_attr) # type: ignore + else: # That's a basic type + # Integrate namespace if necessary + local_node = _create_xml_node(xml_name, xml_prefix, xml_ns) + local_node.text = unicode_str(new_attr) + serialized.append(local_node) # type: ignore + else: # JSON + for k in reversed(keys): # type: ignore + new_attr = {k: new_attr} + + _new_attr = new_attr + _serialized = serialized + for k in keys: # type: ignore + if k not in _serialized: + _serialized.update(_new_attr) # type: ignore + _new_attr = _new_attr[k] # type: ignore + _serialized = _serialized[k] + except ValueError: + continue + + except (AttributeError, KeyError, TypeError) as err: + msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) + raise_with_traceback(SerializationError, msg, err) + else: + return serialized + + def body(self, data, data_type, **kwargs): + """Serialize data intended for a request body. + + :param data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: dict + :raises: SerializationError if serialization fails. + :raises: ValueError if data is None + """ + + # Just in case this is a dict + internal_data_type_str = data_type.strip("[]{}") + internal_data_type = self.dependencies.get(internal_data_type_str, None) + try: + is_xml_model_serialization = kwargs["is_xml"] + except KeyError: + if internal_data_type and issubclass(internal_data_type, Model): + is_xml_model_serialization = kwargs.setdefault("is_xml", internal_data_type.is_xml_model()) + else: + is_xml_model_serialization = False + if internal_data_type and not isinstance(internal_data_type, Enum): + try: + deserializer = Deserializer(self.dependencies) + # Since it's on serialization, it's almost sure that format is not JSON REST + # We're not able to deal with additional properties for now. + deserializer.additional_properties_detection = False + if is_xml_model_serialization: + deserializer.key_extractors = [ # type: ignore + attribute_key_case_insensitive_extractor, + ] + else: + deserializer.key_extractors = [ + rest_key_case_insensitive_extractor, + attribute_key_case_insensitive_extractor, + last_rest_key_case_insensitive_extractor, + ] + data = deserializer._deserialize(data_type, data) + except DeserializationError as err: + raise_with_traceback(SerializationError, "Unable to build a model: " + str(err), err) + + return self._serialize(data, data_type, **kwargs) + + def url(self, name, data, data_type, **kwargs): + """Serialize data intended for a URL path. + + :param data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str + :raises: TypeError if serialization fails. + :raises: ValueError if data is None + """ + try: + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + + if kwargs.get("skip_quote") is True: + output = str(output) + else: + output = quote(str(output), safe="") + except SerializationError: + raise TypeError("{} must be type {}.".format(name, data_type)) + else: + return output + + def query(self, name, data, data_type, **kwargs): + """Serialize data intended for a URL query. + + :param data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str + :raises: TypeError if serialization fails. + :raises: ValueError if data is None + """ + try: + # Treat the list aside, since we don't want to encode the div separator + if data_type.startswith("["): + internal_data_type = data_type[1:-1] + data = [self.serialize_data(d, internal_data_type, **kwargs) if d is not None else "" for d in data] + if not kwargs.get("skip_quote", False): + data = [quote(str(d), safe="") for d in data] + return str(self.serialize_iter(data, internal_data_type, **kwargs)) + + # Not a list, regular serialization + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + if kwargs.get("skip_quote") is True: + output = str(output) + else: + output = quote(str(output), safe="") + except SerializationError: + raise TypeError("{} must be type {}.".format(name, data_type)) + else: + return str(output) + + def header(self, name, data, data_type, **kwargs): + """Serialize data intended for a request header. + + :param data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str + :raises: TypeError if serialization fails. + :raises: ValueError if data is None + """ + try: + if data_type in ["[str]"]: + data = ["" if d is None else d for d in data] + + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + except SerializationError: + raise TypeError("{} must be type {}.".format(name, data_type)) + else: + return str(output) + + def serialize_data(self, data, data_type, **kwargs): + """Serialize generic data according to supplied data type. + + :param data: The data to be serialized. + :param str data_type: The type to be serialized from. + :param bool required: Whether it's essential that the data not be + empty or None + :raises: AttributeError if required data is None. + :raises: ValueError if data is None + :raises: SerializationError if serialization fails. + """ + if data is None: + raise ValueError("No value for given attribute") + + try: + if data is AzureCoreNull: + return None + if data_type in self.basic_types.values(): + return self.serialize_basic(data, data_type, **kwargs) + + elif data_type in self.serialize_type: + return self.serialize_type[data_type](data, **kwargs) + + # If dependencies is empty, try with current data class + # It has to be a subclass of Enum anyway + enum_type = self.dependencies.get(data_type, data.__class__) + if issubclass(enum_type, Enum): + return Serializer.serialize_enum(data, enum_obj=enum_type) + + iter_type = data_type[0] + data_type[-1] + if iter_type in self.serialize_type: + return self.serialize_type[iter_type](data, data_type[1:-1], **kwargs) + + except (ValueError, TypeError) as err: + msg = "Unable to serialize value: {!r} as type: {!r}." + raise_with_traceback(SerializationError, msg.format(data, data_type), err) + else: + return self._serialize(data, **kwargs) + + @classmethod + def _get_custom_serializers(cls, data_type, **kwargs): + custom_serializer = kwargs.get("basic_types_serializers", {}).get(data_type) + if custom_serializer: + return custom_serializer + if kwargs.get("is_xml", False): + return cls._xml_basic_types_serializers.get(data_type) + + @classmethod + def serialize_basic(cls, data, data_type, **kwargs): + """Serialize basic builting data type. + Serializes objects to str, int, float or bool. + + Possible kwargs: + - basic_types_serializers dict[str, callable] : If set, use the callable as serializer + - is_xml bool : If set, use xml_basic_types_serializers + + :param data: Object to be serialized. + :param str data_type: Type of object in the iterable. + """ + custom_serializer = cls._get_custom_serializers(data_type, **kwargs) + if custom_serializer: + return custom_serializer(data) + if data_type == "str": + return cls.serialize_unicode(data) + return eval(data_type)(data) # nosec + + @classmethod + def serialize_unicode(cls, data): + """Special handling for serializing unicode strings in Py2. + Encode to UTF-8 if unicode, otherwise handle as a str. + + :param data: Object to be serialized. + :rtype: str + """ + try: # If I received an enum, return its value + return data.value + except AttributeError: + pass + + try: + if isinstance(data, unicode): # type: ignore + # Don't change it, JSON and XML ElementTree are totally able + # to serialize correctly u'' strings + return data + except NameError: + return str(data) + else: + return str(data) + + def serialize_iter(self, data, iter_type, div=None, **kwargs): + """Serialize iterable. + + Supported kwargs: + - serialization_ctxt dict : The current entry of _attribute_map, or same format. + serialization_ctxt['type'] should be same as data_type. + - is_xml bool : If set, serialize as XML + + :param list attr: Object to be serialized. + :param str iter_type: Type of object in the iterable. + :param bool required: Whether the objects in the iterable must + not be None or empty. + :param str div: If set, this str will be used to combine the elements + in the iterable into a combined string. Default is 'None'. + :rtype: list, str + """ + if isinstance(data, str): + raise SerializationError("Refuse str type as a valid iter type.") + + serialization_ctxt = kwargs.get("serialization_ctxt", {}) + is_xml = kwargs.get("is_xml", False) + + serialized = [] + for d in data: + try: + serialized.append(self.serialize_data(d, iter_type, **kwargs)) + except ValueError: + serialized.append(None) + + if div: + serialized = ["" if s is None else str(s) for s in serialized] + serialized = div.join(serialized) + + if "xml" in serialization_ctxt or is_xml: + # XML serialization is more complicated + xml_desc = serialization_ctxt.get("xml", {}) + xml_name = xml_desc.get("name") + if not xml_name: + xml_name = serialization_ctxt["key"] + + # Create a wrap node if necessary (use the fact that Element and list have "append") + is_wrapped = xml_desc.get("wrapped", False) + node_name = xml_desc.get("itemsName", xml_name) + if is_wrapped: + final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + else: + final_result = [] + # All list elements to "local_node" + for el in serialized: + if isinstance(el, ET.Element): + el_node = el + else: + el_node = _create_xml_node(node_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + if el is not None: # Otherwise it writes "None" :-p + el_node.text = str(el) + final_result.append(el_node) + return final_result + return serialized + + def serialize_dict(self, attr, dict_type, **kwargs): + """Serialize a dictionary of objects. + + :param dict attr: Object to be serialized. + :param str dict_type: Type of object in the dictionary. + :param bool required: Whether the objects in the dictionary must + not be None or empty. + :rtype: dict + """ + serialization_ctxt = kwargs.get("serialization_ctxt", {}) + serialized = {} + for key, value in attr.items(): + try: + serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs) + except ValueError: + serialized[self.serialize_unicode(key)] = None + + if "xml" in serialization_ctxt: + # XML serialization is more complicated + xml_desc = serialization_ctxt["xml"] + xml_name = xml_desc["name"] + + final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + for key, value in serialized.items(): + ET.SubElement(final_result, key).text = value + return final_result + + return serialized + + def serialize_object(self, attr, **kwargs): + """Serialize a generic object. + This will be handled as a dictionary. If object passed in is not + a basic type (str, int, float, dict, list) it will simply be + cast to str. + + :param dict attr: Object to be serialized. + :rtype: dict or str + """ + if attr is None: + return None + if isinstance(attr, ET.Element): + return attr + obj_type = type(attr) + if obj_type in self.basic_types: + return self.serialize_basic(attr, self.basic_types[obj_type], **kwargs) + if obj_type is _long_type: + return self.serialize_long(attr) + if obj_type is unicode_str: + return self.serialize_unicode(attr) + if obj_type is datetime.datetime: + return self.serialize_iso(attr) + if obj_type is datetime.date: + return self.serialize_date(attr) + if obj_type is datetime.time: + return self.serialize_time(attr) + if obj_type is datetime.timedelta: + return self.serialize_duration(attr) + if obj_type is decimal.Decimal: + return self.serialize_decimal(attr) + + # If it's a model or I know this dependency, serialize as a Model + elif obj_type in self.dependencies.values() or isinstance(attr, Model): + return self._serialize(attr) + + if obj_type == dict: + serialized = {} + for key, value in attr.items(): + try: + serialized[self.serialize_unicode(key)] = self.serialize_object(value, **kwargs) + except ValueError: + serialized[self.serialize_unicode(key)] = None + return serialized + + if obj_type == list: + serialized = [] + for obj in attr: + try: + serialized.append(self.serialize_object(obj, **kwargs)) + except ValueError: + pass + return serialized + return str(attr) + + @staticmethod + def serialize_enum(attr, enum_obj=None): + try: + result = attr.value + except AttributeError: + result = attr + try: + enum_obj(result) # type: ignore + return result + except ValueError: + for enum_value in enum_obj: # type: ignore + if enum_value.value.lower() == str(attr).lower(): + return enum_value.value + error = "{!r} is not valid value for enum {!r}" + raise SerializationError(error.format(attr, enum_obj)) + + @staticmethod + def serialize_bytearray(attr, **kwargs): + """Serialize bytearray into base-64 string. + + :param attr: Object to be serialized. + :rtype: str + """ + return b64encode(attr).decode() + + @staticmethod + def serialize_base64(attr, **kwargs): + """Serialize str into base-64 string. + + :param attr: Object to be serialized. + :rtype: str + """ + encoded = b64encode(attr).decode("ascii") + return encoded.strip("=").replace("+", "-").replace("/", "_") + + @staticmethod + def serialize_decimal(attr, **kwargs): + """Serialize Decimal object to float. + + :param attr: Object to be serialized. + :rtype: float + """ + return float(attr) + + @staticmethod + def serialize_long(attr, **kwargs): + """Serialize long (Py2) or int (Py3). + + :param attr: Object to be serialized. + :rtype: int/long + """ + return _long_type(attr) + + @staticmethod + def serialize_date(attr, **kwargs): + """Serialize Date object into ISO-8601 formatted string. + + :param Date attr: Object to be serialized. + :rtype: str + """ + if isinstance(attr, str): + attr = isodate.parse_date(attr) + t = "{:04}-{:02}-{:02}".format(attr.year, attr.month, attr.day) + return t + + @staticmethod + def serialize_time(attr, **kwargs): + """Serialize Time object into ISO-8601 formatted string. + + :param datetime.time attr: Object to be serialized. + :rtype: str + """ + if isinstance(attr, str): + attr = isodate.parse_time(attr) + t = "{:02}:{:02}:{:02}".format(attr.hour, attr.minute, attr.second) + if attr.microsecond: + t += ".{:02}".format(attr.microsecond) + return t + + @staticmethod + def serialize_duration(attr, **kwargs): + """Serialize TimeDelta object into ISO-8601 formatted string. + + :param TimeDelta attr: Object to be serialized. + :rtype: str + """ + if isinstance(attr, str): + attr = isodate.parse_duration(attr) + return isodate.duration_isoformat(attr) + + @staticmethod + def serialize_rfc(attr, **kwargs): + """Serialize Datetime object into RFC-1123 formatted string. + + :param Datetime attr: Object to be serialized. + :rtype: str + :raises: TypeError if format invalid. + """ + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + utc = attr.utctimetuple() + except AttributeError: + raise TypeError("RFC1123 object must be valid Datetime object.") + + return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format( + Serializer.days[utc.tm_wday], + utc.tm_mday, + Serializer.months[utc.tm_mon], + utc.tm_year, + utc.tm_hour, + utc.tm_min, + utc.tm_sec, + ) + + @staticmethod + def serialize_iso(attr, **kwargs): + """Serialize Datetime object into ISO-8601 formatted string. + + :param Datetime attr: Object to be serialized. + :rtype: str + :raises: SerializationError if format invalid. + """ + if isinstance(attr, str): + attr = isodate.parse_datetime(attr) + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + utc = attr.utctimetuple() + if utc.tm_year > 9999 or utc.tm_year < 1: + raise OverflowError("Hit max or min date") + + microseconds = str(attr.microsecond).rjust(6, "0").rstrip("0").ljust(3, "0") + if microseconds: + microseconds = "." + microseconds + date = "{:04}-{:02}-{:02}T{:02}:{:02}:{:02}".format( + utc.tm_year, utc.tm_mon, utc.tm_mday, utc.tm_hour, utc.tm_min, utc.tm_sec + ) + return date + microseconds + "Z" + except (ValueError, OverflowError) as err: + msg = "Unable to serialize datetime object." + raise_with_traceback(SerializationError, msg, err) + except AttributeError as err: + msg = "ISO-8601 object must be valid Datetime object." + raise_with_traceback(TypeError, msg, err) + + @staticmethod + def serialize_unix(attr, **kwargs): + """Serialize Datetime object into IntTime format. + This is represented as seconds. + + :param Datetime attr: Object to be serialized. + :rtype: int + :raises: SerializationError if format invalid + """ + if isinstance(attr, int): + return attr + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + return int(calendar.timegm(attr.utctimetuple())) + except AttributeError: + raise TypeError("Unix time object must be valid Datetime object.") + + +def rest_key_extractor(attr, attr_desc, data): + key = attr_desc["key"] + working_data = data + + while "." in key: + # Need the cast, as for some reasons "split" is typed as list[str | Any] + dict_keys = cast(List[str], _FLATTEN.split(key)) + if len(dict_keys) == 1: + key = _decode_attribute_map_key(dict_keys[0]) + break + working_key = _decode_attribute_map_key(dict_keys[0]) + working_data = working_data.get(working_key, data) + if working_data is None: + # If at any point while following flatten JSON path see None, it means + # that all properties under are None as well + # https://github.com/Azure/msrest-for-python/issues/197 + return None + key = ".".join(dict_keys[1:]) + + return working_data.get(key) + + +def rest_key_case_insensitive_extractor(attr, attr_desc, data): + key = attr_desc["key"] + working_data = data + + while "." in key: + dict_keys = _FLATTEN.split(key) + if len(dict_keys) == 1: + key = _decode_attribute_map_key(dict_keys[0]) + break + working_key = _decode_attribute_map_key(dict_keys[0]) + working_data = attribute_key_case_insensitive_extractor(working_key, None, working_data) + if working_data is None: + # If at any point while following flatten JSON path see None, it means + # that all properties under are None as well + # https://github.com/Azure/msrest-for-python/issues/197 + return None + key = ".".join(dict_keys[1:]) + + if working_data: + return attribute_key_case_insensitive_extractor(key, None, working_data) + + +def last_rest_key_extractor(attr, attr_desc, data): + """Extract the attribute in "data" based on the last part of the JSON path key.""" + key = attr_desc["key"] + dict_keys = _FLATTEN.split(key) + return attribute_key_extractor(dict_keys[-1], None, data) + + +def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): + """Extract the attribute in "data" based on the last part of the JSON path key. + + This is the case insensitive version of "last_rest_key_extractor" + """ + key = attr_desc["key"] + dict_keys = _FLATTEN.split(key) + return attribute_key_case_insensitive_extractor(dict_keys[-1], None, data) + + +def attribute_key_extractor(attr, _, data): + return data.get(attr) + + +def attribute_key_case_insensitive_extractor(attr, _, data): + found_key = None + lower_attr = attr.lower() + for key in data: + if lower_attr == key.lower(): + found_key = key + break + + return data.get(found_key) + + +def _extract_name_from_internal_type(internal_type): + """Given an internal type XML description, extract correct XML name with namespace. + + :param dict internal_type: An model type + :rtype: tuple + :returns: A tuple XML name + namespace dict + """ + internal_type_xml_map = getattr(internal_type, "_xml_map", {}) + xml_name = internal_type_xml_map.get("name", internal_type.__name__) + xml_ns = internal_type_xml_map.get("ns", None) + if xml_ns: + xml_name = "{}{}".format(xml_ns, xml_name) + return xml_name + + +def xml_key_extractor(attr, attr_desc, data): + if isinstance(data, dict): + return None + + # Test if this model is XML ready first + if not isinstance(data, ET.Element): + return None + + xml_desc = attr_desc.get("xml", {}) + xml_name = xml_desc.get("name", attr_desc["key"]) + + # Look for a children + is_iter_type = attr_desc["type"].startswith("[") + is_wrapped = xml_desc.get("wrapped", False) + internal_type = attr_desc.get("internalType", None) + internal_type_xml_map = getattr(internal_type, "_xml_map", {}) + + # Integrate namespace if necessary + xml_ns = xml_desc.get("ns", internal_type_xml_map.get("ns", None)) + if xml_ns: + xml_name = "{}{}".format(xml_ns, xml_name) + + # If it's an attribute, that's simple + if xml_desc.get("attr", False): + return data.get(xml_name) + + # If it's x-ms-text, that's simple too + if xml_desc.get("text", False): + return data.text + + # Scenario where I take the local name: + # - Wrapped node + # - Internal type is an enum (considered basic types) + # - Internal type has no XML/Name node + if is_wrapped or (internal_type and (issubclass(internal_type, Enum) or "name" not in internal_type_xml_map)): + children = data.findall(xml_name) + # If internal type has a local name and it's not a list, I use that name + elif not is_iter_type and internal_type and "name" in internal_type_xml_map: + xml_name = _extract_name_from_internal_type(internal_type) + children = data.findall(xml_name) + # That's an array + else: + if internal_type: # Complex type, ignore itemsName and use the complex type name + items_name = _extract_name_from_internal_type(internal_type) + else: + items_name = xml_desc.get("itemsName", xml_name) + children = data.findall(items_name) + + if len(children) == 0: + if is_iter_type: + if is_wrapped: + return None # is_wrapped no node, we want None + else: + return [] # not wrapped, assume empty list + return None # Assume it's not there, maybe an optional node. + + # If is_iter_type and not wrapped, return all found children + if is_iter_type: + if not is_wrapped: + return children + else: # Iter and wrapped, should have found one node only (the wrap one) + if len(children) != 1: + raise DeserializationError( + "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( + xml_name + ) + ) + return list(children[0]) # Might be empty list and that's ok. + + # Here it's not a itertype, we should have found one element only or empty + if len(children) > 1: + raise DeserializationError("Find several XML '{}' where it was not expected".format(xml_name)) + return children[0] + + +class Deserializer(object): + """Response object model deserializer. + + :param dict classes: Class type dictionary for deserializing complex types. + :ivar list key_extractors: Ordered list of extractors to be used by this deserializer. + """ + + basic_types = {str: "str", int: "int", bool: "bool", float: "float"} + + valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") + + def __init__(self, classes: Optional[Mapping[str, Type[ModelType]]] = None): + self.deserialize_type = { + "iso-8601": Deserializer.deserialize_iso, + "rfc-1123": Deserializer.deserialize_rfc, + "unix-time": Deserializer.deserialize_unix, + "duration": Deserializer.deserialize_duration, + "date": Deserializer.deserialize_date, + "time": Deserializer.deserialize_time, + "decimal": Deserializer.deserialize_decimal, + "long": Deserializer.deserialize_long, + "bytearray": Deserializer.deserialize_bytearray, + "base64": Deserializer.deserialize_base64, + "object": self.deserialize_object, + "[]": self.deserialize_iter, + "{}": self.deserialize_dict, + } + self.deserialize_expected_types = { + "duration": (isodate.Duration, datetime.timedelta), + "iso-8601": (datetime.datetime), + } + self.dependencies: Dict[str, Type[ModelType]] = dict(classes) if classes else {} + self.key_extractors = [rest_key_extractor, xml_key_extractor] + # Additional properties only works if the "rest_key_extractor" is used to + # extract the keys. Making it to work whatever the key extractor is too much + # complicated, with no real scenario for now. + # So adding a flag to disable additional properties detection. This flag should be + # used if your expect the deserialization to NOT come from a JSON REST syntax. + # Otherwise, result are unexpected + self.additional_properties_detection = True + + def __call__(self, target_obj, response_data, content_type=None): + """Call the deserializer to process a REST response. + + :param str target_obj: Target data type to deserialize to. + :param requests.Response response_data: REST response object. + :param str content_type: Swagger "produces" if available. + :raises: DeserializationError if deserialization fails. + :return: Deserialized object. + """ + data = self._unpack_content(response_data, content_type) + return self._deserialize(target_obj, data) + + def _deserialize(self, target_obj, data): + """Call the deserializer on a model. + + Data needs to be already deserialized as JSON or XML ElementTree + + :param str target_obj: Target data type to deserialize to. + :param object data: Object to deserialize. + :raises: DeserializationError if deserialization fails. + :return: Deserialized object. + """ + # This is already a model, go recursive just in case + if hasattr(data, "_attribute_map"): + constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")] + try: + for attr, mapconfig in data._attribute_map.items(): + if attr in constants: + continue + value = getattr(data, attr) + if value is None: + continue + local_type = mapconfig["type"] + internal_data_type = local_type.strip("[]{}") + if internal_data_type not in self.dependencies or isinstance(internal_data_type, Enum): + continue + setattr(data, attr, self._deserialize(local_type, value)) + return data + except AttributeError: + return + + response, class_name = self._classify_target(target_obj, data) + + if isinstance(response, basestring): + return self.deserialize_data(data, response) + elif isinstance(response, type) and issubclass(response, Enum): + return self.deserialize_enum(data, response) + + if data is None: + return data + try: + attributes = response._attribute_map # type: ignore + d_attrs = {} + for attr, attr_desc in attributes.items(): + # Check empty string. If it's not empty, someone has a real "additionalProperties"... + if attr == "additional_properties" and attr_desc["key"] == "": + continue + raw_value = None + # Enhance attr_desc with some dynamic data + attr_desc = attr_desc.copy() # Do a copy, do not change the real one + internal_data_type = attr_desc["type"].strip("[]{}") + if internal_data_type in self.dependencies: + attr_desc["internalType"] = self.dependencies[internal_data_type] + + for key_extractor in self.key_extractors: + found_value = key_extractor(attr, attr_desc, data) + if found_value is not None: + if raw_value is not None and raw_value != found_value: + msg = ( + "Ignoring extracted value '%s' from %s for key '%s'" + " (duplicate extraction, follow extractors order)" + ) + _LOGGER.warning(msg, found_value, key_extractor, attr) + continue + raw_value = found_value + + value = self.deserialize_data(raw_value, attr_desc["type"]) + d_attrs[attr] = value + except (AttributeError, TypeError, KeyError) as err: + msg = "Unable to deserialize to object: " + class_name # type: ignore + raise_with_traceback(DeserializationError, msg, err) + else: + additional_properties = self._build_additional_properties(attributes, data) + return self._instantiate_model(response, d_attrs, additional_properties) + + def _build_additional_properties(self, attribute_map, data): + if not self.additional_properties_detection: + return None + if "additional_properties" in attribute_map and attribute_map.get("additional_properties", {}).get("key") != "": + # Check empty string. If it's not empty, someone has a real "additionalProperties" + return None + if isinstance(data, ET.Element): + data = {el.tag: el.text for el in data} + + known_keys = { + _decode_attribute_map_key(_FLATTEN.split(desc["key"])[0]) + for desc in attribute_map.values() + if desc["key"] != "" + } + present_keys = set(data.keys()) + missing_keys = present_keys - known_keys + return {key: data[key] for key in missing_keys} + + def _classify_target(self, target, data): + """Check to see whether the deserialization target object can + be classified into a subclass. + Once classification has been determined, initialize object. + + :param str target: The target object type to deserialize to. + :param str/dict data: The response data to deserialize. + """ + if target is None: + return None, None + + if isinstance(target, basestring): + try: + target = self.dependencies[target] + except KeyError: + return target, target + + try: + target = target._classify(data, self.dependencies) + except AttributeError: + pass # Target is not a Model, no classify + return target, target.__class__.__name__ # type: ignore + + def failsafe_deserialize(self, target_obj, data, content_type=None): + """Ignores any errors encountered in deserialization, + and falls back to not deserializing the object. Recommended + for use in error deserialization, as we want to return the + HttpResponseError to users, and not have them deal with + a deserialization error. + + :param str target_obj: The target object type to deserialize to. + :param str/dict data: The response data to deserialize. + :param str content_type: Swagger "produces" if available. + """ + try: + return self(target_obj, data, content_type=content_type) + except: + _LOGGER.debug( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + @staticmethod + def _unpack_content(raw_data, content_type=None): + """Extract the correct structure for deserialization. + + If raw_data is a PipelineResponse, try to extract the result of RawDeserializer. + if we can't, raise. Your Pipeline should have a RawDeserializer. + + If not a pipeline response and raw_data is bytes or string, use content-type + to decode it. If no content-type, try JSON. + + If raw_data is something else, bypass all logic and return it directly. + + :param raw_data: Data to be processed. + :param content_type: How to parse if raw_data is a string/bytes. + :raises JSONDecodeError: If JSON is requested and parsing is impossible. + :raises UnicodeDecodeError: If bytes is not UTF8 + """ + # Assume this is enough to detect a Pipeline Response without importing it + context = getattr(raw_data, "context", {}) + if context: + if RawDeserializer.CONTEXT_NAME in context: + return context[RawDeserializer.CONTEXT_NAME] + raise ValueError("This pipeline didn't have the RawDeserializer policy; can't deserialize") + + # Assume this is enough to recognize universal_http.ClientResponse without importing it + if hasattr(raw_data, "body"): + return RawDeserializer.deserialize_from_http_generics(raw_data.text(), raw_data.headers) + + # Assume this enough to recognize requests.Response without importing it. + if hasattr(raw_data, "_content_consumed"): + return RawDeserializer.deserialize_from_http_generics(raw_data.text, raw_data.headers) + + if isinstance(raw_data, (basestring, bytes)) or hasattr(raw_data, "read"): + return RawDeserializer.deserialize_from_text(raw_data, content_type) # type: ignore + return raw_data + + def _instantiate_model(self, response, attrs, additional_properties=None): + """Instantiate a response model passing in deserialized args. + + :param response: The response model class. + :param d_attrs: The deserialized response attributes. + """ + if callable(response): + subtype = getattr(response, "_subtype_map", {}) + try: + readonly = [k for k, v in response._validation.items() if v.get("readonly")] + const = [k for k, v in response._validation.items() if v.get("constant")] + kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const} + response_obj = response(**kwargs) + for attr in readonly: + setattr(response_obj, attr, attrs.get(attr)) + if additional_properties: + response_obj.additional_properties = additional_properties + return response_obj + except TypeError as err: + msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore + raise DeserializationError(msg + str(err)) + else: + try: + for attr, value in attrs.items(): + setattr(response, attr, value) + return response + except Exception as exp: + msg = "Unable to populate response model. " + msg += "Type: {}, Error: {}".format(type(response), exp) + raise DeserializationError(msg) + + def deserialize_data(self, data, data_type): + """Process data for deserialization according to data type. + + :param str data: The response string to be deserialized. + :param str data_type: The type to deserialize to. + :raises: DeserializationError if deserialization fails. + :return: Deserialized object. + """ + if data is None: + return data + + try: + if not data_type: + return data + if data_type in self.basic_types.values(): + return self.deserialize_basic(data, data_type) + if data_type in self.deserialize_type: + if isinstance(data, self.deserialize_expected_types.get(data_type, tuple())): + return data + + is_a_text_parsing_type = lambda x: x not in ["object", "[]", r"{}"] + if isinstance(data, ET.Element) and is_a_text_parsing_type(data_type) and not data.text: + return None + data_val = self.deserialize_type[data_type](data) + return data_val + + iter_type = data_type[0] + data_type[-1] + if iter_type in self.deserialize_type: + return self.deserialize_type[iter_type](data, data_type[1:-1]) + + obj_type = self.dependencies[data_type] + if issubclass(obj_type, Enum): + if isinstance(data, ET.Element): + data = data.text + return self.deserialize_enum(data, obj_type) + + except (ValueError, TypeError, AttributeError) as err: + msg = "Unable to deserialize response data." + msg += " Data: {}, {}".format(data, data_type) + raise_with_traceback(DeserializationError, msg, err) + else: + return self._deserialize(obj_type, data) + + def deserialize_iter(self, attr, iter_type): + """Deserialize an iterable. + + :param list attr: Iterable to be deserialized. + :param str iter_type: The type of object in the iterable. + :rtype: list + """ + if attr is None: + return None + if isinstance(attr, ET.Element): # If I receive an element here, get the children + attr = list(attr) + if not isinstance(attr, (list, set)): + raise DeserializationError("Cannot deserialize as [{}] an object of type {}".format(iter_type, type(attr))) + return [self.deserialize_data(a, iter_type) for a in attr] + + def deserialize_dict(self, attr, dict_type): + """Deserialize a dictionary. + + :param dict/list attr: Dictionary to be deserialized. Also accepts + a list of key, value pairs. + :param str dict_type: The object type of the items in the dictionary. + :rtype: dict + """ + if isinstance(attr, list): + return {x["key"]: self.deserialize_data(x["value"], dict_type) for x in attr} + + if isinstance(attr, ET.Element): + # Transform value into {"Key": "value"} + attr = {el.tag: el.text for el in attr} + return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()} + + def deserialize_object(self, attr, **kwargs): + """Deserialize a generic object. + This will be handled as a dictionary. + + :param dict attr: Dictionary to be deserialized. + :rtype: dict + :raises: TypeError if non-builtin datatype encountered. + """ + if attr is None: + return None + if isinstance(attr, ET.Element): + # Do no recurse on XML, just return the tree as-is + return attr + if isinstance(attr, basestring): + return self.deserialize_basic(attr, "str") + obj_type = type(attr) + if obj_type in self.basic_types: + return self.deserialize_basic(attr, self.basic_types[obj_type]) + if obj_type is _long_type: + return self.deserialize_long(attr) + + if obj_type == dict: + deserialized = {} + for key, value in attr.items(): + try: + deserialized[key] = self.deserialize_object(value, **kwargs) + except ValueError: + deserialized[key] = None + return deserialized + + if obj_type == list: + deserialized = [] + for obj in attr: + try: + deserialized.append(self.deserialize_object(obj, **kwargs)) + except ValueError: + pass + return deserialized + + else: + error = "Cannot deserialize generic object with type: " + raise TypeError(error + str(obj_type)) + + def deserialize_basic(self, attr, data_type): + """Deserialize basic builtin data type from string. + Will attempt to convert to str, int, float and bool. + This function will also accept '1', '0', 'true' and 'false' as + valid bool values. + + :param str attr: response string to be deserialized. + :param str data_type: deserialization data type. + :rtype: str, int, float or bool + :raises: TypeError if string format is not valid. + """ + # If we're here, data is supposed to be a basic type. + # If it's still an XML node, take the text + if isinstance(attr, ET.Element): + attr = attr.text + if not attr: + if data_type == "str": + # None or '', node is empty string. + return "" + else: + # None or '', node with a strong type is None. + # Don't try to model "empty bool" or "empty int" + return None + + if data_type == "bool": + if attr in [True, False, 1, 0]: + return bool(attr) + elif isinstance(attr, basestring): + if attr.lower() in ["true", "1"]: + return True + elif attr.lower() in ["false", "0"]: + return False + raise TypeError("Invalid boolean value: {}".format(attr)) + + if data_type == "str": + return self.deserialize_unicode(attr) + return eval(data_type)(attr) # nosec + + @staticmethod + def deserialize_unicode(data): + """Preserve unicode objects in Python 2, otherwise return data + as a string. + + :param str data: response string to be deserialized. + :rtype: str or unicode + """ + # We might be here because we have an enum modeled as string, + # and we try to deserialize a partial dict with enum inside + if isinstance(data, Enum): + return data + + # Consider this is real string + try: + if isinstance(data, unicode): # type: ignore + return data + except NameError: + return str(data) + else: + return str(data) + + @staticmethod + def deserialize_enum(data, enum_obj): + """Deserialize string into enum object. + + If the string is not a valid enum value it will be returned as-is + and a warning will be logged. + + :param str data: Response string to be deserialized. If this value is + None or invalid it will be returned as-is. + :param Enum enum_obj: Enum object to deserialize to. + :rtype: Enum + """ + if isinstance(data, enum_obj) or data is None: + return data + if isinstance(data, Enum): + data = data.value + if isinstance(data, int): + # Workaround. We might consider remove it in the future. + # https://github.com/Azure/azure-rest-api-specs/issues/141 + try: + return list(enum_obj.__members__.values())[data] + except IndexError: + error = "{!r} is not a valid index for enum {!r}" + raise DeserializationError(error.format(data, enum_obj)) + try: + return enum_obj(str(data)) + except ValueError: + for enum_value in enum_obj: + if enum_value.value.lower() == str(data).lower(): + return enum_value + # We don't fail anymore for unknown value, we deserialize as a string + _LOGGER.warning("Deserializer is not able to find %s as valid enum in %s", data, enum_obj) + return Deserializer.deserialize_unicode(data) + + @staticmethod + def deserialize_bytearray(attr): + """Deserialize string into bytearray. + + :param str attr: response string to be deserialized. + :rtype: bytearray + :raises: TypeError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + return bytearray(b64decode(attr)) # type: ignore + + @staticmethod + def deserialize_base64(attr): + """Deserialize base64 encoded string into string. + + :param str attr: response string to be deserialized. + :rtype: bytearray + :raises: TypeError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore + attr = attr + padding # type: ignore + encoded = attr.replace("-", "+").replace("_", "/") + return b64decode(encoded) + + @staticmethod + def deserialize_decimal(attr): + """Deserialize string into Decimal object. + + :param str attr: response string to be deserialized. + :rtype: Decimal + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + return decimal.Decimal(attr) # type: ignore + except decimal.DecimalException as err: + msg = "Invalid decimal {}".format(attr) + raise_with_traceback(DeserializationError, msg, err) + + @staticmethod + def deserialize_long(attr): + """Deserialize string into long (Py2) or int (Py3). + + :param str attr: response string to be deserialized. + :rtype: long or int + :raises: ValueError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + return _long_type(attr) # type: ignore + + @staticmethod + def deserialize_duration(attr): + """Deserialize ISO-8601 formatted string into TimeDelta object. + + :param str attr: response string to be deserialized. + :rtype: TimeDelta + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + duration = isodate.parse_duration(attr) + except (ValueError, OverflowError, AttributeError) as err: + msg = "Cannot deserialize duration object." + raise_with_traceback(DeserializationError, msg, err) + else: + return duration + + @staticmethod + def deserialize_date(attr): + """Deserialize ISO-8601 formatted string into Date object. + + :param str attr: response string to be deserialized. + :rtype: Date + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore + raise DeserializationError("Date must have only digits and -. Received: %s" % attr) + # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. + return isodate.parse_date(attr, defaultmonth=None, defaultday=None) + + @staticmethod + def deserialize_time(attr): + """Deserialize ISO-8601 formatted string into time object. + + :param str attr: response string to be deserialized. + :rtype: datetime.time + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore + raise DeserializationError("Date must have only digits and -. Received: %s" % attr) + return isodate.parse_time(attr) + + @staticmethod + def deserialize_rfc(attr): + """Deserialize RFC-1123 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: Datetime + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + parsed_date = email.utils.parsedate_tz(attr) # type: ignore + date_obj = datetime.datetime( + *parsed_date[:6], tzinfo=_FixedOffset(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) + ) + if not date_obj.tzinfo: + date_obj = date_obj.astimezone(tz=TZ_UTC) + except ValueError as err: + msg = "Cannot deserialize to rfc datetime object." + raise_with_traceback(DeserializationError, msg, err) + else: + return date_obj + + @staticmethod + def deserialize_iso(attr): + """Deserialize ISO-8601 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: Datetime + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + attr = attr.upper() # type: ignore + match = Deserializer.valid_date.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + check_decimal = attr.split(".") + if len(check_decimal) > 1: + decimal_str = "" + for digit in check_decimal[1]: + if digit.isdigit(): + decimal_str += digit + else: + break + if len(decimal_str) > 6: + attr = attr.replace(decimal_str, decimal_str[0:6]) + + date_obj = isodate.parse_datetime(attr) + test_utc = date_obj.utctimetuple() + if test_utc.tm_year > 9999 or test_utc.tm_year < 1: + raise OverflowError("Hit max or min date") + except (ValueError, OverflowError, AttributeError) as err: + msg = "Cannot deserialize datetime object." + raise_with_traceback(DeserializationError, msg, err) + else: + return date_obj + + @staticmethod + def deserialize_unix(attr): + """Serialize Datetime object into IntTime format. + This is represented as seconds. + + :param int attr: Object to be serialized. + :rtype: Datetime + :raises: DeserializationError if format invalid + """ + if isinstance(attr, ET.Element): + attr = int(attr.text) # type: ignore + try: + date_obj = datetime.datetime.fromtimestamp(attr, TZ_UTC) + except ValueError as err: + msg = "Cannot deserialize to unix datetime object." + raise_with_traceback(DeserializationError, msg, err) + else: + return date_obj diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_vendor.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_vendor.py new file mode 100644 index 000000000000..59d8335b5c63 --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_vendor.py @@ -0,0 +1,26 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from abc import ABC +from typing import TYPE_CHECKING + +from ._configuration import EventGridClientConfiguration + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core import PipelineClient + + from ._serialization import Deserializer, Serializer + + +class EventGridClientMixinABC(ABC): + """DO NOT use this class. It is for internal typing use only.""" + + _client: "PipelineClient" + _config: EventGridClientConfiguration + _serialize: "Serializer" + _deserialize: "Deserializer" diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_version.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_version.py new file mode 100644 index 000000000000..be71c81bd282 --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_version.py @@ -0,0 +1,9 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +VERSION = "1.0.0b1" diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/__init__.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/__init__.py new file mode 100644 index 000000000000..5a6ddd0f6e2b --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/__init__.py @@ -0,0 +1,23 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._client import EventGridClient + +try: + from ._patch import __all__ as _patch_all + from ._patch import * # pylint: disable=unused-wildcard-import +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "EventGridClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) + +_patch_sdk() diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_client.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_client.py new file mode 100644 index 000000000000..e750b32d4902 --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_client.py @@ -0,0 +1,85 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from copy import deepcopy +from typing import Any, Awaitable, TYPE_CHECKING, Union + +from azure.core import AsyncPipelineClient +from azure.core.credentials import AzureKeyCredential +from azure.core.rest import AsyncHttpResponse, HttpRequest + +from .._serialization import Deserializer, Serializer +from ._configuration import EventGridClientConfiguration +from ._operations import EventGridClientOperationsMixin + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class EventGridClient(EventGridClientOperationsMixin): # pylint: disable=client-accepts-api-version-keyword + """Azure EventGrid Client. + + :param endpoint: The host name of the topic, e.g. topic1.westus2-1.eventgrid.azure.net. + Required. + :type endpoint: str + :param credential: Credential needed for the client to connect to Azure. Is either a + AzureKeyCredential type or a TokenCredential type. Required. + :type credential: ~azure.core.credentials.AzureKeyCredential or + ~azure.core.credentials_async.AsyncTokenCredential + :keyword api_version: The API version to use for this operation. Default value is "2018-01-01". + Note that overriding this default value may result in unsupported behavior. + :paramtype api_version: str + """ + + def __init__( + self, endpoint: str, credential: Union[AzureKeyCredential, "AsyncTokenCredential"], **kwargs: Any + ) -> None: + _endpoint = "{endpoint}" + self._config = EventGridClientConfiguration(endpoint=endpoint, credential=credential, **kwargs) + self._client = AsyncPipelineClient(base_url=_endpoint, config=self._config, **kwargs) + + self._serialize = Serializer() + self._deserialize = Deserializer() + self._serialize.client_side_validation = False + + def send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client.send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.AsyncHttpResponse + """ + + request_copy = deepcopy(request) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + + request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) + return self._client.send_request(request_copy, **kwargs) + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "EventGridClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details: Any) -> None: + await self._client.__aexit__(*exc_details) diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_configuration.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_configuration.py new file mode 100644 index 000000000000..3dccfbc8c6ef --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_configuration.py @@ -0,0 +1,82 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +import sys +from typing import Any, TYPE_CHECKING, Union + +from azure.core.configuration import Configuration +from azure.core.credentials import AzureKeyCredential +from azure.core.pipeline import policies + +from .._version import VERSION + +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class EventGridClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes + """Configuration for EventGridClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param endpoint: The host name of the topic, e.g. topic1.westus2-1.eventgrid.azure.net. + Required. + :type endpoint: str + :param credential: Credential needed for the client to connect to Azure. Is either a + AzureKeyCredential type or a TokenCredential type. Required. + :type credential: ~azure.core.credentials.AzureKeyCredential or + ~azure.core.credentials_async.AsyncTokenCredential + :keyword api_version: The API version to use for this operation. Default value is "2018-01-01". + Note that overriding this default value may result in unsupported behavior. + :paramtype api_version: str + """ + + def __init__( + self, endpoint: str, credential: Union[AzureKeyCredential, "AsyncTokenCredential"], **kwargs: Any + ) -> None: + super(EventGridClientConfiguration, self).__init__(**kwargs) + api_version: Literal["2018-01-01"] = kwargs.pop("api_version", "2018-01-01") + + if endpoint is None: + raise ValueError("Parameter 'endpoint' must not be None.") + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + + self.endpoint = endpoint + self.credential = credential + self.api_version = api_version + self.credential_scopes = kwargs.pop("credential_scopes", ["https://eventgrid.azure.net/.default"]) + kwargs.setdefault("sdk_moniker", "eventgridclient/{}".format(VERSION)) + self._configure(**kwargs) + + def _infer_policy(self, **kwargs): + if isinstance(self.credential, AzureKeyCredential): + return policies.AzureKeyCredentialPolicy(self.credential, "aeg-sas-key", **kwargs) + if hasattr(self.credential, "get_token"): + return policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) + raise TypeError(f"Unsupported credential: {self.credential}") + + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or policies.HttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") + if self.credential and not self.authentication_policy: + self.authentication_policy = self._infer_policy(**kwargs) diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_operations/__init__.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_operations/__init__.py new file mode 100644 index 000000000000..51bf5a7f3dcf --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_operations/__init__.py @@ -0,0 +1,19 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import EventGridClientOperationsMixin + +from ._patch import __all__ as _patch_all +from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "EventGridClientOperationsMixin", +] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_operations/_operations.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_operations/_operations.py new file mode 100644 index 000000000000..ac3c076e8050 --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_operations/_operations.py @@ -0,0 +1,127 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import json +from typing import Any, Callable, Dict, Optional, TypeVar, Union, overload + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict + +from ... import models as _models +from ..._model_base import AzureJSONEncoder +from ..._operations._operations import build_event_grid_publish_event_request +from .._vendor import EventGridClientMixinABC + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class EventGridClientOperationsMixin(EventGridClientMixinABC): + @overload + async def publish_event( # pylint: disable=inconsistent-return-statements + self, requests: _models.CloudEventRequest, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """publish_event. + + :param requests: Required. + :type requests: ~eventgrid.models.CloudEventRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def publish_event( # pylint: disable=inconsistent-return-statements + self, requests: _models.EventEventRequest, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """publish_event. + + :param requests: Required. + :type requests: ~eventgrid.models.EventEventRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def publish_event( # pylint: disable=inconsistent-return-statements + self, requests: Union[_models.CloudEventRequest, _models.EventEventRequest], **kwargs: Any + ) -> None: + """publish_event. + + :param requests: Is either a CloudEventRequest type or a EventEventRequest type. Required. + :type requests: ~eventgrid.models.CloudEventRequest or ~eventgrid.models.EventEventRequest + :keyword content_type: Body parameter Content-Type. Known values are: application/json. Default + value is None. + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(requests, _model_base.Model): + _content = json.dumps(requests, cls=AzureJSONEncoder) # type: ignore + elif isinstance(requests, _model_base.Model): + _content = json.dumps(requests, cls=AzureJSONEncoder) # type: ignore + + request = build_event_grid_publish_event_request( + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_operations/_patch.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_operations/_patch.py new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_patch.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_patch.py new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_vendor.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_vendor.py new file mode 100644 index 000000000000..35bd45e3dc6b --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_vendor.py @@ -0,0 +1,26 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from abc import ABC +from typing import TYPE_CHECKING + +from ._configuration import EventGridClientConfiguration + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core import AsyncPipelineClient + + from .._serialization import Deserializer, Serializer + + +class EventGridClientMixinABC(ABC): + """DO NOT use this class. It is for internal typing use only.""" + + _client: "AsyncPipelineClient" + _config: EventGridClientConfiguration + _serialize: "Serializer" + _deserialize: "Deserializer" diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/__init__.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/__init__.py new file mode 100644 index 000000000000..b7210fad7707 --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/__init__.py @@ -0,0 +1,20 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._models import CloudEventRequest +from ._models import EventEventRequest +from ._patch import __all__ as _patch_all +from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "CloudEventRequest", + "EventEventRequest", +] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/_models.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/_models.py new file mode 100644 index 000000000000..0b52ff690984 --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/_models.py @@ -0,0 +1,18 @@ +# coding=utf-8 +# pylint: disable=too-many-lines +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from .. import _model_base + + +class CloudEventRequest(_model_base.Model): + """ """ + + +class EventEventRequest(_model_base.Model): + """ """ diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/_patch.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/_patch.py new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/py.typed b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/setup.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/setup.py new file mode 100644 index 000000000000..7a2293be1ae1 --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/setup.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# coding: utf-8 +from setuptools import setup, find_packages + + +PACKAGE_NAME = "eventgridclient" +version = "1.0.0b1" +setup( + name=PACKAGE_NAME, + version=version, + description="EventGridClient", + author_email="", + url="", + keywords="azure, azure sdk", + packages=find_packages(), + include_package_data=True, + install_requires=[ + "isodate<1.0.0,>=0.6.1", + "azure-core<2.0.0,>=1.24.0", + "typing-extensions>=4.3.0; python_version<'3.8.0'", + ], + long_description="""\ + Azure EventGrid Client. + """, +) From f363d2cc18204322f7af91fff98bd62af3f1535d Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Fri, 17 Feb 2023 09:19:16 -0800 Subject: [PATCH 56/65] overload? --- .../eventgrid/data-plane/cadl/EventGrid.cadl | 28 +++++++------------ .../eventgrid/_operations/_operations.py | 26 ++++++++--------- .../eventgrid/aio/_operations/_operations.py | 26 ++++++++--------- .../cadl-python/eventgrid/models/__init__.py | 8 +++--- .../cadl-python/eventgrid/models/_models.py | 8 +++--- 5 files changed, 44 insertions(+), 52 deletions(-) diff --git a/specification/eventgrid/data-plane/cadl/EventGrid.cadl b/specification/eventgrid/data-plane/cadl/EventGrid.cadl index 970eb8d64e94..07c41e596542 100644 --- a/specification/eventgrid/data-plane/cadl/EventGrid.cadl +++ b/specification/eventgrid/data-plane/cadl/EventGrid.cadl @@ -158,42 +158,34 @@ namespace EventGrid { alias InputType = CloudEventRequest | EventEventRequest; - // op PublishEvent(...ApiVersionParameter, requests:InputType):OkResponse; + alias EventType = EventGridEvent | CloudEventEvent; + + // op PublishEvent(...ApiVersionParameter, requests:InputType):OkResponse; + @post op PublishEvent( ...ApiVersionParameter, @body - requests: InputType + events: EventType, ):OkResponse; - // { - // ...CloudEventRequest, - // ...ApiVersionParameter, - // }| - // { - // ...EventEventRequest, - // ...ApiVersionParameter, - // } - - // @overload(PublishEvent) // @post // op PublishEventCloud( + // events: CloudEventEvent, // ...ApiVersionParameter, - // @body - // @doc("Cloud") - // requests:CloudEventRequest, + // @header("content-type") + // contentType: "application/cloudevents-batch+json; charset=utf-8", // ):OkResponse; // @overload(PublishEvent) // @post // op PublishEventEventGrid( + // events: EventGridEvent, // ...ApiVersionParameter, - // @body - // @doc("Event") - // requests: EventEventRequest, + // @header("content-type") contentType: "application/json", // ):OkResponse; diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_operations/_operations.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_operations/_operations.py index a02d4f14e6a2..eaaf6db1363d 100644 --- a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_operations/_operations.py +++ b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_operations/_operations.py @@ -62,12 +62,12 @@ def build_event_grid_publish_event_request(**kwargs: Any) -> HttpRequest: class EventGridClientOperationsMixin(EventGridClientMixinABC): @overload def publish_event( # pylint: disable=inconsistent-return-statements - self, requests: _models.CloudEventRequest, *, content_type: str = "application/json", **kwargs: Any + self, events: _models.EventGridEvent, *, content_type: str = "application/json", **kwargs: Any ) -> None: """publish_event. - :param requests: Required. - :type requests: ~eventgrid.models.CloudEventRequest + :param events: Required. + :type events: ~eventgrid.models.EventGridEvent :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -78,12 +78,12 @@ def publish_event( # pylint: disable=inconsistent-return-statements @overload def publish_event( # pylint: disable=inconsistent-return-statements - self, requests: _models.EventEventRequest, *, content_type: str = "application/json", **kwargs: Any + self, events: _models.CloudEventEvent, *, content_type: str = "application/json", **kwargs: Any ) -> None: """publish_event. - :param requests: Required. - :type requests: ~eventgrid.models.EventEventRequest + :param events: Required. + :type events: ~eventgrid.models.CloudEventEvent :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -94,12 +94,12 @@ def publish_event( # pylint: disable=inconsistent-return-statements @distributed_trace def publish_event( # pylint: disable=inconsistent-return-statements - self, requests: Union[_models.CloudEventRequest, _models.EventEventRequest], **kwargs: Any + self, events: Union[_models.EventGridEvent, _models.CloudEventEvent], **kwargs: Any ) -> None: """publish_event. - :param requests: Is either a CloudEventRequest type or a EventEventRequest type. Required. - :type requests: ~eventgrid.models.CloudEventRequest or ~eventgrid.models.EventEventRequest + :param events: Is either a EventGridEvent type or a CloudEventEvent type. Required. + :type events: ~eventgrid.models.EventGridEvent or ~eventgrid.models.CloudEventEvent :keyword content_type: Body parameter Content-Type. Known values are: application/json. Default value is None. :paramtype content_type: str @@ -123,10 +123,10 @@ def publish_event( # pylint: disable=inconsistent-return-statements content_type = content_type or "application/json" _content = None - if isinstance(requests, _model_base.Model): - _content = json.dumps(requests, cls=AzureJSONEncoder) # type: ignore - elif isinstance(requests, _model_base.Model): - _content = json.dumps(requests, cls=AzureJSONEncoder) # type: ignore + if isinstance(events, _model_base.Model): + _content = json.dumps(events, cls=AzureJSONEncoder) # type: ignore + elif isinstance(events, _model_base.Model): + _content = json.dumps(events, cls=AzureJSONEncoder) # type: ignore request = build_event_grid_publish_event_request( content_type=content_type, diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_operations/_operations.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_operations/_operations.py index ac3c076e8050..6431a08e9406 100644 --- a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_operations/_operations.py +++ b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_operations/_operations.py @@ -35,12 +35,12 @@ class EventGridClientOperationsMixin(EventGridClientMixinABC): @overload async def publish_event( # pylint: disable=inconsistent-return-statements - self, requests: _models.CloudEventRequest, *, content_type: str = "application/json", **kwargs: Any + self, events: _models.EventGridEvent, *, content_type: str = "application/json", **kwargs: Any ) -> None: """publish_event. - :param requests: Required. - :type requests: ~eventgrid.models.CloudEventRequest + :param events: Required. + :type events: ~eventgrid.models.EventGridEvent :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -51,12 +51,12 @@ async def publish_event( # pylint: disable=inconsistent-return-statements @overload async def publish_event( # pylint: disable=inconsistent-return-statements - self, requests: _models.EventEventRequest, *, content_type: str = "application/json", **kwargs: Any + self, events: _models.CloudEventEvent, *, content_type: str = "application/json", **kwargs: Any ) -> None: """publish_event. - :param requests: Required. - :type requests: ~eventgrid.models.EventEventRequest + :param events: Required. + :type events: ~eventgrid.models.CloudEventEvent :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -67,12 +67,12 @@ async def publish_event( # pylint: disable=inconsistent-return-statements @distributed_trace_async async def publish_event( # pylint: disable=inconsistent-return-statements - self, requests: Union[_models.CloudEventRequest, _models.EventEventRequest], **kwargs: Any + self, events: Union[_models.EventGridEvent, _models.CloudEventEvent], **kwargs: Any ) -> None: """publish_event. - :param requests: Is either a CloudEventRequest type or a EventEventRequest type. Required. - :type requests: ~eventgrid.models.CloudEventRequest or ~eventgrid.models.EventEventRequest + :param events: Is either a EventGridEvent type or a CloudEventEvent type. Required. + :type events: ~eventgrid.models.EventGridEvent or ~eventgrid.models.CloudEventEvent :keyword content_type: Body parameter Content-Type. Known values are: application/json. Default value is None. :paramtype content_type: str @@ -96,10 +96,10 @@ async def publish_event( # pylint: disable=inconsistent-return-statements content_type = content_type or "application/json" _content = None - if isinstance(requests, _model_base.Model): - _content = json.dumps(requests, cls=AzureJSONEncoder) # type: ignore - elif isinstance(requests, _model_base.Model): - _content = json.dumps(requests, cls=AzureJSONEncoder) # type: ignore + if isinstance(events, _model_base.Model): + _content = json.dumps(events, cls=AzureJSONEncoder) # type: ignore + elif isinstance(events, _model_base.Model): + _content = json.dumps(events, cls=AzureJSONEncoder) # type: ignore request = build_event_grid_publish_event_request( content_type=content_type, diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/__init__.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/__init__.py index b7210fad7707..ed4fcbe8d944 100644 --- a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/__init__.py +++ b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/__init__.py @@ -6,15 +6,15 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._models import CloudEventRequest -from ._models import EventEventRequest +from ._models import CloudEventEvent +from ._models import EventGridEvent from ._patch import __all__ as _patch_all from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ - "CloudEventRequest", - "EventEventRequest", + "CloudEventEvent", + "EventGridEvent", ] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/_models.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/_models.py index 0b52ff690984..44a71c8a00e6 100644 --- a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/_models.py +++ b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/_models.py @@ -10,9 +10,9 @@ from .. import _model_base -class CloudEventRequest(_model_base.Model): - """ """ +class CloudEventEvent(_model_base.Model): + """Properties of an event published to an Event Grid topic using the CloudEvent 1.0 Schema""" -class EventEventRequest(_model_base.Model): - """ """ +class EventGridEvent(_model_base.Model): + """Properties of an event published to an Event Grid topic using the EventGrid Schema.""" From 66a5a1a79cb857e333fda55f83ee9c3422904bf7 Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Fri, 17 Feb 2023 10:30:33 -0800 Subject: [PATCH 57/65] eg --- .../eventgrid/data-plane/cadl/EventGrid.cadl | 86 ++++++------------- 1 file changed, 24 insertions(+), 62 deletions(-) diff --git a/specification/eventgrid/data-plane/cadl/EventGrid.cadl b/specification/eventgrid/data-plane/cadl/EventGrid.cadl index 07c41e596542..cfe14bbc9963 100644 --- a/specification/eventgrid/data-plane/cadl/EventGrid.cadl +++ b/specification/eventgrid/data-plane/cadl/EventGrid.cadl @@ -1,15 +1,10 @@ -// import "@cadl-lang/rest"; -// import "@cadl-lang/openapi"; import "@cadl-lang/versioning"; import "@azure-tools/cadl-azure-core"; -// import "@azure-tools/cadl-providerhub"; - enum ServiceApiVersions { v2018_01_01: "2018-01-01", } - @useAuth( ApiKeyAuth | OAuth2Auth<[{ @@ -36,9 +31,7 @@ namespace EventGrid { using Cadl.Http; using Azure.Core.Foundations; - // using Cadl.Rest; using Cadl.Versioning; - // using OpenAPI; @doc("Properties of an event published to an Event Grid topic using the EventGrid Schema.") model EventGridEvent { @@ -135,33 +128,12 @@ namespace EventGrid { "aeg-channel-name"?: string; } - // @post - // // @route("?overload=EventGridEvent") - // // @tag("Events") - // @doc("Publishes a batch of events to an Azure Event Grid topic.") - // op PublishEvents( - // @doc("An array of events to be published to Event Grid.") - // @body - // events: Event, - // ...ApiVersionParameter, - // ): OkResponse; - - model CloudEventRequest{ - @header("content-type") contentType: "application/cloudevents-batch+json; charset=utf-8", - @body _: CloudEventEvent - }; - model EventEventRequest{ - @header("content-type") contentType: "application/json", - @body _: EventGridEvent - }; - - alias InputType = CloudEventRequest | EventEventRequest; alias EventType = EventGridEvent | CloudEventEvent; - // op PublishEvent(...ApiVersionParameter, requests:InputType):OkResponse; +// General Event Function -- manually write overload @post op PublishEvent( @@ -171,51 +143,41 @@ namespace EventGrid { ):OkResponse; +// Overloaded Function -- when that becomes available + + // model CloudEventRequest{ + // @header("content-type") contentType: "application/cloudevents-batch+json; charset=utf-8", + // @body _: CloudEventEvent + // }; + // model EventEventRequest{ + // @header("content-type") contentType: "application/json", + // @body _: EventGridEvent + // }; + + // alias InputType = CloudEventRequest | EventEventRequest; + + // @post + // op PublishEvent( + // ...ApiVersionParameter, + // @body + // events: InputType, + // ):OkResponse; + + // @overload(PublishEvent) // @post // op PublishEventCloud( - // events: CloudEventEvent, + // events: CloudEventRequest, // ...ApiVersionParameter, - // @header("content-type") - // contentType: "application/cloudevents-batch+json; charset=utf-8", // ):OkResponse; // @overload(PublishEvent) // @post // op PublishEventEventGrid( - // events: EventGridEvent, + // events: EventEventRequest, // ...ApiVersionParameter, - // @header("content-type") contentType: "application/json", // ):OkResponse; - - - -// @post -// @route() -// // @route("?overload=cloudEvent") -// @tag("Events") -// @doc("Publishes a batch of events to an Azure Event Grid topic.") -// op PublishCloudEventEvents( -// @doc("An array of events to be published to Event Grid.") -// @body -// events: CloudEventEvent[], -// ...ApiVersionParameter, -// ...ChannelNameParameter, -// ): OkResponse; - -// @post -// // @route("?overload=customEvent") -// @tag("Events") -// @doc("Publishes a batch of events to an Azure Event Grid topic.") -// op PublishCustomEventEvents( -// // @extension("x-ms-identifiers", []) -// @doc("An array of events to be published to Event Grid.") -// @body -// events: CustomEventEvent[], -// ...ApiVersionParameter, -// ): OkResponse; - } From 237ab194e7b23cf34f81e89fb72bc337324316b0 Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Fri, 17 Feb 2023 10:45:29 -0800 Subject: [PATCH 58/65] try overlaod again --- .../eventgrid/data-plane/cadl/EventGrid.cadl | 32 ++- .../eventgrid/_operations/_operations.py | 245 +++++++++++++++++- .../eventgrid/aio/_operations/_operations.py | 215 ++++++++++++++- .../cadl-python/eventgrid/models/__init__.py | 4 + .../cadl-python/eventgrid/models/_models.py | 158 ++++++++++- 5 files changed, 615 insertions(+), 39 deletions(-) diff --git a/specification/eventgrid/data-plane/cadl/EventGrid.cadl b/specification/eventgrid/data-plane/cadl/EventGrid.cadl index cfe14bbc9963..e6cbec7dad4f 100644 --- a/specification/eventgrid/data-plane/cadl/EventGrid.cadl +++ b/specification/eventgrid/data-plane/cadl/EventGrid.cadl @@ -129,9 +129,9 @@ namespace EventGrid { } - alias EventType = EventGridEvent | CloudEventEvent; + model GeneralEvent {} // General Event Function -- manually write overload @@ -139,7 +139,7 @@ namespace EventGrid { op PublishEvent( ...ApiVersionParameter, @body - events: EventType, + events: GeneralEvent, ):OkResponse; @@ -164,19 +164,23 @@ namespace EventGrid { // ):OkResponse; - // @overload(PublishEvent) - // @post - // op PublishEventCloud( - // events: CloudEventRequest, - // ...ApiVersionParameter, - // ):OkResponse; + @overload(PublishEvent) + @post + op PublishCloudEvent( + @header("content-type") contentType: "application/cloudevents-batch+json; charset=utf-8", + @body + events: CloudEventEvent, + ...ApiVersionParameter, + ):OkResponse; - // @overload(PublishEvent) - // @post - // op PublishEventEventGrid( - // events: EventEventRequest, - // ...ApiVersionParameter, - // ):OkResponse; + @overload(PublishEvent) + @post + op PublishEventGridEvent( + @header("content-type") contentType: "application/json", + @body + events: EventGridEvent, + ...ApiVersionParameter, + ):OkResponse; } diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_operations/_operations.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_operations/_operations.py index eaaf6db1363d..c6a858122e1c 100644 --- a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_operations/_operations.py +++ b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_operations/_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- import json import sys -from typing import Any, Callable, Dict, Optional, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,10 +29,15 @@ from .._serialization import Serializer from .._vendor import EventGridClientMixinABC +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports if sys.version_info >= (3, 8): from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports else: from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -59,15 +64,52 @@ def build_event_grid_publish_event_request(**kwargs: Any) -> HttpRequest: return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) +def build_event_grid_publish_cloud_event_request(*, content: _models.CloudEventEvent, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: str = kwargs.pop("content_type") + api_version: Literal["2018-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) + # Construct URL + _url = "/" + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["content-type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, content=content, **kwargs) + + +def build_event_grid_publish_event_grid_event_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("content-type", None)) + api_version: Literal["2018-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) + # Construct URL + _url = "/" + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["content-type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + class EventGridClientOperationsMixin(EventGridClientMixinABC): @overload def publish_event( # pylint: disable=inconsistent-return-statements - self, events: _models.EventGridEvent, *, content_type: str = "application/json", **kwargs: Any + self, events: _models.GeneralEvent, *, content_type: str = "application/json", **kwargs: Any ) -> None: """publish_event. :param events: Required. - :type events: ~eventgrid.models.EventGridEvent + :type events: ~eventgrid.models.GeneralEvent :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -78,12 +120,12 @@ def publish_event( # pylint: disable=inconsistent-return-statements @overload def publish_event( # pylint: disable=inconsistent-return-statements - self, events: _models.CloudEventEvent, *, content_type: str = "application/json", **kwargs: Any + self, events: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> None: """publish_event. :param events: Required. - :type events: ~eventgrid.models.CloudEventEvent + :type events: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -92,14 +134,30 @@ def publish_event( # pylint: disable=inconsistent-return-statements :raises ~azure.core.exceptions.HttpResponseError: """ + @overload + def publish_event( # pylint: disable=inconsistent-return-statements + self, events: IO, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """publish_event. + + :param events: Required. + :type events: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + @distributed_trace def publish_event( # pylint: disable=inconsistent-return-statements - self, events: Union[_models.EventGridEvent, _models.CloudEventEvent], **kwargs: Any + self, events: Union[_models.GeneralEvent, JSON, IO], **kwargs: Any ) -> None: """publish_event. - :param events: Is either a EventGridEvent type or a CloudEventEvent type. Required. - :type events: ~eventgrid.models.EventGridEvent or ~eventgrid.models.CloudEventEvent + :param events: Is one of the following types: GeneralEvent, JSON, IO Required. + :type events: ~eventgrid.models.GeneralEvent or JSON or IO :keyword content_type: Body parameter Content-Type. Known values are: application/json. Default value is None. :paramtype content_type: str @@ -123,9 +181,9 @@ def publish_event( # pylint: disable=inconsistent-return-statements content_type = content_type or "application/json" _content = None - if isinstance(events, _model_base.Model): - _content = json.dumps(events, cls=AzureJSONEncoder) # type: ignore - elif isinstance(events, _model_base.Model): + if isinstance(events, (IO, bytes)): + _content = events + else: _content = json.dumps(events, cls=AzureJSONEncoder) # type: ignore request = build_event_grid_publish_event_request( @@ -152,3 +210,168 @@ def publish_event( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) + + @distributed_trace + def publish_cloud_event( # pylint: disable=inconsistent-return-statements + self, events: _models.CloudEventEvent, **kwargs: Any + ) -> None: + """publish_cloud_event. + + :param events: Required. + :type events: ~eventgrid.models.CloudEventEvent + :keyword content_type: Default value is "application/cloudevents-batch+json; charset=utf-8". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: str = kwargs.pop( + "content_type", _headers.pop("content-type", "application/cloudevents-batch+json; charset=utf-8") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _content = json.dumps(events, cls=AzureJSONEncoder) # type: ignore + + request = build_event_grid_publish_cloud_event_request( + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) + + @overload + def publish_event_grid_event( # pylint: disable=inconsistent-return-statements + self, events: _models.EventGridEvent, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """publish_event_grid_event. + + :param events: Required. + :type events: ~eventgrid.models.EventGridEvent + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def publish_event_grid_event( # pylint: disable=inconsistent-return-statements + self, events: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """publish_event_grid_event. + + :param events: Required. + :type events: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def publish_event_grid_event( # pylint: disable=inconsistent-return-statements + self, events: IO, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """publish_event_grid_event. + + :param events: Required. + :type events: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def publish_event_grid_event( # pylint: disable=inconsistent-return-statements + self, events: Union[_models.EventGridEvent, JSON, IO], **kwargs: Any + ) -> None: + """publish_event_grid_event. + + :param events: Is one of the following types: EventGridEvent, JSON, IO Required. + :type events: ~eventgrid.models.EventGridEvent or JSON or IO + :keyword content_type: Default value is None. + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("content-type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(events, (IO, bytes)): + _content = events + else: + _content = json.dumps(events, cls=AzureJSONEncoder) # type: ignore + + request = build_event_grid_publish_event_grid_event_request( + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_operations/_operations.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_operations/_operations.py index 6431a08e9406..9ca0358bdca5 100644 --- a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_operations/_operations.py +++ b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_operations/_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import json -from typing import Any, Callable, Dict, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -25,9 +26,18 @@ from ... import models as _models from ..._model_base import AzureJSONEncoder -from ..._operations._operations import build_event_grid_publish_event_request +from ..._operations._operations import ( + build_event_grid_publish_cloud_event_request, + build_event_grid_publish_event_grid_event_request, + build_event_grid_publish_event_request, +) from .._vendor import EventGridClientMixinABC +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,12 +45,12 @@ class EventGridClientOperationsMixin(EventGridClientMixinABC): @overload async def publish_event( # pylint: disable=inconsistent-return-statements - self, events: _models.EventGridEvent, *, content_type: str = "application/json", **kwargs: Any + self, events: _models.GeneralEvent, *, content_type: str = "application/json", **kwargs: Any ) -> None: """publish_event. :param events: Required. - :type events: ~eventgrid.models.EventGridEvent + :type events: ~eventgrid.models.GeneralEvent :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -51,12 +61,12 @@ async def publish_event( # pylint: disable=inconsistent-return-statements @overload async def publish_event( # pylint: disable=inconsistent-return-statements - self, events: _models.CloudEventEvent, *, content_type: str = "application/json", **kwargs: Any + self, events: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> None: """publish_event. :param events: Required. - :type events: ~eventgrid.models.CloudEventEvent + :type events: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -65,14 +75,30 @@ async def publish_event( # pylint: disable=inconsistent-return-statements :raises ~azure.core.exceptions.HttpResponseError: """ + @overload + async def publish_event( # pylint: disable=inconsistent-return-statements + self, events: IO, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """publish_event. + + :param events: Required. + :type events: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + @distributed_trace_async async def publish_event( # pylint: disable=inconsistent-return-statements - self, events: Union[_models.EventGridEvent, _models.CloudEventEvent], **kwargs: Any + self, events: Union[_models.GeneralEvent, JSON, IO], **kwargs: Any ) -> None: """publish_event. - :param events: Is either a EventGridEvent type or a CloudEventEvent type. Required. - :type events: ~eventgrid.models.EventGridEvent or ~eventgrid.models.CloudEventEvent + :param events: Is one of the following types: GeneralEvent, JSON, IO Required. + :type events: ~eventgrid.models.GeneralEvent or JSON or IO :keyword content_type: Body parameter Content-Type. Known values are: application/json. Default value is None. :paramtype content_type: str @@ -96,9 +122,9 @@ async def publish_event( # pylint: disable=inconsistent-return-statements content_type = content_type or "application/json" _content = None - if isinstance(events, _model_base.Model): - _content = json.dumps(events, cls=AzureJSONEncoder) # type: ignore - elif isinstance(events, _model_base.Model): + if isinstance(events, (IO, bytes)): + _content = events + else: _content = json.dumps(events, cls=AzureJSONEncoder) # type: ignore request = build_event_grid_publish_event_request( @@ -125,3 +151,168 @@ async def publish_event( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) + + @distributed_trace_async + async def publish_cloud_event( # pylint: disable=inconsistent-return-statements + self, events: _models.CloudEventEvent, **kwargs: Any + ) -> None: + """publish_cloud_event. + + :param events: Required. + :type events: ~eventgrid.models.CloudEventEvent + :keyword content_type: Default value is "application/cloudevents-batch+json; charset=utf-8". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: str = kwargs.pop( + "content_type", _headers.pop("content-type", "application/cloudevents-batch+json; charset=utf-8") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _content = json.dumps(events, cls=AzureJSONEncoder) # type: ignore + + request = build_event_grid_publish_cloud_event_request( + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) + + @overload + async def publish_event_grid_event( # pylint: disable=inconsistent-return-statements + self, events: _models.EventGridEvent, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """publish_event_grid_event. + + :param events: Required. + :type events: ~eventgrid.models.EventGridEvent + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def publish_event_grid_event( # pylint: disable=inconsistent-return-statements + self, events: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """publish_event_grid_event. + + :param events: Required. + :type events: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def publish_event_grid_event( # pylint: disable=inconsistent-return-statements + self, events: IO, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """publish_event_grid_event. + + :param events: Required. + :type events: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def publish_event_grid_event( # pylint: disable=inconsistent-return-statements + self, events: Union[_models.EventGridEvent, JSON, IO], **kwargs: Any + ) -> None: + """publish_event_grid_event. + + :param events: Is one of the following types: EventGridEvent, JSON, IO Required. + :type events: ~eventgrid.models.EventGridEvent or JSON or IO + :keyword content_type: Default value is None. + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("content-type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(events, (IO, bytes)): + _content = events + else: + _content = json.dumps(events, cls=AzureJSONEncoder) # type: ignore + + request = build_event_grid_publish_event_grid_event_request( + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/__init__.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/__init__.py index ed4fcbe8d944..b298e570284e 100644 --- a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/__init__.py +++ b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/__init__.py @@ -8,6 +8,8 @@ from ._models import CloudEventEvent from ._models import EventGridEvent +from ._models import GeneralEvent +from ._models import object from ._patch import __all__ as _patch_all from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk @@ -15,6 +17,8 @@ __all__ = [ "CloudEventEvent", "EventGridEvent", + "GeneralEvent", + "object", ] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/_models.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/_models.py index 44a71c8a00e6..2461c7b4afc8 100644 --- a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/_models.py +++ b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/_models.py @@ -7,12 +7,166 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import datetime +from typing import Any, Mapping, Optional, TYPE_CHECKING, overload + from .. import _model_base +from .._model_base import rest_field + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models class CloudEventEvent(_model_base.Model): - """Properties of an event published to an Event Grid topic using the CloudEvent 1.0 Schema""" + """Properties of an event published to an Event Grid topic using the CloudEvent 1.0 Schema. + + All required parameters must be populated in order to send to Azure. + + :ivar id: An identifier for the event. The combination of id and source must be unique for each + distinct event. Required. + :vartype id: str + :ivar source: Identifies the context in which an event happened. The combination of id and + source must be unique for each distinct event. Required. + :vartype source: str + :ivar data: Event data specific to the event type. + :vartype data: ~eventgrid.models.object + :ivar data_base64: Event data specific to the event type, encoded as a base64 string. + :vartype data_base64: bytes + :ivar type: Type of event related to the originating occurrence. Required. + :vartype type: str + :ivar time: The time (in UTC) the event was generated, in RFC3339 format. + :vartype time: ~datetime.datetime + :ivar specversion: The version of the CloudEvents specification which the event uses. Required. + :vartype specversion: str + :ivar dataschema: Identifies the schema that data adheres to. + :vartype dataschema: str + :ivar datacontenttype: Content type of data value. + :vartype datacontenttype: str + :ivar subject: This describes the subject of the event in the context of the event producer + (identified by source). + :vartype subject: str + """ + + id: str = rest_field() + """An identifier for the event. The combination of id and source must be unique for each distinct event. Required. """ + source: str = rest_field() + """Identifies the context in which an event happened. The combination of id and source must be unique for each distinct event. Required. """ + data: Optional["_models.object"] = rest_field() + """Event data specific to the event type. """ + data_base64: Optional[bytes] = rest_field() + """Event data specific to the event type, encoded as a base64 string. """ + type: str = rest_field() + """Type of event related to the originating occurrence. Required. """ + time: Optional[datetime.datetime] = rest_field() + """The time (in UTC) the event was generated, in RFC3339 format. """ + specversion: str = rest_field() + """The version of the CloudEvents specification which the event uses. Required. """ + dataschema: Optional[str] = rest_field() + """Identifies the schema that data adheres to. """ + datacontenttype: Optional[str] = rest_field() + """Content type of data value. """ + subject: Optional[str] = rest_field() + """This describes the subject of the event in the context of the event producer (identified by source). """ + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + source: str, + type: str, + specversion: str, + data: Optional["_models.object"] = None, + data_base64: Optional[bytes] = None, + time: Optional[datetime.datetime] = None, + dataschema: Optional[str] = None, + datacontenttype: Optional[str] = None, + subject: Optional[str] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) class EventGridEvent(_model_base.Model): - """Properties of an event published to an Event Grid topic using the EventGrid Schema.""" + """Properties of an event published to an Event Grid topic using the EventGrid Schema. + + Readonly variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: An unique identifier for the event. Required. + :vartype id: str + :ivar topic: The resource path of the event source. + :vartype topic: str + :ivar subject: A resource path relative to the topic path. Required. + :vartype subject: str + :ivar data: Event data specific to the event type. Required. + :vartype data: ~eventgrid.models.object + :ivar event_type: The type of the event that occurred. Required. + :vartype event_type: str + :ivar event_time: The time (in UTC) the event was generated. Required. + :vartype event_time: ~datetime.datetime + :ivar metadata_version: The schema version of the event metadata. + :vartype metadata_version: str + :ivar data_version: The schema version of the data object. Required. + :vartype data_version: str + """ + + id: str = rest_field() + """An unique identifier for the event. Required. """ + topic: Optional[str] = rest_field() + """The resource path of the event source. """ + subject: str = rest_field() + """A resource path relative to the topic path. Required. """ + data: "_models.object" = rest_field() + """Event data specific to the event type. Required. """ + event_type: str = rest_field(name="eventType") + """The type of the event that occurred. Required. """ + event_time: datetime.datetime = rest_field(name="eventTime") + """The time (in UTC) the event was generated. Required. """ + metadata_version: Optional[str] = rest_field(name="metadataVersion", readonly=True) + """The schema version of the event metadata. """ + data_version: str = rest_field(name="dataVersion") + """The schema version of the data object. Required. """ + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + subject: str, + data: "_models.object", + event_type: str, + event_time: datetime.datetime, + data_version: str, + topic: Optional[str] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class GeneralEvent(_model_base.Model): + """GeneralEvent.""" + + +class object(_model_base.Model): + """object.""" From 6c45a0ee99db6b41f50d4360ea29648222eb5561 Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Fri, 17 Feb 2023 11:15:51 -0800 Subject: [PATCH 59/65] save here try to see why models are not showing --- .../eventgrid/data-plane/cadl/EventGrid.cadl | 66 +++++++++---------- 1 file changed, 32 insertions(+), 34 deletions(-) diff --git a/specification/eventgrid/data-plane/cadl/EventGrid.cadl b/specification/eventgrid/data-plane/cadl/EventGrid.cadl index e6cbec7dad4f..ed2115848ded 100644 --- a/specification/eventgrid/data-plane/cadl/EventGrid.cadl +++ b/specification/eventgrid/data-plane/cadl/EventGrid.cadl @@ -135,53 +135,51 @@ namespace EventGrid { // General Event Function -- manually write overload - @post - op PublishEvent( - ...ApiVersionParameter, - @body - events: GeneralEvent, - ):OkResponse; - - -// Overloaded Function -- when that becomes available - - // model CloudEventRequest{ - // @header("content-type") contentType: "application/cloudevents-batch+json; charset=utf-8", - // @body _: CloudEventEvent - // }; - // model EventEventRequest{ - // @header("content-type") contentType: "application/json", - // @body _: EventGridEvent - // }; - - // alias InputType = CloudEventRequest | EventEventRequest; - // @post // op PublishEvent( // ...ApiVersionParameter, // @body - // events: InputType, + // events: EventType, // ):OkResponse; - @overload(PublishEvent) - @post - op PublishCloudEvent( +// Overloaded Function -- when that becomes available + + alias CloudEventRequest = { @header("content-type") contentType: "application/cloudevents-batch+json; charset=utf-8", - @body - events: CloudEventEvent, - ...ApiVersionParameter, - ):OkResponse; + ...CloudEventEvent + }; + + alias InputType = CloudEventRequest | EventGridEvent; - @overload(PublishEvent) @post - op PublishEventGridEvent( - @header("content-type") contentType: "application/json", + @route("foo") + op PublishEvent( @body - events: EventGridEvent, - ...ApiVersionParameter, + events: InputType, + ...ApiVersionParameter, + ):OkResponse; + + // @overload(PublishEvent) + // @post + // op PublishCloudEvent( + // @header("content-type") contentType: "application/cloudevents-batch+json; charset=utf-8", + // @body + // events: CloudEventEvent, + // ...ApiVersionParameter, + // ):OkResponse; + + // @overload(PublishEvent) + // @post + // op PublishEventGridEvent( + // @header("content-type") contentType: "application/json", + // @body + // events: EventGridEvent, + // ...ApiVersionParameter, + // ):OkResponse; + } From 2871f290820bdb50c11bebc33d5c85a2392c232b Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Fri, 17 Feb 2023 11:56:13 -0800 Subject: [PATCH 60/65] save --- .../eventgrid/data-plane/cadl/EventGrid.cadl | 6 +- .../eventgrid/_operations/_operations.py | 247 +----------------- .../eventgrid/aio/_operations/_operations.py | 215 +-------------- .../cadl-python/eventgrid/models/__init__.py | 4 - .../cadl-python/eventgrid/models/_models.py | 158 +---------- 5 files changed, 29 insertions(+), 601 deletions(-) diff --git a/specification/eventgrid/data-plane/cadl/EventGrid.cadl b/specification/eventgrid/data-plane/cadl/EventGrid.cadl index ed2115848ded..1bac6a2236b2 100644 --- a/specification/eventgrid/data-plane/cadl/EventGrid.cadl +++ b/specification/eventgrid/data-plane/cadl/EventGrid.cadl @@ -129,9 +129,9 @@ namespace EventGrid { } - alias EventType = EventGridEvent | CloudEventEvent; + // alias EventType = EventGridEvent | CloudEventEvent; - model GeneralEvent {} + // model GeneralEvent {} // General Event Function -- manually write overload @@ -183,6 +183,6 @@ namespace EventGrid { } - +// Try gen swagger and make sure that looks right and maybe create issue for models not appearing *** diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_operations/_operations.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_operations/_operations.py index c6a858122e1c..dbe4a88dbd66 100644 --- a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_operations/_operations.py +++ b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_operations/_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- import json import sys -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +from typing import Any, Callable, Dict, Optional, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,15 +29,10 @@ from .._serialization import Serializer from .._vendor import EventGridClientMixinABC -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports if sys.version_info >= (3, 8): from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports else: from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -52,7 +47,7 @@ def build_event_grid_publish_event_request(**kwargs: Any) -> HttpRequest: content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: Literal["2018-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) # Construct URL - _url = "/" + _url = "/foo" # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -64,52 +59,15 @@ def build_event_grid_publish_event_request(**kwargs: Any) -> HttpRequest: return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_event_grid_publish_cloud_event_request(*, content: _models.CloudEventEvent, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: str = kwargs.pop("content_type") - api_version: Literal["2018-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) - # Construct URL - _url = "/" - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["content-type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, content=content, **kwargs) - - -def build_event_grid_publish_event_grid_event_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("content-type", None)) - api_version: Literal["2018-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) - # Construct URL - _url = "/" - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["content-type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - class EventGridClientOperationsMixin(EventGridClientMixinABC): @overload def publish_event( # pylint: disable=inconsistent-return-statements - self, events: _models.GeneralEvent, *, content_type: str = "application/json", **kwargs: Any + self, events: _models.CloudEventEvent, *, content_type: str = "application/json", **kwargs: Any ) -> None: """publish_event. :param events: Required. - :type events: ~eventgrid.models.GeneralEvent + :type events: ~eventgrid.models.CloudEventEvent :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -120,12 +78,12 @@ def publish_event( # pylint: disable=inconsistent-return-statements @overload def publish_event( # pylint: disable=inconsistent-return-statements - self, events: JSON, *, content_type: str = "application/json", **kwargs: Any + self, events: _models.EventGridEvent, *, content_type: str = "application/json", **kwargs: Any ) -> None: """publish_event. :param events: Required. - :type events: JSON + :type events: ~eventgrid.models.EventGridEvent :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -134,30 +92,14 @@ def publish_event( # pylint: disable=inconsistent-return-statements :raises ~azure.core.exceptions.HttpResponseError: """ - @overload - def publish_event( # pylint: disable=inconsistent-return-statements - self, events: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """publish_event. - - :param events: Required. - :type events: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace def publish_event( # pylint: disable=inconsistent-return-statements - self, events: Union[_models.GeneralEvent, JSON, IO], **kwargs: Any + self, events: Union[_models.CloudEventEvent, _models.EventGridEvent], **kwargs: Any ) -> None: """publish_event. - :param events: Is one of the following types: GeneralEvent, JSON, IO Required. - :type events: ~eventgrid.models.GeneralEvent or JSON or IO + :param events: Is either a CloudEventEvent type or a EventGridEvent type. Required. + :type events: ~eventgrid.models.CloudEventEvent or ~eventgrid.models.EventGridEvent :keyword content_type: Body parameter Content-Type. Known values are: application/json. Default value is None. :paramtype content_type: str @@ -181,177 +123,12 @@ def publish_event( # pylint: disable=inconsistent-return-statements content_type = content_type or "application/json" _content = None - if isinstance(events, (IO, bytes)): - _content = events - else: + if isinstance(events, _model_base.Model): _content = json.dumps(events, cls=AzureJSONEncoder) # type: ignore - - request = build_event_grid_publish_event_request( - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - request.url = self._client.format_url(request.url, **path_format_arguments) - - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) - - @distributed_trace - def publish_cloud_event( # pylint: disable=inconsistent-return-statements - self, events: _models.CloudEventEvent, **kwargs: Any - ) -> None: - """publish_cloud_event. - - :param events: Required. - :type events: ~eventgrid.models.CloudEventEvent - :keyword content_type: Default value is "application/cloudevents-batch+json; charset=utf-8". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: str = kwargs.pop( - "content_type", _headers.pop("content-type", "application/cloudevents-batch+json; charset=utf-8") - ) - cls: ClsType[None] = kwargs.pop("cls", None) - - _content = json.dumps(events, cls=AzureJSONEncoder) # type: ignore - - request = build_event_grid_publish_cloud_event_request( - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - request.url = self._client.format_url(request.url, **path_format_arguments) - - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) - - @overload - def publish_event_grid_event( # pylint: disable=inconsistent-return-statements - self, events: _models.EventGridEvent, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """publish_event_grid_event. - - :param events: Required. - :type events: ~eventgrid.models.EventGridEvent - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def publish_event_grid_event( # pylint: disable=inconsistent-return-statements - self, events: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """publish_event_grid_event. - - :param events: Required. - :type events: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def publish_event_grid_event( # pylint: disable=inconsistent-return-statements - self, events: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """publish_event_grid_event. - - :param events: Required. - :type events: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def publish_event_grid_event( # pylint: disable=inconsistent-return-statements - self, events: Union[_models.EventGridEvent, JSON, IO], **kwargs: Any - ) -> None: - """publish_event_grid_event. - - :param events: Is one of the following types: EventGridEvent, JSON, IO Required. - :type events: ~eventgrid.models.EventGridEvent or JSON or IO - :keyword content_type: Default value is None. - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("content-type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(events, (IO, bytes)): - _content = events - else: + elif isinstance(events, _model_base.Model): _content = json.dumps(events, cls=AzureJSONEncoder) # type: ignore - request = build_event_grid_publish_event_grid_event_request( + request = build_event_grid_publish_event_request( content_type=content_type, api_version=self._config.api_version, content=_content, diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_operations/_operations.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_operations/_operations.py index 9ca0358bdca5..825f33c928fb 100644 --- a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_operations/_operations.py +++ b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_operations/_operations.py @@ -7,8 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import json -import sys -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +from typing import Any, Callable, Dict, Optional, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -26,18 +25,9 @@ from ... import models as _models from ..._model_base import AzureJSONEncoder -from ..._operations._operations import ( - build_event_grid_publish_cloud_event_request, - build_event_grid_publish_event_grid_event_request, - build_event_grid_publish_event_request, -) +from ..._operations._operations import build_event_grid_publish_event_request from .._vendor import EventGridClientMixinABC -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -45,12 +35,12 @@ class EventGridClientOperationsMixin(EventGridClientMixinABC): @overload async def publish_event( # pylint: disable=inconsistent-return-statements - self, events: _models.GeneralEvent, *, content_type: str = "application/json", **kwargs: Any + self, events: _models.CloudEventEvent, *, content_type: str = "application/json", **kwargs: Any ) -> None: """publish_event. :param events: Required. - :type events: ~eventgrid.models.GeneralEvent + :type events: ~eventgrid.models.CloudEventEvent :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -61,12 +51,12 @@ async def publish_event( # pylint: disable=inconsistent-return-statements @overload async def publish_event( # pylint: disable=inconsistent-return-statements - self, events: JSON, *, content_type: str = "application/json", **kwargs: Any + self, events: _models.EventGridEvent, *, content_type: str = "application/json", **kwargs: Any ) -> None: """publish_event. :param events: Required. - :type events: JSON + :type events: ~eventgrid.models.EventGridEvent :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -75,30 +65,14 @@ async def publish_event( # pylint: disable=inconsistent-return-statements :raises ~azure.core.exceptions.HttpResponseError: """ - @overload - async def publish_event( # pylint: disable=inconsistent-return-statements - self, events: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """publish_event. - - :param events: Required. - :type events: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace_async async def publish_event( # pylint: disable=inconsistent-return-statements - self, events: Union[_models.GeneralEvent, JSON, IO], **kwargs: Any + self, events: Union[_models.CloudEventEvent, _models.EventGridEvent], **kwargs: Any ) -> None: """publish_event. - :param events: Is one of the following types: GeneralEvent, JSON, IO Required. - :type events: ~eventgrid.models.GeneralEvent or JSON or IO + :param events: Is either a CloudEventEvent type or a EventGridEvent type. Required. + :type events: ~eventgrid.models.CloudEventEvent or ~eventgrid.models.EventGridEvent :keyword content_type: Body parameter Content-Type. Known values are: application/json. Default value is None. :paramtype content_type: str @@ -122,177 +96,12 @@ async def publish_event( # pylint: disable=inconsistent-return-statements content_type = content_type or "application/json" _content = None - if isinstance(events, (IO, bytes)): - _content = events - else: + if isinstance(events, _model_base.Model): _content = json.dumps(events, cls=AzureJSONEncoder) # type: ignore - - request = build_event_grid_publish_event_request( - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - request.url = self._client.format_url(request.url, **path_format_arguments) - - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) - - @distributed_trace_async - async def publish_cloud_event( # pylint: disable=inconsistent-return-statements - self, events: _models.CloudEventEvent, **kwargs: Any - ) -> None: - """publish_cloud_event. - - :param events: Required. - :type events: ~eventgrid.models.CloudEventEvent - :keyword content_type: Default value is "application/cloudevents-batch+json; charset=utf-8". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: str = kwargs.pop( - "content_type", _headers.pop("content-type", "application/cloudevents-batch+json; charset=utf-8") - ) - cls: ClsType[None] = kwargs.pop("cls", None) - - _content = json.dumps(events, cls=AzureJSONEncoder) # type: ignore - - request = build_event_grid_publish_cloud_event_request( - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - request.url = self._client.format_url(request.url, **path_format_arguments) - - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) - - @overload - async def publish_event_grid_event( # pylint: disable=inconsistent-return-statements - self, events: _models.EventGridEvent, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """publish_event_grid_event. - - :param events: Required. - :type events: ~eventgrid.models.EventGridEvent - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def publish_event_grid_event( # pylint: disable=inconsistent-return-statements - self, events: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """publish_event_grid_event. - - :param events: Required. - :type events: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def publish_event_grid_event( # pylint: disable=inconsistent-return-statements - self, events: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """publish_event_grid_event. - - :param events: Required. - :type events: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def publish_event_grid_event( # pylint: disable=inconsistent-return-statements - self, events: Union[_models.EventGridEvent, JSON, IO], **kwargs: Any - ) -> None: - """publish_event_grid_event. - - :param events: Is one of the following types: EventGridEvent, JSON, IO Required. - :type events: ~eventgrid.models.EventGridEvent or JSON or IO - :keyword content_type: Default value is None. - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("content-type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(events, (IO, bytes)): - _content = events - else: + elif isinstance(events, _model_base.Model): _content = json.dumps(events, cls=AzureJSONEncoder) # type: ignore - request = build_event_grid_publish_event_grid_event_request( + request = build_event_grid_publish_event_request( content_type=content_type, api_version=self._config.api_version, content=_content, diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/__init__.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/__init__.py index b298e570284e..ed4fcbe8d944 100644 --- a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/__init__.py +++ b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/__init__.py @@ -8,8 +8,6 @@ from ._models import CloudEventEvent from ._models import EventGridEvent -from ._models import GeneralEvent -from ._models import object from ._patch import __all__ as _patch_all from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk @@ -17,8 +15,6 @@ __all__ = [ "CloudEventEvent", "EventGridEvent", - "GeneralEvent", - "object", ] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/_models.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/_models.py index 2461c7b4afc8..aea58a8289b2 100644 --- a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/_models.py +++ b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/_models.py @@ -7,166 +7,12 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import datetime -from typing import Any, Mapping, Optional, TYPE_CHECKING, overload - from .. import _model_base -from .._model_base import rest_field - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from .. import models as _models class CloudEventEvent(_model_base.Model): - """Properties of an event published to an Event Grid topic using the CloudEvent 1.0 Schema. - - All required parameters must be populated in order to send to Azure. - - :ivar id: An identifier for the event. The combination of id and source must be unique for each - distinct event. Required. - :vartype id: str - :ivar source: Identifies the context in which an event happened. The combination of id and - source must be unique for each distinct event. Required. - :vartype source: str - :ivar data: Event data specific to the event type. - :vartype data: ~eventgrid.models.object - :ivar data_base64: Event data specific to the event type, encoded as a base64 string. - :vartype data_base64: bytes - :ivar type: Type of event related to the originating occurrence. Required. - :vartype type: str - :ivar time: The time (in UTC) the event was generated, in RFC3339 format. - :vartype time: ~datetime.datetime - :ivar specversion: The version of the CloudEvents specification which the event uses. Required. - :vartype specversion: str - :ivar dataschema: Identifies the schema that data adheres to. - :vartype dataschema: str - :ivar datacontenttype: Content type of data value. - :vartype datacontenttype: str - :ivar subject: This describes the subject of the event in the context of the event producer - (identified by source). - :vartype subject: str - """ - - id: str = rest_field() - """An identifier for the event. The combination of id and source must be unique for each distinct event. Required. """ - source: str = rest_field() - """Identifies the context in which an event happened. The combination of id and source must be unique for each distinct event. Required. """ - data: Optional["_models.object"] = rest_field() - """Event data specific to the event type. """ - data_base64: Optional[bytes] = rest_field() - """Event data specific to the event type, encoded as a base64 string. """ - type: str = rest_field() - """Type of event related to the originating occurrence. Required. """ - time: Optional[datetime.datetime] = rest_field() - """The time (in UTC) the event was generated, in RFC3339 format. """ - specversion: str = rest_field() - """The version of the CloudEvents specification which the event uses. Required. """ - dataschema: Optional[str] = rest_field() - """Identifies the schema that data adheres to. """ - datacontenttype: Optional[str] = rest_field() - """Content type of data value. """ - subject: Optional[str] = rest_field() - """This describes the subject of the event in the context of the event producer (identified by source). """ - - @overload - def __init__( - self, - *, - id: str, # pylint: disable=redefined-builtin - source: str, - type: str, - specversion: str, - data: Optional["_models.object"] = None, - data_base64: Optional[bytes] = None, - time: Optional[datetime.datetime] = None, - dataschema: Optional[str] = None, - datacontenttype: Optional[str] = None, - subject: Optional[str] = None, - ): - ... - - @overload - def __init__(self, mapping: Mapping[str, Any]): - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation - super().__init__(*args, **kwargs) + """ """ class EventGridEvent(_model_base.Model): - """Properties of an event published to an Event Grid topic using the EventGrid Schema. - - Readonly variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: An unique identifier for the event. Required. - :vartype id: str - :ivar topic: The resource path of the event source. - :vartype topic: str - :ivar subject: A resource path relative to the topic path. Required. - :vartype subject: str - :ivar data: Event data specific to the event type. Required. - :vartype data: ~eventgrid.models.object - :ivar event_type: The type of the event that occurred. Required. - :vartype event_type: str - :ivar event_time: The time (in UTC) the event was generated. Required. - :vartype event_time: ~datetime.datetime - :ivar metadata_version: The schema version of the event metadata. - :vartype metadata_version: str - :ivar data_version: The schema version of the data object. Required. - :vartype data_version: str - """ - - id: str = rest_field() - """An unique identifier for the event. Required. """ - topic: Optional[str] = rest_field() - """The resource path of the event source. """ - subject: str = rest_field() - """A resource path relative to the topic path. Required. """ - data: "_models.object" = rest_field() - """Event data specific to the event type. Required. """ - event_type: str = rest_field(name="eventType") - """The type of the event that occurred. Required. """ - event_time: datetime.datetime = rest_field(name="eventTime") - """The time (in UTC) the event was generated. Required. """ - metadata_version: Optional[str] = rest_field(name="metadataVersion", readonly=True) - """The schema version of the event metadata. """ - data_version: str = rest_field(name="dataVersion") - """The schema version of the data object. Required. """ - - @overload - def __init__( - self, - *, - id: str, # pylint: disable=redefined-builtin - subject: str, - data: "_models.object", - event_type: str, - event_time: datetime.datetime, - data_version: str, - topic: Optional[str] = None, - ): - ... - - @overload - def __init__(self, mapping: Mapping[str, Any]): - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation - super().__init__(*args, **kwargs) - - -class GeneralEvent(_model_base.Model): - """GeneralEvent.""" - - -class object(_model_base.Model): - """object.""" + """Properties of an event published to an Event Grid topic using the EventGrid Schema.""" From 4693df60391669f096a889d0e04da6bfb3d68621 Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Fri, 17 Feb 2023 12:20:45 -0800 Subject: [PATCH 61/65] generalevent publish function --- .../eventgrid/data-plane/cadl/EventGrid.cadl | 86 +++--- .../eventgrid/_operations/_operations.py | 248 +++++++++++++++++- .../eventgrid/aio/_operations/_operations.py | 216 ++++++++++++++- .../cadl-python/eventgrid/models/__init__.py | 4 + .../cadl-python/eventgrid/models/_models.py | 158 ++++++++++- 5 files changed, 652 insertions(+), 60 deletions(-) diff --git a/specification/eventgrid/data-plane/cadl/EventGrid.cadl b/specification/eventgrid/data-plane/cadl/EventGrid.cadl index 1bac6a2236b2..3cde81bc1c7d 100644 --- a/specification/eventgrid/data-plane/cadl/EventGrid.cadl +++ b/specification/eventgrid/data-plane/cadl/EventGrid.cadl @@ -129,57 +129,75 @@ namespace EventGrid { } - // alias EventType = EventGridEvent | CloudEventEvent; + alias EventType = EventGridEvent | CloudEventEvent; - // model GeneralEvent {} + model GeneralEvent {} // General Event Function -- manually write overload - // @post - // op PublishEvent( - // ...ApiVersionParameter, - // @body - // events: EventType, - // ):OkResponse; + @post + op PublishEvent( + ...ApiVersionParameter, + @body + events: GeneralEvent, + ):OkResponse; -// Overloaded Function -- when that becomes available + @overload(PublishEvent) + @post + op PublishCloudEvent( + @header("content-type") contentType: "application/cloudevents-batch+json; charset=utf-8", + @body + events: CloudEventEvent, + ...ApiVersionParameter, + ):OkResponse; - alias CloudEventRequest = { - @header("content-type") contentType: "application/cloudevents-batch+json; charset=utf-8", - ...CloudEventEvent - }; + @overload(PublishEvent) + @post + op PublishEventGridEvent( + @body + events: EventGridEvent, + ...ApiVersionParameter, + ):OkResponse; - alias InputType = CloudEventRequest | EventGridEvent; - @post - @route("foo") - op PublishEvent( - @body - events: InputType, - ...ApiVersionParameter, +// Overloaded Function -- when that becomes available - ):OkResponse; + // alias CloudEventRequest = { + // @header("content-type") contentType: "application/cloudevents-batch+json; charset=utf-8", + // ...CloudEventEvent + // }; + // alias InputType = CloudEventRequest | EventGridEvent; - // @overload(PublishEvent) // @post - // op PublishCloudEvent( - // @header("content-type") contentType: "application/cloudevents-batch+json; charset=utf-8", + // @route("foo") + // op PublishEvent( // @body - // events: CloudEventEvent, - // ...ApiVersionParameter, - // ):OkResponse; + // events: InputType, + // ...ApiVersionParameter, - // @overload(PublishEvent) - // @post - // op PublishEventGridEvent( - // @header("content-type") contentType: "application/json", - // @body - // events: EventGridEvent, - // ...ApiVersionParameter, // ):OkResponse; + +// @overload(PublishEvent) +// @post +// op PublishCloudEvent( +// @header("content-type") contentType: "application/cloudevents-batch+json; charset=utf-8", +// @body +// events: CloudEventEvent, +// ...ApiVersionParameter, +// ):OkResponse; + +// @overload(PublishEvent) +// @post +// op PublishEventGridEvent( +// @header("content-type") contentType: "application/json", +// @body +// events: EventGridEvent, +// ...ApiVersionParameter, +// ):OkResponse; + } diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_operations/_operations.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_operations/_operations.py index dbe4a88dbd66..2cd2e326e91f 100644 --- a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_operations/_operations.py +++ b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_operations/_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- import json import sys -from typing import Any, Callable, Dict, Optional, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,10 +29,15 @@ from .._serialization import Serializer from .._vendor import EventGridClientMixinABC +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports if sys.version_info >= (3, 8): from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports else: from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports +JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +52,44 @@ def build_event_grid_publish_event_request(**kwargs: Any) -> HttpRequest: content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) api_version: Literal["2018-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) # Construct URL - _url = "/foo" + _url = "/" + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_event_grid_publish_cloud_event_request(*, content: _models.CloudEventEvent, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: str = kwargs.pop("content_type") + api_version: Literal["2018-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) + # Construct URL + _url = "/" + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["content-type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, content=content, **kwargs) + + +def build_event_grid_publish_event_grid_event_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: Literal["2018-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) + # Construct URL + _url = "/" # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -62,12 +104,12 @@ def build_event_grid_publish_event_request(**kwargs: Any) -> HttpRequest: class EventGridClientOperationsMixin(EventGridClientMixinABC): @overload def publish_event( # pylint: disable=inconsistent-return-statements - self, events: _models.CloudEventEvent, *, content_type: str = "application/json", **kwargs: Any + self, events: _models.GeneralEvent, *, content_type: str = "application/json", **kwargs: Any ) -> None: """publish_event. :param events: Required. - :type events: ~eventgrid.models.CloudEventEvent + :type events: ~eventgrid.models.GeneralEvent :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -78,12 +120,12 @@ def publish_event( # pylint: disable=inconsistent-return-statements @overload def publish_event( # pylint: disable=inconsistent-return-statements - self, events: _models.EventGridEvent, *, content_type: str = "application/json", **kwargs: Any + self, events: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> None: """publish_event. :param events: Required. - :type events: ~eventgrid.models.EventGridEvent + :type events: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -92,14 +134,30 @@ def publish_event( # pylint: disable=inconsistent-return-statements :raises ~azure.core.exceptions.HttpResponseError: """ + @overload + def publish_event( # pylint: disable=inconsistent-return-statements + self, events: IO, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """publish_event. + + :param events: Required. + :type events: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + @distributed_trace def publish_event( # pylint: disable=inconsistent-return-statements - self, events: Union[_models.CloudEventEvent, _models.EventGridEvent], **kwargs: Any + self, events: Union[_models.GeneralEvent, JSON, IO], **kwargs: Any ) -> None: """publish_event. - :param events: Is either a CloudEventEvent type or a EventGridEvent type. Required. - :type events: ~eventgrid.models.CloudEventEvent or ~eventgrid.models.EventGridEvent + :param events: Is one of the following types: GeneralEvent, JSON, IO Required. + :type events: ~eventgrid.models.GeneralEvent or JSON or IO :keyword content_type: Body parameter Content-Type. Known values are: application/json. Default value is None. :paramtype content_type: str @@ -123,9 +181,9 @@ def publish_event( # pylint: disable=inconsistent-return-statements content_type = content_type or "application/json" _content = None - if isinstance(events, _model_base.Model): - _content = json.dumps(events, cls=AzureJSONEncoder) # type: ignore - elif isinstance(events, _model_base.Model): + if isinstance(events, (IO, bytes)): + _content = events + else: _content = json.dumps(events, cls=AzureJSONEncoder) # type: ignore request = build_event_grid_publish_event_request( @@ -152,3 +210,169 @@ def publish_event( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) + + @distributed_trace + def publish_cloud_event( # pylint: disable=inconsistent-return-statements + self, events: _models.CloudEventEvent, **kwargs: Any + ) -> None: + """publish_cloud_event. + + :param events: Required. + :type events: ~eventgrid.models.CloudEventEvent + :keyword content_type: Default value is "application/cloudevents-batch+json; charset=utf-8". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: str = kwargs.pop( + "content_type", _headers.pop("content-type", "application/cloudevents-batch+json; charset=utf-8") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _content = json.dumps(events, cls=AzureJSONEncoder) # type: ignore + + request = build_event_grid_publish_cloud_event_request( + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) + + @overload + def publish_event_grid_event( # pylint: disable=inconsistent-return-statements + self, events: _models.EventGridEvent, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """publish_event_grid_event. + + :param events: Required. + :type events: ~eventgrid.models.EventGridEvent + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def publish_event_grid_event( # pylint: disable=inconsistent-return-statements + self, events: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """publish_event_grid_event. + + :param events: Required. + :type events: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def publish_event_grid_event( # pylint: disable=inconsistent-return-statements + self, events: IO, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """publish_event_grid_event. + + :param events: Required. + :type events: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def publish_event_grid_event( # pylint: disable=inconsistent-return-statements + self, events: Union[_models.EventGridEvent, JSON, IO], **kwargs: Any + ) -> None: + """publish_event_grid_event. + + :param events: Is one of the following types: EventGridEvent, JSON, IO Required. + :type events: ~eventgrid.models.EventGridEvent or JSON or IO + :keyword content_type: Body parameter Content-Type. Known values are: application/json. Default + value is None. + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(events, (IO, bytes)): + _content = events + else: + _content = json.dumps(events, cls=AzureJSONEncoder) # type: ignore + + request = build_event_grid_publish_event_grid_event_request( + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_operations/_operations.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_operations/_operations.py index 825f33c928fb..f57bac1348f7 100644 --- a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_operations/_operations.py +++ b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_operations/_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import json -from typing import Any, Callable, Dict, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -25,9 +26,18 @@ from ... import models as _models from ..._model_base import AzureJSONEncoder -from ..._operations._operations import build_event_grid_publish_event_request +from ..._operations._operations import ( + build_event_grid_publish_cloud_event_request, + build_event_grid_publish_event_grid_event_request, + build_event_grid_publish_event_request, +) from .._vendor import EventGridClientMixinABC +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,12 +45,12 @@ class EventGridClientOperationsMixin(EventGridClientMixinABC): @overload async def publish_event( # pylint: disable=inconsistent-return-statements - self, events: _models.CloudEventEvent, *, content_type: str = "application/json", **kwargs: Any + self, events: _models.GeneralEvent, *, content_type: str = "application/json", **kwargs: Any ) -> None: """publish_event. :param events: Required. - :type events: ~eventgrid.models.CloudEventEvent + :type events: ~eventgrid.models.GeneralEvent :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -51,12 +61,12 @@ async def publish_event( # pylint: disable=inconsistent-return-statements @overload async def publish_event( # pylint: disable=inconsistent-return-statements - self, events: _models.EventGridEvent, *, content_type: str = "application/json", **kwargs: Any + self, events: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> None: """publish_event. :param events: Required. - :type events: ~eventgrid.models.EventGridEvent + :type events: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -65,14 +75,30 @@ async def publish_event( # pylint: disable=inconsistent-return-statements :raises ~azure.core.exceptions.HttpResponseError: """ + @overload + async def publish_event( # pylint: disable=inconsistent-return-statements + self, events: IO, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """publish_event. + + :param events: Required. + :type events: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + @distributed_trace_async async def publish_event( # pylint: disable=inconsistent-return-statements - self, events: Union[_models.CloudEventEvent, _models.EventGridEvent], **kwargs: Any + self, events: Union[_models.GeneralEvent, JSON, IO], **kwargs: Any ) -> None: """publish_event. - :param events: Is either a CloudEventEvent type or a EventGridEvent type. Required. - :type events: ~eventgrid.models.CloudEventEvent or ~eventgrid.models.EventGridEvent + :param events: Is one of the following types: GeneralEvent, JSON, IO Required. + :type events: ~eventgrid.models.GeneralEvent or JSON or IO :keyword content_type: Body parameter Content-Type. Known values are: application/json. Default value is None. :paramtype content_type: str @@ -96,9 +122,9 @@ async def publish_event( # pylint: disable=inconsistent-return-statements content_type = content_type or "application/json" _content = None - if isinstance(events, _model_base.Model): - _content = json.dumps(events, cls=AzureJSONEncoder) # type: ignore - elif isinstance(events, _model_base.Model): + if isinstance(events, (IO, bytes)): + _content = events + else: _content = json.dumps(events, cls=AzureJSONEncoder) # type: ignore request = build_event_grid_publish_event_request( @@ -125,3 +151,169 @@ async def publish_event( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) + + @distributed_trace_async + async def publish_cloud_event( # pylint: disable=inconsistent-return-statements + self, events: _models.CloudEventEvent, **kwargs: Any + ) -> None: + """publish_cloud_event. + + :param events: Required. + :type events: ~eventgrid.models.CloudEventEvent + :keyword content_type: Default value is "application/cloudevents-batch+json; charset=utf-8". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: str = kwargs.pop( + "content_type", _headers.pop("content-type", "application/cloudevents-batch+json; charset=utf-8") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _content = json.dumps(events, cls=AzureJSONEncoder) # type: ignore + + request = build_event_grid_publish_cloud_event_request( + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) + + @overload + async def publish_event_grid_event( # pylint: disable=inconsistent-return-statements + self, events: _models.EventGridEvent, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """publish_event_grid_event. + + :param events: Required. + :type events: ~eventgrid.models.EventGridEvent + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def publish_event_grid_event( # pylint: disable=inconsistent-return-statements + self, events: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """publish_event_grid_event. + + :param events: Required. + :type events: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def publish_event_grid_event( # pylint: disable=inconsistent-return-statements + self, events: IO, *, content_type: str = "application/json", **kwargs: Any + ) -> None: + """publish_event_grid_event. + + :param events: Required. + :type events: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def publish_event_grid_event( # pylint: disable=inconsistent-return-statements + self, events: Union[_models.EventGridEvent, JSON, IO], **kwargs: Any + ) -> None: + """publish_event_grid_event. + + :param events: Is one of the following types: EventGridEvent, JSON, IO Required. + :type events: ~eventgrid.models.EventGridEvent or JSON or IO + :keyword content_type: Body parameter Content-Type. Known values are: application/json. Default + value is None. + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(events, (IO, bytes)): + _content = events + else: + _content = json.dumps(events, cls=AzureJSONEncoder) # type: ignore + + request = build_event_grid_publish_event_grid_event_request( + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/__init__.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/__init__.py index ed4fcbe8d944..b298e570284e 100644 --- a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/__init__.py +++ b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/__init__.py @@ -8,6 +8,8 @@ from ._models import CloudEventEvent from ._models import EventGridEvent +from ._models import GeneralEvent +from ._models import object from ._patch import __all__ as _patch_all from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk @@ -15,6 +17,8 @@ __all__ = [ "CloudEventEvent", "EventGridEvent", + "GeneralEvent", + "object", ] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/_models.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/_models.py index aea58a8289b2..2461c7b4afc8 100644 --- a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/_models.py +++ b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/_models.py @@ -7,12 +7,166 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import datetime +from typing import Any, Mapping, Optional, TYPE_CHECKING, overload + from .. import _model_base +from .._model_base import rest_field + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models class CloudEventEvent(_model_base.Model): - """ """ + """Properties of an event published to an Event Grid topic using the CloudEvent 1.0 Schema. + + All required parameters must be populated in order to send to Azure. + + :ivar id: An identifier for the event. The combination of id and source must be unique for each + distinct event. Required. + :vartype id: str + :ivar source: Identifies the context in which an event happened. The combination of id and + source must be unique for each distinct event. Required. + :vartype source: str + :ivar data: Event data specific to the event type. + :vartype data: ~eventgrid.models.object + :ivar data_base64: Event data specific to the event type, encoded as a base64 string. + :vartype data_base64: bytes + :ivar type: Type of event related to the originating occurrence. Required. + :vartype type: str + :ivar time: The time (in UTC) the event was generated, in RFC3339 format. + :vartype time: ~datetime.datetime + :ivar specversion: The version of the CloudEvents specification which the event uses. Required. + :vartype specversion: str + :ivar dataschema: Identifies the schema that data adheres to. + :vartype dataschema: str + :ivar datacontenttype: Content type of data value. + :vartype datacontenttype: str + :ivar subject: This describes the subject of the event in the context of the event producer + (identified by source). + :vartype subject: str + """ + + id: str = rest_field() + """An identifier for the event. The combination of id and source must be unique for each distinct event. Required. """ + source: str = rest_field() + """Identifies the context in which an event happened. The combination of id and source must be unique for each distinct event. Required. """ + data: Optional["_models.object"] = rest_field() + """Event data specific to the event type. """ + data_base64: Optional[bytes] = rest_field() + """Event data specific to the event type, encoded as a base64 string. """ + type: str = rest_field() + """Type of event related to the originating occurrence. Required. """ + time: Optional[datetime.datetime] = rest_field() + """The time (in UTC) the event was generated, in RFC3339 format. """ + specversion: str = rest_field() + """The version of the CloudEvents specification which the event uses. Required. """ + dataschema: Optional[str] = rest_field() + """Identifies the schema that data adheres to. """ + datacontenttype: Optional[str] = rest_field() + """Content type of data value. """ + subject: Optional[str] = rest_field() + """This describes the subject of the event in the context of the event producer (identified by source). """ + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + source: str, + type: str, + specversion: str, + data: Optional["_models.object"] = None, + data_base64: Optional[bytes] = None, + time: Optional[datetime.datetime] = None, + dataschema: Optional[str] = None, + datacontenttype: Optional[str] = None, + subject: Optional[str] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) class EventGridEvent(_model_base.Model): - """Properties of an event published to an Event Grid topic using the EventGrid Schema.""" + """Properties of an event published to an Event Grid topic using the EventGrid Schema. + + Readonly variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: An unique identifier for the event. Required. + :vartype id: str + :ivar topic: The resource path of the event source. + :vartype topic: str + :ivar subject: A resource path relative to the topic path. Required. + :vartype subject: str + :ivar data: Event data specific to the event type. Required. + :vartype data: ~eventgrid.models.object + :ivar event_type: The type of the event that occurred. Required. + :vartype event_type: str + :ivar event_time: The time (in UTC) the event was generated. Required. + :vartype event_time: ~datetime.datetime + :ivar metadata_version: The schema version of the event metadata. + :vartype metadata_version: str + :ivar data_version: The schema version of the data object. Required. + :vartype data_version: str + """ + + id: str = rest_field() + """An unique identifier for the event. Required. """ + topic: Optional[str] = rest_field() + """The resource path of the event source. """ + subject: str = rest_field() + """A resource path relative to the topic path. Required. """ + data: "_models.object" = rest_field() + """Event data specific to the event type. Required. """ + event_type: str = rest_field(name="eventType") + """The type of the event that occurred. Required. """ + event_time: datetime.datetime = rest_field(name="eventTime") + """The time (in UTC) the event was generated. Required. """ + metadata_version: Optional[str] = rest_field(name="metadataVersion", readonly=True) + """The schema version of the event metadata. """ + data_version: str = rest_field(name="dataVersion") + """The schema version of the data object. Required. """ + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + subject: str, + data: "_models.object", + event_type: str, + event_time: datetime.datetime, + data_version: str, + topic: Optional[str] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class GeneralEvent(_model_base.Model): + """GeneralEvent.""" + + +class object(_model_base.Model): + """object.""" From 7cc26c383a78a900d23dcb5b9c77bf5158c8c54e Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Tue, 14 Mar 2023 15:32:29 -0700 Subject: [PATCH 62/65] shared route --- .../{ApiManagement.cadl => ApiManagement.tsp} | 54 +- .../cadl/ApiManagementTypedReference.cadl | 134 -- .../cadl/ApiManagementTypedReference.tsp | 247 ++ ...onfiguration.cadl => AppConfiguration.tsp} | 16 +- ...es.cadl => AzureCommunicationServices.tsp} | 2 +- ...adl => AzureCommunicationServicesCore.tsp} | 0 ...nerRegistry.cadl => ContainerRegistry.tsp} | 6 +- ...ainerService.cadl => ContainerService.tsp} | 0 .../eventgrid/data-plane/cadl/DataBox.cadl | 41 - .../eventgrid/data-plane/cadl/DataBox.tsp | 38 + .../cadl/{EventGrid.cadl => EventGrid.tsp} | 169 +- .../cadl/{EventHub.cadl => EventHub.tsp} | 0 ...HealthcareApis.cadl => HealthcareApis.tsp} | 9 +- .../cadl/{IotHub.cadl => IotHub.tsp} | 12 +- .../cadl/{KeyVault.cadl => KeyVault.tsp} | 21 +- ...vices.cadl => MachineLearningServices.tsp} | 0 .../data-plane/cadl/{Maps.cadl => Maps.tsp} | 0 .../{MediaServices.cadl => MediaServices.tsp} | 2 +- ...PolicyInsights.cadl => PolicyInsights.tsp} | 7 +- .../cadl/{RedisCache.cadl => RedisCache.tsp} | 14 +- .../cadl/{Resources.cadl => Resources.tsp} | 18 +- .../cadl/{ServiceBus.cadl => ServiceBus.tsp} | 8 +- ...SignalRService.cadl => SignalRService.tsp} | 2 +- .../cadl/{Storage.cadl => Storage.tsp} | 2 +- .../eventgrid/data-plane/cadl/Testing.tsp | 45 + .../data-plane/cadl/{Web.cadl => Web.tsp} | 28 +- .../cadl-python/eventgrid/__init__.py | 26 - .../cadl-python/eventgrid/_client.py | 83 - .../cadl-python/eventgrid/_configuration.py | 80 - .../cadl-python/eventgrid/_model_base.py | 714 ------ .../eventgrid/_operations/__init__.py | 19 - .../eventgrid/_operations/_operations.py | 378 ---- .../eventgrid/_operations/_patch.py | 20 - .../cadl-python/eventgrid/_patch.py | 20 - .../cadl-python/eventgrid/_serialization.py | 1996 ----------------- .../cadl-python/eventgrid/_vendor.py | 26 - .../cadl-python/eventgrid/_version.py | 9 - .../cadl-python/eventgrid/aio/__init__.py | 23 - .../cadl-python/eventgrid/aio/_client.py | 85 - .../eventgrid/aio/_configuration.py | 82 - .../eventgrid/aio/_operations/__init__.py | 19 - .../eventgrid/aio/_operations/_operations.py | 319 --- .../eventgrid/aio/_operations/_patch.py | 20 - .../cadl-python/eventgrid/aio/_patch.py | 20 - .../cadl-python/eventgrid/aio/_vendor.py | 26 - .../cadl-python/eventgrid/models/__init__.py | 24 - .../cadl-python/eventgrid/models/_models.py | 172 -- .../cadl-python/eventgrid/models/_patch.py | 20 - .../cadl-python/eventgrid/py.typed | 1 - .../@azure-tools/cadl-python/setup.py | 31 - .../data-plane/cadl/{main.cadl => main.tsp} | 47 +- .../data-plane/cadl/package-lock.json | 1283 +++++++++++ .../eventgrid/data-plane/cadl/package.json | 14 + 53 files changed, 1849 insertions(+), 4583 deletions(-) rename specification/eventgrid/data-plane/cadl/{ApiManagement.cadl => ApiManagement.tsp} (86%) delete mode 100644 specification/eventgrid/data-plane/cadl/ApiManagementTypedReference.cadl create mode 100644 specification/eventgrid/data-plane/cadl/ApiManagementTypedReference.tsp rename specification/eventgrid/data-plane/cadl/{AppConfiguration.cadl => AppConfiguration.tsp} (78%) rename specification/eventgrid/data-plane/cadl/{AzureCommunicationServices.cadl => AzureCommunicationServices.tsp} (99%) rename specification/eventgrid/data-plane/cadl/{AzureCommunicationServicesCore.cadl => AzureCommunicationServicesCore.tsp} (100%) rename specification/eventgrid/data-plane/cadl/{ContainerRegistry.cadl => ContainerRegistry.tsp} (98%) rename specification/eventgrid/data-plane/cadl/{ContainerService.cadl => ContainerService.tsp} (100%) delete mode 100644 specification/eventgrid/data-plane/cadl/DataBox.cadl create mode 100644 specification/eventgrid/data-plane/cadl/DataBox.tsp rename specification/eventgrid/data-plane/cadl/{EventGrid.cadl => EventGrid.tsp} (65%) rename specification/eventgrid/data-plane/cadl/{EventHub.cadl => EventHub.tsp} (100%) rename specification/eventgrid/data-plane/cadl/{HealthcareApis.cadl => HealthcareApis.tsp} (99%) rename specification/eventgrid/data-plane/cadl/{IotHub.cadl => IotHub.tsp} (97%) rename specification/eventgrid/data-plane/cadl/{KeyVault.cadl => KeyVault.tsp} (83%) rename specification/eventgrid/data-plane/cadl/{MachineLearningServices.cadl => MachineLearningServices.tsp} (100%) rename specification/eventgrid/data-plane/cadl/{Maps.cadl => Maps.tsp} (100%) rename specification/eventgrid/data-plane/cadl/{MediaServices.cadl => MediaServices.tsp} (99%) rename specification/eventgrid/data-plane/cadl/{PolicyInsights.cadl => PolicyInsights.tsp} (90%) rename specification/eventgrid/data-plane/cadl/{RedisCache.cadl => RedisCache.tsp} (82%) rename specification/eventgrid/data-plane/cadl/{Resources.cadl => Resources.tsp} (91%) rename specification/eventgrid/data-plane/cadl/{ServiceBus.cadl => ServiceBus.tsp} (98%) rename specification/eventgrid/data-plane/cadl/{SignalRService.cadl => SignalRService.tsp} (94%) rename specification/eventgrid/data-plane/cadl/{Storage.cadl => Storage.tsp} (98%) create mode 100644 specification/eventgrid/data-plane/cadl/Testing.tsp rename specification/eventgrid/data-plane/cadl/{Web.cadl => Web.tsp} (90%) delete mode 100644 specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/__init__.py delete mode 100644 specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_client.py delete mode 100644 specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_configuration.py delete mode 100644 specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_model_base.py delete mode 100644 specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_operations/__init__.py delete mode 100644 specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_operations/_operations.py delete mode 100644 specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_operations/_patch.py delete mode 100644 specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_patch.py delete mode 100644 specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_serialization.py delete mode 100644 specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_vendor.py delete mode 100644 specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_version.py delete mode 100644 specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/__init__.py delete mode 100644 specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_client.py delete mode 100644 specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_configuration.py delete mode 100644 specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_operations/__init__.py delete mode 100644 specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_operations/_operations.py delete mode 100644 specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_operations/_patch.py delete mode 100644 specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_patch.py delete mode 100644 specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_vendor.py delete mode 100644 specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/__init__.py delete mode 100644 specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/_models.py delete mode 100644 specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/_patch.py delete mode 100644 specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/py.typed delete mode 100644 specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/setup.py rename specification/eventgrid/data-plane/cadl/{main.cadl => main.tsp} (60%) create mode 100644 specification/eventgrid/data-plane/cadl/package-lock.json create mode 100644 specification/eventgrid/data-plane/cadl/package.json diff --git a/specification/eventgrid/data-plane/cadl/ApiManagement.cadl b/specification/eventgrid/data-plane/cadl/ApiManagement.tsp similarity index 86% rename from specification/eventgrid/data-plane/cadl/ApiManagement.cadl rename to specification/eventgrid/data-plane/cadl/ApiManagement.tsp index 463cea827e82..e74ab625533f 100644 --- a/specification/eventgrid/data-plane/cadl/ApiManagement.cadl +++ b/specification/eventgrid/data-plane/cadl/ApiManagement.tsp @@ -1,132 +1,132 @@ @doc("Describes the schema of the Azure API Management events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") namespace EventGrid.ApiManagement { @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.UserCreated event.") - model ApiManagementUserCreatedEventData{ + model ApiManagementUserCreatedEventData { ...ApiManagementBase; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.UserUpdated event.") - model ApiManagementUserUpdatedEventData{ + model ApiManagementUserUpdatedEventData { ...ApiManagementBase; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.UserDeleted event.") - model ApiManagementUserDeletedEventData{ + model ApiManagementUserDeletedEventData { ...ApiManagementBase; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.SubscriptionCreated event.") - model ApiManagementSubscriptionCreatedEventData{ + model ApiManagementSubscriptionCreatedEventData { ...ApiManagementBase; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.SubscriptionUpdated event.") - model ApiManagementSubscriptionUpdatedEventData{ + model ApiManagementSubscriptionUpdatedEventData { ...ApiManagementBase; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.SubscriptionDeleted event.") - model ApiManagementSubscriptionDeletedEventData{ + model ApiManagementSubscriptionDeletedEventData { ...ApiManagementBase; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.ProductCreated event.") - model ApiManagementProductCreatedEventData{ + model ApiManagementProductCreatedEventData { ...ApiManagementBase; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.ProductUpdated event.") - model ApiManagementProductUpdatedEventData{ + model ApiManagementProductUpdatedEventData { ...ApiManagementBase; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.ProductDeleted event.") - model ApiManagementProductDeletedEventData{ + model ApiManagementProductDeletedEventData { ...ApiManagementBase; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APICreated event.") - model ApiManagementApiCreatedEventData{ + model ApiManagementApiCreatedEventData { ...ApiManagementBase; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIUpdated event.") - model ApiManagementApiUpdatedEventData{ + model ApiManagementApiUpdatedEventData { ...ApiManagementBase; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIDeleted event.") - model ApiManagementApiDeletedEventData{ + model ApiManagementApiDeletedEventData { ...ApiManagementBase; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIReleaseCreated event.") - model ApiManagementApiReleaseCreatedEventData{ + model ApiManagementApiReleaseCreatedEventData { ...ApiManagementBase; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIReleaseUpdated event.") - model ApiManagementApiReleaseUpdatedEventData{ + model ApiManagementApiReleaseUpdatedEventData { ...ApiManagementBase; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIReleaseDeleted event.") - model ApiManagementApiReleaseDeletedEventData{ + model ApiManagementApiReleaseDeletedEventData { ...ApiManagementBase; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayCreated event.") - model ApiManagementGatewayCreatedEventData{ + model ApiManagementGatewayCreatedEventData { ...ApiGatewayBase; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayUpdated event.") - model ApiManagementGatewayUpdatedEventData{ + model ApiManagementGatewayUpdatedEventData { ...ApiGatewayBase; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayDeleted event.") - model ApiManagementGatewayDeletedEventData{ + model ApiManagementGatewayDeletedEventData { ...ApiGatewayBase; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayHostnameConfigurationCreated event.") - model ApiManagementGatewayHostnameConfigurationCreatedEventData{ + model ApiManagementGatewayHostnameConfigurationCreatedEventData { ...ApiGatewayHostnameBase; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayHostnameConfigurationUpdated event.") - model ApiManagementGatewayHostnameConfigurationUpdatedEventData{ + model ApiManagementGatewayHostnameConfigurationUpdatedEventData { ...ApiGatewayHostnameBase; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayHostnameConfigurationDeleted event.") - model ApiManagementGatewayHostnameConfigurationDeletedEventData{ + model ApiManagementGatewayHostnameConfigurationDeletedEventData { ...ApiGatewayHostnameBase; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayCertificateAuthorityCreated event.") - model ApiManagementGatewayCertificateAuthorityCreatedEventData{ + model ApiManagementGatewayCertificateAuthorityCreatedEventData { ...ApiGatewayCertificateBase; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayCertificateAuthorityUpdated event.") - model ApiManagementGatewayCertificateAuthorityUpdatedEventData{ + model ApiManagementGatewayCertificateAuthorityUpdatedEventData { ...ApiGatewayCertificateBase; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayCertificateAuthorityDeleted event.") - model ApiManagementGatewayCertificateAuthorityDeletedEventData{ + model ApiManagementGatewayCertificateAuthorityDeletedEventData { ...ApiGatewayCertificateBase; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayAPIAdded event.") - model ApiManagementGatewayApiAddedEventData{ + model ApiManagementGatewayApiAddedEventData { ...ApiGatewayApiBase; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.GatewayAPIRemoved event.") - model ApiManagementGatewayApiRemovedEventData{ + model ApiManagementGatewayApiRemovedEventData { ...ApiGatewayApiBase; } @@ -137,7 +137,7 @@ namespace EventGrid.ApiManagement { alias ApiGatewayBase = { @doc("The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions//resourceGroups//Microsoft.ApiManagement/service//gateways/`") - resourceUri?: string; + resourceUri?: string; }; alias ApiGatewayHostnameBase = { diff --git a/specification/eventgrid/data-plane/cadl/ApiManagementTypedReference.cadl b/specification/eventgrid/data-plane/cadl/ApiManagementTypedReference.cadl deleted file mode 100644 index c24eb8fe0110..000000000000 --- a/specification/eventgrid/data-plane/cadl/ApiManagementTypedReference.cadl +++ /dev/null @@ -1,134 +0,0 @@ -@doc("Describes the schema of the Azure API Management events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") -namespace EventGrid.ApiManagement { - - @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.UserCreated event.") - model ApiManagementUserCreatedEventData{ - ...BaseEventData; - }; - - model ApiManagementUserCreatedEvent is EventGrid.TypedEventGridEvent<"Microsoft.ApiManagement.UserCreated", ApiManagementUserCreatedEventData>; - model ApiManagementUserCreatedEventCloud is EventGrid.TypedCloudEvent<"Microsoft.ApiManagement.UserCreated", ApiManagementUserCreatedEventData>; - - @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.UserUpdated event.") - model ApiManagementUserUpdatedEventData{ - ...BaseEventData; - }; - - model ApiManagementUserUpdatedEvent is EventGrid.TypedEventGridEvent<"Microsoft.ApiManagement.UserUpdated", ApiManagementUserUpdatedEventData>; - model ApiManagementUserUpdatedEventCloud is EventGrid.TypedCloudEvent<"Microsoft.ApiManagement.UserUpdated", ApiManagementUserUpdatedEventData>; - - - @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.UserDeleted event.") - model ApiManagementUserDeletedEventData{ - ...BaseEventData; - }; - - model ApiManagementUserDeletedEvent is EventGrid.TypedEventGridEvent<"Microsoft.ApiManagement.UserDeleted", ApiManagementUserDeletedEventData>; - model ApiManagementUserDeletedEventCloud is EventGrid.TypedCloudEvent<"Microsoft.ApiManagement.UserDeleted", ApiManagementUserDeletedEventData>; - - - @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.SubscriptionCreated event.") - model ApiManagementSubscriptionCreatedEventData{ - ...BaseEventData; - }; - - model ApiManagementSubscriptionCreatedEvent is EventGrid.TypedEventGridEvent<"Microsoft.ApiManagement.SubscriptionCreated", ApiManagementSubscriptionCreatedEventData>; - model ApiManagementSubscriptionCreatedEventCloud is EventGrid.TypedCloudEvent<"Microsoft.ApiManagement.SubscriptionCreated", ApiManagementSubscriptionCreatedEventData>; - - - @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.SubscriptionUpdated event.") - model ApiManagementSubscriptionUpdatedEventData{ - ...BaseEventData; - }; - - model ApiManagementSubscriptionUpdatedEvent is EventGrid.TypedEventGridEvent<"Microsoft.ApiManagement.SubscriptionUpdated", ApiManagementSubscriptionUpdatedEventData>; - model ApiManagementSubscriptionUpdatedEventCloud is EventGrid.TypedCloudEvent<"Microsoft.ApiManagement.SubscriptionUpdated", ApiManagementSubscriptionUpdatedEventData>; - - @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.SubscriptionDeleted event.") - model ApiManagementSubscriptionDeletedEventData{ - ...BaseEventData; - }; - - model ApiManagementSubscriptionDeletedEvent is EventGrid.TypedEventGridEvent<"Microsoft.ApiManagement.SubscriptionDeleted", ApiManagementSubscriptionDeletedEventData>; - model ApiManagementSubscriptionDeletedEventCloud is EventGrid.TypedCloudEvent<"Microsoft.ApiManagement.SubscriptionDeleted", ApiManagementSubscriptionDeletedEventData>; - - @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.ProductCreated event.") - model ApiManagementProductCreatedEventData{ - ...BaseEventData; - }; - - model ApiManagementProductCreatedEvent is EventGrid.TypedEventGridEvent<"Microsoft.ApiManagement.ProductCreated", ApiManagementProductCreatedEventData>; - model ApiManagementProductCreatedEventCloud is EventGrid.TypedCloudEvent<"Microsoft.ApiManagement.ProductCreated", ApiManagementProductCreatedEventData>; - - @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.ProductUpdated event.") - model ApiManagementProductUpdatedEventData{ - ...BaseEventData; - }; - - model ApiManagementProductUpdatedEvent is EventGrid.TypedEventGridEvent<"Microsoft.ApiManagement.ProductUpdated", ApiManagementProductUpdatedEventData>; - model ApiManagementProductUpdatedEventCloud is EventGrid.TypedCloudEvent<"Microsoft.ApiManagement.ProductUpdated", ApiManagementProductUpdatedEventData>; - - @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.ProductDeleted event.") - model ApiManagementProductDeletedEventData{ - ...BaseEventData; - }; - - model ApiManagementProductDeletedEvent is EventGrid.TypedEventGridEvent<"Microsoft.ApiManagement.ProductDeleted", ApiManagementProductDeletedEventData>; - model ApiManagementProductDeletedEventCloud is EventGrid.TypedCloudEvent<"Microsoft.ApiManagement.ProductDeleted", ApiManagementProductDeletedEventData>; - - @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APICreated event.") - model ApiManagementApiCreatedEventData{ - ...BaseEventData; - }; - - model ApiManagementApiCreatedEvent is EventGrid.TypedEventGridEvent<"Microsoft.ApiManagement.ApiCreated", ApiManagementApiCreatedEventData>; - model ApiManagementApiCreatedEventCloud is EventGrid.TypedCloudEvent<"Microsoft.ApiManagement.ApiCreated", ApiManagementApiCreatedEventData>; - - @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIUpdated event.") - model ApiManagementApiUpdatedEventData{ - ...BaseEventData; - }; - - model ApiManagementApiUpdatedEvent is EventGrid.TypedEventGridEvent<"Microsoft.ApiManagement.ApiUpdated", ApiManagementApiUpdatedEventData>; - model ApiManagementApiUpdatedEventCloud is EventGrid.TypedCloudEvent<"Microsoft.ApiManagement.ApiUpdated", ApiManagementApiUpdatedEventData>; - - - @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIDeleted event.") - model ApiManagementApiDeletedEventData{ - ...BaseEventData; - }; - - model ApiManagementApiDeletedEvent is EventGrid.TypedEventGridEvent<"Microsoft.ApiManagement.ApiDeleted", ApiManagementApiDeletedEventData>; - model ApiManagementApiDeletedEventCloud is EventGrid.TypedCloudEvent<"Microsoft.ApiManagement.ApiDeleted", ApiManagementApiDeletedEventData>; - - @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIReleaseCreated event.") - model ApiManagementApiReleaseCreatedEventData{ - ...BaseEventData; - }; - - model ApiManagementApiReleaseCreatedEvent is EventGrid.TypedEventGridEvent<"Microsoft.ApiManagement.ApiReleaseCreated", ApiManagementApiReleaseCreatedEventData>; - model ApiManagementApiReleaseCreatedEventCloud is EventGrid.TypedCloudEvent<"Microsoft.ApiManagement.ApiReleaseCreated", ApiManagementApiReleaseCreatedEventData>; - - - @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIReleaseUpdated event.") - model ApiManagementApiReleaseUpdatedEventData{ - ...BaseEventData; - }; - - model ApiManagementApiReleaseUpdatedEvent is EventGrid.TypedEventGridEvent<"Microsoft.ApiManagement.ApiReleaseUpdated", ApiManagementApiReleaseUpdatedEventData>; - model ApiManagementApiReleaseUpdatedEventCloud is EventGrid.TypedCloudEvent<"Microsoft.ApiManagement.ApiReleaseUpdated", ApiManagementApiReleaseUpdatedEventData>; - - @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIReleaseDeleted event.") - model ApiManagementApiReleaseDeletedEventData{ - ...BaseEventData; - }; - - model ApiManagementApiReleaseDeletedEvent is EventGrid.TypedEventGridEvent<"Microsoft.ApiManagement.ApiReleaseDeleted", ApiManagementApiReleaseDeletedEventData>; - model ApiManagementApiReleaseDeletedEventCloud is EventGrid.TypedCloudEvent<"Microsoft.ApiManagement.ApiReleaseDeleted", ApiManagementApiReleaseDeletedEventData>; - - alias BaseEventData = { - @doc("The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions//resourceGroups//Microsoft.ApiManagement/service///`") - resourceUri?: string; - }; - -} diff --git a/specification/eventgrid/data-plane/cadl/ApiManagementTypedReference.tsp b/specification/eventgrid/data-plane/cadl/ApiManagementTypedReference.tsp new file mode 100644 index 000000000000..19b6f66ca825 --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/ApiManagementTypedReference.tsp @@ -0,0 +1,247 @@ +@doc("Describes the schema of the Azure API Management events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") +namespace EventGrid.ApiManagement { + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.UserCreated event.") + model ApiManagementUserCreatedEventData { + ...BaseEventData; + } + + model ApiManagementUserCreatedEvent + is EventGrid.TypedEventGridEvent< + "Microsoft.ApiManagement.UserCreated", + ApiManagementUserCreatedEventData + >; + model ApiManagementUserCreatedEventCloud + is EventGrid.TypedCloudEvent< + "Microsoft.ApiManagement.UserCreated", + ApiManagementUserCreatedEventData + >; + + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.UserUpdated event.") + model ApiManagementUserUpdatedEventData { + ...BaseEventData; + } + + model ApiManagementUserUpdatedEvent + is EventGrid.TypedEventGridEvent< + "Microsoft.ApiManagement.UserUpdated", + ApiManagementUserUpdatedEventData + >; + model ApiManagementUserUpdatedEventCloud + is EventGrid.TypedCloudEvent< + "Microsoft.ApiManagement.UserUpdated", + ApiManagementUserUpdatedEventData + >; + + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.UserDeleted event.") + model ApiManagementUserDeletedEventData { + ...BaseEventData; + } + + model ApiManagementUserDeletedEvent + is EventGrid.TypedEventGridEvent< + "Microsoft.ApiManagement.UserDeleted", + ApiManagementUserDeletedEventData + >; + model ApiManagementUserDeletedEventCloud + is EventGrid.TypedCloudEvent< + "Microsoft.ApiManagement.UserDeleted", + ApiManagementUserDeletedEventData + >; + + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.SubscriptionCreated event.") + model ApiManagementSubscriptionCreatedEventData { + ...BaseEventData; + } + + model ApiManagementSubscriptionCreatedEvent + is EventGrid.TypedEventGridEvent< + "Microsoft.ApiManagement.SubscriptionCreated", + ApiManagementSubscriptionCreatedEventData + >; + model ApiManagementSubscriptionCreatedEventCloud + is EventGrid.TypedCloudEvent< + "Microsoft.ApiManagement.SubscriptionCreated", + ApiManagementSubscriptionCreatedEventData + >; + + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.SubscriptionUpdated event.") + model ApiManagementSubscriptionUpdatedEventData { + ...BaseEventData; + } + + model ApiManagementSubscriptionUpdatedEvent + is EventGrid.TypedEventGridEvent< + "Microsoft.ApiManagement.SubscriptionUpdated", + ApiManagementSubscriptionUpdatedEventData + >; + model ApiManagementSubscriptionUpdatedEventCloud + is EventGrid.TypedCloudEvent< + "Microsoft.ApiManagement.SubscriptionUpdated", + ApiManagementSubscriptionUpdatedEventData + >; + + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.SubscriptionDeleted event.") + model ApiManagementSubscriptionDeletedEventData { + ...BaseEventData; + } + + model ApiManagementSubscriptionDeletedEvent + is EventGrid.TypedEventGridEvent< + "Microsoft.ApiManagement.SubscriptionDeleted", + ApiManagementSubscriptionDeletedEventData + >; + model ApiManagementSubscriptionDeletedEventCloud + is EventGrid.TypedCloudEvent< + "Microsoft.ApiManagement.SubscriptionDeleted", + ApiManagementSubscriptionDeletedEventData + >; + + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.ProductCreated event.") + model ApiManagementProductCreatedEventData { + ...BaseEventData; + } + + model ApiManagementProductCreatedEvent + is EventGrid.TypedEventGridEvent< + "Microsoft.ApiManagement.ProductCreated", + ApiManagementProductCreatedEventData + >; + model ApiManagementProductCreatedEventCloud + is EventGrid.TypedCloudEvent< + "Microsoft.ApiManagement.ProductCreated", + ApiManagementProductCreatedEventData + >; + + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.ProductUpdated event.") + model ApiManagementProductUpdatedEventData { + ...BaseEventData; + } + + model ApiManagementProductUpdatedEvent + is EventGrid.TypedEventGridEvent< + "Microsoft.ApiManagement.ProductUpdated", + ApiManagementProductUpdatedEventData + >; + model ApiManagementProductUpdatedEventCloud + is EventGrid.TypedCloudEvent< + "Microsoft.ApiManagement.ProductUpdated", + ApiManagementProductUpdatedEventData + >; + + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.ProductDeleted event.") + model ApiManagementProductDeletedEventData { + ...BaseEventData; + } + + model ApiManagementProductDeletedEvent + is EventGrid.TypedEventGridEvent< + "Microsoft.ApiManagement.ProductDeleted", + ApiManagementProductDeletedEventData + >; + model ApiManagementProductDeletedEventCloud + is EventGrid.TypedCloudEvent< + "Microsoft.ApiManagement.ProductDeleted", + ApiManagementProductDeletedEventData + >; + + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APICreated event.") + model ApiManagementApiCreatedEventData { + ...BaseEventData; + } + + model ApiManagementApiCreatedEvent + is EventGrid.TypedEventGridEvent< + "Microsoft.ApiManagement.ApiCreated", + ApiManagementApiCreatedEventData + >; + model ApiManagementApiCreatedEventCloud + is EventGrid.TypedCloudEvent< + "Microsoft.ApiManagement.ApiCreated", + ApiManagementApiCreatedEventData + >; + + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIUpdated event.") + model ApiManagementApiUpdatedEventData { + ...BaseEventData; + } + + model ApiManagementApiUpdatedEvent + is EventGrid.TypedEventGridEvent< + "Microsoft.ApiManagement.ApiUpdated", + ApiManagementApiUpdatedEventData + >; + model ApiManagementApiUpdatedEventCloud + is EventGrid.TypedCloudEvent< + "Microsoft.ApiManagement.ApiUpdated", + ApiManagementApiUpdatedEventData + >; + + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIDeleted event.") + model ApiManagementApiDeletedEventData { + ...BaseEventData; + } + + model ApiManagementApiDeletedEvent + is EventGrid.TypedEventGridEvent< + "Microsoft.ApiManagement.ApiDeleted", + ApiManagementApiDeletedEventData + >; + model ApiManagementApiDeletedEventCloud + is EventGrid.TypedCloudEvent< + "Microsoft.ApiManagement.ApiDeleted", + ApiManagementApiDeletedEventData + >; + + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIReleaseCreated event.") + model ApiManagementApiReleaseCreatedEventData { + ...BaseEventData; + } + + model ApiManagementApiReleaseCreatedEvent + is EventGrid.TypedEventGridEvent< + "Microsoft.ApiManagement.ApiReleaseCreated", + ApiManagementApiReleaseCreatedEventData + >; + model ApiManagementApiReleaseCreatedEventCloud + is EventGrid.TypedCloudEvent< + "Microsoft.ApiManagement.ApiReleaseCreated", + ApiManagementApiReleaseCreatedEventData + >; + + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIReleaseUpdated event.") + model ApiManagementApiReleaseUpdatedEventData { + ...BaseEventData; + } + + model ApiManagementApiReleaseUpdatedEvent + is EventGrid.TypedEventGridEvent< + "Microsoft.ApiManagement.ApiReleaseUpdated", + ApiManagementApiReleaseUpdatedEventData + >; + model ApiManagementApiReleaseUpdatedEventCloud + is EventGrid.TypedCloudEvent< + "Microsoft.ApiManagement.ApiReleaseUpdated", + ApiManagementApiReleaseUpdatedEventData + >; + + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APIReleaseDeleted event.") + model ApiManagementApiReleaseDeletedEventData { + ...BaseEventData; + } + + model ApiManagementApiReleaseDeletedEvent + is EventGrid.TypedEventGridEvent< + "Microsoft.ApiManagement.ApiReleaseDeleted", + ApiManagementApiReleaseDeletedEventData + >; + model ApiManagementApiReleaseDeletedEventCloud + is EventGrid.TypedCloudEvent< + "Microsoft.ApiManagement.ApiReleaseDeleted", + ApiManagementApiReleaseDeletedEventData + >; + + alias BaseEventData = { + @doc("The fully qualified ID of the resource that the compliance state change is for, including the resource name and resource type. Uses the format, `/subscriptions//resourceGroups//Microsoft.ApiManagement/service///`") + resourceUri?: string; + }; +} diff --git a/specification/eventgrid/data-plane/cadl/AppConfiguration.cadl b/specification/eventgrid/data-plane/cadl/AppConfiguration.tsp similarity index 78% rename from specification/eventgrid/data-plane/cadl/AppConfiguration.cadl rename to specification/eventgrid/data-plane/cadl/AppConfiguration.tsp index 6c6b648c5990..c3b4cc2e0394 100644 --- a/specification/eventgrid/data-plane/cadl/AppConfiguration.cadl +++ b/specification/eventgrid/data-plane/cadl/AppConfiguration.tsp @@ -1,18 +1,17 @@ @doc("Describes the schema of the Azure App Configuration events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") -namespace EventGrid.AppConfiguration{ +namespace EventGrid.AppConfiguration { +// need to figure out an alternative to this method --- should we pass in docstring here or should we just copy/paste and see what happens @doc("Schema of the Data property of an EventGridEvent for a Microsoft.AppConfiguration.KeyValueModified event.") - model AppConfigurationKeyValueModifiedEventData{ + model AppConfigurationKeyValueModifiedEventData { ...AppConfigurationBase<"modified">; - }; + } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.AppConfiguration.KeyValueDeleted event.") - model AppConfigurationKeyValueDeletedEventData{ + model AppConfigurationKeyValueDeletedEventData { ...AppConfigurationBase<"deleted">; - }; - + } - // need to figure out an alternative to this method --- should we pass in docstring here or should we just copy/paste and see what happens alias AppConfigurationBase = { @doc( "The key used to identify the key-value that was {name}.", @@ -41,5 +40,4 @@ namespace EventGrid.AppConfiguration{ @doc("The sync token representing the server state after the event.") syncToken?: string; }; - -} \ No newline at end of file +} diff --git a/specification/eventgrid/data-plane/cadl/AzureCommunicationServices.cadl b/specification/eventgrid/data-plane/cadl/AzureCommunicationServices.tsp similarity index 99% rename from specification/eventgrid/data-plane/cadl/AzureCommunicationServices.cadl rename to specification/eventgrid/data-plane/cadl/AzureCommunicationServices.tsp index ba7408a626e2..194ee4b5f67c 100644 --- a/specification/eventgrid/data-plane/cadl/AzureCommunicationServices.cadl +++ b/specification/eventgrid/data-plane/cadl/AzureCommunicationServices.tsp @@ -1,4 +1,4 @@ -import "./AzureCommunicationServicesCore.cadl"; +import "./AzureCommunicationServicesCore.tsp"; @doc("Describes the schema of the Azure Communication Services events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") namespace EventGrid.AzureCommunicationServices; diff --git a/specification/eventgrid/data-plane/cadl/AzureCommunicationServicesCore.cadl b/specification/eventgrid/data-plane/cadl/AzureCommunicationServicesCore.tsp similarity index 100% rename from specification/eventgrid/data-plane/cadl/AzureCommunicationServicesCore.cadl rename to specification/eventgrid/data-plane/cadl/AzureCommunicationServicesCore.tsp diff --git a/specification/eventgrid/data-plane/cadl/ContainerRegistry.cadl b/specification/eventgrid/data-plane/cadl/ContainerRegistry.tsp similarity index 98% rename from specification/eventgrid/data-plane/cadl/ContainerRegistry.cadl rename to specification/eventgrid/data-plane/cadl/ContainerRegistry.tsp index 7565c571b3f1..632edbc48b16 100644 --- a/specification/eventgrid/data-plane/cadl/ContainerRegistry.cadl +++ b/specification/eventgrid/data-plane/cadl/ContainerRegistry.tsp @@ -62,7 +62,7 @@ namespace EventGrid.ContainerRegistry { } @doc("The target of the event.") - model ContainerRegistryEventTarget{ + model ContainerRegistryEventTarget { ...ContainerRegistryBaseEventTarget< "The MIME type of the referenced object.", "The number of bytes of the content. Same as Length field.", @@ -70,6 +70,7 @@ namespace EventGrid.ContainerRegistry { "The repository name.", "The tag name." >; + @doc("The number of bytes of the content. Same as Size field.") length?: int64; @@ -79,13 +80,14 @@ namespace EventGrid.ContainerRegistry { @doc("The target of the event.") model ContainerRegistryArtifactEventTarget { - ...ContainerRegistryBaseEventTarget< + ...ContainerRegistryBaseEventTarget< "The MIME type of the artifact.", "The size in bytes of the artifact.", "The digest of the artifact.", "The repository name of the artifact.", "The tag of the artifact." >; + @doc("The name of the artifact.") name?: string; diff --git a/specification/eventgrid/data-plane/cadl/ContainerService.cadl b/specification/eventgrid/data-plane/cadl/ContainerService.tsp similarity index 100% rename from specification/eventgrid/data-plane/cadl/ContainerService.cadl rename to specification/eventgrid/data-plane/cadl/ContainerService.tsp diff --git a/specification/eventgrid/data-plane/cadl/DataBox.cadl b/specification/eventgrid/data-plane/cadl/DataBox.cadl deleted file mode 100644 index 8c4c769c4dbb..000000000000 --- a/specification/eventgrid/data-plane/cadl/DataBox.cadl +++ /dev/null @@ -1,41 +0,0 @@ - - -namespace EventGrid.DataBox { - - @doc("Schema of the Data property of an EventGridEvent for a Microsoft.DataBox.CopyStarted event.") - model DataBoxCopyStartedEventData{ - ...DataBoxBase; - } - - @doc("Schema of the Data property of an EventGridEvent for a Microsoft.DataBox.CopyCompleted event.") - model DataBoxCopyCompletedEventData{ - ...DataBoxBase; - } - - @doc("Schema of the Data property of an EventGridEvent for a Microsoft.DataBox.OrderCompleted event.") - model DataBoxOrderCompletedEventData{ - ...DataBoxBase; - } - - alias DataBoxBase = { - @doc("Serial Number of the device associated with the event. The list is comma separated if more than one serial number is associated.") - serialNumber?: string; - - @doc("Name of the current Stage") - stageName?: DataBoxStageName; - - @doc("The time at which the stage happened.") - stageTime?:string; - }; - - enum DataBoxStageName { - @doc("Copy has started") - "CopyStarted", - @doc("Copy has completed") - "CopyCompleted", - @doc("Order has been completed") - "OrderCompleted", - } - - -}; \ No newline at end of file diff --git a/specification/eventgrid/data-plane/cadl/DataBox.tsp b/specification/eventgrid/data-plane/cadl/DataBox.tsp new file mode 100644 index 000000000000..479f47b14f08 --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/DataBox.tsp @@ -0,0 +1,38 @@ +namespace EventGrid.DataBox { + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.DataBox.CopyStarted event.") + model DataBoxCopyStartedEventData { + ...DataBoxBase; + } + + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.DataBox.CopyCompleted event.") + model DataBoxCopyCompletedEventData { + ...DataBoxBase; + } + + @doc("Schema of the Data property of an EventGridEvent for a Microsoft.DataBox.OrderCompleted event.") + model DataBoxOrderCompletedEventData { + ...DataBoxBase; + } + + alias DataBoxBase = { + @doc("Serial Number of the device associated with the event. The list is comma separated if more than one serial number is associated.") + serialNumber?: string; + + @doc("Name of the current Stage") + stageName?: DataBoxStageName; + + @doc("The time at which the stage happened.") + stageTime?: string; + }; + + enum DataBoxStageName { + @doc("Copy has started") + CopyStarted, + + @doc("Copy has completed") + CopyCompleted, + + @doc("Order has been completed") + OrderCompleted, + } +} diff --git a/specification/eventgrid/data-plane/cadl/EventGrid.cadl b/specification/eventgrid/data-plane/cadl/EventGrid.tsp similarity index 65% rename from specification/eventgrid/data-plane/cadl/EventGrid.cadl rename to specification/eventgrid/data-plane/cadl/EventGrid.tsp index 3cde81bc1c7d..925f104849f9 100644 --- a/specification/eventgrid/data-plane/cadl/EventGrid.cadl +++ b/specification/eventgrid/data-plane/cadl/EventGrid.tsp @@ -1,18 +1,22 @@ -import "@cadl-lang/versioning"; -import "@azure-tools/cadl-azure-core"; +import "@typespec/http"; +import "@typespec/rest"; +import "@typespec/versioning"; +import "@azure-tools/typespec-autorest"; +import "@azure-tools/typespec-azure-core"; enum ServiceApiVersions { v2018_01_01: "2018-01-01", } @useAuth( - ApiKeyAuth | - OAuth2Auth<[{ + ApiKeyAuth | OAuth2Auth<[ + { type: OAuth2FlowType.implicit, authorizationUrl: "https://login.microsoftonline.com/common/oauth2/v2.0/authorize", - scopes: ["https://eventgrid.azure.net/.default"] - }]>) - + scopes: ["https://eventgrid.azure.net/.default"], + } + ]> +) @service({ title: "EventGridClient", version: "2018-01-01", @@ -25,13 +29,15 @@ enum ServiceApiVersions { endpoint: url, } ) -@versioned(ServiceApiVersions) + @doc("Azure EventGrid Client") +@versioned(ServiceApiVersions) namespace EventGrid { - - using Cadl.Http; + using TypeSpec.Http; + using TypeSpec.Rest; + using TypeSpec.Versioning; + using Azure.Core; using Azure.Core.Foundations; - using Cadl.Versioning; @doc("Properties of an event published to an Event Grid topic using the EventGrid Schema.") model EventGridEvent { @@ -121,52 +127,85 @@ namespace EventGrid { eventSubscriptionId?: string; } - - model ChannelNameParameter { - @doc("Required only when publishing to partner namespaces with partner topic routing mode ChannelNameHeader.") - @query - "aeg-channel-name"?: string; - } - + // USE SHARED ROUTES (Not supported yet by language emitters - can use with OpenAPI3) alias EventType = EventGridEvent | CloudEventEvent; - model GeneralEvent {} + @doc("Publish Events") + @route("/send", { shared: true}) + op send is Azure.Core.RpcOperation<{ + @doc("channel name") + @header("aeg-channel-name") + channelName?: string, -// General Event Function -- manually write overload + @doc("Events being published.") + @body + events: EventType + }, {}>; + + @doc("Publish CloudEvents") + @overload(send) + @route("/send", { shared: true}) + op PublishCloudEvent is Azure.Core.RpcOperation<{ + @doc("content type") + @header("content-type") + contentType: "application/cloudevents-batch+json; charset=utf-8", + + @doc("Events being published.") + @body + events: CloudEventEvent, + }, {} >; + + @doc("Publish EventGridEvents") + @overload(send) + @route("/send", { shared: true}) + op PublishEventGridEvent is Azure.Core.RpcOperation<{ - @post - op PublishEvent( - ...ApiVersionParameter, + @doc("Events being published.") @body - events: GeneralEvent, - ):OkResponse; + events: EventGridEvent, + }, {} >; +} - @overload(PublishEvent) - @post - op PublishCloudEvent( - @header("content-type") contentType: "application/cloudevents-batch+json; charset=utf-8", - @body - events: CloudEventEvent, - ...ApiVersionParameter, - ):OkResponse; +// Try gen swagger and make sure that looks right and maybe create issue for models not appearing *** - @overload(PublishEvent) - @post - op PublishEventGridEvent( - @body - events: EventGridEvent, - ...ApiVersionParameter, - ):OkResponse; + // Use @overload -// Overloaded Function -- when that becomes available + // alias EventType = EventGridEvent | CloudEventEvent; - // alias CloudEventRequest = { + // @post + // @doc("Some Doc") + // @route("/send") + // op PublishEvent is Azure.Core.RpcOperation<{ + // @doc("channel name") + // @header("aeg-channel-name") + // channelName?: string, + + // @doc("Doc for body") + // @body + // events: EventType + // }, {}>; + + // @overload(PublishEvent) + // @post + // op PublishCloudEvent is Azure.Core.RpcOperation<{ // @header("content-type") contentType: "application/cloudevents-batch+json; charset=utf-8", - // ...CloudEventEvent - // }; + // @body + // events: CloudEventEvent, + // // ...ApiVersionParameter, + // }, {}>; + + // @overload(PublishEvent) + // @post + // op PublishEventGridEvent is Azure.Core.RpcOperation<{ + // @body + // events: EventGridEvent, + // // ...ApiVersionParameter, + // }, {}>; + + // alias InputType = CloudEventRequest | EventGridEvent; @@ -175,32 +214,24 @@ namespace EventGrid { // op PublishEvent( // @body // events: InputType, - // ...ApiVersionParameter, + // ...ApiVersionParameter, // ):OkResponse; + // @overload(PublishEvent) + // @post + // op PublishCloudEvent( + // @header("content-type") contentType: "application/cloudevents-batch+json; charset=utf-8", + // @body + // events: CloudEventEvent, + // ...ApiVersionParameter, + // ):OkResponse; -// @overload(PublishEvent) -// @post -// op PublishCloudEvent( -// @header("content-type") contentType: "application/cloudevents-batch+json; charset=utf-8", -// @body -// events: CloudEventEvent, -// ...ApiVersionParameter, -// ):OkResponse; - -// @overload(PublishEvent) -// @post -// op PublishEventGridEvent( -// @header("content-type") contentType: "application/json", -// @body -// events: EventGridEvent, -// ...ApiVersionParameter, -// ):OkResponse; - -} - - -// Try gen swagger and make sure that looks right and maybe create issue for models not appearing *** - - + // @overload(PublishEvent) + // @post + // op PublishEventGridEvent( + // @header("content-type") contentType: "application/json", + // @body + // events: EventGridEvent, + // ...ApiVersionParameter, + // ):OkResponse; diff --git a/specification/eventgrid/data-plane/cadl/EventHub.cadl b/specification/eventgrid/data-plane/cadl/EventHub.tsp similarity index 100% rename from specification/eventgrid/data-plane/cadl/EventHub.cadl rename to specification/eventgrid/data-plane/cadl/EventHub.tsp diff --git a/specification/eventgrid/data-plane/cadl/HealthcareApis.cadl b/specification/eventgrid/data-plane/cadl/HealthcareApis.tsp similarity index 99% rename from specification/eventgrid/data-plane/cadl/HealthcareApis.cadl rename to specification/eventgrid/data-plane/cadl/HealthcareApis.tsp index 584c4cf3503d..9f5805275870 100644 --- a/specification/eventgrid/data-plane/cadl/HealthcareApis.cadl +++ b/specification/eventgrid/data-plane/cadl/HealthcareApis.tsp @@ -1,8 +1,11 @@ @doc("Describes the schema of the Azure HealthcareApis events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") namespace EventGrid.HealthCareApis { + +// model HealthcareFhirResourceType is string {} @doc("Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.FhirResourceCreated event.") model HealthcareFhirResourceCreatedEventData { ...HealthcareFhirResourceBaseEventData; + @doc("Type of HL7 FHIR resource.") resourceType?: HealthcareFhirResourceType; } @@ -10,6 +13,7 @@ namespace EventGrid.HealthCareApis { @doc("Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.FhirResourceUpdated event.") model HealthcareFhirResourceUpdatedEventData { ...HealthcareFhirResourceBaseEventData; + @doc("Type of HL7 FHIR resource.") resourceType?: HealthcareFhirResourceType; } @@ -17,6 +21,7 @@ namespace EventGrid.HealthCareApis { @doc("Schema of the Data property of an EventGridEvent for a Microsoft.HealthcareApis.FhirResourceDeleted event.") model HealthcareFhirResourceDeletedEventData { ...HealthcareFhirResourceBaseEventData; + @doc("Type of HL7 FHIR resource.") resourceType?: HealthcareFhirResourceType; } @@ -57,8 +62,6 @@ namespace EventGrid.HealthCareApis { sequenceNumber?: int64; } - // model HealthcareFhirResourceType is string {} - @doc("Schema of FHIR resource type enumeration.") enum HealthcareFhirResourceType { @doc("The FHIR resource type defined in STU3 and R4.") @@ -544,7 +547,7 @@ namespace EventGrid.HealthCareApis { @doc("The FHIR resource type defined in STU3 and R4.") VisionPrescription, } - + alias HealthcareFhirResourceBaseEventData = { @doc("Domain name of FHIR account for this resource.") resourceFhirAccount?: string; diff --git a/specification/eventgrid/data-plane/cadl/IotHub.cadl b/specification/eventgrid/data-plane/cadl/IotHub.tsp similarity index 97% rename from specification/eventgrid/data-plane/cadl/IotHub.cadl rename to specification/eventgrid/data-plane/cadl/IotHub.tsp index 2aa3a3e9e375..dd6c56dcddec 100644 --- a/specification/eventgrid/data-plane/cadl/IotHub.cadl +++ b/specification/eventgrid/data-plane/cadl/IotHub.tsp @@ -102,14 +102,14 @@ model DeviceConnectionStateEventInfo { } @doc("Event data for Microsoft.Devices.DeviceCreated event.") -model IotHubDeviceCreatedEventData{ +model IotHubDeviceCreatedEventData { ...DeviceLifeCycleEventProperties; -} +} @doc("Event data for Microsoft.Devices.DeviceDeleted event.") -model IotHubDeviceDeletedEventData{ +model IotHubDeviceDeletedEventData { ...DeviceLifeCycleEventProperties; -} +} @doc("Event data for Microsoft.Devices.DeviceConnected event.") model IotHubDeviceConnectedEventData @@ -120,9 +120,9 @@ model IotHubDeviceDisconnectedEventData extends DeviceConnectionStateEventProperties {} @doc("Event data for Microsoft.Devices.DeviceTelemetry event.") -model IotHubDeviceTelemetryEventData{ +model IotHubDeviceTelemetryEventData { ...DeviceTelemetryEventProperties; -} +} model PropertiesJson { @doc("A portion of the properties that can be written only by the application back-end, and read by the device.") diff --git a/specification/eventgrid/data-plane/cadl/KeyVault.cadl b/specification/eventgrid/data-plane/cadl/KeyVault.tsp similarity index 83% rename from specification/eventgrid/data-plane/cadl/KeyVault.cadl rename to specification/eventgrid/data-plane/cadl/KeyVault.tsp index ffdecf99e1dc..de9507b47338 100644 --- a/specification/eventgrid/data-plane/cadl/KeyVault.cadl +++ b/specification/eventgrid/data-plane/cadl/KeyVault.tsp @@ -1,52 +1,52 @@ @doc("Describes the schema of the Azure Key Vault events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") namespace EventGrid.KeyVault { @doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.CertificateNewVersionCreated event.") - model KeyVaultCertificateNewVersionCreatedEventData{ + model KeyVaultCertificateNewVersionCreatedEventData { ...KeyVaultCertificateBase; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.CertificateNearExpiry event.") - model KeyVaultCertificateNearExpiryEventData{ + model KeyVaultCertificateNearExpiryEventData { ...KeyVaultCertificateBase; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.CertificateExpired event.") - model KeyVaultCertificateExpiredEventData{ + model KeyVaultCertificateExpiredEventData { ...KeyVaultCertificateBase; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.KeyNewVersionCreated event.") - model KeyVaultKeyNewVersionCreatedEventData{ + model KeyVaultKeyNewVersionCreatedEventData { ...KeyVaultCertificateBase; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.KeyNearExpiry event.") - model KeyVaultKeyNearExpiryEventData{ + model KeyVaultKeyNearExpiryEventData { ...KeyVaultCertificateBase; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.KeyExpired event.") - model KeyVaultKeyExpiredEventData{ + model KeyVaultKeyExpiredEventData { ...KeyVaultCertificateBase; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.SecretNewVersionCreated event.") - model KeyVaultSecretNewVersionCreatedEventData{ + model KeyVaultSecretNewVersionCreatedEventData { ...KeyVaultCertificateBase; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.SecretNearExpiry event.") - model KeyVaultSecretNearExpiryEventData{ + model KeyVaultSecretNearExpiryEventData { ...KeyVaultCertificateBase; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.SecretExpired event.") - model KeyVaultSecretExpiredEventData{ + model KeyVaultSecretExpiredEventData { ...KeyVaultCertificateBase; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.VaultAccessPolicyChanged event.") - model KeyVaultVaultAccessPolicyChangedEventData{ + model KeyVaultVaultAccessPolicyChangedEventData { ...KeyVaultCertificateBase; } @@ -72,5 +72,4 @@ namespace EventGrid.KeyVault { @doc("The expiration date of the object that triggered this event") EXP?: float64; }; - } diff --git a/specification/eventgrid/data-plane/cadl/MachineLearningServices.cadl b/specification/eventgrid/data-plane/cadl/MachineLearningServices.tsp similarity index 100% rename from specification/eventgrid/data-plane/cadl/MachineLearningServices.cadl rename to specification/eventgrid/data-plane/cadl/MachineLearningServices.tsp diff --git a/specification/eventgrid/data-plane/cadl/Maps.cadl b/specification/eventgrid/data-plane/cadl/Maps.tsp similarity index 100% rename from specification/eventgrid/data-plane/cadl/Maps.cadl rename to specification/eventgrid/data-plane/cadl/Maps.tsp diff --git a/specification/eventgrid/data-plane/cadl/MediaServices.cadl b/specification/eventgrid/data-plane/cadl/MediaServices.tsp similarity index 99% rename from specification/eventgrid/data-plane/cadl/MediaServices.cadl rename to specification/eventgrid/data-plane/cadl/MediaServices.tsp index 8b992db311ac..300480762ca4 100644 --- a/specification/eventgrid/data-plane/cadl/MediaServices.cadl +++ b/specification/eventgrid/data-plane/cadl/MediaServices.tsp @@ -238,7 +238,7 @@ namespace EventGrid.MediaServices { extends MediaJobOutputStateChangeEventData {} @doc("Encoder connect event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventEncoderConnected event.") - model MediaLiveEventEncoderConnectedEventData{ + model MediaLiveEventEncoderConnectedEventData { ...MediaLiveEventConnectionBaseData; } diff --git a/specification/eventgrid/data-plane/cadl/PolicyInsights.cadl b/specification/eventgrid/data-plane/cadl/PolicyInsights.tsp similarity index 90% rename from specification/eventgrid/data-plane/cadl/PolicyInsights.cadl rename to specification/eventgrid/data-plane/cadl/PolicyInsights.tsp index 1e14a4889640..04300b8c466a 100644 --- a/specification/eventgrid/data-plane/cadl/PolicyInsights.cadl +++ b/specification/eventgrid/data-plane/cadl/PolicyInsights.tsp @@ -1,21 +1,20 @@ @doc("Describes the schema of the Azure Policy events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") namespace EventGrid.PolicyInsights { @doc("Schema of the Data property of an EventGridEvent for a Microsoft.PolicyInsights.PolicyStateCreated event.") - model PolicyInsightsPolicyStateCreatedEventData{ + model PolicyInsightsPolicyStateCreatedEventData { ...PolicyInsightsBaseEventData; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.PolicyInsights.PolicyStateChanged event.") - model PolicyInsightsPolicyStateChangedEventData{ + model PolicyInsightsPolicyStateChangedEventData { ...PolicyInsightsBaseEventData; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.PolicyInsights.PolicyStateDeleted event.") - model PolicyInsightsPolicyStateDeletedEventData{ + model PolicyInsightsPolicyStateDeletedEventData { ...PolicyInsightsBaseEventData; } - alias PolicyInsightsBaseEventData = { @doc("The time that the resource was scanned by Azure Policy in the Universal ISO 8601 DateTime format yyyy-MM-ddTHH:mm:ss.fffffffZ.") timestamp?: zonedDateTime; diff --git a/specification/eventgrid/data-plane/cadl/RedisCache.cadl b/specification/eventgrid/data-plane/cadl/RedisCache.tsp similarity index 82% rename from specification/eventgrid/data-plane/cadl/RedisCache.cadl rename to specification/eventgrid/data-plane/cadl/RedisCache.tsp index 4fa848e06fc7..cc021a9854d5 100644 --- a/specification/eventgrid/data-plane/cadl/RedisCache.cadl +++ b/specification/eventgrid/data-plane/cadl/RedisCache.tsp @@ -1,6 +1,5 @@ @doc("Describes the schema of the Redis Cache events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") -namespace EventGrid.RedisCache{ - +namespace EventGrid.RedisCache { alias RedisBaseEventData = { @doc("The time at which the event occurred.") timestamp?: zonedDateTime; @@ -13,23 +12,22 @@ namespace EventGrid.RedisCache{ }; @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Cache.PatchingCompleted event.") - model RedisPatchingCompletedEventData{ + model RedisPatchingCompletedEventData { ...RedisBaseEventData; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Cache.ScalingCompleted event.") - model RedisScalingCompletedEventData{ + model RedisScalingCompletedEventData { ...RedisBaseEventData; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Cache.ExportRDBCompleted event.") - model RedisExportRDBCompletedEventData{ + model RedisExportRDBCompletedEventData { ...RedisBaseEventData; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Cache.ImportRDBCompleted event.") - model RedisImportRDBCompletedEventData{ + model RedisImportRDBCompletedEventData { ...RedisBaseEventData; } - -} \ No newline at end of file +} diff --git a/specification/eventgrid/data-plane/cadl/Resources.cadl b/specification/eventgrid/data-plane/cadl/Resources.tsp similarity index 91% rename from specification/eventgrid/data-plane/cadl/Resources.cadl rename to specification/eventgrid/data-plane/cadl/Resources.tsp index c3e020dbc398..931343130ced 100644 --- a/specification/eventgrid/data-plane/cadl/Resources.cadl +++ b/specification/eventgrid/data-plane/cadl/Resources.tsp @@ -1,47 +1,47 @@ @doc("Describes the schema of the Azure resource events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") namespace EventGrid.Resources { @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceWriteSuccess event. This is raised when a resource create or update operation succeeds.") - model ResourceWriteSuccessData{ + model ResourceWriteSuccessData { ...ResourceBaseEventData; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceWriteFailure event. This is raised when a resource create or update operation fails.") - model ResourceWriteFailureData{ + model ResourceWriteFailureData { ...ResourceBaseEventData; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceWriteCancel event. This is raised when a resource create or update operation is canceled.") - model ResourceWriteCancelData{ + model ResourceWriteCancelData { ...ResourceBaseEventData; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceDeleteSuccess event. This is raised when a resource delete operation succeeds.") - model ResourceDeleteSuccessData{ + model ResourceDeleteSuccessData { ...ResourceBaseEventData; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceDeleteFailure event. This is raised when a resource delete operation fails.") - model ResourceDeleteFailureData{ + model ResourceDeleteFailureData { ...ResourceBaseEventData; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceDeleteCancel event. This is raised when a resource delete operation is canceled.") - model ResourceDeleteCancelData{ + model ResourceDeleteCancelData { ...ResourceBaseEventData; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceActionSuccess event. This is raised when a resource action operation succeeds.") - model ResourceActionSuccessData{ + model ResourceActionSuccessData { ...ResourceBaseEventData; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceActionFailure event. This is raised when a resource action operation fails.") - model ResourceActionFailureData{ + model ResourceActionFailureData { ...ResourceBaseEventData; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceActionCancel event. This is raised when a resource action operation is canceled.") - model ResourceActionCancelData{ + model ResourceActionCancelData { ...ResourceBaseEventData; } diff --git a/specification/eventgrid/data-plane/cadl/ServiceBus.cadl b/specification/eventgrid/data-plane/cadl/ServiceBus.tsp similarity index 98% rename from specification/eventgrid/data-plane/cadl/ServiceBus.cadl rename to specification/eventgrid/data-plane/cadl/ServiceBus.tsp index 184ec8533d11..04af39f5b28a 100644 --- a/specification/eventgrid/data-plane/cadl/ServiceBus.cadl +++ b/specification/eventgrid/data-plane/cadl/ServiceBus.tsp @@ -1,22 +1,22 @@ @doc("Describes the schema of the Azure ServiceBus Messaging events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") namespace EventGrid.ServiceBus { @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ServiceBus.ActiveMessagesAvailableWithNoListeners event.") - model ServiceBusActiveMessagesAvailableWithNoListenersEventData{ + model ServiceBusActiveMessagesAvailableWithNoListenersEventData { ...ServiceBusBaseEventData; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ServiceBus.DeadletterMessagesAvailableWithNoListeners event.") - model ServiceBusDeadletterMessagesAvailableWithNoListenersEventData{ + model ServiceBusDeadletterMessagesAvailableWithNoListenersEventData { ...ServiceBusBaseEventData; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ServiceBus.ActiveMessagesAvailablePeriodicNotifications event.") - model ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData{ + model ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData { ...ServiceBusBaseEventData; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.ServiceBus.DeadletterMessagesAvailablePeriodicNotifications event.") - model ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData{ + model ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData { ...ServiceBusBaseEventData; } diff --git a/specification/eventgrid/data-plane/cadl/SignalRService.cadl b/specification/eventgrid/data-plane/cadl/SignalRService.tsp similarity index 94% rename from specification/eventgrid/data-plane/cadl/SignalRService.cadl rename to specification/eventgrid/data-plane/cadl/SignalRService.tsp index 95c676f73c88..e29f69d2f683 100644 --- a/specification/eventgrid/data-plane/cadl/SignalRService.cadl +++ b/specification/eventgrid/data-plane/cadl/SignalRService.tsp @@ -1,7 +1,7 @@ @doc("Describes the schema of the Azure SignalR Service events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") namespace EventGrid.SignalRService { @doc("Schema of the Data property of an EventGridEvent for a Microsoft.SignalRService.ClientConnectionConnected event.") - model SignalRServiceClientConnectionConnectedEventData{ + model SignalRServiceClientConnectionConnectedEventData { ...SignalRServiceBaseEventdata; } diff --git a/specification/eventgrid/data-plane/cadl/Storage.cadl b/specification/eventgrid/data-plane/cadl/Storage.tsp similarity index 98% rename from specification/eventgrid/data-plane/cadl/Storage.cadl rename to specification/eventgrid/data-plane/cadl/Storage.tsp index 4805930105c2..f24ba3ffd194 100644 --- a/specification/eventgrid/data-plane/cadl/Storage.cadl +++ b/specification/eventgrid/data-plane/cadl/Storage.tsp @@ -119,7 +119,7 @@ namespace EventGrid.Storage { manifestBlobUrl?: string; } - alias StorageBaseEventData = { + alias StorageBaseEventData = { @doc("The name of the API/operation that triggered this event.") api?: string; diff --git a/specification/eventgrid/data-plane/cadl/Testing.tsp b/specification/eventgrid/data-plane/cadl/Testing.tsp new file mode 100644 index 000000000000..158e46c87973 --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/Testing.tsp @@ -0,0 +1,45 @@ +import "@typespec/http"; +import "@typespec/rest"; +import "@typespec/versioning"; +import "@azure-tools/typespec-azure-core"; + +using TypeSpec.Http; +using TypeSpec.Rest; +using TypeSpec.Versioning; +using Azure.Core; + + +@doc("Event Grid Event") +model EventGridEvent { + @doc("quiet") + @header("content-type") contentType: "eventgrid"; + + @doc("id") + id: string; +} + +@doc("Cloud Event Event") +model CloudEvent { + @doc("quiet") + @header("content-type") contentType: "cloudevent"; + + @doc("name") + name: string; +} + + +alias EventType = EventGridEvent | CloudEvent; + +@doc("Send Operation") +@route("/send", { shared: true}) +op send is Azure.Core.RpcOperation<{ @doc("Body is a union of EventGridEvent and CloudEvent") @body _: EventType}, {}>; + +@doc("Send CloudEvent Operation") +@overload(send) +@route("/send", { shared: true}) +op sendCloudEvent is Azure.Core.RpcOperation<{ @doc("Body is a CloudEvent") @body _: CloudEvent }, {}>; + +@doc("Send EventGridEvent Operation") +@overload(send) +@route("/send", { shared: true}) +op sendEventGridEvent is Azure.Core.RpcOperation<{ @doc("Body is an EventGridEvent") @body _: EventGridEvent }, {}>; \ No newline at end of file diff --git a/specification/eventgrid/data-plane/cadl/Web.cadl b/specification/eventgrid/data-plane/cadl/Web.tsp similarity index 90% rename from specification/eventgrid/data-plane/cadl/Web.cadl rename to specification/eventgrid/data-plane/cadl/Web.tsp index 0f3b4a3c88a0..27ecdcca8cf1 100644 --- a/specification/eventgrid/data-plane/cadl/Web.cadl +++ b/specification/eventgrid/data-plane/cadl/Web.tsp @@ -1,5 +1,7 @@ @doc("Describes the schema of the Azure App Service events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent.") namespace EventGrid.Web { + +// @doc("sku of app service plan.") @doc("Detail of action on the app.") model AppEventTypeDetail { @doc("Type of action of the operation.") @@ -7,62 +9,62 @@ namespace EventGrid.Web { } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.AppUpdated event.") - model WebAppUpdatedEventData{ + model WebAppUpdatedEventData { ...WebAppBaseEventData; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.BackupOperationStarted event.") - model WebBackupOperationStartedEventData{ + model WebBackupOperationStartedEventData { ...WebAppBaseEventData; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.BackupOperationCompleted event.") - model WebBackupOperationCompletedEventData{ + model WebBackupOperationCompletedEventData { ...WebAppBaseEventData; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.BackupOperationFailed event.") - model WebBackupOperationFailedEventData{ + model WebBackupOperationFailedEventData { ...WebAppBaseEventData; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.RestoreOperationStarted event.") - model WebRestoreOperationStartedEventData{ + model WebRestoreOperationStartedEventData { ...WebAppBaseEventData; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.RestoreOperationCompleted event.") - model WebRestoreOperationCompletedEventData{ + model WebRestoreOperationCompletedEventData { ...WebAppBaseEventData; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.RestoreOperationFailed event.") - model WebRestoreOperationFailedEventData{ + model WebRestoreOperationFailedEventData { ...WebAppBaseEventData; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapStarted event.") - model WebSlotSwapStartedEventData{ + model WebSlotSwapStartedEventData { ...WebAppBaseEventData; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapCompleted event.") - model WebSlotSwapCompletedEventData{ + model WebSlotSwapCompletedEventData { ...WebAppBaseEventData; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapFailed event.") - model WebSlotSwapFailedEventData{ + model WebSlotSwapFailedEventData { ...WebAppBaseEventData; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapWithPreviewStarted event.") - model WebSlotSwapWithPreviewStartedEventData{ + model WebSlotSwapWithPreviewStartedEventData { ...WebAppBaseEventData; } @doc("Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapWithPreviewCancelled event.") - model WebSlotSwapWithPreviewCancelledEventData{ + model WebSlotSwapWithPreviewCancelledEventData { ...WebAppBaseEventData; } @@ -171,7 +173,6 @@ namespace EventGrid.Web { verb?: string; }; - // @doc("sku of app service plan.") alias sku = { @doc("name of app service plan sku.") name?: string; @@ -188,5 +189,4 @@ namespace EventGrid.Web { @doc("capacity of app service plan sku.") Capacity?: string; }; - } diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/__init__.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/__init__.py deleted file mode 100644 index 78d20e5468da..000000000000 --- a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/__init__.py +++ /dev/null @@ -1,26 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._client import EventGridClient -from ._version import VERSION - -__version__ = VERSION - -try: - from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "EventGridClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) - -_patch_sdk() diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_client.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_client.py deleted file mode 100644 index 403f85053544..000000000000 --- a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_client.py +++ /dev/null @@ -1,83 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from copy import deepcopy -from typing import Any, TYPE_CHECKING, Union - -from azure.core import PipelineClient -from azure.core.credentials import AzureKeyCredential -from azure.core.rest import HttpRequest, HttpResponse - -from ._configuration import EventGridClientConfiguration -from ._operations import EventGridClientOperationsMixin -from ._serialization import Deserializer, Serializer - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials import TokenCredential - - -class EventGridClient(EventGridClientOperationsMixin): # pylint: disable=client-accepts-api-version-keyword - """Azure EventGrid Client. - - :param endpoint: The host name of the topic, e.g. topic1.westus2-1.eventgrid.azure.net. - Required. - :type endpoint: str - :param credential: Credential needed for the client to connect to Azure. Is either a - AzureKeyCredential type or a TokenCredential type. Required. - :type credential: ~azure.core.credentials.AzureKeyCredential or - ~azure.core.credentials.TokenCredential - :keyword api_version: The API version to use for this operation. Default value is "2018-01-01". - Note that overriding this default value may result in unsupported behavior. - :paramtype api_version: str - """ - - def __init__(self, endpoint: str, credential: Union[AzureKeyCredential, "TokenCredential"], **kwargs: Any) -> None: - _endpoint = "{endpoint}" - self._config = EventGridClientConfiguration(endpoint=endpoint, credential=credential, **kwargs) - self._client = PipelineClient(base_url=_endpoint, config=self._config, **kwargs) - - self._serialize = Serializer() - self._deserialize = Deserializer() - self._serialize.client_side_validation = False - - def send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = client.send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.HttpResponse - """ - - request_copy = deepcopy(request) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - - request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) - return self._client.send_request(request_copy, **kwargs) - - def close(self) -> None: - self._client.close() - - def __enter__(self) -> "EventGridClient": - self._client.__enter__() - return self - - def __exit__(self, *exc_details: Any) -> None: - self._client.__exit__(*exc_details) diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_configuration.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_configuration.py deleted file mode 100644 index bbd17d61bdce..000000000000 --- a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_configuration.py +++ /dev/null @@ -1,80 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import sys -from typing import Any, TYPE_CHECKING, Union - -from azure.core.configuration import Configuration -from azure.core.credentials import AzureKeyCredential -from azure.core.pipeline import policies - -from ._version import VERSION - -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials import TokenCredential - - -class EventGridClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes - """Configuration for EventGridClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param endpoint: The host name of the topic, e.g. topic1.westus2-1.eventgrid.azure.net. - Required. - :type endpoint: str - :param credential: Credential needed for the client to connect to Azure. Is either a - AzureKeyCredential type or a TokenCredential type. Required. - :type credential: ~azure.core.credentials.AzureKeyCredential or - ~azure.core.credentials.TokenCredential - :keyword api_version: The API version to use for this operation. Default value is "2018-01-01". - Note that overriding this default value may result in unsupported behavior. - :paramtype api_version: str - """ - - def __init__(self, endpoint: str, credential: Union[AzureKeyCredential, "TokenCredential"], **kwargs: Any) -> None: - super(EventGridClientConfiguration, self).__init__(**kwargs) - api_version: Literal["2018-01-01"] = kwargs.pop("api_version", "2018-01-01") - - if endpoint is None: - raise ValueError("Parameter 'endpoint' must not be None.") - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - - self.endpoint = endpoint - self.credential = credential - self.api_version = api_version - self.credential_scopes = kwargs.pop("credential_scopes", ["https://eventgrid.azure.net/.default"]) - kwargs.setdefault("sdk_moniker", "eventgridclient/{}".format(VERSION)) - self._configure(**kwargs) - - def _infer_policy(self, **kwargs): - if isinstance(self.credential, AzureKeyCredential): - return policies.AzureKeyCredentialPolicy(self.credential, "aeg-sas-key", **kwargs) - if hasattr(self.credential, "get_token"): - return policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) - raise TypeError(f"Unsupported credential: {self.credential}") - - def _configure(self, **kwargs: Any) -> None: - self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get("http_logging_policy") or policies.HttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get("authentication_policy") - if self.credential and not self.authentication_policy: - self.authentication_policy = self._infer_policy(**kwargs) diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_model_base.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_model_base.py deleted file mode 100644 index c37b9314ab90..000000000000 --- a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_model_base.py +++ /dev/null @@ -1,714 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -------------------------------------------------------------------------- -# pylint: disable=protected-access, arguments-differ, signature-differs, broad-except -# pyright: reportGeneralTypeIssues=false - -import functools -import sys -import logging -import base64 -import re -import copy -import typing -from datetime import datetime, date, time, timedelta, timezone -from json import JSONEncoder -import isodate -from azure.core.exceptions import DeserializationError -from azure.core import CaseInsensitiveEnumMeta -from azure.core.pipeline import PipelineResponse -from azure.core.serialization import NULL as AzureCoreNull - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping - -_LOGGER = logging.getLogger(__name__) - -__all__ = ["NULL", "AzureJSONEncoder", "Model", "rest_field", "rest_discriminator"] - - -class _Null(object): - """To create a Falsy object""" - - def __bool__(self): - return False - - __nonzero__ = __bool__ # Python2 compatibility - - -NULL = _Null() -""" -A falsy sentinel object which is supposed to be used to specify attributes -with no data. This gets serialized to `null` on the wire. -""" - -TZ_UTC = timezone.utc - - -def _timedelta_as_isostr(td: timedelta) -> str: - """Converts a datetime.timedelta object into an ISO 8601 formatted string, e.g. 'P4DT12H30M05S' - - Function adapted from the Tin Can Python project: https://github.com/RusticiSoftware/TinCanPython - - :param timedelta td: The timedelta to convert - :rtype: str - :return: ISO8601 version of this timedelta - """ - - # Split seconds to larger units - seconds = td.total_seconds() - minutes, seconds = divmod(seconds, 60) - hours, minutes = divmod(minutes, 60) - days, hours = divmod(hours, 24) - - days, hours, minutes = list(map(int, (days, hours, minutes))) - seconds = round(seconds, 6) - - # Build date - date_str = "" - if days: - date_str = "%sD" % days - - # Build time - time_str = "T" - - # Hours - bigger_exists = date_str or hours - if bigger_exists: - time_str += "{:02}H".format(hours) - - # Minutes - bigger_exists = bigger_exists or minutes - if bigger_exists: - time_str += "{:02}M".format(minutes) - - # Seconds - try: - if seconds.is_integer(): - seconds_string = "{:02}".format(int(seconds)) - else: - # 9 chars long w/ leading 0, 6 digits after decimal - seconds_string = "%09.6f" % seconds - # Remove trailing zeros - seconds_string = seconds_string.rstrip("0") - except AttributeError: # int.is_integer() raises - seconds_string = "{:02}".format(seconds) - - time_str += "{}S".format(seconds_string) - - return "P" + date_str + time_str - - -def _datetime_as_isostr(dt: typing.Union[datetime, date, time, timedelta]) -> str: - """Converts a datetime.(datetime|date|time|timedelta) object into an ISO 8601 formatted string - - :param timedelta dt: The date object to convert - :rtype: str - :return: ISO8601 version of this datetime - """ - # First try datetime.datetime - if hasattr(dt, "year") and hasattr(dt, "hour"): - dt = typing.cast(datetime, dt) - # astimezone() fails for naive times in Python 2.7, so make make sure dt is aware (tzinfo is set) - if not dt.tzinfo: - iso_formatted = dt.replace(tzinfo=TZ_UTC).isoformat() - else: - iso_formatted = dt.astimezone(TZ_UTC).isoformat() - # Replace the trailing "+00:00" UTC offset with "Z" (RFC 3339: https://www.ietf.org/rfc/rfc3339.txt) - return iso_formatted.replace("+00:00", "Z") - # Next try datetime.date or datetime.time - try: - dt = typing.cast(typing.Union[date, time], dt) - return dt.isoformat() - # Last, try datetime.timedelta - except AttributeError: - dt = typing.cast(timedelta, dt) - return _timedelta_as_isostr(dt) - - -def _serialize_bytes(o) -> str: - return base64.b64encode(o).decode() - - -def _serialize_datetime(o): - if hasattr(o, "year") and hasattr(o, "hour"): - # astimezone() fails for naive times in Python 2.7, so make make sure o is aware (tzinfo is set) - if not o.tzinfo: - iso_formatted = o.replace(tzinfo=TZ_UTC).isoformat() - else: - iso_formatted = o.astimezone(TZ_UTC).isoformat() - # Replace the trailing "+00:00" UTC offset with "Z" (RFC 3339: https://www.ietf.org/rfc/rfc3339.txt) - return iso_formatted.replace("+00:00", "Z") - # Next try datetime.date or datetime.time - return o.isoformat() - - -def _is_readonly(p): - try: - return p._readonly # pylint: disable=protected-access - except AttributeError: - return False - - -class AzureJSONEncoder(JSONEncoder): - """A JSON encoder that's capable of serializing datetime objects and bytes.""" - - def default(self, o): # pylint: disable=too-many-return-statements - if _is_model(o): - readonly_props = [ - p._rest_name for p in o._attr_to_rest_field.values() if _is_readonly(p) - ] # pylint: disable=protected-access - return {k: v for k, v in o.items() if k not in readonly_props} - if isinstance(o, (bytes, bytearray)): - return base64.b64encode(o).decode() - if o is AzureCoreNull: - return None - try: - return super(AzureJSONEncoder, self).default(o) - except TypeError: - if isinstance(o, (bytes, bytearray)): - return _serialize_bytes(o) - try: - # First try datetime.datetime - return _serialize_datetime(o) - except AttributeError: - pass - # Last, try datetime.timedelta - try: - return _timedelta_as_isostr(o) - except AttributeError: - # This will be raised when it hits value.total_seconds in the method above - pass - return super(AzureJSONEncoder, self).default(o) - - -_VALID_DATE = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" + r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") - - -def _deserialize_datetime(attr: typing.Union[str, datetime]) -> datetime: - """Deserialize ISO-8601 formatted string into Datetime object. - - :param str attr: response string to be deserialized. - :rtype: ~datetime.datetime - :returns: The datetime object from that input - """ - if isinstance(attr, datetime): - # i'm already deserialized - return attr - attr = attr.upper() - match = _VALID_DATE.match(attr) - if not match: - raise ValueError("Invalid datetime string: " + attr) - - check_decimal = attr.split(".") - if len(check_decimal) > 1: - decimal_str = "" - for digit in check_decimal[1]: - if digit.isdigit(): - decimal_str += digit - else: - break - if len(decimal_str) > 6: - attr = attr.replace(decimal_str, decimal_str[0:6]) - - date_obj = isodate.parse_datetime(attr) - test_utc = date_obj.utctimetuple() - if test_utc.tm_year > 9999 or test_utc.tm_year < 1: - raise OverflowError("Hit max or min date") - return date_obj - - -def _deserialize_date(attr: typing.Union[str, date]) -> date: - """Deserialize ISO-8601 formatted string into Date object. - :param str attr: response string to be deserialized. - :rtype: date - :returns: The date object from that input - """ - # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. - if isinstance(attr, date): - return attr - return isodate.parse_date(attr, defaultmonth=None, defaultday=None) - - -def _deserialize_time(attr: typing.Union[str, time]) -> time: - """Deserialize ISO-8601 formatted string into time object. - - :param str attr: response string to be deserialized. - :rtype: datetime.time - :returns: The time object from that input - """ - if isinstance(attr, time): - return attr - return isodate.parse_time(attr) - - -def deserialize_bytes(attr): - if isinstance(attr, (bytes, bytearray)): - return attr - return bytes(base64.b64decode(attr)) - - -def deserialize_duration(attr): - if isinstance(attr, timedelta): - return attr - return isodate.parse_duration(attr) - - -_DESERIALIZE_MAPPING = { - datetime: _deserialize_datetime, - date: _deserialize_date, - time: _deserialize_time, - bytes: deserialize_bytes, - timedelta: deserialize_duration, - typing.Any: lambda x: x, -} - - -def _get_model(module_name: str, model_name: str): - models = {k: v for k, v in sys.modules[module_name].__dict__.items() if isinstance(v, type)} - module_end = module_name.rsplit(".", 1)[0] - module = sys.modules[module_end] - models.update({k: v for k, v in module.__dict__.items() if isinstance(v, type)}) - if isinstance(model_name, str): - model_name = model_name.split(".")[-1] - if model_name not in models: - return model_name - return models[model_name] - - -_UNSET = object() - - -class _MyMutableMapping(MutableMapping[str, typing.Any]): # pylint: disable=unsubscriptable-object - def __init__(self, data: typing.Dict[str, typing.Any]) -> None: - self._data = copy.deepcopy(data) - - def __contains__(self, key: typing.Any) -> bool: - return key in self._data - - def __getitem__(self, key: str) -> typing.Any: - return self._data.__getitem__(key) - - def __setitem__(self, key: str, value: typing.Any) -> None: - self._data.__setitem__(key, value) - - def __delitem__(self, key: str) -> None: - self._data.__delitem__(key) - - def __iter__(self) -> typing.Iterator[typing.Any]: - return self._data.__iter__() - - def __len__(self) -> int: - return self._data.__len__() - - def __ne__(self, other: typing.Any) -> bool: - return not self.__eq__(other) - - def keys(self) -> typing.KeysView[str]: - return self._data.keys() - - def values(self) -> typing.ValuesView[typing.Any]: - return self._data.values() - - def items(self) -> typing.ItemsView[str, typing.Any]: - return self._data.items() - - def get(self, key: str, default: typing.Any = None) -> typing.Any: - try: - return self[key] - except KeyError: - return default - - @typing.overload # type: ignore - def pop(self, key: str) -> typing.Any: # pylint: disable=no-member - ... - - @typing.overload - def pop(self, key: str, default: typing.Any) -> typing.Any: - ... - - def pop(self, key: str, default: typing.Any = _UNSET) -> typing.Any: - if default is _UNSET: - return self._data.pop(key) - return self._data.pop(key, default) - - def popitem(self) -> typing.Tuple[str, typing.Any]: - return self._data.popitem() - - def clear(self) -> None: - self._data.clear() - - def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: - self._data.update(*args, **kwargs) - - @typing.overload # type: ignore - def setdefault(self, key: str) -> typing.Any: - ... - - @typing.overload - def setdefault(self, key: str, default: typing.Any) -> typing.Any: - ... - - def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: - if default is _UNSET: - return self._data.setdefault(key) - return self._data.setdefault(key, default) - - def __eq__(self, other: typing.Any) -> bool: - try: - other_model = self.__class__(other) - except Exception: - return False - return self._data == other_model._data - - def __repr__(self) -> str: - return str(self._data) - - -def _is_model(obj: typing.Any) -> bool: - return getattr(obj, "_is_model", False) - - -def _serialize(o): - if isinstance(o, (bytes, bytearray)): - return _serialize_bytes(o) - try: - # First try datetime.datetime - return _serialize_datetime(o) - except AttributeError: - pass - # Last, try datetime.timedelta - try: - return _timedelta_as_isostr(o) - except AttributeError: - # This will be raised when it hits value.total_seconds in the method above - pass - return o - - -def _get_rest_field( - attr_to_rest_field: typing.Dict[str, "_RestField"], rest_name: str -) -> typing.Optional["_RestField"]: - try: - return next(rf for rf in attr_to_rest_field.values() if rf._rest_name == rest_name) - except StopIteration: - return None - - -def _create_value(rf: typing.Optional["_RestField"], value: typing.Any) -> typing.Any: - return _deserialize(rf._type, value) if (rf and rf._is_model) else _serialize(value) - - -class Model(_MyMutableMapping): - _is_model = True - - def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: - class_name = self.__class__.__name__ - if len(args) > 1: - raise TypeError(f"{class_name}.__init__() takes 2 positional arguments but {len(args) + 1} were given") - dict_to_pass = { - rest_field._rest_name: rest_field._default - for rest_field in self._attr_to_rest_field.values() - if rest_field._default is not _UNSET - } - if args: - dict_to_pass.update( - {k: _create_value(_get_rest_field(self._attr_to_rest_field, k), v) for k, v in args[0].items()} - ) - else: - non_attr_kwargs = [k for k in kwargs if k not in self._attr_to_rest_field] - if non_attr_kwargs: - # actual type errors only throw the first wrong keyword arg they see, so following that. - raise TypeError(f"{class_name}.__init__() got an unexpected keyword argument '{non_attr_kwargs[0]}'") - dict_to_pass.update({self._attr_to_rest_field[k]._rest_name: _serialize(v) for k, v in kwargs.items()}) - super().__init__(dict_to_pass) - - def copy(self) -> "Model": - return Model(self.__dict__) - - def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> "Model": # pylint: disable=unused-argument - # we know the last three classes in mro are going to be 'Model', 'dict', and 'object' - mros = cls.__mro__[:-3][::-1] # ignore model, dict, and object parents, and reverse the mro order - attr_to_rest_field: typing.Dict[str, _RestField] = { # map attribute name to rest_field property - k: v for mro_class in mros for k, v in mro_class.__dict__.items() if k[0] != "_" and hasattr(v, "_type") - } - annotations = { - k: v - for mro_class in mros - if hasattr(mro_class, "__annotations__") # pylint: disable=no-member - for k, v in mro_class.__annotations__.items() # pylint: disable=no-member - } - for attr, rf in attr_to_rest_field.items(): - rf._module = cls.__module__ - if not rf._type: - rf._type = rf._get_deserialize_callable_from_annotation(annotations.get(attr, None)) - if not rf._rest_name_input: - rf._rest_name_input = attr - cls._attr_to_rest_field: typing.Dict[str, _RestField] = dict(attr_to_rest_field.items()) - - return super().__new__(cls) # pylint: disable=no-value-for-parameter - - def __init_subclass__(cls, discriminator: typing.Optional[str] = None) -> None: - for base in cls.__bases__: - if hasattr(base, "__mapping__"): # pylint: disable=no-member - base.__mapping__[discriminator or cls.__name__] = cls # type: ignore # pylint: disable=no-member - - @classmethod - def _get_discriminator(cls) -> typing.Optional[str]: - for v in cls.__dict__.values(): - if isinstance(v, _RestField) and v._is_discriminator: # pylint: disable=protected-access - return v._rest_name # pylint: disable=protected-access - return None - - @classmethod - def _deserialize(cls, data): - if not hasattr(cls, "__mapping__"): # pylint: disable=no-member - return cls(data) - discriminator = cls._get_discriminator() - mapped_cls = cls.__mapping__.get(data.get(discriminator), cls) # pylint: disable=no-member - if mapped_cls == cls: - return cls(data) - return mapped_cls._deserialize(data) # pylint: disable=protected-access - - -def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-return-statements, too-many-statements - annotation: typing.Any, module: typing.Optional[str], rf: typing.Optional["_RestField"] = None -) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: - if not annotation or annotation in [int, float]: - return None - - try: - if module and _is_model(_get_model(module, annotation)): - if rf: - rf._is_model = True - - def _deserialize_model(model_deserializer: typing.Optional[typing.Callable], obj): - if _is_model(obj): - return obj - return _deserialize(model_deserializer, obj) - - return functools.partial(_deserialize_model, _get_model(module, annotation)) - except Exception: - pass - - # is it a literal? - try: - if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports - else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports - - if annotation.__origin__ == Literal: - return None - except AttributeError: - pass - - if getattr(annotation, "__origin__", None) is typing.Union: - - def _deserialize_with_union(union_annotation, obj): - for t in union_annotation.__args__: - try: - return _deserialize(t, obj, module) - except DeserializationError: - pass - raise DeserializationError() - - return functools.partial(_deserialize_with_union, annotation) - - # is it optional? - try: - # right now, assuming we don't have unions, since we're getting rid of the only - # union we used to have in msrest models, which was union of str and enum - if any(a for a in annotation.__args__ if a == type(None)): - - if_obj_deserializer = _get_deserialize_callable_from_annotation( - next(a for a in annotation.__args__ if a != type(None)), module, rf - ) - - def _deserialize_with_optional(if_obj_deserializer: typing.Optional[typing.Callable], obj): - if obj is None: - return obj - return _deserialize_with_callable(if_obj_deserializer, obj) - - return functools.partial(_deserialize_with_optional, if_obj_deserializer) - except AttributeError: - pass - - # is it a forward ref / in quotes? - if isinstance(annotation, (str, typing.ForwardRef)): - try: - model_name = annotation.__forward_arg__ # type: ignore - except AttributeError: - model_name = annotation - if module is not None: - annotation = _get_model(module, model_name) - - try: - if annotation._name == "Dict": - key_deserializer = _get_deserialize_callable_from_annotation(annotation.__args__[0], module, rf) - value_deserializer = _get_deserialize_callable_from_annotation(annotation.__args__[1], module, rf) - - def _deserialize_dict( - key_deserializer: typing.Optional[typing.Callable], - value_deserializer: typing.Optional[typing.Callable], - obj: typing.Dict[typing.Any, typing.Any], - ): - if obj is None: - return obj - return { - _deserialize(key_deserializer, k, module): _deserialize(value_deserializer, v, module) - for k, v in obj.items() - } - - return functools.partial( - _deserialize_dict, - key_deserializer, - value_deserializer, - ) - except (AttributeError, IndexError): - pass - try: - if annotation._name in ["List", "Set", "Tuple", "Sequence"]: - if len(annotation.__args__) > 1: - - def _deserialize_multiple_sequence( - entry_deserializers: typing.List[typing.Optional[typing.Callable]], obj - ): - if obj is None: - return obj - return type(obj)( - _deserialize(deserializer, entry, module) - for entry, deserializer in zip(obj, entry_deserializers) - ) - - entry_deserializers = [ - _get_deserialize_callable_from_annotation(dt, module, rf) for dt in annotation.__args__ - ] - return functools.partial(_deserialize_multiple_sequence, entry_deserializers) - deserializer = _get_deserialize_callable_from_annotation(annotation.__args__[0], module, rf) - - def _deserialize_sequence( - deserializer: typing.Optional[typing.Callable], - obj, - ): - if obj is None: - return obj - return type(obj)(_deserialize(deserializer, entry, module) for entry in obj) - - return functools.partial(_deserialize_sequence, deserializer) - except (TypeError, IndexError, AttributeError, SyntaxError): - pass - - def _deserialize_default( - annotation, - deserializer_from_mapping, - obj, - ): - if obj is None: - return obj - try: - return _deserialize_with_callable(annotation, obj) - except Exception: - pass - return _deserialize_with_callable(deserializer_from_mapping, obj) - - return functools.partial(_deserialize_default, annotation, _DESERIALIZE_MAPPING.get(annotation)) - - -def _deserialize_with_callable( - deserializer: typing.Optional[typing.Callable[[typing.Any], typing.Any]], value: typing.Any -): - try: - if value is None: - return None - if deserializer is None: - return value - if isinstance(deserializer, CaseInsensitiveEnumMeta): - try: - return deserializer(value) - except ValueError: - # for unknown value, return raw value - return value - if isinstance(deserializer, type) and issubclass(deserializer, Model): - return deserializer._deserialize(value) - return typing.cast(typing.Callable[[typing.Any], typing.Any], deserializer)(value) - except Exception as e: - raise DeserializationError() from e - - -def _deserialize(deserializer: typing.Any, value: typing.Any, module: typing.Optional[str] = None) -> typing.Any: - if isinstance(value, PipelineResponse): - value = value.http_response.json() - deserializer = _get_deserialize_callable_from_annotation(deserializer, module) - return _deserialize_with_callable(deserializer, value) - - -class _RestField: - def __init__( - self, - *, - name: typing.Optional[str] = None, - type: typing.Optional[typing.Callable] = None, - is_discriminator: bool = False, - readonly: bool = False, - default: typing.Any = _UNSET, - ): - self._type = type - self._rest_name_input = name - self._module: typing.Optional[str] = None - self._is_discriminator = is_discriminator - self._readonly = readonly - self._is_model = False - self._default = default - - @property - def _rest_name(self) -> str: - if self._rest_name_input is None: - raise ValueError("Rest name was never set") - return self._rest_name_input - - def __get__(self, obj: Model, type=None): - # by this point, type and rest_name will have a value bc we default - # them in __new__ of the Model class - item = obj.get(self._rest_name) - if item is None: - return item - return _deserialize(self._type, _serialize(item)) - - def __set__(self, obj: Model, value) -> None: - if value is None: - # we want to wipe out entries if users set attr to None - try: - obj.__delitem__(self._rest_name) - except KeyError: - pass - return - if self._is_model and not _is_model(value): - obj.__setitem__(self._rest_name, _deserialize(self._type, value)) - obj.__setitem__(self._rest_name, _serialize(value)) - - def _get_deserialize_callable_from_annotation( - self, annotation: typing.Any - ) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: - return _get_deserialize_callable_from_annotation(annotation, self._module, self) - - -def rest_field( - *, - name: typing.Optional[str] = None, - type: typing.Optional[typing.Callable] = None, - readonly: bool = False, - default: typing.Any = _UNSET, -) -> typing.Any: - return _RestField(name=name, type=type, readonly=readonly, default=default) - - -def rest_discriminator( - *, name: typing.Optional[str] = None, type: typing.Optional[typing.Callable] = None -) -> typing.Any: - return _RestField(name=name, type=type, is_discriminator=True) diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_operations/__init__.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_operations/__init__.py deleted file mode 100644 index 51bf5a7f3dcf..000000000000 --- a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_operations/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._operations import EventGridClientOperationsMixin - -from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "EventGridClientOperationsMixin", -] -__all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_operations/_operations.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_operations/_operations.py deleted file mode 100644 index 2cd2e326e91f..000000000000 --- a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_operations/_operations.py +++ /dev/null @@ -1,378 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import json -import sys -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict - -from .. import models as _models -from .._model_base import AzureJSONEncoder -from .._serialization import Serializer -from .._vendor import EventGridClientMixinABC - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_event_grid_publish_event_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: Literal["2018-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) - # Construct URL - _url = "/" - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_event_grid_publish_cloud_event_request(*, content: _models.CloudEventEvent, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: str = kwargs.pop("content_type") - api_version: Literal["2018-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) - # Construct URL - _url = "/" - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["content-type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, content=content, **kwargs) - - -def build_event_grid_publish_event_grid_event_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: Literal["2018-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01")) - # Construct URL - _url = "/" - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -class EventGridClientOperationsMixin(EventGridClientMixinABC): - @overload - def publish_event( # pylint: disable=inconsistent-return-statements - self, events: _models.GeneralEvent, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """publish_event. - - :param events: Required. - :type events: ~eventgrid.models.GeneralEvent - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def publish_event( # pylint: disable=inconsistent-return-statements - self, events: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """publish_event. - - :param events: Required. - :type events: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def publish_event( # pylint: disable=inconsistent-return-statements - self, events: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """publish_event. - - :param events: Required. - :type events: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def publish_event( # pylint: disable=inconsistent-return-statements - self, events: Union[_models.GeneralEvent, JSON, IO], **kwargs: Any - ) -> None: - """publish_event. - - :param events: Is one of the following types: GeneralEvent, JSON, IO Required. - :type events: ~eventgrid.models.GeneralEvent or JSON or IO - :keyword content_type: Body parameter Content-Type. Known values are: application/json. Default - value is None. - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(events, (IO, bytes)): - _content = events - else: - _content = json.dumps(events, cls=AzureJSONEncoder) # type: ignore - - request = build_event_grid_publish_event_request( - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - request.url = self._client.format_url(request.url, **path_format_arguments) - - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) - - @distributed_trace - def publish_cloud_event( # pylint: disable=inconsistent-return-statements - self, events: _models.CloudEventEvent, **kwargs: Any - ) -> None: - """publish_cloud_event. - - :param events: Required. - :type events: ~eventgrid.models.CloudEventEvent - :keyword content_type: Default value is "application/cloudevents-batch+json; charset=utf-8". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: str = kwargs.pop( - "content_type", _headers.pop("content-type", "application/cloudevents-batch+json; charset=utf-8") - ) - cls: ClsType[None] = kwargs.pop("cls", None) - - _content = json.dumps(events, cls=AzureJSONEncoder) # type: ignore - - request = build_event_grid_publish_cloud_event_request( - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - request.url = self._client.format_url(request.url, **path_format_arguments) - - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) - - @overload - def publish_event_grid_event( # pylint: disable=inconsistent-return-statements - self, events: _models.EventGridEvent, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """publish_event_grid_event. - - :param events: Required. - :type events: ~eventgrid.models.EventGridEvent - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def publish_event_grid_event( # pylint: disable=inconsistent-return-statements - self, events: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """publish_event_grid_event. - - :param events: Required. - :type events: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def publish_event_grid_event( # pylint: disable=inconsistent-return-statements - self, events: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """publish_event_grid_event. - - :param events: Required. - :type events: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def publish_event_grid_event( # pylint: disable=inconsistent-return-statements - self, events: Union[_models.EventGridEvent, JSON, IO], **kwargs: Any - ) -> None: - """publish_event_grid_event. - - :param events: Is one of the following types: EventGridEvent, JSON, IO Required. - :type events: ~eventgrid.models.EventGridEvent or JSON or IO - :keyword content_type: Body parameter Content-Type. Known values are: application/json. Default - value is None. - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(events, (IO, bytes)): - _content = events - else: - _content = json.dumps(events, cls=AzureJSONEncoder) # type: ignore - - request = build_event_grid_publish_event_grid_event_request( - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - request.url = self._client.format_url(request.url, **path_format_arguments) - - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_operations/_patch.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_operations/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_patch.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_serialization.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_serialization.py deleted file mode 100644 index f17c068e833e..000000000000 --- a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_serialization.py +++ /dev/null @@ -1,1996 +0,0 @@ -# -------------------------------------------------------------------------- -# -# Copyright (c) Microsoft Corporation. All rights reserved. -# -# The MIT License (MIT) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the ""Software""), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# -# -------------------------------------------------------------------------- - -# pylint: skip-file -# pyright: reportUnnecessaryTypeIgnoreComment=false - -from base64 import b64decode, b64encode -import calendar -import datetime -import decimal -import email -from enum import Enum -import json -import logging -import re -import sys -import codecs -from typing import ( - Dict, - Any, - cast, - Optional, - Union, - AnyStr, - IO, - Mapping, - Callable, - TypeVar, - MutableMapping, - Type, - List, - Mapping, -) - -try: - from urllib import quote # type: ignore -except ImportError: - from urllib.parse import quote -import xml.etree.ElementTree as ET - -import isodate # type: ignore - -from azure.core.exceptions import DeserializationError, SerializationError, raise_with_traceback -from azure.core.serialization import NULL as AzureCoreNull - -_BOM = codecs.BOM_UTF8.decode(encoding="utf-8") - -ModelType = TypeVar("ModelType", bound="Model") -JSON = MutableMapping[str, Any] - - -class RawDeserializer: - - # Accept "text" because we're open minded people... - JSON_REGEXP = re.compile(r"^(application|text)/([a-z+.]+\+)?json$") - - # Name used in context - CONTEXT_NAME = "deserialized_data" - - @classmethod - def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: Optional[str] = None) -> Any: - """Decode data according to content-type. - - Accept a stream of data as well, but will be load at once in memory for now. - - If no content-type, will return the string version (not bytes, not stream) - - :param data: Input, could be bytes or stream (will be decoded with UTF8) or text - :type data: str or bytes or IO - :param str content_type: The content type. - """ - if hasattr(data, "read"): - # Assume a stream - data = cast(IO, data).read() - - if isinstance(data, bytes): - data_as_str = data.decode(encoding="utf-8-sig") - else: - # Explain to mypy the correct type. - data_as_str = cast(str, data) - - # Remove Byte Order Mark if present in string - data_as_str = data_as_str.lstrip(_BOM) - - if content_type is None: - return data - - if cls.JSON_REGEXP.match(content_type): - try: - return json.loads(data_as_str) - except ValueError as err: - raise DeserializationError("JSON is invalid: {}".format(err), err) - elif "xml" in (content_type or []): - try: - - try: - if isinstance(data, unicode): # type: ignore - # If I'm Python 2.7 and unicode XML will scream if I try a "fromstring" on unicode string - data_as_str = data_as_str.encode(encoding="utf-8") # type: ignore - except NameError: - pass - - return ET.fromstring(data_as_str) # nosec - except ET.ParseError: - # It might be because the server has an issue, and returned JSON with - # content-type XML.... - # So let's try a JSON load, and if it's still broken - # let's flow the initial exception - def _json_attemp(data): - try: - return True, json.loads(data) - except ValueError: - return False, None # Don't care about this one - - success, json_result = _json_attemp(data) - if success: - return json_result - # If i'm here, it's not JSON, it's not XML, let's scream - # and raise the last context in this block (the XML exception) - # The function hack is because Py2.7 messes up with exception - # context otherwise. - _LOGGER.critical("Wasn't XML not JSON, failing") - raise_with_traceback(DeserializationError, "XML is invalid") - raise DeserializationError("Cannot deserialize content-type: {}".format(content_type)) - - @classmethod - def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], headers: Mapping) -> Any: - """Deserialize from HTTP response. - - Use bytes and headers to NOT use any requests/aiohttp or whatever - specific implementation. - Headers will tested for "content-type" - """ - # Try to use content-type from headers if available - content_type = None - if "content-type" in headers: - content_type = headers["content-type"].split(";")[0].strip().lower() - # Ouch, this server did not declare what it sent... - # Let's guess it's JSON... - # Also, since Autorest was considering that an empty body was a valid JSON, - # need that test as well.... - else: - content_type = "application/json" - - if body_bytes: - return cls.deserialize_from_text(body_bytes, content_type) - return None - - -try: - basestring # type: ignore - unicode_str = unicode # type: ignore -except NameError: - basestring = str - unicode_str = str - -_LOGGER = logging.getLogger(__name__) - -try: - _long_type = long # type: ignore -except NameError: - _long_type = int - - -class UTC(datetime.tzinfo): - """Time Zone info for handling UTC""" - - def utcoffset(self, dt): - """UTF offset for UTC is 0.""" - return datetime.timedelta(0) - - def tzname(self, dt): - """Timestamp representation.""" - return "Z" - - def dst(self, dt): - """No daylight saving for UTC.""" - return datetime.timedelta(hours=1) - - -try: - from datetime import timezone as _FixedOffset # type: ignore -except ImportError: # Python 2.7 - - class _FixedOffset(datetime.tzinfo): # type: ignore - """Fixed offset in minutes east from UTC. - Copy/pasted from Python doc - :param datetime.timedelta offset: offset in timedelta format - """ - - def __init__(self, offset): - self.__offset = offset - - def utcoffset(self, dt): - return self.__offset - - def tzname(self, dt): - return str(self.__offset.total_seconds() / 3600) - - def __repr__(self): - return "".format(self.tzname(None)) - - def dst(self, dt): - return datetime.timedelta(0) - - def __getinitargs__(self): - return (self.__offset,) - - -try: - from datetime import timezone - - TZ_UTC = timezone.utc -except ImportError: - TZ_UTC = UTC() # type: ignore - -_FLATTEN = re.compile(r"(? None: - self.additional_properties: Dict[str, Any] = {} - for k in kwargs: - if k not in self._attribute_map: - _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) - elif k in self._validation and self._validation[k].get("readonly", False): - _LOGGER.warning("Readonly attribute %s will be ignored in class %s", k, self.__class__) - else: - setattr(self, k, kwargs[k]) - - def __eq__(self, other: Any) -> bool: - """Compare objects by comparing all attributes.""" - if isinstance(other, self.__class__): - return self.__dict__ == other.__dict__ - return False - - def __ne__(self, other: Any) -> bool: - """Compare objects by comparing all attributes.""" - return not self.__eq__(other) - - def __str__(self) -> str: - return str(self.__dict__) - - @classmethod - def enable_additional_properties_sending(cls) -> None: - cls._attribute_map["additional_properties"] = {"key": "", "type": "{object}"} - - @classmethod - def is_xml_model(cls) -> bool: - try: - cls._xml_map # type: ignore - except AttributeError: - return False - return True - - @classmethod - def _create_xml_node(cls): - """Create XML node.""" - try: - xml_map = cls._xml_map # type: ignore - except AttributeError: - xml_map = {} - - return _create_xml_node(xml_map.get("name", cls.__name__), xml_map.get("prefix", None), xml_map.get("ns", None)) - - def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: - """Return the JSON that would be sent to azure from this model. - - This is an alias to `as_dict(full_restapi_key_transformer, keep_readonly=False)`. - - If you want XML serialization, you can pass the kwargs is_xml=True. - - :param bool keep_readonly: If you want to serialize the readonly attributes - :returns: A dict JSON compatible object - :rtype: dict - """ - serializer = Serializer(self._infer_class_models()) - return serializer._serialize(self, keep_readonly=keep_readonly, **kwargs) - - def as_dict( - self, - keep_readonly: bool = True, - key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer, - **kwargs: Any - ) -> JSON: - """Return a dict that can be serialized using json.dump. - - Advanced usage might optionally use a callback as parameter: - - .. code::python - - def my_key_transformer(key, attr_desc, value): - return key - - Key is the attribute name used in Python. Attr_desc - is a dict of metadata. Currently contains 'type' with the - msrest type and 'key' with the RestAPI encoded key. - Value is the current value in this object. - - The string returned will be used to serialize the key. - If the return type is a list, this is considered hierarchical - result dict. - - See the three examples in this file: - - - attribute_transformer - - full_restapi_key_transformer - - last_restapi_key_transformer - - If you want XML serialization, you can pass the kwargs is_xml=True. - - :param function key_transformer: A key transformer function. - :returns: A dict JSON compatible object - :rtype: dict - """ - serializer = Serializer(self._infer_class_models()) - return serializer._serialize(self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs) - - @classmethod - def _infer_class_models(cls): - try: - str_models = cls.__module__.rsplit(".", 1)[0] - models = sys.modules[str_models] - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - if cls.__name__ not in client_models: - raise ValueError("Not Autorest generated code") - except Exception: - # Assume it's not Autorest generated (tests?). Add ourselves as dependencies. - client_models = {cls.__name__: cls} - return client_models - - @classmethod - def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> ModelType: - """Parse a str using the RestAPI syntax and return a model. - - :param str data: A str using RestAPI structure. JSON by default. - :param str content_type: JSON by default, set application/xml if XML. - :returns: An instance of this model - :raises: DeserializationError if something went wrong - """ - deserializer = Deserializer(cls._infer_class_models()) - return deserializer(cls.__name__, data, content_type=content_type) - - @classmethod - def from_dict( - cls: Type[ModelType], - data: Any, - key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, - content_type: Optional[str] = None, - ) -> ModelType: - """Parse a dict using given key extractor return a model. - - By default consider key - extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor - and last_rest_key_case_insensitive_extractor) - - :param dict data: A dict using RestAPI structure - :param str content_type: JSON by default, set application/xml if XML. - :returns: An instance of this model - :raises: DeserializationError if something went wrong - """ - deserializer = Deserializer(cls._infer_class_models()) - deserializer.key_extractors = ( # type: ignore - [ # type: ignore - attribute_key_case_insensitive_extractor, - rest_key_case_insensitive_extractor, - last_rest_key_case_insensitive_extractor, - ] - if key_extractors is None - else key_extractors - ) - return deserializer(cls.__name__, data, content_type=content_type) - - @classmethod - def _flatten_subtype(cls, key, objects): - if "_subtype_map" not in cls.__dict__: - return {} - result = dict(cls._subtype_map[key]) - for valuetype in cls._subtype_map[key].values(): - result.update(objects[valuetype]._flatten_subtype(key, objects)) - return result - - @classmethod - def _classify(cls, response, objects): - """Check the class _subtype_map for any child classes. - We want to ignore any inherited _subtype_maps. - Remove the polymorphic key from the initial data. - """ - for subtype_key in cls.__dict__.get("_subtype_map", {}).keys(): - subtype_value = None - - if not isinstance(response, ET.Element): - rest_api_response_key = cls._get_rest_key_parts(subtype_key)[-1] - subtype_value = response.pop(rest_api_response_key, None) or response.pop(subtype_key, None) - else: - subtype_value = xml_key_extractor(subtype_key, cls._attribute_map[subtype_key], response) - if subtype_value: - # Try to match base class. Can be class name only - # (bug to fix in Autorest to support x-ms-discriminator-name) - if cls.__name__ == subtype_value: - return cls - flatten_mapping_type = cls._flatten_subtype(subtype_key, objects) - try: - return objects[flatten_mapping_type[subtype_value]] # type: ignore - except KeyError: - _LOGGER.warning( - "Subtype value %s has no mapping, use base class %s.", - subtype_value, - cls.__name__, - ) - break - else: - _LOGGER.warning("Discriminator %s is absent or null, use base class %s.", subtype_key, cls.__name__) - break - return cls - - @classmethod - def _get_rest_key_parts(cls, attr_key): - """Get the RestAPI key of this attr, split it and decode part - :param str attr_key: Attribute key must be in attribute_map. - :returns: A list of RestAPI part - :rtype: list - """ - rest_split_key = _FLATTEN.split(cls._attribute_map[attr_key]["key"]) - return [_decode_attribute_map_key(key_part) for key_part in rest_split_key] - - -def _decode_attribute_map_key(key): - """This decode a key in an _attribute_map to the actual key we want to look at - inside the received data. - - :param str key: A key string from the generated code - """ - return key.replace("\\.", ".") - - -class Serializer(object): - """Request object model serializer.""" - - basic_types = {str: "str", int: "int", bool: "bool", float: "float"} - - _xml_basic_types_serializers = {"bool": lambda x: str(x).lower()} - days = {0: "Mon", 1: "Tue", 2: "Wed", 3: "Thu", 4: "Fri", 5: "Sat", 6: "Sun"} - months = { - 1: "Jan", - 2: "Feb", - 3: "Mar", - 4: "Apr", - 5: "May", - 6: "Jun", - 7: "Jul", - 8: "Aug", - 9: "Sep", - 10: "Oct", - 11: "Nov", - 12: "Dec", - } - validation = { - "min_length": lambda x, y: len(x) < y, - "max_length": lambda x, y: len(x) > y, - "minimum": lambda x, y: x < y, - "maximum": lambda x, y: x > y, - "minimum_ex": lambda x, y: x <= y, - "maximum_ex": lambda x, y: x >= y, - "min_items": lambda x, y: len(x) < y, - "max_items": lambda x, y: len(x) > y, - "pattern": lambda x, y: not re.match(y, x, re.UNICODE), - "unique": lambda x, y: len(x) != len(set(x)), - "multiple": lambda x, y: x % y != 0, - } - - def __init__(self, classes: Optional[Mapping[str, Type[ModelType]]] = None): - self.serialize_type = { - "iso-8601": Serializer.serialize_iso, - "rfc-1123": Serializer.serialize_rfc, - "unix-time": Serializer.serialize_unix, - "duration": Serializer.serialize_duration, - "date": Serializer.serialize_date, - "time": Serializer.serialize_time, - "decimal": Serializer.serialize_decimal, - "long": Serializer.serialize_long, - "bytearray": Serializer.serialize_bytearray, - "base64": Serializer.serialize_base64, - "object": self.serialize_object, - "[]": self.serialize_iter, - "{}": self.serialize_dict, - } - self.dependencies: Dict[str, Type[ModelType]] = dict(classes) if classes else {} - self.key_transformer = full_restapi_key_transformer - self.client_side_validation = True - - def _serialize(self, target_obj, data_type=None, **kwargs): - """Serialize data into a string according to type. - - :param target_obj: The data to be serialized. - :param str data_type: The type to be serialized from. - :rtype: str, dict - :raises: SerializationError if serialization fails. - """ - key_transformer = kwargs.get("key_transformer", self.key_transformer) - keep_readonly = kwargs.get("keep_readonly", False) - if target_obj is None: - return None - - attr_name = None - class_name = target_obj.__class__.__name__ - - if data_type: - return self.serialize_data(target_obj, data_type, **kwargs) - - if not hasattr(target_obj, "_attribute_map"): - data_type = type(target_obj).__name__ - if data_type in self.basic_types.values(): - return self.serialize_data(target_obj, data_type, **kwargs) - - # Force "is_xml" kwargs if we detect a XML model - try: - is_xml_model_serialization = kwargs["is_xml"] - except KeyError: - is_xml_model_serialization = kwargs.setdefault("is_xml", target_obj.is_xml_model()) - - serialized = {} - if is_xml_model_serialization: - serialized = target_obj._create_xml_node() - try: - attributes = target_obj._attribute_map - for attr, attr_desc in attributes.items(): - attr_name = attr - if not keep_readonly and target_obj._validation.get(attr_name, {}).get("readonly", False): - continue - - if attr_name == "additional_properties" and attr_desc["key"] == "": - if target_obj.additional_properties is not None: - serialized.update(target_obj.additional_properties) - continue - try: - - orig_attr = getattr(target_obj, attr) - if is_xml_model_serialization: - pass # Don't provide "transformer" for XML for now. Keep "orig_attr" - else: # JSON - keys, orig_attr = key_transformer(attr, attr_desc.copy(), orig_attr) - keys = keys if isinstance(keys, list) else [keys] - - kwargs["serialization_ctxt"] = attr_desc - new_attr = self.serialize_data(orig_attr, attr_desc["type"], **kwargs) - - if is_xml_model_serialization: - xml_desc = attr_desc.get("xml", {}) - xml_name = xml_desc.get("name", attr_desc["key"]) - xml_prefix = xml_desc.get("prefix", None) - xml_ns = xml_desc.get("ns", None) - if xml_desc.get("attr", False): - if xml_ns: - ET.register_namespace(xml_prefix, xml_ns) - xml_name = "{}{}".format(xml_ns, xml_name) - serialized.set(xml_name, new_attr) # type: ignore - continue - if xml_desc.get("text", False): - serialized.text = new_attr # type: ignore - continue - if isinstance(new_attr, list): - serialized.extend(new_attr) # type: ignore - elif isinstance(new_attr, ET.Element): - # If the down XML has no XML/Name, we MUST replace the tag with the local tag. But keeping the namespaces. - if "name" not in getattr(orig_attr, "_xml_map", {}): - splitted_tag = new_attr.tag.split("}") - if len(splitted_tag) == 2: # Namespace - new_attr.tag = "}".join([splitted_tag[0], xml_name]) - else: - new_attr.tag = xml_name - serialized.append(new_attr) # type: ignore - else: # That's a basic type - # Integrate namespace if necessary - local_node = _create_xml_node(xml_name, xml_prefix, xml_ns) - local_node.text = unicode_str(new_attr) - serialized.append(local_node) # type: ignore - else: # JSON - for k in reversed(keys): # type: ignore - new_attr = {k: new_attr} - - _new_attr = new_attr - _serialized = serialized - for k in keys: # type: ignore - if k not in _serialized: - _serialized.update(_new_attr) # type: ignore - _new_attr = _new_attr[k] # type: ignore - _serialized = _serialized[k] - except ValueError: - continue - - except (AttributeError, KeyError, TypeError) as err: - msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) - raise_with_traceback(SerializationError, msg, err) - else: - return serialized - - def body(self, data, data_type, **kwargs): - """Serialize data intended for a request body. - - :param data: The data to be serialized. - :param str data_type: The type to be serialized from. - :rtype: dict - :raises: SerializationError if serialization fails. - :raises: ValueError if data is None - """ - - # Just in case this is a dict - internal_data_type_str = data_type.strip("[]{}") - internal_data_type = self.dependencies.get(internal_data_type_str, None) - try: - is_xml_model_serialization = kwargs["is_xml"] - except KeyError: - if internal_data_type and issubclass(internal_data_type, Model): - is_xml_model_serialization = kwargs.setdefault("is_xml", internal_data_type.is_xml_model()) - else: - is_xml_model_serialization = False - if internal_data_type and not isinstance(internal_data_type, Enum): - try: - deserializer = Deserializer(self.dependencies) - # Since it's on serialization, it's almost sure that format is not JSON REST - # We're not able to deal with additional properties for now. - deserializer.additional_properties_detection = False - if is_xml_model_serialization: - deserializer.key_extractors = [ # type: ignore - attribute_key_case_insensitive_extractor, - ] - else: - deserializer.key_extractors = [ - rest_key_case_insensitive_extractor, - attribute_key_case_insensitive_extractor, - last_rest_key_case_insensitive_extractor, - ] - data = deserializer._deserialize(data_type, data) - except DeserializationError as err: - raise_with_traceback(SerializationError, "Unable to build a model: " + str(err), err) - - return self._serialize(data, data_type, **kwargs) - - def url(self, name, data, data_type, **kwargs): - """Serialize data intended for a URL path. - - :param data: The data to be serialized. - :param str data_type: The type to be serialized from. - :rtype: str - :raises: TypeError if serialization fails. - :raises: ValueError if data is None - """ - try: - output = self.serialize_data(data, data_type, **kwargs) - if data_type == "bool": - output = json.dumps(output) - - if kwargs.get("skip_quote") is True: - output = str(output) - else: - output = quote(str(output), safe="") - except SerializationError: - raise TypeError("{} must be type {}.".format(name, data_type)) - else: - return output - - def query(self, name, data, data_type, **kwargs): - """Serialize data intended for a URL query. - - :param data: The data to be serialized. - :param str data_type: The type to be serialized from. - :rtype: str - :raises: TypeError if serialization fails. - :raises: ValueError if data is None - """ - try: - # Treat the list aside, since we don't want to encode the div separator - if data_type.startswith("["): - internal_data_type = data_type[1:-1] - data = [self.serialize_data(d, internal_data_type, **kwargs) if d is not None else "" for d in data] - if not kwargs.get("skip_quote", False): - data = [quote(str(d), safe="") for d in data] - return str(self.serialize_iter(data, internal_data_type, **kwargs)) - - # Not a list, regular serialization - output = self.serialize_data(data, data_type, **kwargs) - if data_type == "bool": - output = json.dumps(output) - if kwargs.get("skip_quote") is True: - output = str(output) - else: - output = quote(str(output), safe="") - except SerializationError: - raise TypeError("{} must be type {}.".format(name, data_type)) - else: - return str(output) - - def header(self, name, data, data_type, **kwargs): - """Serialize data intended for a request header. - - :param data: The data to be serialized. - :param str data_type: The type to be serialized from. - :rtype: str - :raises: TypeError if serialization fails. - :raises: ValueError if data is None - """ - try: - if data_type in ["[str]"]: - data = ["" if d is None else d for d in data] - - output = self.serialize_data(data, data_type, **kwargs) - if data_type == "bool": - output = json.dumps(output) - except SerializationError: - raise TypeError("{} must be type {}.".format(name, data_type)) - else: - return str(output) - - def serialize_data(self, data, data_type, **kwargs): - """Serialize generic data according to supplied data type. - - :param data: The data to be serialized. - :param str data_type: The type to be serialized from. - :param bool required: Whether it's essential that the data not be - empty or None - :raises: AttributeError if required data is None. - :raises: ValueError if data is None - :raises: SerializationError if serialization fails. - """ - if data is None: - raise ValueError("No value for given attribute") - - try: - if data is AzureCoreNull: - return None - if data_type in self.basic_types.values(): - return self.serialize_basic(data, data_type, **kwargs) - - elif data_type in self.serialize_type: - return self.serialize_type[data_type](data, **kwargs) - - # If dependencies is empty, try with current data class - # It has to be a subclass of Enum anyway - enum_type = self.dependencies.get(data_type, data.__class__) - if issubclass(enum_type, Enum): - return Serializer.serialize_enum(data, enum_obj=enum_type) - - iter_type = data_type[0] + data_type[-1] - if iter_type in self.serialize_type: - return self.serialize_type[iter_type](data, data_type[1:-1], **kwargs) - - except (ValueError, TypeError) as err: - msg = "Unable to serialize value: {!r} as type: {!r}." - raise_with_traceback(SerializationError, msg.format(data, data_type), err) - else: - return self._serialize(data, **kwargs) - - @classmethod - def _get_custom_serializers(cls, data_type, **kwargs): - custom_serializer = kwargs.get("basic_types_serializers", {}).get(data_type) - if custom_serializer: - return custom_serializer - if kwargs.get("is_xml", False): - return cls._xml_basic_types_serializers.get(data_type) - - @classmethod - def serialize_basic(cls, data, data_type, **kwargs): - """Serialize basic builting data type. - Serializes objects to str, int, float or bool. - - Possible kwargs: - - basic_types_serializers dict[str, callable] : If set, use the callable as serializer - - is_xml bool : If set, use xml_basic_types_serializers - - :param data: Object to be serialized. - :param str data_type: Type of object in the iterable. - """ - custom_serializer = cls._get_custom_serializers(data_type, **kwargs) - if custom_serializer: - return custom_serializer(data) - if data_type == "str": - return cls.serialize_unicode(data) - return eval(data_type)(data) # nosec - - @classmethod - def serialize_unicode(cls, data): - """Special handling for serializing unicode strings in Py2. - Encode to UTF-8 if unicode, otherwise handle as a str. - - :param data: Object to be serialized. - :rtype: str - """ - try: # If I received an enum, return its value - return data.value - except AttributeError: - pass - - try: - if isinstance(data, unicode): # type: ignore - # Don't change it, JSON and XML ElementTree are totally able - # to serialize correctly u'' strings - return data - except NameError: - return str(data) - else: - return str(data) - - def serialize_iter(self, data, iter_type, div=None, **kwargs): - """Serialize iterable. - - Supported kwargs: - - serialization_ctxt dict : The current entry of _attribute_map, or same format. - serialization_ctxt['type'] should be same as data_type. - - is_xml bool : If set, serialize as XML - - :param list attr: Object to be serialized. - :param str iter_type: Type of object in the iterable. - :param bool required: Whether the objects in the iterable must - not be None or empty. - :param str div: If set, this str will be used to combine the elements - in the iterable into a combined string. Default is 'None'. - :rtype: list, str - """ - if isinstance(data, str): - raise SerializationError("Refuse str type as a valid iter type.") - - serialization_ctxt = kwargs.get("serialization_ctxt", {}) - is_xml = kwargs.get("is_xml", False) - - serialized = [] - for d in data: - try: - serialized.append(self.serialize_data(d, iter_type, **kwargs)) - except ValueError: - serialized.append(None) - - if div: - serialized = ["" if s is None else str(s) for s in serialized] - serialized = div.join(serialized) - - if "xml" in serialization_ctxt or is_xml: - # XML serialization is more complicated - xml_desc = serialization_ctxt.get("xml", {}) - xml_name = xml_desc.get("name") - if not xml_name: - xml_name = serialization_ctxt["key"] - - # Create a wrap node if necessary (use the fact that Element and list have "append") - is_wrapped = xml_desc.get("wrapped", False) - node_name = xml_desc.get("itemsName", xml_name) - if is_wrapped: - final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) - else: - final_result = [] - # All list elements to "local_node" - for el in serialized: - if isinstance(el, ET.Element): - el_node = el - else: - el_node = _create_xml_node(node_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) - if el is not None: # Otherwise it writes "None" :-p - el_node.text = str(el) - final_result.append(el_node) - return final_result - return serialized - - def serialize_dict(self, attr, dict_type, **kwargs): - """Serialize a dictionary of objects. - - :param dict attr: Object to be serialized. - :param str dict_type: Type of object in the dictionary. - :param bool required: Whether the objects in the dictionary must - not be None or empty. - :rtype: dict - """ - serialization_ctxt = kwargs.get("serialization_ctxt", {}) - serialized = {} - for key, value in attr.items(): - try: - serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs) - except ValueError: - serialized[self.serialize_unicode(key)] = None - - if "xml" in serialization_ctxt: - # XML serialization is more complicated - xml_desc = serialization_ctxt["xml"] - xml_name = xml_desc["name"] - - final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) - for key, value in serialized.items(): - ET.SubElement(final_result, key).text = value - return final_result - - return serialized - - def serialize_object(self, attr, **kwargs): - """Serialize a generic object. - This will be handled as a dictionary. If object passed in is not - a basic type (str, int, float, dict, list) it will simply be - cast to str. - - :param dict attr: Object to be serialized. - :rtype: dict or str - """ - if attr is None: - return None - if isinstance(attr, ET.Element): - return attr - obj_type = type(attr) - if obj_type in self.basic_types: - return self.serialize_basic(attr, self.basic_types[obj_type], **kwargs) - if obj_type is _long_type: - return self.serialize_long(attr) - if obj_type is unicode_str: - return self.serialize_unicode(attr) - if obj_type is datetime.datetime: - return self.serialize_iso(attr) - if obj_type is datetime.date: - return self.serialize_date(attr) - if obj_type is datetime.time: - return self.serialize_time(attr) - if obj_type is datetime.timedelta: - return self.serialize_duration(attr) - if obj_type is decimal.Decimal: - return self.serialize_decimal(attr) - - # If it's a model or I know this dependency, serialize as a Model - elif obj_type in self.dependencies.values() or isinstance(attr, Model): - return self._serialize(attr) - - if obj_type == dict: - serialized = {} - for key, value in attr.items(): - try: - serialized[self.serialize_unicode(key)] = self.serialize_object(value, **kwargs) - except ValueError: - serialized[self.serialize_unicode(key)] = None - return serialized - - if obj_type == list: - serialized = [] - for obj in attr: - try: - serialized.append(self.serialize_object(obj, **kwargs)) - except ValueError: - pass - return serialized - return str(attr) - - @staticmethod - def serialize_enum(attr, enum_obj=None): - try: - result = attr.value - except AttributeError: - result = attr - try: - enum_obj(result) # type: ignore - return result - except ValueError: - for enum_value in enum_obj: # type: ignore - if enum_value.value.lower() == str(attr).lower(): - return enum_value.value - error = "{!r} is not valid value for enum {!r}" - raise SerializationError(error.format(attr, enum_obj)) - - @staticmethod - def serialize_bytearray(attr, **kwargs): - """Serialize bytearray into base-64 string. - - :param attr: Object to be serialized. - :rtype: str - """ - return b64encode(attr).decode() - - @staticmethod - def serialize_base64(attr, **kwargs): - """Serialize str into base-64 string. - - :param attr: Object to be serialized. - :rtype: str - """ - encoded = b64encode(attr).decode("ascii") - return encoded.strip("=").replace("+", "-").replace("/", "_") - - @staticmethod - def serialize_decimal(attr, **kwargs): - """Serialize Decimal object to float. - - :param attr: Object to be serialized. - :rtype: float - """ - return float(attr) - - @staticmethod - def serialize_long(attr, **kwargs): - """Serialize long (Py2) or int (Py3). - - :param attr: Object to be serialized. - :rtype: int/long - """ - return _long_type(attr) - - @staticmethod - def serialize_date(attr, **kwargs): - """Serialize Date object into ISO-8601 formatted string. - - :param Date attr: Object to be serialized. - :rtype: str - """ - if isinstance(attr, str): - attr = isodate.parse_date(attr) - t = "{:04}-{:02}-{:02}".format(attr.year, attr.month, attr.day) - return t - - @staticmethod - def serialize_time(attr, **kwargs): - """Serialize Time object into ISO-8601 formatted string. - - :param datetime.time attr: Object to be serialized. - :rtype: str - """ - if isinstance(attr, str): - attr = isodate.parse_time(attr) - t = "{:02}:{:02}:{:02}".format(attr.hour, attr.minute, attr.second) - if attr.microsecond: - t += ".{:02}".format(attr.microsecond) - return t - - @staticmethod - def serialize_duration(attr, **kwargs): - """Serialize TimeDelta object into ISO-8601 formatted string. - - :param TimeDelta attr: Object to be serialized. - :rtype: str - """ - if isinstance(attr, str): - attr = isodate.parse_duration(attr) - return isodate.duration_isoformat(attr) - - @staticmethod - def serialize_rfc(attr, **kwargs): - """Serialize Datetime object into RFC-1123 formatted string. - - :param Datetime attr: Object to be serialized. - :rtype: str - :raises: TypeError if format invalid. - """ - try: - if not attr.tzinfo: - _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") - utc = attr.utctimetuple() - except AttributeError: - raise TypeError("RFC1123 object must be valid Datetime object.") - - return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format( - Serializer.days[utc.tm_wday], - utc.tm_mday, - Serializer.months[utc.tm_mon], - utc.tm_year, - utc.tm_hour, - utc.tm_min, - utc.tm_sec, - ) - - @staticmethod - def serialize_iso(attr, **kwargs): - """Serialize Datetime object into ISO-8601 formatted string. - - :param Datetime attr: Object to be serialized. - :rtype: str - :raises: SerializationError if format invalid. - """ - if isinstance(attr, str): - attr = isodate.parse_datetime(attr) - try: - if not attr.tzinfo: - _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") - utc = attr.utctimetuple() - if utc.tm_year > 9999 or utc.tm_year < 1: - raise OverflowError("Hit max or min date") - - microseconds = str(attr.microsecond).rjust(6, "0").rstrip("0").ljust(3, "0") - if microseconds: - microseconds = "." + microseconds - date = "{:04}-{:02}-{:02}T{:02}:{:02}:{:02}".format( - utc.tm_year, utc.tm_mon, utc.tm_mday, utc.tm_hour, utc.tm_min, utc.tm_sec - ) - return date + microseconds + "Z" - except (ValueError, OverflowError) as err: - msg = "Unable to serialize datetime object." - raise_with_traceback(SerializationError, msg, err) - except AttributeError as err: - msg = "ISO-8601 object must be valid Datetime object." - raise_with_traceback(TypeError, msg, err) - - @staticmethod - def serialize_unix(attr, **kwargs): - """Serialize Datetime object into IntTime format. - This is represented as seconds. - - :param Datetime attr: Object to be serialized. - :rtype: int - :raises: SerializationError if format invalid - """ - if isinstance(attr, int): - return attr - try: - if not attr.tzinfo: - _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") - return int(calendar.timegm(attr.utctimetuple())) - except AttributeError: - raise TypeError("Unix time object must be valid Datetime object.") - - -def rest_key_extractor(attr, attr_desc, data): - key = attr_desc["key"] - working_data = data - - while "." in key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - dict_keys = cast(List[str], _FLATTEN.split(key)) - if len(dict_keys) == 1: - key = _decode_attribute_map_key(dict_keys[0]) - break - working_key = _decode_attribute_map_key(dict_keys[0]) - working_data = working_data.get(working_key, data) - if working_data is None: - # If at any point while following flatten JSON path see None, it means - # that all properties under are None as well - # https://github.com/Azure/msrest-for-python/issues/197 - return None - key = ".".join(dict_keys[1:]) - - return working_data.get(key) - - -def rest_key_case_insensitive_extractor(attr, attr_desc, data): - key = attr_desc["key"] - working_data = data - - while "." in key: - dict_keys = _FLATTEN.split(key) - if len(dict_keys) == 1: - key = _decode_attribute_map_key(dict_keys[0]) - break - working_key = _decode_attribute_map_key(dict_keys[0]) - working_data = attribute_key_case_insensitive_extractor(working_key, None, working_data) - if working_data is None: - # If at any point while following flatten JSON path see None, it means - # that all properties under are None as well - # https://github.com/Azure/msrest-for-python/issues/197 - return None - key = ".".join(dict_keys[1:]) - - if working_data: - return attribute_key_case_insensitive_extractor(key, None, working_data) - - -def last_rest_key_extractor(attr, attr_desc, data): - """Extract the attribute in "data" based on the last part of the JSON path key.""" - key = attr_desc["key"] - dict_keys = _FLATTEN.split(key) - return attribute_key_extractor(dict_keys[-1], None, data) - - -def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): - """Extract the attribute in "data" based on the last part of the JSON path key. - - This is the case insensitive version of "last_rest_key_extractor" - """ - key = attr_desc["key"] - dict_keys = _FLATTEN.split(key) - return attribute_key_case_insensitive_extractor(dict_keys[-1], None, data) - - -def attribute_key_extractor(attr, _, data): - return data.get(attr) - - -def attribute_key_case_insensitive_extractor(attr, _, data): - found_key = None - lower_attr = attr.lower() - for key in data: - if lower_attr == key.lower(): - found_key = key - break - - return data.get(found_key) - - -def _extract_name_from_internal_type(internal_type): - """Given an internal type XML description, extract correct XML name with namespace. - - :param dict internal_type: An model type - :rtype: tuple - :returns: A tuple XML name + namespace dict - """ - internal_type_xml_map = getattr(internal_type, "_xml_map", {}) - xml_name = internal_type_xml_map.get("name", internal_type.__name__) - xml_ns = internal_type_xml_map.get("ns", None) - if xml_ns: - xml_name = "{}{}".format(xml_ns, xml_name) - return xml_name - - -def xml_key_extractor(attr, attr_desc, data): - if isinstance(data, dict): - return None - - # Test if this model is XML ready first - if not isinstance(data, ET.Element): - return None - - xml_desc = attr_desc.get("xml", {}) - xml_name = xml_desc.get("name", attr_desc["key"]) - - # Look for a children - is_iter_type = attr_desc["type"].startswith("[") - is_wrapped = xml_desc.get("wrapped", False) - internal_type = attr_desc.get("internalType", None) - internal_type_xml_map = getattr(internal_type, "_xml_map", {}) - - # Integrate namespace if necessary - xml_ns = xml_desc.get("ns", internal_type_xml_map.get("ns", None)) - if xml_ns: - xml_name = "{}{}".format(xml_ns, xml_name) - - # If it's an attribute, that's simple - if xml_desc.get("attr", False): - return data.get(xml_name) - - # If it's x-ms-text, that's simple too - if xml_desc.get("text", False): - return data.text - - # Scenario where I take the local name: - # - Wrapped node - # - Internal type is an enum (considered basic types) - # - Internal type has no XML/Name node - if is_wrapped or (internal_type and (issubclass(internal_type, Enum) or "name" not in internal_type_xml_map)): - children = data.findall(xml_name) - # If internal type has a local name and it's not a list, I use that name - elif not is_iter_type and internal_type and "name" in internal_type_xml_map: - xml_name = _extract_name_from_internal_type(internal_type) - children = data.findall(xml_name) - # That's an array - else: - if internal_type: # Complex type, ignore itemsName and use the complex type name - items_name = _extract_name_from_internal_type(internal_type) - else: - items_name = xml_desc.get("itemsName", xml_name) - children = data.findall(items_name) - - if len(children) == 0: - if is_iter_type: - if is_wrapped: - return None # is_wrapped no node, we want None - else: - return [] # not wrapped, assume empty list - return None # Assume it's not there, maybe an optional node. - - # If is_iter_type and not wrapped, return all found children - if is_iter_type: - if not is_wrapped: - return children - else: # Iter and wrapped, should have found one node only (the wrap one) - if len(children) != 1: - raise DeserializationError( - "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( - xml_name - ) - ) - return list(children[0]) # Might be empty list and that's ok. - - # Here it's not a itertype, we should have found one element only or empty - if len(children) > 1: - raise DeserializationError("Find several XML '{}' where it was not expected".format(xml_name)) - return children[0] - - -class Deserializer(object): - """Response object model deserializer. - - :param dict classes: Class type dictionary for deserializing complex types. - :ivar list key_extractors: Ordered list of extractors to be used by this deserializer. - """ - - basic_types = {str: "str", int: "int", bool: "bool", float: "float"} - - valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") - - def __init__(self, classes: Optional[Mapping[str, Type[ModelType]]] = None): - self.deserialize_type = { - "iso-8601": Deserializer.deserialize_iso, - "rfc-1123": Deserializer.deserialize_rfc, - "unix-time": Deserializer.deserialize_unix, - "duration": Deserializer.deserialize_duration, - "date": Deserializer.deserialize_date, - "time": Deserializer.deserialize_time, - "decimal": Deserializer.deserialize_decimal, - "long": Deserializer.deserialize_long, - "bytearray": Deserializer.deserialize_bytearray, - "base64": Deserializer.deserialize_base64, - "object": self.deserialize_object, - "[]": self.deserialize_iter, - "{}": self.deserialize_dict, - } - self.deserialize_expected_types = { - "duration": (isodate.Duration, datetime.timedelta), - "iso-8601": (datetime.datetime), - } - self.dependencies: Dict[str, Type[ModelType]] = dict(classes) if classes else {} - self.key_extractors = [rest_key_extractor, xml_key_extractor] - # Additional properties only works if the "rest_key_extractor" is used to - # extract the keys. Making it to work whatever the key extractor is too much - # complicated, with no real scenario for now. - # So adding a flag to disable additional properties detection. This flag should be - # used if your expect the deserialization to NOT come from a JSON REST syntax. - # Otherwise, result are unexpected - self.additional_properties_detection = True - - def __call__(self, target_obj, response_data, content_type=None): - """Call the deserializer to process a REST response. - - :param str target_obj: Target data type to deserialize to. - :param requests.Response response_data: REST response object. - :param str content_type: Swagger "produces" if available. - :raises: DeserializationError if deserialization fails. - :return: Deserialized object. - """ - data = self._unpack_content(response_data, content_type) - return self._deserialize(target_obj, data) - - def _deserialize(self, target_obj, data): - """Call the deserializer on a model. - - Data needs to be already deserialized as JSON or XML ElementTree - - :param str target_obj: Target data type to deserialize to. - :param object data: Object to deserialize. - :raises: DeserializationError if deserialization fails. - :return: Deserialized object. - """ - # This is already a model, go recursive just in case - if hasattr(data, "_attribute_map"): - constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")] - try: - for attr, mapconfig in data._attribute_map.items(): - if attr in constants: - continue - value = getattr(data, attr) - if value is None: - continue - local_type = mapconfig["type"] - internal_data_type = local_type.strip("[]{}") - if internal_data_type not in self.dependencies or isinstance(internal_data_type, Enum): - continue - setattr(data, attr, self._deserialize(local_type, value)) - return data - except AttributeError: - return - - response, class_name = self._classify_target(target_obj, data) - - if isinstance(response, basestring): - return self.deserialize_data(data, response) - elif isinstance(response, type) and issubclass(response, Enum): - return self.deserialize_enum(data, response) - - if data is None: - return data - try: - attributes = response._attribute_map # type: ignore - d_attrs = {} - for attr, attr_desc in attributes.items(): - # Check empty string. If it's not empty, someone has a real "additionalProperties"... - if attr == "additional_properties" and attr_desc["key"] == "": - continue - raw_value = None - # Enhance attr_desc with some dynamic data - attr_desc = attr_desc.copy() # Do a copy, do not change the real one - internal_data_type = attr_desc["type"].strip("[]{}") - if internal_data_type in self.dependencies: - attr_desc["internalType"] = self.dependencies[internal_data_type] - - for key_extractor in self.key_extractors: - found_value = key_extractor(attr, attr_desc, data) - if found_value is not None: - if raw_value is not None and raw_value != found_value: - msg = ( - "Ignoring extracted value '%s' from %s for key '%s'" - " (duplicate extraction, follow extractors order)" - ) - _LOGGER.warning(msg, found_value, key_extractor, attr) - continue - raw_value = found_value - - value = self.deserialize_data(raw_value, attr_desc["type"]) - d_attrs[attr] = value - except (AttributeError, TypeError, KeyError) as err: - msg = "Unable to deserialize to object: " + class_name # type: ignore - raise_with_traceback(DeserializationError, msg, err) - else: - additional_properties = self._build_additional_properties(attributes, data) - return self._instantiate_model(response, d_attrs, additional_properties) - - def _build_additional_properties(self, attribute_map, data): - if not self.additional_properties_detection: - return None - if "additional_properties" in attribute_map and attribute_map.get("additional_properties", {}).get("key") != "": - # Check empty string. If it's not empty, someone has a real "additionalProperties" - return None - if isinstance(data, ET.Element): - data = {el.tag: el.text for el in data} - - known_keys = { - _decode_attribute_map_key(_FLATTEN.split(desc["key"])[0]) - for desc in attribute_map.values() - if desc["key"] != "" - } - present_keys = set(data.keys()) - missing_keys = present_keys - known_keys - return {key: data[key] for key in missing_keys} - - def _classify_target(self, target, data): - """Check to see whether the deserialization target object can - be classified into a subclass. - Once classification has been determined, initialize object. - - :param str target: The target object type to deserialize to. - :param str/dict data: The response data to deserialize. - """ - if target is None: - return None, None - - if isinstance(target, basestring): - try: - target = self.dependencies[target] - except KeyError: - return target, target - - try: - target = target._classify(data, self.dependencies) - except AttributeError: - pass # Target is not a Model, no classify - return target, target.__class__.__name__ # type: ignore - - def failsafe_deserialize(self, target_obj, data, content_type=None): - """Ignores any errors encountered in deserialization, - and falls back to not deserializing the object. Recommended - for use in error deserialization, as we want to return the - HttpResponseError to users, and not have them deal with - a deserialization error. - - :param str target_obj: The target object type to deserialize to. - :param str/dict data: The response data to deserialize. - :param str content_type: Swagger "produces" if available. - """ - try: - return self(target_obj, data, content_type=content_type) - except: - _LOGGER.debug( - "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True - ) - return None - - @staticmethod - def _unpack_content(raw_data, content_type=None): - """Extract the correct structure for deserialization. - - If raw_data is a PipelineResponse, try to extract the result of RawDeserializer. - if we can't, raise. Your Pipeline should have a RawDeserializer. - - If not a pipeline response and raw_data is bytes or string, use content-type - to decode it. If no content-type, try JSON. - - If raw_data is something else, bypass all logic and return it directly. - - :param raw_data: Data to be processed. - :param content_type: How to parse if raw_data is a string/bytes. - :raises JSONDecodeError: If JSON is requested and parsing is impossible. - :raises UnicodeDecodeError: If bytes is not UTF8 - """ - # Assume this is enough to detect a Pipeline Response without importing it - context = getattr(raw_data, "context", {}) - if context: - if RawDeserializer.CONTEXT_NAME in context: - return context[RawDeserializer.CONTEXT_NAME] - raise ValueError("This pipeline didn't have the RawDeserializer policy; can't deserialize") - - # Assume this is enough to recognize universal_http.ClientResponse without importing it - if hasattr(raw_data, "body"): - return RawDeserializer.deserialize_from_http_generics(raw_data.text(), raw_data.headers) - - # Assume this enough to recognize requests.Response without importing it. - if hasattr(raw_data, "_content_consumed"): - return RawDeserializer.deserialize_from_http_generics(raw_data.text, raw_data.headers) - - if isinstance(raw_data, (basestring, bytes)) or hasattr(raw_data, "read"): - return RawDeserializer.deserialize_from_text(raw_data, content_type) # type: ignore - return raw_data - - def _instantiate_model(self, response, attrs, additional_properties=None): - """Instantiate a response model passing in deserialized args. - - :param response: The response model class. - :param d_attrs: The deserialized response attributes. - """ - if callable(response): - subtype = getattr(response, "_subtype_map", {}) - try: - readonly = [k for k, v in response._validation.items() if v.get("readonly")] - const = [k for k, v in response._validation.items() if v.get("constant")] - kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const} - response_obj = response(**kwargs) - for attr in readonly: - setattr(response_obj, attr, attrs.get(attr)) - if additional_properties: - response_obj.additional_properties = additional_properties - return response_obj - except TypeError as err: - msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore - raise DeserializationError(msg + str(err)) - else: - try: - for attr, value in attrs.items(): - setattr(response, attr, value) - return response - except Exception as exp: - msg = "Unable to populate response model. " - msg += "Type: {}, Error: {}".format(type(response), exp) - raise DeserializationError(msg) - - def deserialize_data(self, data, data_type): - """Process data for deserialization according to data type. - - :param str data: The response string to be deserialized. - :param str data_type: The type to deserialize to. - :raises: DeserializationError if deserialization fails. - :return: Deserialized object. - """ - if data is None: - return data - - try: - if not data_type: - return data - if data_type in self.basic_types.values(): - return self.deserialize_basic(data, data_type) - if data_type in self.deserialize_type: - if isinstance(data, self.deserialize_expected_types.get(data_type, tuple())): - return data - - is_a_text_parsing_type = lambda x: x not in ["object", "[]", r"{}"] - if isinstance(data, ET.Element) and is_a_text_parsing_type(data_type) and not data.text: - return None - data_val = self.deserialize_type[data_type](data) - return data_val - - iter_type = data_type[0] + data_type[-1] - if iter_type in self.deserialize_type: - return self.deserialize_type[iter_type](data, data_type[1:-1]) - - obj_type = self.dependencies[data_type] - if issubclass(obj_type, Enum): - if isinstance(data, ET.Element): - data = data.text - return self.deserialize_enum(data, obj_type) - - except (ValueError, TypeError, AttributeError) as err: - msg = "Unable to deserialize response data." - msg += " Data: {}, {}".format(data, data_type) - raise_with_traceback(DeserializationError, msg, err) - else: - return self._deserialize(obj_type, data) - - def deserialize_iter(self, attr, iter_type): - """Deserialize an iterable. - - :param list attr: Iterable to be deserialized. - :param str iter_type: The type of object in the iterable. - :rtype: list - """ - if attr is None: - return None - if isinstance(attr, ET.Element): # If I receive an element here, get the children - attr = list(attr) - if not isinstance(attr, (list, set)): - raise DeserializationError("Cannot deserialize as [{}] an object of type {}".format(iter_type, type(attr))) - return [self.deserialize_data(a, iter_type) for a in attr] - - def deserialize_dict(self, attr, dict_type): - """Deserialize a dictionary. - - :param dict/list attr: Dictionary to be deserialized. Also accepts - a list of key, value pairs. - :param str dict_type: The object type of the items in the dictionary. - :rtype: dict - """ - if isinstance(attr, list): - return {x["key"]: self.deserialize_data(x["value"], dict_type) for x in attr} - - if isinstance(attr, ET.Element): - # Transform value into {"Key": "value"} - attr = {el.tag: el.text for el in attr} - return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()} - - def deserialize_object(self, attr, **kwargs): - """Deserialize a generic object. - This will be handled as a dictionary. - - :param dict attr: Dictionary to be deserialized. - :rtype: dict - :raises: TypeError if non-builtin datatype encountered. - """ - if attr is None: - return None - if isinstance(attr, ET.Element): - # Do no recurse on XML, just return the tree as-is - return attr - if isinstance(attr, basestring): - return self.deserialize_basic(attr, "str") - obj_type = type(attr) - if obj_type in self.basic_types: - return self.deserialize_basic(attr, self.basic_types[obj_type]) - if obj_type is _long_type: - return self.deserialize_long(attr) - - if obj_type == dict: - deserialized = {} - for key, value in attr.items(): - try: - deserialized[key] = self.deserialize_object(value, **kwargs) - except ValueError: - deserialized[key] = None - return deserialized - - if obj_type == list: - deserialized = [] - for obj in attr: - try: - deserialized.append(self.deserialize_object(obj, **kwargs)) - except ValueError: - pass - return deserialized - - else: - error = "Cannot deserialize generic object with type: " - raise TypeError(error + str(obj_type)) - - def deserialize_basic(self, attr, data_type): - """Deserialize basic builtin data type from string. - Will attempt to convert to str, int, float and bool. - This function will also accept '1', '0', 'true' and 'false' as - valid bool values. - - :param str attr: response string to be deserialized. - :param str data_type: deserialization data type. - :rtype: str, int, float or bool - :raises: TypeError if string format is not valid. - """ - # If we're here, data is supposed to be a basic type. - # If it's still an XML node, take the text - if isinstance(attr, ET.Element): - attr = attr.text - if not attr: - if data_type == "str": - # None or '', node is empty string. - return "" - else: - # None or '', node with a strong type is None. - # Don't try to model "empty bool" or "empty int" - return None - - if data_type == "bool": - if attr in [True, False, 1, 0]: - return bool(attr) - elif isinstance(attr, basestring): - if attr.lower() in ["true", "1"]: - return True - elif attr.lower() in ["false", "0"]: - return False - raise TypeError("Invalid boolean value: {}".format(attr)) - - if data_type == "str": - return self.deserialize_unicode(attr) - return eval(data_type)(attr) # nosec - - @staticmethod - def deserialize_unicode(data): - """Preserve unicode objects in Python 2, otherwise return data - as a string. - - :param str data: response string to be deserialized. - :rtype: str or unicode - """ - # We might be here because we have an enum modeled as string, - # and we try to deserialize a partial dict with enum inside - if isinstance(data, Enum): - return data - - # Consider this is real string - try: - if isinstance(data, unicode): # type: ignore - return data - except NameError: - return str(data) - else: - return str(data) - - @staticmethod - def deserialize_enum(data, enum_obj): - """Deserialize string into enum object. - - If the string is not a valid enum value it will be returned as-is - and a warning will be logged. - - :param str data: Response string to be deserialized. If this value is - None or invalid it will be returned as-is. - :param Enum enum_obj: Enum object to deserialize to. - :rtype: Enum - """ - if isinstance(data, enum_obj) or data is None: - return data - if isinstance(data, Enum): - data = data.value - if isinstance(data, int): - # Workaround. We might consider remove it in the future. - # https://github.com/Azure/azure-rest-api-specs/issues/141 - try: - return list(enum_obj.__members__.values())[data] - except IndexError: - error = "{!r} is not a valid index for enum {!r}" - raise DeserializationError(error.format(data, enum_obj)) - try: - return enum_obj(str(data)) - except ValueError: - for enum_value in enum_obj: - if enum_value.value.lower() == str(data).lower(): - return enum_value - # We don't fail anymore for unknown value, we deserialize as a string - _LOGGER.warning("Deserializer is not able to find %s as valid enum in %s", data, enum_obj) - return Deserializer.deserialize_unicode(data) - - @staticmethod - def deserialize_bytearray(attr): - """Deserialize string into bytearray. - - :param str attr: response string to be deserialized. - :rtype: bytearray - :raises: TypeError if string format invalid. - """ - if isinstance(attr, ET.Element): - attr = attr.text - return bytearray(b64decode(attr)) # type: ignore - - @staticmethod - def deserialize_base64(attr): - """Deserialize base64 encoded string into string. - - :param str attr: response string to be deserialized. - :rtype: bytearray - :raises: TypeError if string format invalid. - """ - if isinstance(attr, ET.Element): - attr = attr.text - padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore - attr = attr + padding # type: ignore - encoded = attr.replace("-", "+").replace("_", "/") - return b64decode(encoded) - - @staticmethod - def deserialize_decimal(attr): - """Deserialize string into Decimal object. - - :param str attr: response string to be deserialized. - :rtype: Decimal - :raises: DeserializationError if string format invalid. - """ - if isinstance(attr, ET.Element): - attr = attr.text - try: - return decimal.Decimal(attr) # type: ignore - except decimal.DecimalException as err: - msg = "Invalid decimal {}".format(attr) - raise_with_traceback(DeserializationError, msg, err) - - @staticmethod - def deserialize_long(attr): - """Deserialize string into long (Py2) or int (Py3). - - :param str attr: response string to be deserialized. - :rtype: long or int - :raises: ValueError if string format invalid. - """ - if isinstance(attr, ET.Element): - attr = attr.text - return _long_type(attr) # type: ignore - - @staticmethod - def deserialize_duration(attr): - """Deserialize ISO-8601 formatted string into TimeDelta object. - - :param str attr: response string to be deserialized. - :rtype: TimeDelta - :raises: DeserializationError if string format invalid. - """ - if isinstance(attr, ET.Element): - attr = attr.text - try: - duration = isodate.parse_duration(attr) - except (ValueError, OverflowError, AttributeError) as err: - msg = "Cannot deserialize duration object." - raise_with_traceback(DeserializationError, msg, err) - else: - return duration - - @staticmethod - def deserialize_date(attr): - """Deserialize ISO-8601 formatted string into Date object. - - :param str attr: response string to be deserialized. - :rtype: Date - :raises: DeserializationError if string format invalid. - """ - if isinstance(attr, ET.Element): - attr = attr.text - if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore - raise DeserializationError("Date must have only digits and -. Received: %s" % attr) - # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. - return isodate.parse_date(attr, defaultmonth=None, defaultday=None) - - @staticmethod - def deserialize_time(attr): - """Deserialize ISO-8601 formatted string into time object. - - :param str attr: response string to be deserialized. - :rtype: datetime.time - :raises: DeserializationError if string format invalid. - """ - if isinstance(attr, ET.Element): - attr = attr.text - if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore - raise DeserializationError("Date must have only digits and -. Received: %s" % attr) - return isodate.parse_time(attr) - - @staticmethod - def deserialize_rfc(attr): - """Deserialize RFC-1123 formatted string into Datetime object. - - :param str attr: response string to be deserialized. - :rtype: Datetime - :raises: DeserializationError if string format invalid. - """ - if isinstance(attr, ET.Element): - attr = attr.text - try: - parsed_date = email.utils.parsedate_tz(attr) # type: ignore - date_obj = datetime.datetime( - *parsed_date[:6], tzinfo=_FixedOffset(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) - ) - if not date_obj.tzinfo: - date_obj = date_obj.astimezone(tz=TZ_UTC) - except ValueError as err: - msg = "Cannot deserialize to rfc datetime object." - raise_with_traceback(DeserializationError, msg, err) - else: - return date_obj - - @staticmethod - def deserialize_iso(attr): - """Deserialize ISO-8601 formatted string into Datetime object. - - :param str attr: response string to be deserialized. - :rtype: Datetime - :raises: DeserializationError if string format invalid. - """ - if isinstance(attr, ET.Element): - attr = attr.text - try: - attr = attr.upper() # type: ignore - match = Deserializer.valid_date.match(attr) - if not match: - raise ValueError("Invalid datetime string: " + attr) - - check_decimal = attr.split(".") - if len(check_decimal) > 1: - decimal_str = "" - for digit in check_decimal[1]: - if digit.isdigit(): - decimal_str += digit - else: - break - if len(decimal_str) > 6: - attr = attr.replace(decimal_str, decimal_str[0:6]) - - date_obj = isodate.parse_datetime(attr) - test_utc = date_obj.utctimetuple() - if test_utc.tm_year > 9999 or test_utc.tm_year < 1: - raise OverflowError("Hit max or min date") - except (ValueError, OverflowError, AttributeError) as err: - msg = "Cannot deserialize datetime object." - raise_with_traceback(DeserializationError, msg, err) - else: - return date_obj - - @staticmethod - def deserialize_unix(attr): - """Serialize Datetime object into IntTime format. - This is represented as seconds. - - :param int attr: Object to be serialized. - :rtype: Datetime - :raises: DeserializationError if format invalid - """ - if isinstance(attr, ET.Element): - attr = int(attr.text) # type: ignore - try: - date_obj = datetime.datetime.fromtimestamp(attr, TZ_UTC) - except ValueError as err: - msg = "Cannot deserialize to unix datetime object." - raise_with_traceback(DeserializationError, msg, err) - else: - return date_obj diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_vendor.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_vendor.py deleted file mode 100644 index 59d8335b5c63..000000000000 --- a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_vendor.py +++ /dev/null @@ -1,26 +0,0 @@ -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from abc import ABC -from typing import TYPE_CHECKING - -from ._configuration import EventGridClientConfiguration - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core import PipelineClient - - from ._serialization import Deserializer, Serializer - - -class EventGridClientMixinABC(ABC): - """DO NOT use this class. It is for internal typing use only.""" - - _client: "PipelineClient" - _config: EventGridClientConfiguration - _serialize: "Serializer" - _deserialize: "Deserializer" diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_version.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_version.py deleted file mode 100644 index be71c81bd282..000000000000 --- a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/_version.py +++ /dev/null @@ -1,9 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -VERSION = "1.0.0b1" diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/__init__.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/__init__.py deleted file mode 100644 index 5a6ddd0f6e2b..000000000000 --- a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/__init__.py +++ /dev/null @@ -1,23 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._client import EventGridClient - -try: - from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "EventGridClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) - -_patch_sdk() diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_client.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_client.py deleted file mode 100644 index e750b32d4902..000000000000 --- a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_client.py +++ /dev/null @@ -1,85 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from copy import deepcopy -from typing import Any, Awaitable, TYPE_CHECKING, Union - -from azure.core import AsyncPipelineClient -from azure.core.credentials import AzureKeyCredential -from azure.core.rest import AsyncHttpResponse, HttpRequest - -from .._serialization import Deserializer, Serializer -from ._configuration import EventGridClientConfiguration -from ._operations import EventGridClientOperationsMixin - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - - -class EventGridClient(EventGridClientOperationsMixin): # pylint: disable=client-accepts-api-version-keyword - """Azure EventGrid Client. - - :param endpoint: The host name of the topic, e.g. topic1.westus2-1.eventgrid.azure.net. - Required. - :type endpoint: str - :param credential: Credential needed for the client to connect to Azure. Is either a - AzureKeyCredential type or a TokenCredential type. Required. - :type credential: ~azure.core.credentials.AzureKeyCredential or - ~azure.core.credentials_async.AsyncTokenCredential - :keyword api_version: The API version to use for this operation. Default value is "2018-01-01". - Note that overriding this default value may result in unsupported behavior. - :paramtype api_version: str - """ - - def __init__( - self, endpoint: str, credential: Union[AzureKeyCredential, "AsyncTokenCredential"], **kwargs: Any - ) -> None: - _endpoint = "{endpoint}" - self._config = EventGridClientConfiguration(endpoint=endpoint, credential=credential, **kwargs) - self._client = AsyncPipelineClient(base_url=_endpoint, config=self._config, **kwargs) - - self._serialize = Serializer() - self._deserialize = Deserializer() - self._serialize.client_side_validation = False - - def send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = await client.send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.AsyncHttpResponse - """ - - request_copy = deepcopy(request) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - - request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) - return self._client.send_request(request_copy, **kwargs) - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> "EventGridClient": - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details: Any) -> None: - await self._client.__aexit__(*exc_details) diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_configuration.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_configuration.py deleted file mode 100644 index 3dccfbc8c6ef..000000000000 --- a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_configuration.py +++ /dev/null @@ -1,82 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import sys -from typing import Any, TYPE_CHECKING, Union - -from azure.core.configuration import Configuration -from azure.core.credentials import AzureKeyCredential -from azure.core.pipeline import policies - -from .._version import VERSION - -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - - -class EventGridClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes - """Configuration for EventGridClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param endpoint: The host name of the topic, e.g. topic1.westus2-1.eventgrid.azure.net. - Required. - :type endpoint: str - :param credential: Credential needed for the client to connect to Azure. Is either a - AzureKeyCredential type or a TokenCredential type. Required. - :type credential: ~azure.core.credentials.AzureKeyCredential or - ~azure.core.credentials_async.AsyncTokenCredential - :keyword api_version: The API version to use for this operation. Default value is "2018-01-01". - Note that overriding this default value may result in unsupported behavior. - :paramtype api_version: str - """ - - def __init__( - self, endpoint: str, credential: Union[AzureKeyCredential, "AsyncTokenCredential"], **kwargs: Any - ) -> None: - super(EventGridClientConfiguration, self).__init__(**kwargs) - api_version: Literal["2018-01-01"] = kwargs.pop("api_version", "2018-01-01") - - if endpoint is None: - raise ValueError("Parameter 'endpoint' must not be None.") - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - - self.endpoint = endpoint - self.credential = credential - self.api_version = api_version - self.credential_scopes = kwargs.pop("credential_scopes", ["https://eventgrid.azure.net/.default"]) - kwargs.setdefault("sdk_moniker", "eventgridclient/{}".format(VERSION)) - self._configure(**kwargs) - - def _infer_policy(self, **kwargs): - if isinstance(self.credential, AzureKeyCredential): - return policies.AzureKeyCredentialPolicy(self.credential, "aeg-sas-key", **kwargs) - if hasattr(self.credential, "get_token"): - return policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) - raise TypeError(f"Unsupported credential: {self.credential}") - - def _configure(self, **kwargs: Any) -> None: - self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get("http_logging_policy") or policies.HttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get("authentication_policy") - if self.credential and not self.authentication_policy: - self.authentication_policy = self._infer_policy(**kwargs) diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_operations/__init__.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_operations/__init__.py deleted file mode 100644 index 51bf5a7f3dcf..000000000000 --- a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_operations/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._operations import EventGridClientOperationsMixin - -from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "EventGridClientOperationsMixin", -] -__all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_operations/_operations.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_operations/_operations.py deleted file mode 100644 index f57bac1348f7..000000000000 --- a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_operations/_operations.py +++ /dev/null @@ -1,319 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import json -import sys -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict - -from ... import models as _models -from ..._model_base import AzureJSONEncoder -from ..._operations._operations import ( - build_event_grid_publish_cloud_event_request, - build_event_grid_publish_event_grid_event_request, - build_event_grid_publish_event_request, -) -from .._vendor import EventGridClientMixinABC - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class EventGridClientOperationsMixin(EventGridClientMixinABC): - @overload - async def publish_event( # pylint: disable=inconsistent-return-statements - self, events: _models.GeneralEvent, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """publish_event. - - :param events: Required. - :type events: ~eventgrid.models.GeneralEvent - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def publish_event( # pylint: disable=inconsistent-return-statements - self, events: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """publish_event. - - :param events: Required. - :type events: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def publish_event( # pylint: disable=inconsistent-return-statements - self, events: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """publish_event. - - :param events: Required. - :type events: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def publish_event( # pylint: disable=inconsistent-return-statements - self, events: Union[_models.GeneralEvent, JSON, IO], **kwargs: Any - ) -> None: - """publish_event. - - :param events: Is one of the following types: GeneralEvent, JSON, IO Required. - :type events: ~eventgrid.models.GeneralEvent or JSON or IO - :keyword content_type: Body parameter Content-Type. Known values are: application/json. Default - value is None. - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(events, (IO, bytes)): - _content = events - else: - _content = json.dumps(events, cls=AzureJSONEncoder) # type: ignore - - request = build_event_grid_publish_event_request( - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - request.url = self._client.format_url(request.url, **path_format_arguments) - - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) - - @distributed_trace_async - async def publish_cloud_event( # pylint: disable=inconsistent-return-statements - self, events: _models.CloudEventEvent, **kwargs: Any - ) -> None: - """publish_cloud_event. - - :param events: Required. - :type events: ~eventgrid.models.CloudEventEvent - :keyword content_type: Default value is "application/cloudevents-batch+json; charset=utf-8". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: str = kwargs.pop( - "content_type", _headers.pop("content-type", "application/cloudevents-batch+json; charset=utf-8") - ) - cls: ClsType[None] = kwargs.pop("cls", None) - - _content = json.dumps(events, cls=AzureJSONEncoder) # type: ignore - - request = build_event_grid_publish_cloud_event_request( - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - request.url = self._client.format_url(request.url, **path_format_arguments) - - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) - - @overload - async def publish_event_grid_event( # pylint: disable=inconsistent-return-statements - self, events: _models.EventGridEvent, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """publish_event_grid_event. - - :param events: Required. - :type events: ~eventgrid.models.EventGridEvent - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def publish_event_grid_event( # pylint: disable=inconsistent-return-statements - self, events: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """publish_event_grid_event. - - :param events: Required. - :type events: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def publish_event_grid_event( # pylint: disable=inconsistent-return-statements - self, events: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """publish_event_grid_event. - - :param events: Required. - :type events: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def publish_event_grid_event( # pylint: disable=inconsistent-return-statements - self, events: Union[_models.EventGridEvent, JSON, IO], **kwargs: Any - ) -> None: - """publish_event_grid_event. - - :param events: Is one of the following types: EventGridEvent, JSON, IO Required. - :type events: ~eventgrid.models.EventGridEvent or JSON or IO - :keyword content_type: Body parameter Content-Type. Known values are: application/json. Default - value is None. - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(events, (IO, bytes)): - _content = events - else: - _content = json.dumps(events, cls=AzureJSONEncoder) # type: ignore - - request = build_event_grid_publish_event_grid_event_request( - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - } - request.url = self._client.format_url(request.url, **path_format_arguments) - - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_operations/_patch.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_operations/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_patch.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_vendor.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_vendor.py deleted file mode 100644 index 35bd45e3dc6b..000000000000 --- a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/aio/_vendor.py +++ /dev/null @@ -1,26 +0,0 @@ -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from abc import ABC -from typing import TYPE_CHECKING - -from ._configuration import EventGridClientConfiguration - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core import AsyncPipelineClient - - from .._serialization import Deserializer, Serializer - - -class EventGridClientMixinABC(ABC): - """DO NOT use this class. It is for internal typing use only.""" - - _client: "AsyncPipelineClient" - _config: EventGridClientConfiguration - _serialize: "Serializer" - _deserialize: "Deserializer" diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/__init__.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/__init__.py deleted file mode 100644 index b298e570284e..000000000000 --- a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._models import CloudEventEvent -from ._models import EventGridEvent -from ._models import GeneralEvent -from ._models import object -from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "CloudEventEvent", - "EventGridEvent", - "GeneralEvent", - "object", -] -__all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/_models.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/_models.py deleted file mode 100644 index 2461c7b4afc8..000000000000 --- a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/_models.py +++ /dev/null @@ -1,172 +0,0 @@ -# coding=utf-8 -# pylint: disable=too-many-lines -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import datetime -from typing import Any, Mapping, Optional, TYPE_CHECKING, overload - -from .. import _model_base -from .._model_base import rest_field - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from .. import models as _models - - -class CloudEventEvent(_model_base.Model): - """Properties of an event published to an Event Grid topic using the CloudEvent 1.0 Schema. - - All required parameters must be populated in order to send to Azure. - - :ivar id: An identifier for the event. The combination of id and source must be unique for each - distinct event. Required. - :vartype id: str - :ivar source: Identifies the context in which an event happened. The combination of id and - source must be unique for each distinct event. Required. - :vartype source: str - :ivar data: Event data specific to the event type. - :vartype data: ~eventgrid.models.object - :ivar data_base64: Event data specific to the event type, encoded as a base64 string. - :vartype data_base64: bytes - :ivar type: Type of event related to the originating occurrence. Required. - :vartype type: str - :ivar time: The time (in UTC) the event was generated, in RFC3339 format. - :vartype time: ~datetime.datetime - :ivar specversion: The version of the CloudEvents specification which the event uses. Required. - :vartype specversion: str - :ivar dataschema: Identifies the schema that data adheres to. - :vartype dataschema: str - :ivar datacontenttype: Content type of data value. - :vartype datacontenttype: str - :ivar subject: This describes the subject of the event in the context of the event producer - (identified by source). - :vartype subject: str - """ - - id: str = rest_field() - """An identifier for the event. The combination of id and source must be unique for each distinct event. Required. """ - source: str = rest_field() - """Identifies the context in which an event happened. The combination of id and source must be unique for each distinct event. Required. """ - data: Optional["_models.object"] = rest_field() - """Event data specific to the event type. """ - data_base64: Optional[bytes] = rest_field() - """Event data specific to the event type, encoded as a base64 string. """ - type: str = rest_field() - """Type of event related to the originating occurrence. Required. """ - time: Optional[datetime.datetime] = rest_field() - """The time (in UTC) the event was generated, in RFC3339 format. """ - specversion: str = rest_field() - """The version of the CloudEvents specification which the event uses. Required. """ - dataschema: Optional[str] = rest_field() - """Identifies the schema that data adheres to. """ - datacontenttype: Optional[str] = rest_field() - """Content type of data value. """ - subject: Optional[str] = rest_field() - """This describes the subject of the event in the context of the event producer (identified by source). """ - - @overload - def __init__( - self, - *, - id: str, # pylint: disable=redefined-builtin - source: str, - type: str, - specversion: str, - data: Optional["_models.object"] = None, - data_base64: Optional[bytes] = None, - time: Optional[datetime.datetime] = None, - dataschema: Optional[str] = None, - datacontenttype: Optional[str] = None, - subject: Optional[str] = None, - ): - ... - - @overload - def __init__(self, mapping: Mapping[str, Any]): - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation - super().__init__(*args, **kwargs) - - -class EventGridEvent(_model_base.Model): - """Properties of an event published to an Event Grid topic using the EventGrid Schema. - - Readonly variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: An unique identifier for the event. Required. - :vartype id: str - :ivar topic: The resource path of the event source. - :vartype topic: str - :ivar subject: A resource path relative to the topic path. Required. - :vartype subject: str - :ivar data: Event data specific to the event type. Required. - :vartype data: ~eventgrid.models.object - :ivar event_type: The type of the event that occurred. Required. - :vartype event_type: str - :ivar event_time: The time (in UTC) the event was generated. Required. - :vartype event_time: ~datetime.datetime - :ivar metadata_version: The schema version of the event metadata. - :vartype metadata_version: str - :ivar data_version: The schema version of the data object. Required. - :vartype data_version: str - """ - - id: str = rest_field() - """An unique identifier for the event. Required. """ - topic: Optional[str] = rest_field() - """The resource path of the event source. """ - subject: str = rest_field() - """A resource path relative to the topic path. Required. """ - data: "_models.object" = rest_field() - """Event data specific to the event type. Required. """ - event_type: str = rest_field(name="eventType") - """The type of the event that occurred. Required. """ - event_time: datetime.datetime = rest_field(name="eventTime") - """The time (in UTC) the event was generated. Required. """ - metadata_version: Optional[str] = rest_field(name="metadataVersion", readonly=True) - """The schema version of the event metadata. """ - data_version: str = rest_field(name="dataVersion") - """The schema version of the data object. Required. """ - - @overload - def __init__( - self, - *, - id: str, # pylint: disable=redefined-builtin - subject: str, - data: "_models.object", - event_type: str, - event_time: datetime.datetime, - data_version: str, - topic: Optional[str] = None, - ): - ... - - @overload - def __init__(self, mapping: Mapping[str, Any]): - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation - super().__init__(*args, **kwargs) - - -class GeneralEvent(_model_base.Model): - """GeneralEvent.""" - - -class object(_model_base.Model): - """object.""" diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/_patch.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/models/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/py.typed b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/py.typed deleted file mode 100644 index e5aff4f83af8..000000000000 --- a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/eventgrid/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file diff --git a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/setup.py b/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/setup.py deleted file mode 100644 index 7a2293be1ae1..000000000000 --- a/specification/eventgrid/data-plane/cadl/cadl-output/@azure-tools/cadl-python/setup.py +++ /dev/null @@ -1,31 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# coding: utf-8 -from setuptools import setup, find_packages - - -PACKAGE_NAME = "eventgridclient" -version = "1.0.0b1" -setup( - name=PACKAGE_NAME, - version=version, - description="EventGridClient", - author_email="", - url="", - keywords="azure, azure sdk", - packages=find_packages(), - include_package_data=True, - install_requires=[ - "isodate<1.0.0,>=0.6.1", - "azure-core<2.0.0,>=1.24.0", - "typing-extensions>=4.3.0; python_version<'3.8.0'", - ], - long_description="""\ - Azure EventGrid Client. - """, -) diff --git a/specification/eventgrid/data-plane/cadl/main.cadl b/specification/eventgrid/data-plane/cadl/main.tsp similarity index 60% rename from specification/eventgrid/data-plane/cadl/main.cadl rename to specification/eventgrid/data-plane/cadl/main.tsp index ad50679f609a..8dfecb88fba7 100644 --- a/specification/eventgrid/data-plane/cadl/main.cadl +++ b/specification/eventgrid/data-plane/cadl/main.tsp @@ -1,29 +1,27 @@ -import "./ApiManagement.cadl"; -import "./AppConfiguration.cadl"; -import "./AzureCommunicationServices.cadl"; -import "./ContainerRegistry.cadl"; -import "./ContainerService.cadl"; -import "./EventHub.cadl"; -import "./Maps.cadl"; -import "./IotHub.cadl"; -import "./HealthcareApis.cadl"; -import "./KeyVault.cadl"; -import "./MachineLearningServices.cadl"; -import "./MediaServices.cadl"; -import "./PolicyInsights.cadl"; -import "./RedisCache.cadl"; -import "./Resources.cadl"; -import "./ServiceBus.cadl"; -import "./SignalRService.cadl"; -import "./Storage.cadl"; -import "./Web.cadl"; -import "./EventGrid.cadl"; - - +import "./ApiManagement.tsp"; +import "./AppConfiguration.tsp"; +import "./AzureCommunicationServices.tsp"; +import "./ContainerRegistry.tsp"; +import "./ContainerService.tsp"; +import "./EventHub.tsp"; +import "./Maps.tsp"; +import "./IotHub.tsp"; +import "./HealthcareApis.tsp"; +import "./KeyVault.tsp"; +import "./MachineLearningServices.tsp"; +import "./MediaServices.tsp"; +import "./PolicyInsights.tsp"; +import "./RedisCache.tsp"; +import "./Resources.tsp"; +import "./ServiceBus.tsp"; +import "./SignalRService.tsp"; +import "./Storage.tsp"; +import "./Web.tsp"; +import "./EventGrid.tsp"; //Uncomment for testing out typed events with ApiManagement -// import "./ApiManagementTypedReference.cadl"; +// import "./ApiManagementTypedReference.tsp"; // @service({ title: "Glory to the event grid!" }) // namespace EventGrid { @@ -62,5 +60,4 @@ import "./EventGrid.cadl"; // dataType: TData; // } - -// } \ No newline at end of file +// } diff --git a/specification/eventgrid/data-plane/cadl/package-lock.json b/specification/eventgrid/data-plane/cadl/package-lock.json new file mode 100644 index 000000000000..e9980e44ca57 --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/package-lock.json @@ -0,0 +1,1283 @@ +{ + "name": "cadl", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "dependencies": { + "@azure-tools/cadl-python": "^0.5.2", + "@azure-tools/typespec-autorest": "^0.28.0", + "@azure-tools/typespec-azure-core": "^0.28.0", + "@azure-tools/typespec-client-generator-core": "^0.28.0", + "@typespec/compiler": "^0.42.0", + "@typespec/http": "^0.42.0", + "@typespec/openapi": "^0.42.0", + "@typespec/openapi3": "^0.42.0", + "@typespec/rest": "^0.42.0", + "@typespec/versioning": "^0.42.0" + } + }, + "node_modules/@autorest/python": { + "version": "6.4.3", + "resolved": "https://registry.npmjs.org/@autorest/python/-/python-6.4.3.tgz", + "integrity": "sha512-jh4WLQlVPxsrlNLjRuTFwSyUtKhi2DrvxUFZdXzwd3SS9lad1YtfX1zeeG5r7VudySyPLyu5/d0UPFzuENgNlg==", + "hasInstallScript": true, + "dependencies": { + "@autorest/system-requirements": "~1.0.0" + } + }, + "node_modules/@autorest/system-requirements": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@autorest/system-requirements/-/system-requirements-1.0.2.tgz", + "integrity": "sha512-T21naRb6JDdjjn2s/zwr9iCIv/9jviL/PRtiWAhi+3UA2WKH2wrId2VqJa4uVD7iEV8BLkuGgFmMkaMBG26hFw==", + "dependencies": { + "@azure/logger": "^1.0.2", + "command-exists": "~1.2.9", + "semver": "^7.3.5" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@azure-tools/cadl-azure-core": { + "version": "0.26.0", + "resolved": "https://registry.npmjs.org/@azure-tools/cadl-azure-core/-/cadl-azure-core-0.26.0.tgz", + "integrity": "sha512-PYmG/cp+QhyjuQa0jwTkkPp487d500FmPUB5rhjjx+OG080322d+uLeS9tx25dEq3GRoehEnF80qkupBjZBr1g==", + "peer": true, + "dependencies": { + "@cadl-lang/lint": "~0.40.0" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@cadl-lang/compiler": "~0.40.0", + "@cadl-lang/rest": "~0.40.0" + } + }, + "node_modules/@azure-tools/cadl-dpg": { + "version": "0.26.0", + "resolved": "https://registry.npmjs.org/@azure-tools/cadl-dpg/-/cadl-dpg-0.26.0.tgz", + "integrity": "sha512-/F40cUDwKZVPj+dBWxdZ3rXwiqs0kGV6ra/LcNoqK+M+nacd48R4L0512izfJbm8KqFen8yh9jfVC8xQfB6bJg==", + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@cadl-lang/compiler": "~0.40.0", + "@cadl-lang/rest": "~0.40.0" + } + }, + "node_modules/@azure-tools/cadl-python": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/@azure-tools/cadl-python/-/cadl-python-0.5.2.tgz", + "integrity": "sha512-fgS17opg+ZYnPnwC4HVM9IyBeuJA/PexulXgKsHqxwRZHIpSkhs3533g6TOU/tXl8bt3Xuc5vq1cHh9u+56oLQ==", + "dependencies": { + "@autorest/python": "^6.4.3", + "@azure-tools/cadl-dpg": "~0.26.0", + "@cadl-lang/compiler": "~0.40.0", + "js-yaml": "~4.1.0" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "@azure-tools/cadl-azure-core": "~0.26.0", + "@cadl-lang/rest": "~0.40.0", + "@cadl-lang/versioning": "~0.40.0" + } + }, + "node_modules/@azure-tools/typespec-autorest": { + "version": "0.28.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-autorest/-/typespec-autorest-0.28.0.tgz", + "integrity": "sha512-BEitqXLZGc3fzr5F6LoSV7hdHfYFc+YghU3cMTC74lDRLZ1IkiAB0pwaKHHSMicTHqufxaCmmsodYljQyNEo1g==", + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@azure-tools/typespec-azure-core": "~0.28.0", + "@typespec/compiler": "~0.42.0", + "@typespec/http": "~0.42.0", + "@typespec/openapi": "~0.42.0", + "@typespec/rest": "~0.42.0", + "@typespec/versioning": "~0.42.0" + } + }, + "node_modules/@azure-tools/typespec-azure-core": { + "version": "0.28.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-core/-/typespec-azure-core-0.28.0.tgz", + "integrity": "sha512-5qs2ItWRfndL4ScAGhIceff03uejpNlSbQwOYo3QjYzzJ9+xGXqtY8NIBOR/JbKe1/3SdCkoeoRjf4KQ7/OvZw==", + "dependencies": { + "@typespec/lint": "~0.42.0" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@typespec/compiler": "~0.42.0", + "@typespec/http": "~0.42.0", + "@typespec/rest": "~0.42.0" + } + }, + "node_modules/@azure-tools/typespec-client-generator-core": { + "version": "0.28.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.28.0.tgz", + "integrity": "sha512-EuWlcstpFTvxZ4dft5H6BobG4/JXGQVVzytvLmpLNKRmCfkgtP4I/zA5ZxzVJT4HFIeyW24B5lzafrik8JYdJg==", + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@typespec/compiler": "~0.42.0", + "@typespec/http": "~0.42.0", + "@typespec/rest": "~0.42.0" + } + }, + "node_modules/@azure/logger": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@azure/logger/-/logger-1.0.4.tgz", + "integrity": "sha512-ustrPY8MryhloQj7OWGe+HrYx+aoiOxzbXTtgblbV3xwCqpzUK36phH3XNHQKj3EPonyFUuDTfR3qFhTEAuZEg==", + "dependencies": { + "tslib": "^2.2.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", + "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", + "dependencies": { + "@babel/highlight": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.19.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", + "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", + "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", + "dependencies": { + "@babel/helper-validator-identifier": "^7.18.6", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@cadl-lang/compiler": { + "version": "0.40.0", + "resolved": "https://registry.npmjs.org/@cadl-lang/compiler/-/compiler-0.40.0.tgz", + "integrity": "sha512-4u/Dnm39Ma+8wH0SDu7ya1+2oBRDiNByiRoijwyScHRec26UWLyWvHMvvU89ISU6O8Vwtq0bpmbD7FeJTnlbHw==", + "dependencies": { + "@babel/code-frame": "~7.18.6", + "ajv": "~8.11.2", + "change-case": "~4.1.2", + "globby": "~13.1.1", + "js-yaml": "~4.1.0", + "mkdirp": "~1.0.4", + "mustache": "~4.2.0", + "node-fetch": "3.2.8", + "node-watch": "~0.7.1", + "picocolors": "~1.0.0", + "prettier": "~2.8.1", + "prompts": "~2.4.1", + "vscode-languageserver": "~8.0.2", + "vscode-languageserver-textdocument": "~1.0.1", + "yargs": "~17.6.2" + }, + "bin": { + "cadl": "cmd/cadl.js", + "cadl-server": "cmd/cadl-server.js" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@cadl-lang/lint": { + "version": "0.40.0", + "resolved": "https://registry.npmjs.org/@cadl-lang/lint/-/lint-0.40.0.tgz", + "integrity": "sha512-V/V5Msuurhb7kVZsvuAKVAHq4twmC5YC5k/t7YJWETOowFXepgIneWJPH2TDyyzO9WqJjqRJVRXPTrTuKuNFsA==", + "peer": true, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@cadl-lang/compiler": "~0.40.0" + } + }, + "node_modules/@cadl-lang/rest": { + "version": "0.40.0", + "resolved": "https://registry.npmjs.org/@cadl-lang/rest/-/rest-0.40.0.tgz", + "integrity": "sha512-WfGq6lN87adRKsKd3XtztvOLXHzyFlDRQiEcXKfnwXia37zVwK355KX39P1RimQ9mpDsmXaGG4ETkdUSWvXe7w==", + "peer": true, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@cadl-lang/compiler": "~0.40.0" + } + }, + "node_modules/@cadl-lang/versioning": { + "version": "0.40.0", + "resolved": "https://registry.npmjs.org/@cadl-lang/versioning/-/versioning-0.40.0.tgz", + "integrity": "sha512-HK/jw0kxo/6RwbnR7nPyCj2kJ94uZbBhEmS08ms+fX4UB4nDNBXqXFwMwgftVZ2qdS9xEkRhLqpVYfEPzlFBJw==", + "peer": true, + "dependencies": { + "@cadl-lang/compiler": "~0.40.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@typespec/compiler": { + "version": "0.42.0", + "resolved": "https://registry.npmjs.org/@typespec/compiler/-/compiler-0.42.0.tgz", + "integrity": "sha512-eONMtlDQ5Bpge4lcprI06mnfW924bo23LVNNKTdC1/1g1iQWPGH2fNpstEomumzOvTNwINh3xKtwkJ5huckBUQ==", + "dependencies": { + "@babel/code-frame": "~7.18.6", + "ajv": "~8.11.2", + "change-case": "~4.1.2", + "globby": "~13.1.1", + "js-yaml": "~4.1.0", + "mkdirp": "~1.0.4", + "mustache": "~4.2.0", + "node-fetch": "3.2.8", + "node-watch": "~0.7.1", + "picocolors": "~1.0.0", + "prettier": "~2.8.1", + "prompts": "~2.4.1", + "vscode-languageserver": "~8.0.2", + "vscode-languageserver-textdocument": "~1.0.1", + "yargs": "~17.6.2" + }, + "bin": { + "tsp": "cmd/tsp.js", + "tsp-server": "cmd/tsp-server.js" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@typespec/http": { + "version": "0.42.0", + "resolved": "https://registry.npmjs.org/@typespec/http/-/http-0.42.0.tgz", + "integrity": "sha512-RQgw1ha805m31cRJ+yJik0b9eTPQonYAouPAGhIRrtWKmXHQ9FdtP9yUCKKRA2nG8o8F4lTA+cluA5c8xZO3wQ==", + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@typespec/compiler": "~0.42.0" + } + }, + "node_modules/@typespec/lint": { + "version": "0.42.0", + "resolved": "https://registry.npmjs.org/@typespec/lint/-/lint-0.42.0.tgz", + "integrity": "sha512-kUD6rddC93L3zBRN5GMxqkO1oFZUA+0k1K/1OCtUKjKaFXFrcO4m4XPIUPZuM71JXCufwp2qNfo19peshs6CQQ==", + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@typespec/compiler": "~0.42.0" + } + }, + "node_modules/@typespec/openapi": { + "version": "0.42.0", + "resolved": "https://registry.npmjs.org/@typespec/openapi/-/openapi-0.42.0.tgz", + "integrity": "sha512-UiPyx95enMhiE84990T7eyRgVn9tjB5cKhkCzRRwrFiyjbun7pVJahbPYwhS8bknxL+Sl2M3gcTaw5WWUzN51A==", + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@typespec/compiler": "~0.42.0", + "@typespec/http": "~0.42.0", + "@typespec/rest": "~0.42.0" + } + }, + "node_modules/@typespec/openapi3": { + "version": "0.42.0", + "resolved": "https://registry.npmjs.org/@typespec/openapi3/-/openapi3-0.42.0.tgz", + "integrity": "sha512-OHDnnLsQPh2yhmHcDsvLt6BBfS/xZRgrur+lgqLmKQMP26e+6TqjsrNEgaU+UB8wwMv4ZFdEe+DVOsaF0biX4A==", + "dependencies": { + "js-yaml": "~4.1.0" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@typespec/compiler": "~0.42.0", + "@typespec/http": "~0.42.0", + "@typespec/openapi": "~0.42.0", + "@typespec/rest": "~0.42.0", + "@typespec/versioning": "~0.42.0" + } + }, + "node_modules/@typespec/rest": { + "version": "0.42.0", + "resolved": "https://registry.npmjs.org/@typespec/rest/-/rest-0.42.0.tgz", + "integrity": "sha512-qUj1sk0ZeCVKs4BDw8TnICfRYraTwCaC+vN107a+3PvBLwGCCCGNrDYwsy38PYxFPU3TBmkPyOQ5/Mv6ifJjkQ==", + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@typespec/compiler": "~0.42.0" + } + }, + "node_modules/@typespec/versioning": { + "version": "0.42.0", + "resolved": "https://registry.npmjs.org/@typespec/versioning/-/versioning-0.42.0.tgz", + "integrity": "sha512-MAXcYuqtNiZiCSYRg/LgSuP3zx4jYoffx8f0b21EKwUlwqFyjGbMBp6v7WX9mrf6o5ggZXn3T3tJX4gJa1BQiA==", + "dependencies": { + "@typespec/compiler": "~0.42.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/ajv": { + "version": "8.11.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.2.tgz", + "integrity": "sha512-E4bfmKAhGiSTvMfL1Myyycaub+cUEU2/IvpylXkUu7CHBkBj1f/ikdzbD7YQ6FKUbixDxeYvB/xY4fvyroDlQg==", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/camel-case": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-4.1.2.tgz", + "integrity": "sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw==", + "dependencies": { + "pascal-case": "^3.1.2", + "tslib": "^2.0.3" + } + }, + "node_modules/capital-case": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/capital-case/-/capital-case-1.0.4.tgz", + "integrity": "sha512-ds37W8CytHgwnhGGTi88pcPyR15qoNkOpYwmMMfnWqqWgESapLqvDx6huFjQ5vqWSn2Z06173XNA7LtMOeUh1A==", + "dependencies": { + "no-case": "^3.0.4", + "tslib": "^2.0.3", + "upper-case-first": "^2.0.2" + } + }, + "node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/change-case": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/change-case/-/change-case-4.1.2.tgz", + "integrity": "sha512-bSxY2ws9OtviILG1EiY5K7NNxkqg/JnRnFxLtKQ96JaviiIxi7djMrSd0ECT9AC+lttClmYwKw53BWpOMblo7A==", + "dependencies": { + "camel-case": "^4.1.2", + "capital-case": "^1.0.4", + "constant-case": "^3.0.4", + "dot-case": "^3.0.4", + "header-case": "^2.0.4", + "no-case": "^3.0.4", + "param-case": "^3.0.4", + "pascal-case": "^3.1.2", + "path-case": "^3.0.4", + "sentence-case": "^3.0.4", + "snake-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" + }, + "node_modules/command-exists": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/command-exists/-/command-exists-1.2.9.tgz", + "integrity": "sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w==" + }, + "node_modules/constant-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/constant-case/-/constant-case-3.0.4.tgz", + "integrity": "sha512-I2hSBi7Vvs7BEuJDr5dDHfzb/Ruj3FyvFyh7KLilAjNQw3Be+xgqUBA2W6scVEcL0hL1dwPRtIqEPVUCKkSsyQ==", + "dependencies": { + "no-case": "^3.0.4", + "tslib": "^2.0.3", + "upper-case": "^2.0.2" + } + }, + "node_modules/data-uri-to-buffer": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz", + "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==", + "engines": { + "node": ">= 12" + } + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/dot-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz", + "integrity": "sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==", + "dependencies": { + "no-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "node_modules/escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + }, + "node_modules/fast-glob": { + "version": "3.2.12", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", + "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fastq": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", + "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fetch-blob": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", + "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "paypal", + "url": "https://paypal.me/jimmywarting" + } + ], + "dependencies": { + "node-domexception": "^1.0.0", + "web-streams-polyfill": "^3.0.3" + }, + "engines": { + "node": "^12.20 || >= 14.13" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/formdata-polyfill": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", + "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", + "dependencies": { + "fetch-blob": "^3.1.2" + }, + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/globby": { + "version": "13.1.3", + "resolved": "https://registry.npmjs.org/globby/-/globby-13.1.3.tgz", + "integrity": "sha512-8krCNHXvlCgHDpegPzleMq07yMYTO2sXKASmZmquEYWEmCx6J5UTRbp5RwMJkTJGtcQ44YpiUYUiN0b9mzy8Bw==", + "dependencies": { + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.11", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "engines": { + "node": ">=4" + } + }, + "node_modules/header-case": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/header-case/-/header-case-2.0.4.tgz", + "integrity": "sha512-H/vuk5TEEVZwrR0lp2zed9OCo1uAILMlx0JEMgC26rzyJJ3N1v6XkwHHXJQdR2doSjcGPM6OKPYoJgf0plJ11Q==", + "dependencies": { + "capital-case": "^1.0.4", + "tslib": "^2.0.3" + } + }, + "node_modules/ignore": { + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", + "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "engines": { + "node": ">= 4" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" + }, + "node_modules/kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "engines": { + "node": ">=6" + } + }, + "node_modules/lower-case": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", + "integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==", + "dependencies": { + "tslib": "^2.0.3" + } + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/mustache": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz", + "integrity": "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==", + "bin": { + "mustache": "bin/mustache" + } + }, + "node_modules/no-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz", + "integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==", + "dependencies": { + "lower-case": "^2.0.2", + "tslib": "^2.0.3" + } + }, + "node_modules/node-domexception": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "github", + "url": "https://paypal.me/jimmywarting" + } + ], + "engines": { + "node": ">=10.5.0" + } + }, + "node_modules/node-fetch": { + "version": "3.2.8", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.2.8.tgz", + "integrity": "sha512-KtpD1YhGszhntMpBDyp5lyagk8KIMopC1LEb7cQUAh7zcosaX5uK8HnbNb2i3NTQK3sIawCItS0uFC3QzcLHdg==", + "dependencies": { + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/node-fetch" + } + }, + "node_modules/node-watch": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/node-watch/-/node-watch-0.7.3.tgz", + "integrity": "sha512-3l4E8uMPY1HdMMryPRUAl+oIHtXtyiTlIiESNSVSNxcPfzAFzeTbXFQkZfAwBbo0B1qMSG8nUABx+Gd+YrbKrQ==", + "engines": { + "node": ">=6" + } + }, + "node_modules/param-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/param-case/-/param-case-3.0.4.tgz", + "integrity": "sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A==", + "dependencies": { + "dot-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, + "node_modules/pascal-case": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/pascal-case/-/pascal-case-3.1.2.tgz", + "integrity": "sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g==", + "dependencies": { + "no-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, + "node_modules/path-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/path-case/-/path-case-3.0.4.tgz", + "integrity": "sha512-qO4qCFjXqVTrcbPt/hQfhTQ+VhFsqNKOPtytgNKkKxSoEp3XPUQ8ObFuePylOIok5gjn69ry8XiULxCwot3Wfg==", + "dependencies": { + "dot-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "engines": { + "node": ">=8" + } + }, + "node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/prettier": { + "version": "2.8.4", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.4.tgz", + "integrity": "sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw==", + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/prompts": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", + "dependencies": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.5" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/punycode": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", + "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", + "engines": { + "node": ">=6" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/semver": { + "version": "7.3.8", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", + "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/sentence-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/sentence-case/-/sentence-case-3.0.4.tgz", + "integrity": "sha512-8LS0JInaQMCRoQ7YUytAo/xUu5W2XnQxV2HI/6uM6U7CITS1RqPElr30V6uIqyMKM9lJGRVFy5/4CuzcixNYSg==", + "dependencies": { + "no-case": "^3.0.4", + "tslib": "^2.0.3", + "upper-case-first": "^2.0.2" + } + }, + "node_modules/sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==" + }, + "node_modules/slash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", + "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/snake-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/snake-case/-/snake-case-3.0.4.tgz", + "integrity": "sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==", + "dependencies": { + "dot-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/tslib": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", + "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==" + }, + "node_modules/upper-case": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/upper-case/-/upper-case-2.0.2.tgz", + "integrity": "sha512-KgdgDGJt2TpuwBUIjgG6lzw2GWFRCW9Qkfkiv0DxqHHLYJHmtmdUIKcZd8rHgFSjopVTlw6ggzCm1b8MFQwikg==", + "dependencies": { + "tslib": "^2.0.3" + } + }, + "node_modules/upper-case-first": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/upper-case-first/-/upper-case-first-2.0.2.tgz", + "integrity": "sha512-514ppYHBaKwfJRK/pNC6c/OxfGa0obSnAl106u97Ed0I625Nin96KAjttZF6ZL3e1XLtphxnqrOi9iWgm+u+bg==", + "dependencies": { + "tslib": "^2.0.3" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/vscode-jsonrpc": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.0.2.tgz", + "integrity": "sha512-RY7HwI/ydoC1Wwg4gJ3y6LpU9FJRZAUnTYMXthqhFXXu77ErDd/xkREpGuk4MyYkk4a+XDWAMqe0S3KkelYQEQ==", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/vscode-languageserver": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-8.0.2.tgz", + "integrity": "sha512-bpEt2ggPxKzsAOZlXmCJ50bV7VrxwCS5BI4+egUmure/oI/t4OlFzi/YNtVvY24A2UDOZAgwFGgnZPwqSJubkA==", + "dependencies": { + "vscode-languageserver-protocol": "3.17.2" + }, + "bin": { + "installServerIntoExtension": "bin/installServerIntoExtension" + } + }, + "node_modules/vscode-languageserver-protocol": { + "version": "3.17.2", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.2.tgz", + "integrity": "sha512-8kYisQ3z/SQ2kyjlNeQxbkkTNmVFoQCqkmGrzLH6A9ecPlgTbp3wDTnUNqaUxYr4vlAcloxx8zwy7G5WdguYNg==", + "dependencies": { + "vscode-jsonrpc": "8.0.2", + "vscode-languageserver-types": "3.17.2" + } + }, + "node_modules/vscode-languageserver-textdocument": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.8.tgz", + "integrity": "sha512-1bonkGqQs5/fxGT5UchTgjGVnfysL0O8v1AYMBjqTbWQTFn721zaPGDYFkOKtfDgFiSgXM3KwaG3FMGfW4Ed9Q==" + }, + "node_modules/vscode-languageserver-types": { + "version": "3.17.2", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.2.tgz", + "integrity": "sha512-zHhCWatviizPIq9B7Vh9uvrH6x3sK8itC84HkamnBWoDFJtzBf7SWlpLCZUit72b3os45h6RWQNC9xHRDF8dRA==" + }, + "node_modules/web-streams-polyfill": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz", + "integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==", + "engines": { + "node": ">= 8" + } + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/wrap-ansi/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "engines": { + "node": ">=10" + } + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, + "node_modules/yargs": { + "version": "17.6.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.6.2.tgz", + "integrity": "sha512-1/9UrdHjDZc0eOU0HxOHoS78C69UD3JRMvzlJ7S79S2nTaWRA/whGCTV8o9e/N/1Va9YIV7Q4sOxD8VV4pCWOw==", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "engines": { + "node": ">=12" + } + } + } +} diff --git a/specification/eventgrid/data-plane/cadl/package.json b/specification/eventgrid/data-plane/cadl/package.json new file mode 100644 index 000000000000..ec5962f2fef0 --- /dev/null +++ b/specification/eventgrid/data-plane/cadl/package.json @@ -0,0 +1,14 @@ +{ + "dependencies": { + "@azure-tools/cadl-python": "^0.5.2", + "@azure-tools/typespec-autorest": "^0.28.0", + "@azure-tools/typespec-azure-core": "^0.28.0", + "@azure-tools/typespec-client-generator-core": "^0.28.0", + "@typespec/compiler": "^0.42.0", + "@typespec/http": "^0.42.0", + "@typespec/openapi": "^0.42.0", + "@typespec/openapi3": "^0.42.0", + "@typespec/rest": "^0.42.0", + "@typespec/versioning": "^0.42.0" + } +} From b6ff831913dc9b842d90d4e7c69727327d7aa4e3 Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Tue, 14 Mar 2023 15:42:15 -0700 Subject: [PATCH 63/65] remove commented code --- .../eventgrid/data-plane/cadl/EventGrid.tsp | 69 +------------------ 1 file changed, 1 insertion(+), 68 deletions(-) diff --git a/specification/eventgrid/data-plane/cadl/EventGrid.tsp b/specification/eventgrid/data-plane/cadl/EventGrid.tsp index 925f104849f9..724f59c8be77 100644 --- a/specification/eventgrid/data-plane/cadl/EventGrid.tsp +++ b/specification/eventgrid/data-plane/cadl/EventGrid.tsp @@ -127,7 +127,7 @@ namespace EventGrid { eventSubscriptionId?: string; } - // USE SHARED ROUTES (Not supported yet by language emitters - can use with OpenAPI3) + // USE SHARED ROUTES alias EventType = EventGridEvent | CloudEventEvent; @@ -168,70 +168,3 @@ namespace EventGrid { } -// Try gen swagger and make sure that looks right and maybe create issue for models not appearing *** - - - // Use @overload - - // alias EventType = EventGridEvent | CloudEventEvent; - - // @post - // @doc("Some Doc") - // @route("/send") - // op PublishEvent is Azure.Core.RpcOperation<{ - // @doc("channel name") - // @header("aeg-channel-name") - // channelName?: string, - - // @doc("Doc for body") - // @body - // events: EventType - // }, {}>; - - // @overload(PublishEvent) - // @post - // op PublishCloudEvent is Azure.Core.RpcOperation<{ - // @header("content-type") contentType: "application/cloudevents-batch+json; charset=utf-8", - // @body - // events: CloudEventEvent, - // // ...ApiVersionParameter, - // }, {}>; - - // @overload(PublishEvent) - // @post - // op PublishEventGridEvent is Azure.Core.RpcOperation<{ - // @body - // events: EventGridEvent, - // // ...ApiVersionParameter, - // }, {}>; - - - - // alias InputType = CloudEventRequest | EventGridEvent; - - // @post - // @route("foo") - // op PublishEvent( - // @body - // events: InputType, - // ...ApiVersionParameter, - - // ):OkResponse; - - // @overload(PublishEvent) - // @post - // op PublishCloudEvent( - // @header("content-type") contentType: "application/cloudevents-batch+json; charset=utf-8", - // @body - // events: CloudEventEvent, - // ...ApiVersionParameter, - // ):OkResponse; - - // @overload(PublishEvent) - // @post - // op PublishEventGridEvent( - // @header("content-type") contentType: "application/json", - // @body - // events: EventGridEvent, - // ...ApiVersionParameter, - // ):OkResponse; From 46fe6fd22d9e267678b6f8e9ab61ecc18c02cb67 Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Wed, 15 Mar 2023 14:25:09 -0700 Subject: [PATCH 64/65] rename to typespec --- .../{cadl => typespec}/ApiManagement.tsp | 0 .../ApiManagementTypedReference.tsp | 0 .../{cadl => typespec}/AppConfiguration.tsp | 0 .../AzureCommunicationServices.tsp | 0 .../AzureCommunicationServicesCore.tsp | 0 .../{cadl => typespec}/ContainerRegistry.tsp | 0 .../{cadl => typespec}/ContainerService.tsp | 0 .../data-plane/{cadl => typespec}/DataBox.tsp | 0 .../{cadl => typespec}/EventGrid.tsp | 1 + .../{cadl => typespec}/EventHub.tsp | 0 .../{cadl => typespec}/HealthcareApis.tsp | 0 .../data-plane/{cadl => typespec}/IotHub.tsp | 0 .../{cadl => typespec}/KeyVault.tsp | 0 .../MachineLearningServices.tsp | 0 .../data-plane/{cadl => typespec}/Maps.tsp | 0 .../{cadl => typespec}/MediaServices.tsp | 0 .../{cadl => typespec}/PolicyInsights.tsp | 0 .../{cadl => typespec}/RedisCache.tsp | 0 .../{cadl => typespec}/Resources.tsp | 0 .../{cadl => typespec}/ServiceBus.tsp | 0 .../{cadl => typespec}/SignalRService.tsp | 0 .../data-plane/{cadl => typespec}/Storage.tsp | 0 .../data-plane/{cadl => typespec}/Testing.tsp | 0 .../data-plane/{cadl => typespec}/Web.tsp | 0 .../{cadl => typespec}/generation_steps.md | 0 .../data-plane/{cadl => typespec}/main.tsp | 0 .../{cadl => typespec}/package-lock.json | 0 .../{cadl => typespec}/package.json | 0 .../swagger/ApiManagement.json | 0 .../swagger/AppConfiguration.json | 0 .../swagger/AzureCommunicationServices.json | 0 .../swagger/ContainerRegistry.json | 0 .../swagger/ContainerService.json | 0 .../{cadl => typespec}/swagger/EventGrid.json | 0 .../{cadl => typespec}/swagger/EventHub.json | 0 .../swagger/HealthcareApis.json | 0 .../{cadl => typespec}/swagger/IotHub.json | 0 .../{cadl => typespec}/swagger/KeyVault.json | 0 .../swagger/MachineLearningServices.json | 0 .../{cadl => typespec}/swagger/Maps.json | 0 .../swagger/MediaServices.json | 0 .../swagger/PolicyInsights.json | 0 .../swagger/RedisCache.json | 0 .../{cadl => typespec}/swagger/Resources.json | 0 .../swagger/ServiceBus.json | 0 .../swagger/SignalRService.json | 0 .../{cadl => typespec}/swagger/Storage.json | 0 .../{cadl => typespec}/swagger/Web.json | 0 .../openapi3/openapi.2018-01-01.yaml | 286 ++++++++++++++++++ 49 files changed, 287 insertions(+) rename specification/eventgrid/data-plane/{cadl => typespec}/ApiManagement.tsp (100%) rename specification/eventgrid/data-plane/{cadl => typespec}/ApiManagementTypedReference.tsp (100%) rename specification/eventgrid/data-plane/{cadl => typespec}/AppConfiguration.tsp (100%) rename specification/eventgrid/data-plane/{cadl => typespec}/AzureCommunicationServices.tsp (100%) rename specification/eventgrid/data-plane/{cadl => typespec}/AzureCommunicationServicesCore.tsp (100%) rename specification/eventgrid/data-plane/{cadl => typespec}/ContainerRegistry.tsp (100%) rename specification/eventgrid/data-plane/{cadl => typespec}/ContainerService.tsp (100%) rename specification/eventgrid/data-plane/{cadl => typespec}/DataBox.tsp (100%) rename specification/eventgrid/data-plane/{cadl => typespec}/EventGrid.tsp (99%) rename specification/eventgrid/data-plane/{cadl => typespec}/EventHub.tsp (100%) rename specification/eventgrid/data-plane/{cadl => typespec}/HealthcareApis.tsp (100%) rename specification/eventgrid/data-plane/{cadl => typespec}/IotHub.tsp (100%) rename specification/eventgrid/data-plane/{cadl => typespec}/KeyVault.tsp (100%) rename specification/eventgrid/data-plane/{cadl => typespec}/MachineLearningServices.tsp (100%) rename specification/eventgrid/data-plane/{cadl => typespec}/Maps.tsp (100%) rename specification/eventgrid/data-plane/{cadl => typespec}/MediaServices.tsp (100%) rename specification/eventgrid/data-plane/{cadl => typespec}/PolicyInsights.tsp (100%) rename specification/eventgrid/data-plane/{cadl => typespec}/RedisCache.tsp (100%) rename specification/eventgrid/data-plane/{cadl => typespec}/Resources.tsp (100%) rename specification/eventgrid/data-plane/{cadl => typespec}/ServiceBus.tsp (100%) rename specification/eventgrid/data-plane/{cadl => typespec}/SignalRService.tsp (100%) rename specification/eventgrid/data-plane/{cadl => typespec}/Storage.tsp (100%) rename specification/eventgrid/data-plane/{cadl => typespec}/Testing.tsp (100%) rename specification/eventgrid/data-plane/{cadl => typespec}/Web.tsp (100%) rename specification/eventgrid/data-plane/{cadl => typespec}/generation_steps.md (100%) rename specification/eventgrid/data-plane/{cadl => typespec}/main.tsp (100%) rename specification/eventgrid/data-plane/{cadl => typespec}/package-lock.json (100%) rename specification/eventgrid/data-plane/{cadl => typespec}/package.json (100%) rename specification/eventgrid/data-plane/{cadl => typespec}/swagger/ApiManagement.json (100%) rename specification/eventgrid/data-plane/{cadl => typespec}/swagger/AppConfiguration.json (100%) rename specification/eventgrid/data-plane/{cadl => typespec}/swagger/AzureCommunicationServices.json (100%) rename specification/eventgrid/data-plane/{cadl => typespec}/swagger/ContainerRegistry.json (100%) rename specification/eventgrid/data-plane/{cadl => typespec}/swagger/ContainerService.json (100%) rename specification/eventgrid/data-plane/{cadl => typespec}/swagger/EventGrid.json (100%) rename specification/eventgrid/data-plane/{cadl => typespec}/swagger/EventHub.json (100%) rename specification/eventgrid/data-plane/{cadl => typespec}/swagger/HealthcareApis.json (100%) rename specification/eventgrid/data-plane/{cadl => typespec}/swagger/IotHub.json (100%) rename specification/eventgrid/data-plane/{cadl => typespec}/swagger/KeyVault.json (100%) rename specification/eventgrid/data-plane/{cadl => typespec}/swagger/MachineLearningServices.json (100%) rename specification/eventgrid/data-plane/{cadl => typespec}/swagger/Maps.json (100%) rename specification/eventgrid/data-plane/{cadl => typespec}/swagger/MediaServices.json (100%) rename specification/eventgrid/data-plane/{cadl => typespec}/swagger/PolicyInsights.json (100%) rename specification/eventgrid/data-plane/{cadl => typespec}/swagger/RedisCache.json (100%) rename specification/eventgrid/data-plane/{cadl => typespec}/swagger/Resources.json (100%) rename specification/eventgrid/data-plane/{cadl => typespec}/swagger/ServiceBus.json (100%) rename specification/eventgrid/data-plane/{cadl => typespec}/swagger/SignalRService.json (100%) rename specification/eventgrid/data-plane/{cadl => typespec}/swagger/Storage.json (100%) rename specification/eventgrid/data-plane/{cadl => typespec}/swagger/Web.json (100%) create mode 100644 specification/eventgrid/data-plane/typespec/tsp-output/@typespec/openapi3/openapi.2018-01-01.yaml diff --git a/specification/eventgrid/data-plane/cadl/ApiManagement.tsp b/specification/eventgrid/data-plane/typespec/ApiManagement.tsp similarity index 100% rename from specification/eventgrid/data-plane/cadl/ApiManagement.tsp rename to specification/eventgrid/data-plane/typespec/ApiManagement.tsp diff --git a/specification/eventgrid/data-plane/cadl/ApiManagementTypedReference.tsp b/specification/eventgrid/data-plane/typespec/ApiManagementTypedReference.tsp similarity index 100% rename from specification/eventgrid/data-plane/cadl/ApiManagementTypedReference.tsp rename to specification/eventgrid/data-plane/typespec/ApiManagementTypedReference.tsp diff --git a/specification/eventgrid/data-plane/cadl/AppConfiguration.tsp b/specification/eventgrid/data-plane/typespec/AppConfiguration.tsp similarity index 100% rename from specification/eventgrid/data-plane/cadl/AppConfiguration.tsp rename to specification/eventgrid/data-plane/typespec/AppConfiguration.tsp diff --git a/specification/eventgrid/data-plane/cadl/AzureCommunicationServices.tsp b/specification/eventgrid/data-plane/typespec/AzureCommunicationServices.tsp similarity index 100% rename from specification/eventgrid/data-plane/cadl/AzureCommunicationServices.tsp rename to specification/eventgrid/data-plane/typespec/AzureCommunicationServices.tsp diff --git a/specification/eventgrid/data-plane/cadl/AzureCommunicationServicesCore.tsp b/specification/eventgrid/data-plane/typespec/AzureCommunicationServicesCore.tsp similarity index 100% rename from specification/eventgrid/data-plane/cadl/AzureCommunicationServicesCore.tsp rename to specification/eventgrid/data-plane/typespec/AzureCommunicationServicesCore.tsp diff --git a/specification/eventgrid/data-plane/cadl/ContainerRegistry.tsp b/specification/eventgrid/data-plane/typespec/ContainerRegistry.tsp similarity index 100% rename from specification/eventgrid/data-plane/cadl/ContainerRegistry.tsp rename to specification/eventgrid/data-plane/typespec/ContainerRegistry.tsp diff --git a/specification/eventgrid/data-plane/cadl/ContainerService.tsp b/specification/eventgrid/data-plane/typespec/ContainerService.tsp similarity index 100% rename from specification/eventgrid/data-plane/cadl/ContainerService.tsp rename to specification/eventgrid/data-plane/typespec/ContainerService.tsp diff --git a/specification/eventgrid/data-plane/cadl/DataBox.tsp b/specification/eventgrid/data-plane/typespec/DataBox.tsp similarity index 100% rename from specification/eventgrid/data-plane/cadl/DataBox.tsp rename to specification/eventgrid/data-plane/typespec/DataBox.tsp diff --git a/specification/eventgrid/data-plane/cadl/EventGrid.tsp b/specification/eventgrid/data-plane/typespec/EventGrid.tsp similarity index 99% rename from specification/eventgrid/data-plane/cadl/EventGrid.tsp rename to specification/eventgrid/data-plane/typespec/EventGrid.tsp index 724f59c8be77..ca968e0a246c 100644 --- a/specification/eventgrid/data-plane/cadl/EventGrid.tsp +++ b/specification/eventgrid/data-plane/typespec/EventGrid.tsp @@ -132,6 +132,7 @@ namespace EventGrid { alias EventType = EventGridEvent | CloudEventEvent; @doc("Publish Events") + @post @route("/send", { shared: true}) op send is Azure.Core.RpcOperation<{ @doc("channel name") diff --git a/specification/eventgrid/data-plane/cadl/EventHub.tsp b/specification/eventgrid/data-plane/typespec/EventHub.tsp similarity index 100% rename from specification/eventgrid/data-plane/cadl/EventHub.tsp rename to specification/eventgrid/data-plane/typespec/EventHub.tsp diff --git a/specification/eventgrid/data-plane/cadl/HealthcareApis.tsp b/specification/eventgrid/data-plane/typespec/HealthcareApis.tsp similarity index 100% rename from specification/eventgrid/data-plane/cadl/HealthcareApis.tsp rename to specification/eventgrid/data-plane/typespec/HealthcareApis.tsp diff --git a/specification/eventgrid/data-plane/cadl/IotHub.tsp b/specification/eventgrid/data-plane/typespec/IotHub.tsp similarity index 100% rename from specification/eventgrid/data-plane/cadl/IotHub.tsp rename to specification/eventgrid/data-plane/typespec/IotHub.tsp diff --git a/specification/eventgrid/data-plane/cadl/KeyVault.tsp b/specification/eventgrid/data-plane/typespec/KeyVault.tsp similarity index 100% rename from specification/eventgrid/data-plane/cadl/KeyVault.tsp rename to specification/eventgrid/data-plane/typespec/KeyVault.tsp diff --git a/specification/eventgrid/data-plane/cadl/MachineLearningServices.tsp b/specification/eventgrid/data-plane/typespec/MachineLearningServices.tsp similarity index 100% rename from specification/eventgrid/data-plane/cadl/MachineLearningServices.tsp rename to specification/eventgrid/data-plane/typespec/MachineLearningServices.tsp diff --git a/specification/eventgrid/data-plane/cadl/Maps.tsp b/specification/eventgrid/data-plane/typespec/Maps.tsp similarity index 100% rename from specification/eventgrid/data-plane/cadl/Maps.tsp rename to specification/eventgrid/data-plane/typespec/Maps.tsp diff --git a/specification/eventgrid/data-plane/cadl/MediaServices.tsp b/specification/eventgrid/data-plane/typespec/MediaServices.tsp similarity index 100% rename from specification/eventgrid/data-plane/cadl/MediaServices.tsp rename to specification/eventgrid/data-plane/typespec/MediaServices.tsp diff --git a/specification/eventgrid/data-plane/cadl/PolicyInsights.tsp b/specification/eventgrid/data-plane/typespec/PolicyInsights.tsp similarity index 100% rename from specification/eventgrid/data-plane/cadl/PolicyInsights.tsp rename to specification/eventgrid/data-plane/typespec/PolicyInsights.tsp diff --git a/specification/eventgrid/data-plane/cadl/RedisCache.tsp b/specification/eventgrid/data-plane/typespec/RedisCache.tsp similarity index 100% rename from specification/eventgrid/data-plane/cadl/RedisCache.tsp rename to specification/eventgrid/data-plane/typespec/RedisCache.tsp diff --git a/specification/eventgrid/data-plane/cadl/Resources.tsp b/specification/eventgrid/data-plane/typespec/Resources.tsp similarity index 100% rename from specification/eventgrid/data-plane/cadl/Resources.tsp rename to specification/eventgrid/data-plane/typespec/Resources.tsp diff --git a/specification/eventgrid/data-plane/cadl/ServiceBus.tsp b/specification/eventgrid/data-plane/typespec/ServiceBus.tsp similarity index 100% rename from specification/eventgrid/data-plane/cadl/ServiceBus.tsp rename to specification/eventgrid/data-plane/typespec/ServiceBus.tsp diff --git a/specification/eventgrid/data-plane/cadl/SignalRService.tsp b/specification/eventgrid/data-plane/typespec/SignalRService.tsp similarity index 100% rename from specification/eventgrid/data-plane/cadl/SignalRService.tsp rename to specification/eventgrid/data-plane/typespec/SignalRService.tsp diff --git a/specification/eventgrid/data-plane/cadl/Storage.tsp b/specification/eventgrid/data-plane/typespec/Storage.tsp similarity index 100% rename from specification/eventgrid/data-plane/cadl/Storage.tsp rename to specification/eventgrid/data-plane/typespec/Storage.tsp diff --git a/specification/eventgrid/data-plane/cadl/Testing.tsp b/specification/eventgrid/data-plane/typespec/Testing.tsp similarity index 100% rename from specification/eventgrid/data-plane/cadl/Testing.tsp rename to specification/eventgrid/data-plane/typespec/Testing.tsp diff --git a/specification/eventgrid/data-plane/cadl/Web.tsp b/specification/eventgrid/data-plane/typespec/Web.tsp similarity index 100% rename from specification/eventgrid/data-plane/cadl/Web.tsp rename to specification/eventgrid/data-plane/typespec/Web.tsp diff --git a/specification/eventgrid/data-plane/cadl/generation_steps.md b/specification/eventgrid/data-plane/typespec/generation_steps.md similarity index 100% rename from specification/eventgrid/data-plane/cadl/generation_steps.md rename to specification/eventgrid/data-plane/typespec/generation_steps.md diff --git a/specification/eventgrid/data-plane/cadl/main.tsp b/specification/eventgrid/data-plane/typespec/main.tsp similarity index 100% rename from specification/eventgrid/data-plane/cadl/main.tsp rename to specification/eventgrid/data-plane/typespec/main.tsp diff --git a/specification/eventgrid/data-plane/cadl/package-lock.json b/specification/eventgrid/data-plane/typespec/package-lock.json similarity index 100% rename from specification/eventgrid/data-plane/cadl/package-lock.json rename to specification/eventgrid/data-plane/typespec/package-lock.json diff --git a/specification/eventgrid/data-plane/cadl/package.json b/specification/eventgrid/data-plane/typespec/package.json similarity index 100% rename from specification/eventgrid/data-plane/cadl/package.json rename to specification/eventgrid/data-plane/typespec/package.json diff --git a/specification/eventgrid/data-plane/cadl/swagger/ApiManagement.json b/specification/eventgrid/data-plane/typespec/swagger/ApiManagement.json similarity index 100% rename from specification/eventgrid/data-plane/cadl/swagger/ApiManagement.json rename to specification/eventgrid/data-plane/typespec/swagger/ApiManagement.json diff --git a/specification/eventgrid/data-plane/cadl/swagger/AppConfiguration.json b/specification/eventgrid/data-plane/typespec/swagger/AppConfiguration.json similarity index 100% rename from specification/eventgrid/data-plane/cadl/swagger/AppConfiguration.json rename to specification/eventgrid/data-plane/typespec/swagger/AppConfiguration.json diff --git a/specification/eventgrid/data-plane/cadl/swagger/AzureCommunicationServices.json b/specification/eventgrid/data-plane/typespec/swagger/AzureCommunicationServices.json similarity index 100% rename from specification/eventgrid/data-plane/cadl/swagger/AzureCommunicationServices.json rename to specification/eventgrid/data-plane/typespec/swagger/AzureCommunicationServices.json diff --git a/specification/eventgrid/data-plane/cadl/swagger/ContainerRegistry.json b/specification/eventgrid/data-plane/typespec/swagger/ContainerRegistry.json similarity index 100% rename from specification/eventgrid/data-plane/cadl/swagger/ContainerRegistry.json rename to specification/eventgrid/data-plane/typespec/swagger/ContainerRegistry.json diff --git a/specification/eventgrid/data-plane/cadl/swagger/ContainerService.json b/specification/eventgrid/data-plane/typespec/swagger/ContainerService.json similarity index 100% rename from specification/eventgrid/data-plane/cadl/swagger/ContainerService.json rename to specification/eventgrid/data-plane/typespec/swagger/ContainerService.json diff --git a/specification/eventgrid/data-plane/cadl/swagger/EventGrid.json b/specification/eventgrid/data-plane/typespec/swagger/EventGrid.json similarity index 100% rename from specification/eventgrid/data-plane/cadl/swagger/EventGrid.json rename to specification/eventgrid/data-plane/typespec/swagger/EventGrid.json diff --git a/specification/eventgrid/data-plane/cadl/swagger/EventHub.json b/specification/eventgrid/data-plane/typespec/swagger/EventHub.json similarity index 100% rename from specification/eventgrid/data-plane/cadl/swagger/EventHub.json rename to specification/eventgrid/data-plane/typespec/swagger/EventHub.json diff --git a/specification/eventgrid/data-plane/cadl/swagger/HealthcareApis.json b/specification/eventgrid/data-plane/typespec/swagger/HealthcareApis.json similarity index 100% rename from specification/eventgrid/data-plane/cadl/swagger/HealthcareApis.json rename to specification/eventgrid/data-plane/typespec/swagger/HealthcareApis.json diff --git a/specification/eventgrid/data-plane/cadl/swagger/IotHub.json b/specification/eventgrid/data-plane/typespec/swagger/IotHub.json similarity index 100% rename from specification/eventgrid/data-plane/cadl/swagger/IotHub.json rename to specification/eventgrid/data-plane/typespec/swagger/IotHub.json diff --git a/specification/eventgrid/data-plane/cadl/swagger/KeyVault.json b/specification/eventgrid/data-plane/typespec/swagger/KeyVault.json similarity index 100% rename from specification/eventgrid/data-plane/cadl/swagger/KeyVault.json rename to specification/eventgrid/data-plane/typespec/swagger/KeyVault.json diff --git a/specification/eventgrid/data-plane/cadl/swagger/MachineLearningServices.json b/specification/eventgrid/data-plane/typespec/swagger/MachineLearningServices.json similarity index 100% rename from specification/eventgrid/data-plane/cadl/swagger/MachineLearningServices.json rename to specification/eventgrid/data-plane/typespec/swagger/MachineLearningServices.json diff --git a/specification/eventgrid/data-plane/cadl/swagger/Maps.json b/specification/eventgrid/data-plane/typespec/swagger/Maps.json similarity index 100% rename from specification/eventgrid/data-plane/cadl/swagger/Maps.json rename to specification/eventgrid/data-plane/typespec/swagger/Maps.json diff --git a/specification/eventgrid/data-plane/cadl/swagger/MediaServices.json b/specification/eventgrid/data-plane/typespec/swagger/MediaServices.json similarity index 100% rename from specification/eventgrid/data-plane/cadl/swagger/MediaServices.json rename to specification/eventgrid/data-plane/typespec/swagger/MediaServices.json diff --git a/specification/eventgrid/data-plane/cadl/swagger/PolicyInsights.json b/specification/eventgrid/data-plane/typespec/swagger/PolicyInsights.json similarity index 100% rename from specification/eventgrid/data-plane/cadl/swagger/PolicyInsights.json rename to specification/eventgrid/data-plane/typespec/swagger/PolicyInsights.json diff --git a/specification/eventgrid/data-plane/cadl/swagger/RedisCache.json b/specification/eventgrid/data-plane/typespec/swagger/RedisCache.json similarity index 100% rename from specification/eventgrid/data-plane/cadl/swagger/RedisCache.json rename to specification/eventgrid/data-plane/typespec/swagger/RedisCache.json diff --git a/specification/eventgrid/data-plane/cadl/swagger/Resources.json b/specification/eventgrid/data-plane/typespec/swagger/Resources.json similarity index 100% rename from specification/eventgrid/data-plane/cadl/swagger/Resources.json rename to specification/eventgrid/data-plane/typespec/swagger/Resources.json diff --git a/specification/eventgrid/data-plane/cadl/swagger/ServiceBus.json b/specification/eventgrid/data-plane/typespec/swagger/ServiceBus.json similarity index 100% rename from specification/eventgrid/data-plane/cadl/swagger/ServiceBus.json rename to specification/eventgrid/data-plane/typespec/swagger/ServiceBus.json diff --git a/specification/eventgrid/data-plane/cadl/swagger/SignalRService.json b/specification/eventgrid/data-plane/typespec/swagger/SignalRService.json similarity index 100% rename from specification/eventgrid/data-plane/cadl/swagger/SignalRService.json rename to specification/eventgrid/data-plane/typespec/swagger/SignalRService.json diff --git a/specification/eventgrid/data-plane/cadl/swagger/Storage.json b/specification/eventgrid/data-plane/typespec/swagger/Storage.json similarity index 100% rename from specification/eventgrid/data-plane/cadl/swagger/Storage.json rename to specification/eventgrid/data-plane/typespec/swagger/Storage.json diff --git a/specification/eventgrid/data-plane/cadl/swagger/Web.json b/specification/eventgrid/data-plane/typespec/swagger/Web.json similarity index 100% rename from specification/eventgrid/data-plane/cadl/swagger/Web.json rename to specification/eventgrid/data-plane/typespec/swagger/Web.json diff --git a/specification/eventgrid/data-plane/typespec/tsp-output/@typespec/openapi3/openapi.2018-01-01.yaml b/specification/eventgrid/data-plane/typespec/tsp-output/@typespec/openapi3/openapi.2018-01-01.yaml new file mode 100644 index 000000000000..290ae400846f --- /dev/null +++ b/specification/eventgrid/data-plane/typespec/tsp-output/@typespec/openapi3/openapi.2018-01-01.yaml @@ -0,0 +1,286 @@ +openapi: 3.0.0 +info: + title: EventGridClient + version: '2018-01-01' + description: Azure EventGrid Client +tags: [] +paths: + /send: + post: + operationId: send + description: Publish Events + parameters: + - $ref: '#/components/parameters/Azure.Core.Foundations.ApiVersionParameter' + - name: aeg-channel-name + in: header + required: false + description: channel name + schema: + type: string + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + type: object + properties: {} + x-typespec-name: '{}' + default: + description: An unexpected error response. + headers: + x-ms-error-code: + required: false + description: String error code indicating what went wrong. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse' + requestBody: + description: Events being published. + content: + application/json: + schema: + anyOf: + - $ref: '#/components/schemas/EventGridEvent' + - $ref: '#/components/schemas/CloudEventEvent' + x-typespec-name: EventGridEvent | CloudEventEvent +security: + - ApiKeyAuth: [] + - OAuth2Auth: + - https://eventgrid.azure.net/.default +components: + parameters: + Azure.Core.Foundations.ApiVersionParameter: + name: api-version + in: query + required: true + description: The API version to use for this operation. + schema: + type: string + minLength: 1 + schemas: + 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: '#/components/schemas/Azure.Core.Foundations.Error' + x-typespec-name: Azure.Core.Foundations.Error[] + description: >- + An array of details about specific errors that led to this reported + error. + innererror: + allOf: + - $ref: '#/components/schemas/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: + allOf: + - $ref: '#/components/schemas/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: + allOf: + - $ref: '#/components/schemas/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 + 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: + allOf: + - $ref: '#/components/schemas/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 Event Grid topic using the + CloudEvent 1.0 Schema + required: + - id + - source + - type + - specversion + CustomEventEvent: + type: object + properties: {} + description: >- + Properties of an event published to an Event Grid topic using a custom + schema + EventGridEvent: + type: object + properties: + id: + type: string + description: An unique identifier for the event. + topic: + type: string + description: The resource path of the event source. + subject: + type: string + description: A resource path relative to the topic path. + data: + allOf: + - $ref: '#/components/schemas/object' + description: Event data specific to the event type. + eventType: + type: string + description: The type of the event that occurred. + eventTime: + type: string + format: date-time + description: The time (in UTC) the event was generated. + metadataVersion: + type: string + description: The schema version of the event metadata. + readOnly: true + dataVersion: + type: string + description: The schema version of the data object. + description: >- + Properties of an event published to an Event Grid topic using the + EventGrid Schema. + required: + - id + - subject + - data + - eventType + - eventTime + - dataVersion + SubscriptionDeletedEventData: + type: object + properties: + eventSubscriptionId: + type: string + description: The Azure resource ID of the deleted event subscription. + readOnly: true + description: >- + Schema of the Data property of an EventGridEvent for a + Microsoft.EventGrid.SubscriptionDeletedEvent event. + SubscriptionValidationEventData: + type: object + properties: + validationCode: + type: string + description: >- + The validation code sent by Azure Event Grid to validate an event + subscription. To complete the validation handshake, the subscriber + must either respond with this validation code as part of the + validation response, or perform a GET request on the validationUrl + (available starting version 2018-05-01-preview). + readOnly: true + validationUrl: + type: string + description: >- + The validation URL sent by Azure Event Grid (available starting + version 2018-05-01-preview). To complete the validation handshake, + the subscriber must either respond with the validationCode as part + of the validation response, or perform a GET request on the + validationUrl (available starting version 2018-05-01-preview). + readOnly: true + description: >- + Schema of the Data property of an EventGridEvent for a + Microsoft.EventGrid.SubscriptionValidationEvent event. + SubscriptionValidationResponse: + type: object + properties: + validationResponse: + type: string + description: >- + The validation response sent by the subscriber to Azure Event Grid + to complete the validation of an event subscription. + description: >- + To complete an event subscription validation handshake, a subscriber can + use either the validationCode or the validationUrl received in a + SubscriptionValidationEvent. When the validationCode is used, the + SubscriptionValidationResponse can be used to build the response. + object: + type: object + properties: {} + securitySchemes: + ApiKeyAuth: + type: apiKey + in: header + name: aeg-sas-key + OAuth2Auth: + type: oauth2 + flows: + implicit: + authorizationUrl: https://login.microsoftonline.com/common/oauth2/v2.0/authorize + scopes: + https://eventgrid.azure.net/.default: '' +servers: + - url: '{endpoint}' + description: The host name of the topic + variables: + endpoint: + default: '' + description: The host name of the topic, e.g. topic1.westus2-1.eventgrid.azure.net From a19e0598ac5261dd772ae15c438686ab6df48a50 Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Wed, 15 Mar 2023 16:05:02 -0700 Subject: [PATCH 65/65] eventgrid updates --- .../data-plane/typespec/EventGrid.tsp | 29 +++++++------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/specification/eventgrid/data-plane/typespec/EventGrid.tsp b/specification/eventgrid/data-plane/typespec/EventGrid.tsp index ca968e0a246c..628acfe1d662 100644 --- a/specification/eventgrid/data-plane/typespec/EventGrid.tsp +++ b/specification/eventgrid/data-plane/typespec/EventGrid.tsp @@ -129,42 +129,35 @@ namespace EventGrid { // USE SHARED ROUTES - alias EventType = EventGridEvent | CloudEventEvent; - - @doc("Publish Events") - @post - @route("/send", { shared: true}) - op send is Azure.Core.RpcOperation<{ - @doc("channel name") - @header("aeg-channel-name") - channelName?: string, - - @doc("Events being published.") - @body - events: EventType - }, {}>; + alias EventType = EventGridEvent[] | CloudEventEvent[]; @doc("Publish CloudEvents") - @overload(send) @route("/send", { shared: true}) op PublishCloudEvent is Azure.Core.RpcOperation<{ + @doc("content type") @header("content-type") contentType: "application/cloudevents-batch+json; charset=utf-8", + @doc("Required only when publishing to partner namespaces with partner topic routing mode ChannelNameHeader.") + @header("aeg-channel-name") + channelName?: string, + @doc("Events being published.") @body - events: CloudEventEvent, + events: CloudEventEvent[], }, {} >; @doc("Publish EventGridEvents") - @overload(send) @route("/send", { shared: true}) op PublishEventGridEvent is Azure.Core.RpcOperation<{ + @doc("content type") + @header("content-type") + contentType: "application/json", @doc("Events being published.") @body - events: EventGridEvent, + events: EventGridEvent[], }, {} >; }