diff --git a/go.mod b/go.mod index a1f36e9a7bfa..5b0edd1ba65a 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/gofrs/uuid v4.0.0+incompatible github.com/google/go-cmp v0.5.6 github.com/google/uuid v1.1.2 - github.com/hashicorp/go-azure-helpers v0.28.0 + github.com/hashicorp/go-azure-helpers v0.30.0 github.com/hashicorp/go-multierror v1.1.1 github.com/hashicorp/go-uuid v1.0.2 github.com/hashicorp/go-version v1.3.0 diff --git a/go.sum b/go.sum index 3e566a36d2bc..0f22e2b718a3 100644 --- a/go.sum +++ b/go.sum @@ -256,8 +256,8 @@ github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brv 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.12.0/go.mod h1:Zc3v4DNeX6PDdy7NljlYpnrdac1++qNW0I4U+ofGwpg= -github.com/hashicorp/go-azure-helpers v0.28.0 h1:MGRtyj7S7+fecsxTrKZAhqNj29Z1JPpzJOMCiYJGLRc= -github.com/hashicorp/go-azure-helpers v0.28.0/go.mod h1:IE2catLXPXO5L1rRCqOnZjN2s84uGNyYg0IiF2IgeAo= +github.com/hashicorp/go-azure-helpers v0.30.0 h1:4wuiUiX52fmFc3tLK+uFm2f5gYqx+J3+q8Bza2YDR70= +github.com/hashicorp/go-azure-helpers v0.30.0/go.mod h1:gcutZ/Hf/O7YN9M3UIvyZ9l0Rxv7Yrc9x5sSfM9cuSw= github.com/hashicorp/go-checkpoint v0.5.0 h1:MFYpPZCnQqQTE18jFwSII6eUQrD/oxMFp3mlgcqk5mU= github.com/hashicorp/go-checkpoint v0.5.0/go.mod h1:7nfLNL10NsxqO4iWuW6tWW0HjZuDrwkBuEQsVcpCOgg= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= diff --git a/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones/model.go b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones/model.go new file mode 100644 index 000000000000..f1326f089265 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones/model.go @@ -0,0 +1,42 @@ +package edgezones + +import ( + "encoding/json" + "fmt" + "strings" +) + +var _ json.Marshaler = &Model{} +var _ json.Unmarshaler = &Model{} + +type Model struct { + Name string +} + +func (m *Model) MarshalJSON() ([]byte, error) { + out := map[string]interface{}{} + + if m.Name != "" { + out["name"] = m.Name + out["type"] = "EdgeZone" + } + + return json.Marshal(out) +} + +func (m *Model) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Name *string `json:"name"` + Type *string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("decoding: %+v", err) + } + + if decoded.Name == nil || decoded.Type == nil || !strings.EqualFold(*decoded.Type, "EdgeZone") { + return nil + } + + m.Name = *decoded.Name + return nil +} diff --git a/vendor/modules.txt b/vendor/modules.txt index b7d83992af6d..36fac66704da 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -195,7 +195,7 @@ github.com/google/uuid # github.com/hashicorp/errwrap v1.1.0 ## explicit github.com/hashicorp/errwrap -# github.com/hashicorp/go-azure-helpers v0.28.0 +# github.com/hashicorp/go-azure-helpers v0.30.0 ## explicit; go 1.17 github.com/hashicorp/go-azure-helpers/authentication github.com/hashicorp/go-azure-helpers/lang/dates