From 089bd4dbf3282479e497c4c0e27e30c980cf5292 Mon Sep 17 00:00:00 2001 From: Francesc Arbona Date: Fri, 10 Jan 2025 10:47:35 +0000 Subject: [PATCH] chore: Update postgresql vendor files --- .../2024-08-01/servers/constants.go | 44 +++++++++++++++++++ .../2024-08-01/servers/model_server.go | 19 ++++---- .../servers/model_serverforupdate.go | 6 +-- .../servers/model_userassignedidentity.go | 10 +++++ .../2024-08-01/servers/model_useridentity.go | 9 ++++ 5 files changed, 73 insertions(+), 15 deletions(-) create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/postgresql/2024-08-01/servers/model_userassignedidentity.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/postgresql/2024-08-01/servers/model_useridentity.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/postgresql/2024-08-01/servers/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/postgresql/2024-08-01/servers/constants.go index 23011e6a11f4..c4534eb7d6cb 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/postgresql/2024-08-01/servers/constants.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/postgresql/2024-08-01/servers/constants.go @@ -350,6 +350,50 @@ func parseHighAvailabilityMode(input string) (*HighAvailabilityMode, error) { return &out, nil } +type IdentityType string + +const ( + IdentityTypeNone IdentityType = "None" + IdentityTypeSystemAssigned IdentityType = "SystemAssigned" + IdentityTypeUserAssigned IdentityType = "UserAssigned" +) + +func PossibleValuesForIdentityType() []string { + return []string{ + string(IdentityTypeNone), + string(IdentityTypeSystemAssigned), + string(IdentityTypeUserAssigned), + } +} + +func (s *IdentityType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIdentityType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIdentityType(input string) (*IdentityType, error) { + vals := map[string]IdentityType{ + "none": IdentityTypeNone, + "systemassigned": IdentityTypeSystemAssigned, + "userassigned": IdentityTypeUserAssigned, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IdentityType(input) + return &out, nil +} + type KeyStatusEnum string const ( diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/postgresql/2024-08-01/servers/model_server.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/postgresql/2024-08-01/servers/model_server.go index bbf3ab9ba4e5..30f99bc8a50c 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/postgresql/2024-08-01/servers/model_server.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/postgresql/2024-08-01/servers/model_server.go @@ -1,7 +1,6 @@ package servers import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" ) @@ -9,13 +8,13 @@ import ( // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type Server struct { - Id *string `json:"id,omitempty"` - Identity *identity.UserAssignedMap `json:"identity,omitempty"` - Location string `json:"location"` - Name *string `json:"name,omitempty"` - Properties *ServerProperties `json:"properties,omitempty"` - Sku *Sku `json:"sku,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` + Id *string `json:"id,omitempty"` + Identity *UserAssignedIdentity `json:"identity,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties *ServerProperties `json:"properties,omitempty"` + Sku *Sku `json:"sku,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/postgresql/2024-08-01/servers/model_serverforupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/postgresql/2024-08-01/servers/model_serverforupdate.go index 17611eb8b4bf..50710925f29f 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/postgresql/2024-08-01/servers/model_serverforupdate.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/postgresql/2024-08-01/servers/model_serverforupdate.go @@ -1,14 +1,10 @@ package servers -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" -) - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ServerForUpdate struct { - Identity *identity.UserAssignedMap `json:"identity,omitempty"` + Identity *UserAssignedIdentity `json:"identity,omitempty"` Properties *ServerPropertiesForUpdate `json:"properties,omitempty"` Sku *Sku `json:"sku,omitempty"` Tags *map[string]string `json:"tags,omitempty"` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/postgresql/2024-08-01/servers/model_userassignedidentity.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/postgresql/2024-08-01/servers/model_userassignedidentity.go new file mode 100644 index 000000000000..a02a2769cf0d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/postgresql/2024-08-01/servers/model_userassignedidentity.go @@ -0,0 +1,10 @@ +package servers + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UserAssignedIdentity struct { + TenantId *string `json:"tenantId,omitempty"` + Type IdentityType `json:"type"` + UserAssignedIdentities *map[string]UserIdentity `json:"userAssignedIdentities,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/postgresql/2024-08-01/servers/model_useridentity.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/postgresql/2024-08-01/servers/model_useridentity.go new file mode 100644 index 000000000000..d884ea454951 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/postgresql/2024-08-01/servers/model_useridentity.go @@ -0,0 +1,9 @@ +package servers + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UserIdentity struct { + ClientId *string `json:"clientId,omitempty"` + PrincipalId *string `json:"principalId,omitempty"` +}