Skip to content

Commit

Permalink
[azsystemevents] Updating to the latest commit: fb64eaa0dfc7ee8abc8e1…
Browse files Browse the repository at this point in the history
…0369495729d5b3c1cc5 (#23775)
  • Loading branch information
richardpark-msft authored Nov 19, 2024
1 parent 5b99014 commit 6cfdc39
Show file tree
Hide file tree
Showing 13 changed files with 808 additions and 1,240 deletions.
9 changes: 7 additions & 2 deletions sdk/messaging/eventgrid/azsystemevents/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
# Release History

## 0.4.4 (Unreleased)
## 0.5.0 (2024-11-19)

### Features Added

- A new system event has been added: `ResourceNotificationsContainerServiceEventResourcesScheduledEventData`
- A new field: `StorageLifecyclePolicyCompletedEventData.PolicyRunSummary`

### Breaking Changes

- Models, that were not system events, have been removed. Any fields from those types are incorporated into their corresponding system event type.

### Bugs Fixed

### Other Changes
- ACSMessageDeliveryStatusUpdatedEventData.Error has been corrected to use an exported type.

## 0.4.3 (2024-10-14)

Expand Down
21 changes: 21 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.

6 changes: 3 additions & 3 deletions sdk/messaging/eventgrid/azsystemevents/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/Azure/azure-sdk-for-go/sdk/messaging/eventgrid/azsystemevents
go 1.18

require (
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.16.0
github.com/joho/godotenv v1.5.1
github.com/stretchr/testify v1.9.0
)
Expand All @@ -12,7 +12,7 @@ require (
github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
golang.org/x/net v0.27.0 // indirect
golang.org/x/text v0.16.0 // indirect
golang.org/x/net v0.29.0 // indirect
golang.org/x/text v0.18.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
12 changes: 6 additions & 6 deletions sdk/messaging/eventgrid/azsystemevents/go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 h1:GJHeeA2N7xrG3q30L2UXDyuWRzDM900/65j70wcM4Ww=
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0/go.mod h1:l38EPgmsp71HHLq9j7De57JcKOWPyhrsW1Awm1JS6K0=
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.16.0 h1:JZg6HRh6W6U4OLl6lk7BZ7BLisIzM9dG1R50zUk9C/M=
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.16.0/go.mod h1:YL1xnZ6QejvQHWJrX/AvhFl4WW4rqHVoKspWNVwFk0M=
github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY=
github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
Expand All @@ -13,10 +13,10 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo=
golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0=
golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224=
golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ func main() {
return err
}

// remove extraneous types
if err := doRemove(); err != nil {
return err
}

if err := generateSystemEventEnum(); err != nil {
return err
}
Expand All @@ -40,7 +35,7 @@ func main() {
}

if err := fn(); err != nil {
fmt.Printf("Failed with error: %s\n", err)
fmt.Printf("./internal/generate: Failed with error: %s\n", err)
os.Exit(1)
}

Expand All @@ -57,6 +52,19 @@ func swapErrorTypes() error {
return err
}

// NOTE: the renaming of the error type is done in the propertyNameOverrideGo.tsp (AcsMessageChannelEventError)

// NOTE: there appears to be a bug where my type name is automatically being capitalized, even though I marked it as internal.
// Filed as https://github.com/Azure/autorest.go/issues/1467.
if err := gopls.Rename(syms.Get("InternalACSMessageChannelEventError"), "internalACSMessageChannelEventError"); err != nil {
return err
}

if err := gopls.Rename(syms.Get("InternalACSRouterCommunicationError"), "internalACSRouterCommunicationError"); err != nil {
return err
}

// TODO: do I really need to handle these myself? Can I not use TypeSpec to do it?
{
if err := SwapType(syms.Get("AcsMessageReceivedEventData.Error"), "*Error"); err != nil {
return err
Expand All @@ -67,6 +75,16 @@ func swapErrorTypes() error {
}
}

{
if err := SwapType(syms.Get("ACSMessageDeliveryStatusUpdatedEventData.Error"), "*Error"); err != nil {
return err
}

if err := UseCustomUnpopulate(modelsSerdeGoFile, "ACSMessageDeliveryStatusUpdatedEventData.Error", "unmarshalInternalACSMessageChannelEventError"); err != nil {
return err
}
}

{
if err := SwapType(syms.Get("AcsRouterJobClassificationFailedEventData.Errors"), "[]*Error"); err != nil {
return err
Expand All @@ -93,7 +111,7 @@ func swapErrorTypes() error {
}

if strings.HasSuffix(sym.Name, "Error") && !strings.HasPrefix(sym.Name, "internal") && sym.Type == "Struct" {
return fmt.Errorf("found redundant unhandled error type %s\n", sym.Name)
return fmt.Errorf("found error type which should have been deleted/renamed %q", sym.Name)
}
}

Expand Down Expand Up @@ -134,38 +152,3 @@ func deleteUnneededFiles() {
}
}
}

func doRemove() error {
modelsToRemove := []string{
// These types are base objects of some of our system events in the TypeSpec, giving them a simple way to share fields.
// Our generator handles this parent/child relationship by just inlining those properties into the children, so the base struct is just vestigial.
// Note that these have been annotated with @output, which is why they're not just clipped out using our normal "unused/unreferenced" type logic
// in the Go emitter.
"ACSChatEventBaseProperties",
"ACSChatEventInThreadBaseProperties",
"ACSChatMessageEventBaseProperties",
"ACSChatMessageEventInThreadBaseProperties",
"ACSChatThreadEventBaseProperties",
"ACSChatThreadEventInThreadBaseProperties",
"ACSRouterEventData",
"ACSRouterJobEventData",
"ACSRouterWorkerEventData",
"ACSSmsEventBaseProperties",
"AppConfigurationSnapshotEventData",
"AVSClusterEventData",
"AVSPrivateCloudEventData",
"AVSScriptExecutionEventData",
"ContainerServiceClusterSupportEventData",
"ContainerServiceNodePoolRollingEventData",
"ResourceNotificationsResourceDeletedEventData",
"ResourceNotificationsResourceUpdatedEventData",
}

for _, m := range modelsToRemove {
if err := DeleteType(m); err != nil {
return err
}
}

return nil
}
2 changes: 1 addition & 1 deletion sdk/messaging/eventgrid/azsystemevents/internal/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ const (
ModuleName = "azsystemevents"

// ModuleVersion is the semantic version (see http://semver.org) of this module.
ModuleVersion = "v0.4.4"
ModuleVersion = "v0.5.0"
)
Loading

0 comments on commit 6cfdc39

Please sign in to comment.