Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package dataworkarounds

import (
"fmt"

"github.com/hashicorp/pandora/tools/importer-rest-api-specs/models"
)

var _ workaround = workaroundAutomation25435{}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a link to the issue here as well as a brief summary on the issue.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added.

// workaround for https://github.com/Azure/azure-rest-api-specs/pull/25435
// this is a workaround for the fact that the `CreateOrUpdate` operation for `Python3Package` is not marked as `LongRunning`
type workaroundAutomation25435 struct {
}

func (workaroundAutomation25435) IsApplicable(apiDefinition *models.AzureApiDefinition) bool {
return apiDefinition.ServiceName == "Automation" && apiDefinition.ApiVersion == "2022-08-08"
}

func (workaroundAutomation25435) Name() string {
return "Automation / 25434"
}

func (workaroundAutomation25435) Process(apiDefinition models.AzureApiDefinition) (*models.AzureApiDefinition, error) {
resource, ok := apiDefinition.Resources["Python3Package"]
if !ok {
return nil, fmt.Errorf("expected a Resource named `Python3Package`")
}
operation, ok := resource.Operations["CreateOrUpdate"]
if !ok {
return nil, fmt.Errorf("expected an Operation named `CreateOrUpdate` for `Python3Package`")
}

operation.LongRunning = true
resource.Operations["CreateOrUpdate"] = operation
apiDefinition.Resources["Python3Package"] = resource

return &apiDefinition, nil
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ var workarounds = []workaround{
workaroundAuthorization25080{},
workaroundDigitalTwins25120{},
workaroundAutomation25108{},
workaroundAutomation25435{},
workaroundBatch21291{},
workaroundContainerService21394{},
workaroundDataFactory23013{},
Expand Down