-
Notifications
You must be signed in to change notification settings - Fork 945
[azsystemevents] First generation of package for Azure Event Grid system events #22400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
richardpark-msft
merged 12 commits into
Azure:main
from
richardpark-msft:eg-systemevents
Feb 26, 2024
Merged
Changes from 4 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
5f97679
A system events pacakge
9918327
Adding in required LICENSE.txt
5f99323
Changelog and version.
b9399fe
- Removing some older tests - they weren't needed
64d8a3a
Clean up go.mod
fcf2d9d
Should be 1.18
86784ed
Replace a function that doesn't work with go1.18
6b29a39
- Moving to the final location decided by the arch board. Also, updat…
d3db121
Updating ci.yml
591f285
Readme, examples added.
c4c6442
Use aka links for things that aren't valid yet.
ee906a7
Removing eng/
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| ## 0.1.0 (2023-07-11) | ||
|
|
||
| ### Features Added | ||
|
|
||
| - Initial preview for the Event Grid package for Event Grid Namespaces | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| MIT License | ||
|
|
||
| Copyright (c) Microsoft Corporation. | ||
|
|
||
| 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,131 @@ | ||
| ## Go | ||
|
|
||
| ``` yaml | ||
| title: AzureEventGridSystemEvents | ||
| 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 | ||
| license-header: MICROSOFT_MIT_NO_VERSION | ||
| openapi-type: "data-plane" | ||
| output-folder: ../azsystemevents | ||
| override-client-name: ClientDeleteMe | ||
| security: "AADToken" | ||
| use: "@autorest/[email protected]" | ||
richardpark-msft marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| version: "^3.0.0" | ||
| slice-elements-byval: true | ||
| remove-non-reference-schema: true | ||
| batch: | ||
| - tag: package-2018-01 | ||
| directive: | ||
| - from: swagger-document | ||
| where: $ | ||
| transform: $['paths'] = {}; return $; | ||
| - from: swagger-document | ||
| where: $.definitions.MediaJobOutput | ||
| transform: > | ||
| $.required.push("@odata.type"); | ||
| $["x-csharp-usage"] = "model,output"; | ||
| # reference azcore/messaging/CloudEvent | ||
| - from: client.go | ||
richardpark-msft marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| where: $ | ||
| transform: return $.replace(/\[\]CloudEvent/g, "[]messaging.CloudEvent"); | ||
| - from: client.go | ||
| where: $ | ||
| transform: return $.replace(/func \(client \*Client\) PublishCloudEventEvents\(/g, "func (client *Client) internalPublishCloudEventEvents("); | ||
| - from: swagger-document | ||
| where: $.definitions.CloudEventEvent | ||
| transform: $["x-ms-external"] = true | ||
| - from: | ||
| - models.go | ||
| - models_serde.go | ||
| where: $ | ||
| transform: | | ||
| return $.replace(/ResourceActionCancelData/g, 'ResourceActionCancelEventData') | ||
| .replace(/ResourceActionFailureData/g, 'ResourceActionFailureEventData') | ||
| .replace(/ResourceActionSuccessData/g, 'ResourceActionSuccessEventData') | ||
| .replace(/ResourceDeleteCancelData/g, 'ResourceDeleteCancelEventData') | ||
| .replace(/ResourceDeleteFailureData/g, 'ResourceDeleteFailureEventData') | ||
| .replace(/ResourceDeleteSuccessData/g, 'ResourceDeleteSuccessEventData') | ||
| .replace(/ResourceWriteCancelData/g, 'ResourceWriteCancelEventData') | ||
| .replace(/ResourceWriteFailureData/g, 'ResourceWriteFailureEventData') | ||
| .replace(/ResourceWriteSuccessData/g, 'ResourceWriteSuccessEventData') | ||
| ``` | ||
|
|
||
| ```yaml | ||
| directive: | ||
| - from: | ||
| - models.go | ||
| - client.go | ||
| - response_types.go | ||
| - options.go | ||
| where: $ | ||
| transform: return $.replace(/CloudEventEvent/g, "CloudEvent"); | ||
| - from: | ||
| - models.go | ||
| - models_serde.go | ||
| - client.go | ||
| - response_types.go | ||
| - options.go | ||
| where: $ | ||
| transform: return $.replace(/Schema of the Data property of an EventGridEvent/g, "Schema of the Data property of an CloudEvent/EventGridEvent"); | ||
| ``` | ||
|
|
||
| ```yaml | ||
| directive: | ||
| - from: | ||
| - models.go | ||
| - models_serde.go | ||
| where: $ | ||
| transform: | | ||
| return $ | ||
| .replace(/ChannelLatencyMs \*string/g, "ChannelLatencyMS *string") | ||
| .replace(/m.ChannelLatencyMs/g, "m.ChannelLatencyMS"); | ||
| ``` | ||
|
|
||
| ```yaml | ||
| directive: | ||
| - from: constants.go | ||
| where: $ | ||
| transform: return $.replace(/EventGridMqttClientDisconnectionReason/g, "EventGridMQTTClientDisconnectionReason") | ||
| - from: models.go | ||
| where: $ | ||
| transform: return $.replace(/DisconnectionReason \*EventGridMqttClientDisconnectionReason/, "DisconnectionReason *EventGridMQTTClientDisconnectionReason") | ||
| ``` | ||
|
|
||
| Manually map n/a to the zero value for the type for `MediaLiveEventChannelArchiveHeartbeatEventData` and `MediaLiveEventIngestHeartbeatEventData` | ||
|
|
||
| ```yaml | ||
| directive: | ||
| - from: models_serde.go | ||
| where: $ | ||
| transform: | | ||
| return $ | ||
| .replace(/(\s+err = unpopulate\(val, "IngestDriftValue", &m.IngestDriftValue\))/, "$1\nfixNAValue(&m.IngestDriftValue)") | ||
| .replace(/(\s+err = unpopulate\(val, "ChannelLatencyMs", &m.ChannelLatencyMS\))/, "$1\nfixNAValue(&m.ChannelLatencyMS)"); | ||
| ``` | ||
|
|
||
| Rename `AcsRouterWorkerSelector.TTLSeconds` to `TimeToLive` | ||
|
|
||
| ```yaml | ||
| directive: | ||
| - from: | ||
| - models.go | ||
| where: $ | ||
| transform: return $.replace(/TTLSeconds \*float32/g, "TimeToLive *float32"); | ||
| - from: | ||
| - models_serde.go | ||
| where: $ | ||
| transform: return $.replace(/a\.TTLSeconds/g, "a.TimeToLive"); | ||
| ``` | ||
|
|
||
| Fix the EventGridEvent deserialization to work similar to CloudEvent. | ||
|
|
||
| ```yaml | ||
| directive: | ||
| - from: models_serde.go | ||
| where: $ | ||
| transform: | | ||
| return $.replace(/err = unpopulate\(val, "Data", &e.Data\)/, "e.Data = []byte(val)") | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| //go:build go1.18 | ||
| // +build go1.18 | ||
|
|
||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. See License.txt in the project root for license information. | ||
|
|
||
| //go:generate autorest ./autorest.md | ||
| //go:generate goimports -w ./.. | ||
| //go:generate go run ./internal/generate generate | ||
| //go:generate goimports -w ./.. | ||
|
|
||
| package azsystemevents |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. | ||
| trigger: | ||
| branches: | ||
| include: | ||
| - main | ||
| - feature/* | ||
| - hotfix/* | ||
| - release/* | ||
| paths: | ||
| include: | ||
| - sdk/messaging/azsystemevents | ||
| - eng/ | ||
|
|
||
| pr: | ||
| branches: | ||
| include: | ||
| - main | ||
| - feature/* | ||
| - hotfix/* | ||
| - release/* | ||
| paths: | ||
| include: | ||
| - sdk/messaging/azsystemevents | ||
|
|
||
| stages: | ||
| - template: /eng/pipelines/templates/jobs/archetype-sdk-client.yml | ||
| parameters: | ||
| ServiceDirectory: "messaging/azsystemevents" | ||
| RunLiveTests: true | ||
| UsePipelineProxy: false | ||
| Location: westus2 | ||
| EnvVars: | ||
| AZURE_CLIENT_ID: $(AZSYSTEMEVENTS_CLIENT_ID) | ||
| AZURE_TENANT_ID: $(AZSYSTEMEVENTS_TENANT_ID) | ||
| AZURE_CLIENT_SECRET: $(AZSYSTEMEVENTS_CLIENT_SECRET) | ||
| AZURE_SUBSCRIPTION_ID: $(AZSYSTEMEVENTS_SUBSCRIPTION_ID) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.