Skip to content

Commit

Permalink
[EG] System events reformat (Azure#28706)
Browse files Browse the repository at this point in the history
* refactor

* updayrd

* format

* add apicenter

* update new events

* tsp format

* new events

* modelAsString for Media Union as False

* tsp format

* Revert "tsp format"

This reverts commit 1a01cf8.

* Revert "modelAsString for Media Union as False"

This reverts commit 6b60581.

* remove ReadOnly

* rename resources

* remove duplicate vault

* remove Optional from Nullable Types part 1

* add csharp to x-ms-client-names

* typo

* swagger typo

* formatting

* Client Name Overrides JS EG System Events

* Adding in renames for Go

* fix RecordingDurationMs casing

* Fixing something that Libba refused to for like months now.

* Removing SystemEvents from the constant names

* Should be a number == float64.

* Field name is labelOperator, not operator.

(as shown here: https://github.com/Azure/azure-rest-api-specs/blob/0a8300f818c1df4018e2586540bed4c72c7c5375/specification/eventgrid/data-plane/Microsoft.Communication/stable/2018-01-01/AzureCommunicationServices.json#L2120)

* Field is state, not selectorState:

https://github.com/Azure/azure-rest-api-specs/blob/0a8300f818c1df4018e2586540bed4c72c7c5375/specification/eventgrid/data-plane/Microsoft.Communication/stable/2018-01-01/AzureCommunicationServices.json#L2171

* More renames to bring us to par with what we had before.

* Adding in some docs that were missing for unions.

* format

* fix warnigns

* moving around clientNames

* spellcheck

* try to update csharp clientNames

* tsp format

* missing labelValue x-ms-client-name

* format

* nit typo

* update csharp

---------

Co-authored-by: Sarangan Rajamanickam <sarajama@microsoft.com>
Co-authored-by: ripark <ripark@microsoft.com>
  • Loading branch information
3 people authored Jun 3, 2024
1 parent 8713240 commit a58614a
Show file tree
Hide file tree
Showing 56 changed files with 4,790 additions and 2,325 deletions.
6 changes: 6 additions & 0 deletions cSpell.json
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,12 @@
"clientsession"
]
},
{
"filename": "**/specification/eventgrid/data-plane/Microsoft.EventGrid/stable/2024-01-01/SystemEvents.json",
"words": [
"whatsapp"
]
},
{
"filename": "**/specification/eventgrid/data-plane/Microsoft.EventGrid/**/EventGrid.json",
"words": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,15 @@ model AvsClusterFailedEventData extends AvsClusterEventData {
failureMessage?: string;
}

/** Schema of the Data property of an EventGridEvent for a Microsoft.AVS.ScriptExecutionStarted event. */
#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "Maintain compatibility with existing models."
model AvsScriptExecutionStartedEventData extends AvsScriptExecutionEventData {}

/** Schema of the Data property of an EventGridEvent for a Microsoft.AVS.ScriptExecutionFinished event. */
#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "Maintain compatibility with existing models."
model AvsScriptExecutionFinishedEventData extends AvsScriptExecutionEventData {
/** Named outputs of completed execution, if any. */
namedOutputs?: Record<string>;
namedOutputs: Record<string>;
}

/** Schema of the Data property of an EventGridEvent for a Microsoft.AVS.ScriptExecutionCancelled event. */
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
import "@azure-tools/typespec-client-generator-core";

using Azure.ClientGenerator.Core;
//Models
@@usage(Microsoft.EventGrid.SystemEvents.AvsPrivateCloudUpdatingEventData,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.AvsPrivateCloudUpdatingEventData,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.AvsPrivateCloudUpdatedEventData,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.AvsPrivateCloudUpdatedEventData,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.AvsPrivateCloudFailedEventData,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.AvsPrivateCloudFailedEventData,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.AvsClusterCreatedEventData,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.AvsClusterCreatedEventData,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.AvsClusterDeletedEventData,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.AvsClusterDeletedEventData,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.AvsClusterUpdatingEventData,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.AvsClusterUpdatingEventData,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.AvsClusterUpdatedEventData,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.AvsClusterUpdatedEventData,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.AvsClusterFailedEventData,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.AvsClusterFailedEventData,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.AvsScriptExecutionStartedEventData,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.AvsScriptExecutionStartedEventData,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.AvsScriptExecutionFinishedEventData,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.AvsScriptExecutionFinishedEventData,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.AvsScriptExecutionCancelledEventData,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.AvsScriptExecutionCancelledEventData,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.AvsScriptExecutionFailedEventData,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.AvsScriptExecutionFailedEventData,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.AvsPrivateCloudEventData,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.AvsPrivateCloudEventData,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.AvsClusterEventData, Usage.output);
@@access(Microsoft.EventGrid.SystemEvents.AvsClusterEventData, Access.public);
@@usage(Microsoft.EventGrid.SystemEvents.AvsScriptExecutionEventData,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.AvsScriptExecutionEventData,
Access.public
);
//Enums
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/** Describes the schema of the Azure API Center events published to Azure Event Grid. This corresponds to the Data property of an EventGridEvent. */
namespace Microsoft.EventGrid.SystemEvents;

/** Schema of the data property of an EventGridEvent for a Microsoft.ApiCenter.ApiDefinitionAdded event. */
model ApiCenterApiDefinitionAddedEventData {
/** API definition title. */
title?: string;

/** API definition description. */
description?: string;

/** API definition specification. */
specification: ApiCenterApiSpecification;
}

/** Schema of the data property of an EventGridEvent for a Microsoft.ApiCenter.ApiDefinitionUpdated event. */
model ApiCenterApiDefinitionUpdatedEventData {
/** API definition title. */
title?: string;

/** API definition description. */
description?: string;

/** API definition specification. */
specification: ApiCenterApiSpecification;
}

/** API specification details. */
model ApiCenterApiSpecification {
/** Specification name. */
name?: string;

/** Specification version. */
version?: string;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import "@azure-tools/typespec-client-generator-core";

using Azure.ClientGenerator.Core;
//Models
@@usage(Microsoft.EventGrid.SystemEvents.ApiCenterApiDefinitionAddedEventData,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.ApiCenterApiDefinitionAddedEventData,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.ApiCenterApiDefinitionUpdatedEventData,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.ApiCenterApiDefinitionUpdatedEventData,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.ApiCenterApiSpecification,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.ApiCenterApiSpecification,
Access.public
);
//Enums
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
import "@azure-tools/typespec-client-generator-core";

using Azure.ClientGenerator.Core;
//Models
@@usage(Microsoft.EventGrid.SystemEvents.ApiManagementUserCreatedEventData,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.ApiManagementUserCreatedEventData,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.ApiManagementUserUpdatedEventData,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.ApiManagementUserUpdatedEventData,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.ApiManagementUserDeletedEventData,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.ApiManagementUserDeletedEventData,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.ApiManagementSubscriptionCreatedEventData,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.ApiManagementSubscriptionCreatedEventData,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.ApiManagementSubscriptionUpdatedEventData,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.ApiManagementSubscriptionUpdatedEventData,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.ApiManagementSubscriptionDeletedEventData,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.ApiManagementSubscriptionDeletedEventData,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.ApiManagementProductCreatedEventData,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.ApiManagementProductCreatedEventData,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.ApiManagementProductUpdatedEventData,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.ApiManagementProductUpdatedEventData,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.ApiManagementProductDeletedEventData,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.ApiManagementProductDeletedEventData,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.ApiManagementApiCreatedEventData,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.ApiManagementApiCreatedEventData,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.ApiManagementApiUpdatedEventData,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.ApiManagementApiUpdatedEventData,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.ApiManagementApiDeletedEventData,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.ApiManagementApiDeletedEventData,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.ApiManagementApiReleaseCreatedEventData,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.ApiManagementApiReleaseCreatedEventData,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.ApiManagementApiReleaseUpdatedEventData,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.ApiManagementApiReleaseUpdatedEventData,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.ApiManagementApiReleaseDeletedEventData,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.ApiManagementApiReleaseDeletedEventData,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.ApiManagementGatewayCreatedEventData,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.ApiManagementGatewayCreatedEventData,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.ApiManagementGatewayUpdatedEventData,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.ApiManagementGatewayUpdatedEventData,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.ApiManagementGatewayDeletedEventData,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.ApiManagementGatewayDeletedEventData,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.ApiManagementGatewayHostnameConfigurationCreatedEventData,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.ApiManagementGatewayHostnameConfigurationCreatedEventData,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.ApiManagementGatewayHostnameConfigurationUpdatedEventData,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.ApiManagementGatewayHostnameConfigurationUpdatedEventData,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.ApiManagementGatewayHostnameConfigurationDeletedEventData,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.ApiManagementGatewayHostnameConfigurationDeletedEventData,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.ApiManagementGatewayCertificateAuthorityCreatedEventData,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.ApiManagementGatewayCertificateAuthorityCreatedEventData,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.ApiManagementGatewayCertificateAuthorityUpdatedEventData,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.ApiManagementGatewayCertificateAuthorityUpdatedEventData,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.ApiManagementGatewayCertificateAuthorityDeletedEventData,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.ApiManagementGatewayCertificateAuthorityDeletedEventData,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.ApiManagementGatewayApiAddedEventData,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.ApiManagementGatewayApiAddedEventData,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.ApiManagementGatewayApiRemovedEventData,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.ApiManagementGatewayApiRemovedEventData,
Access.public
);
//Enums
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import "@azure-tools/typespec-client-generator-core";

using Azure.ClientGenerator.Core;
//Models
@@usage(Microsoft.EventGrid.SystemEvents.AppConfigurationKeyValueModifiedEventData,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.AppConfigurationKeyValueModifiedEventData,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.AppConfigurationKeyValueDeletedEventData,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.AppConfigurationKeyValueDeletedEventData,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.AppConfigurationSnapshotEventData,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.AppConfigurationSnapshotEventData,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.AppConfigurationSnapshotCreatedEventData,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.AppConfigurationSnapshotCreatedEventData,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.AppConfigurationSnapshotModifiedEventData,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.AppConfigurationSnapshotModifiedEventData,
Access.public
);
//Enums
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
namespace Microsoft.EventGrid.SystemEvents {
alias RedisBaseEventData = {
/** The time at which the event occurred. */
timestamp?: utcDateTime;
timestamp: utcDateTime;

/** The name of this event. */
name?: string;
Expand Down
Loading

0 comments on commit a58614a

Please sign in to comment.