diff --git a/go.mod b/go.mod index 952d06ebfc49..d281f52c185a 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/golang-jwt/jwt/v4 v4.5.0 github.com/google/go-cmp v0.6.0 github.com/google/uuid v1.6.0 - github.com/hashicorp/go-azure-helpers v0.70.1 + github.com/hashicorp/go-azure-helpers v0.71.0 github.com/hashicorp/go-azure-sdk/resource-manager v0.20241104.1140654 github.com/hashicorp/go-azure-sdk/sdk v0.20241104.1140654 github.com/hashicorp/go-hclog v1.6.3 diff --git a/go.sum b/go.sum index b89d7fd12565..3afe50012f37 100644 --- a/go.sum +++ b/go.sum @@ -91,8 +91,8 @@ github.com/hashicorp/errwrap v0.0.0-20180715044906-d6c0cd880357/go.mod h1:YH+1FK github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-azure-helpers v0.70.1 h1:7hlnRrZobMZxpOzdlNEsayzAayj/KRG4wpDS1jgo4GM= -github.com/hashicorp/go-azure-helpers v0.70.1/go.mod h1:BmbF4JDYXK5sEmFeU5hcn8Br21uElcqLfdQxjatwQKw= +github.com/hashicorp/go-azure-helpers v0.71.0 h1:ra3aIRzg01g6MLKQ+yABcb6WJtrqRUDDgyuPLmyZ9lY= +github.com/hashicorp/go-azure-helpers v0.71.0/go.mod h1:BmbF4JDYXK5sEmFeU5hcn8Br21uElcqLfdQxjatwQKw= github.com/hashicorp/go-azure-sdk/resource-manager v0.20241104.1140654 h1:mJJ+LO2Xdu5S+Ccie0QTGXEupuVZfkQqCZ2/IOMeDIo= github.com/hashicorp/go-azure-sdk/resource-manager v0.20241104.1140654/go.mod h1:JFrQrK0Pbn0ynhgcnIsgD9lp1xq0vaRVtnxvPFiar1U= github.com/hashicorp/go-azure-sdk/sdk v0.20241104.1140654 h1:DxQDXVDMu2Jkli2KAWvwU2+fR9I7W5U2dKpwUAkARig= diff --git a/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/app_service_logic_app.go b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/app_service_logic_app.go new file mode 100644 index 000000000000..916490ed6737 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/commonids/app_service_logic_app.go @@ -0,0 +1,55 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package commonids + +import "fmt" + +// NOTE: A Logic App is just an App Service instance - but to allow for potential differentiation in the future +// we're wrapping this to provide a unique Type, Parse and Validation functions. + +type LogicAppId = AppServiceId + +// ParseLogicAppId parses 'input' into a LogicAppId +func ParseLogicAppId(input string) (*LogicAppId, error) { + parsed, err := ParseAppServiceID(input) + if err != nil { + return nil, fmt.Errorf("parsing %q as a Logic App ID: %+v", input, err) + } + + return &LogicAppId{ + SubscriptionId: parsed.SubscriptionId, + ResourceGroupName: parsed.ResourceGroupName, + SiteName: parsed.SiteName, + }, nil +} + +// ParseLogicAppIdInsensitively parses 'input' case-insensitively into a LogicAppId +// note: this method should only be used for API response data and not user input +func ParseLogicAppIdInsensitively(input string) (*LogicAppId, error) { + parsed, err := ParseAppServiceIDInsensitively(input) + if err != nil { + return nil, fmt.Errorf("parsing %q as a Logic App ID: %+v", input, err) + } + + return &LogicAppId{ + SubscriptionId: parsed.SubscriptionId, + ResourceGroupName: parsed.ResourceGroupName, + SiteName: parsed.SiteName, + }, nil +} + +// ValidateLogicAppId checks that 'input' can be parsed as a Logic App ID +func ValidateLogicAppId(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseLogicAppId(v); err != nil { + errors = append(errors, err) + } + + return +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 65d46228a169..17f236d01267 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -127,7 +127,7 @@ github.com/google/uuid # github.com/hashicorp/errwrap v1.1.0 ## explicit github.com/hashicorp/errwrap -# github.com/hashicorp/go-azure-helpers v0.70.1 +# github.com/hashicorp/go-azure-helpers v0.71.0 ## explicit; go 1.21 github.com/hashicorp/go-azure-helpers/eventhub github.com/hashicorp/go-azure-helpers/lang/dates