Skip to content

Commit

Permalink
[azeventgrid(s)] Regenerating azsystemevents based on latest commit, …
Browse files Browse the repository at this point in the history
…updating CHANGELOG dates for release. (#22514)

- Prepping all the eventgrid packages for release. All of these releases are betas.
- Regenerating the azsystemevents package based on the latest commit.
  • Loading branch information
richardpark-msft committed Mar 5, 2024
1 parent bc4f15f commit ae828a8
Show file tree
Hide file tree
Showing 13 changed files with 1,377 additions and 467 deletions.
4 changes: 2 additions & 2 deletions sdk/messaging/eventgrid/azeventgrid/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Release History

## 0.1.0 (Unreleased)
## 0.1.0 (2024-03-05)

### Features Added

- Initial preview for the Event Grid Basic module.
- Initial preview for the Event Grid Basic module. This module is the new home the `github.com/Azure/azure-sdk-for-go/sdk/messaging/azeventgrid/publisher` package.
8 changes: 1 addition & 7 deletions sdk/messaging/eventgrid/aznamespaces/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
# Release History

## 0.4.1 (Unreleased)

### Features Added
## 0.4.1 (2024-03-05)

### Breaking Changes

- This module has been moved from its previous location in `azeventgrid` to this location (`github.com/Azure/azure-sdk-for-go/sdk/messaging/eventgrid/aznamespaces`).

### Bugs Fixed

### Other Changes

## 0.4.0 (2023-11-27)

### Features Added
Expand Down
2 changes: 1 addition & 1 deletion sdk/messaging/eventgrid/azsystemevents/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 0.1.0 (TBD)
## 0.1.0 (2024-03-05)

### Features Added

Expand Down
48 changes: 47 additions & 1 deletion sdk/messaging/eventgrid/azsystemevents/autorest.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: Azure Event Grid system events
generated-metadata: false
clear-output-folder: false
go: true
require: https://github.com/Azure/azure-rest-api-specs/blob/11bbc2b1df2e915a2227a6a1a48a27b9e67c3311/specification/eventgrid/data-plane/readme.md
require: https://github.com/Azure/azure-rest-api-specs/blob/1d89c126e2d0e09112b218151a916617d1128cf5/specification/eventgrid/data-plane/readme.md
license-header: MICROSOFT_MIT_NO_VERSION
openapi-type: "data-plane"
output-folder: ../azsystemevents
Expand Down Expand Up @@ -121,3 +121,49 @@ directive:
transform: |
return $.replace(/err = unpopulate\(val, "Data", &e.Data\)/, "e.Data = []byte(val)")
```

Remove models that are only used as base models, but aren't needed. The OpenAPI emitter
just duplicates the fields into each child, rather than embedding. So these aren't needed.

```yaml
directive:
- from: models.go
where: $
transform: return $.replace(/\/\/ (AvsClusterEventData|AvsPrivateCloudEventData|AvsScriptExecutionEventData) - .+?\n}\n/gs, "");
- from: models_serde.go
where: $
transform: |
for (let name of ["AvsClusterEventData", "AvsPrivateCloudEventData", "AvsScriptExecutionEventData"]) {
// ex: '// MarshalJSON implements the json.Marshaller interface for type AvsScriptExecutionEventData.'
const marshalPrefix = `// MarshalJSON implements the json\.Marshaller interface for type ${name}.+?\n}\n`;
// ex: '// UnmarshalJSON implements the json.Unmarshaller interface for type AvsClusterEventData.'
const unmarshalPrefix = `// UnmarshalJSON implements the json\.Unmarshaller interface for type ${name}.+?\n}\n`;

$ = $.replace(new RegExp(marshalPrefix, "gs"), "");
$ = $.replace(new RegExp(unmarshalPrefix, "gs"), "");
}
return $;
```

Fix acronyms so they match our naming convention.

```yaml
directive:
- from:
- models.go
- models_serde.go
where: $
debug: true
transform: |
const acronyms = ["Acs", "Avs", "Iot"];
for (let acr of acronyms) {
// ex:
// '// AcsChatMessageDeletedEventData - Schema'
// 'type AcsChatMessageDeletedEventData struct'
// 'Participants []AcsChatThreadParticipantProperties'
// 'ParticipantRemoved *AcsChatThreadParticipantProperties'
const re = new RegExp(`([ *\\]])${acr}([A-Za-z0-9]+?(?:EventData|Properties))`, "sg");
$ = $.replace(re, `$1${acr.toUpperCase()}$2`);
}
return $;
```
16 changes: 16 additions & 0 deletions sdk/messaging/eventgrid/azsystemevents/constants.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ func getConstantValues(reader io.ReadCloser) (map[string]constant, error) {
ignorable := false

// we have a few types that we can ignore - they're not top-level SystemEvents (they're
// embeded or used by other events).
// embedded or used by other events).
for _, prefix := range ignoredTypes {
if strings.HasPrefix(comment.Text, prefix) {
ignorable = true
Expand Down
Loading

0 comments on commit ae828a8

Please sign in to comment.