Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
25 changes: 24 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,26 @@ 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 $;
```
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
227 changes: 227 additions & 0 deletions sdk/messaging/eventgrid/azsystemevents/models.go

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

Loading