diff --git a/resource-manager/network/2024-05-01/networkmanagereffectiveconnectivityconfiguration/constants.go b/resource-manager/network/2024-05-01/networkmanagereffectiveconnectivityconfiguration/constants.go index caa8b3c8747..9007e4a33df 100644 --- a/resource-manager/network/2024-05-01/networkmanagereffectiveconnectivityconfiguration/constants.go +++ b/resource-manager/network/2024-05-01/networkmanagereffectiveconnectivityconfiguration/constants.go @@ -217,6 +217,8 @@ func parseIsGlobal(input string) (*IsGlobal, error) { type ProvisioningState string const ( + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateCreating ProvisioningState = "Creating" ProvisioningStateDeleting ProvisioningState = "Deleting" ProvisioningStateFailed ProvisioningState = "Failed" ProvisioningStateSucceeded ProvisioningState = "Succeeded" @@ -225,6 +227,8 @@ const ( func PossibleValuesForProvisioningState() []string { return []string{ + string(ProvisioningStateCanceled), + string(ProvisioningStateCreating), string(ProvisioningStateDeleting), string(ProvisioningStateFailed), string(ProvisioningStateSucceeded), @@ -247,6 +251,8 @@ func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { func parseProvisioningState(input string) (*ProvisioningState, error) { vals := map[string]ProvisioningState{ + "canceled": ProvisioningStateCanceled, + "creating": ProvisioningStateCreating, "deleting": ProvisioningStateDeleting, "failed": ProvisioningStateFailed, "succeeded": ProvisioningStateSucceeded, diff --git a/resource-manager/network/2024-05-01/networkmanagereffectivesecurityadminrules/constants.go b/resource-manager/network/2024-05-01/networkmanagereffectivesecurityadminrules/constants.go index 67086d778e3..6dbd1e6db74 100644 --- a/resource-manager/network/2024-05-01/networkmanagereffectivesecurityadminrules/constants.go +++ b/resource-manager/network/2024-05-01/networkmanagereffectivesecurityadminrules/constants.go @@ -138,6 +138,8 @@ func parseGroupMemberType(input string) (*GroupMemberType, error) { type ProvisioningState string const ( + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateCreating ProvisioningState = "Creating" ProvisioningStateDeleting ProvisioningState = "Deleting" ProvisioningStateFailed ProvisioningState = "Failed" ProvisioningStateSucceeded ProvisioningState = "Succeeded" @@ -146,6 +148,8 @@ const ( func PossibleValuesForProvisioningState() []string { return []string{ + string(ProvisioningStateCanceled), + string(ProvisioningStateCreating), string(ProvisioningStateDeleting), string(ProvisioningStateFailed), string(ProvisioningStateSucceeded), @@ -168,6 +172,8 @@ func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { func parseProvisioningState(input string) (*ProvisioningState, error) { vals := map[string]ProvisioningState{ + "canceled": ProvisioningStateCanceled, + "creating": ProvisioningStateCreating, "deleting": ProvisioningStateDeleting, "failed": ProvisioningStateFailed, "succeeded": ProvisioningStateSucceeded, diff --git a/resource-manager/sql/2023-08-01-preview/jobagents/constants.go b/resource-manager/sql/2023-08-01-preview/jobagents/constants.go index 015cde7bdcc..488c4253caf 100644 --- a/resource-manager/sql/2023-08-01-preview/jobagents/constants.go +++ b/resource-manager/sql/2023-08-01-preview/jobagents/constants.go @@ -9,53 +9,6 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type JobAgentIdentityType string - -const ( - JobAgentIdentityTypeNone JobAgentIdentityType = "None" - JobAgentIdentityTypeSystemAssigned JobAgentIdentityType = "SystemAssigned" - JobAgentIdentityTypeSystemAssignedUserAssigned JobAgentIdentityType = "SystemAssignedUserAssigned" - JobAgentIdentityTypeUserAssigned JobAgentIdentityType = "UserAssigned" -) - -func PossibleValuesForJobAgentIdentityType() []string { - return []string{ - string(JobAgentIdentityTypeNone), - string(JobAgentIdentityTypeSystemAssigned), - string(JobAgentIdentityTypeSystemAssignedUserAssigned), - string(JobAgentIdentityTypeUserAssigned), - } -} - -func (s *JobAgentIdentityType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseJobAgentIdentityType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseJobAgentIdentityType(input string) (*JobAgentIdentityType, error) { - vals := map[string]JobAgentIdentityType{ - "none": JobAgentIdentityTypeNone, - "systemassigned": JobAgentIdentityTypeSystemAssigned, - "systemassigneduserassigned": JobAgentIdentityTypeSystemAssignedUserAssigned, - "userassigned": JobAgentIdentityTypeUserAssigned, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := JobAgentIdentityType(input) - return &out, nil -} - type JobAgentState string const ( diff --git a/resource-manager/sql/2023-08-01-preview/jobagents/model_jobagent.go b/resource-manager/sql/2023-08-01-preview/jobagents/model_jobagent.go index f4d2138665d..73cecd43f90 100644 --- a/resource-manager/sql/2023-08-01-preview/jobagents/model_jobagent.go +++ b/resource-manager/sql/2023-08-01-preview/jobagents/model_jobagent.go @@ -1,15 +1,19 @@ package jobagents +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 JobAgent struct { - Id *string `json:"id,omitempty"` - Identity *JobAgentIdentity `json:"identity,omitempty"` - Location string `json:"location"` - Name *string `json:"name,omitempty"` - Properties *JobAgentProperties `json:"properties,omitempty"` - Sku *Sku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` + Id *string `json:"id,omitempty"` + Identity *identity.UserAssignedMap `json:"identity,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties *JobAgentProperties `json:"properties,omitempty"` + Sku *Sku `json:"sku,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` } diff --git a/resource-manager/sql/2023-08-01-preview/jobagents/model_jobagentidentity.go b/resource-manager/sql/2023-08-01-preview/jobagents/model_jobagentidentity.go deleted file mode 100644 index 031109c9b52..00000000000 --- a/resource-manager/sql/2023-08-01-preview/jobagents/model_jobagentidentity.go +++ /dev/null @@ -1,10 +0,0 @@ -package jobagents - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type JobAgentIdentity struct { - TenantId *string `json:"tenantId,omitempty"` - Type JobAgentIdentityType `json:"type"` - UserAssignedIdentities *map[string]JobAgentUserAssignedIdentity `json:"userAssignedIdentities,omitempty"` -} diff --git a/resource-manager/sql/2023-08-01-preview/jobagents/model_jobagentupdate.go b/resource-manager/sql/2023-08-01-preview/jobagents/model_jobagentupdate.go index 5c013e0cbbd..a42600dc619 100644 --- a/resource-manager/sql/2023-08-01-preview/jobagents/model_jobagentupdate.go +++ b/resource-manager/sql/2023-08-01-preview/jobagents/model_jobagentupdate.go @@ -1,10 +1,14 @@ package jobagents +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 JobAgentUpdate struct { - Identity *JobAgentIdentity `json:"identity,omitempty"` - Sku *Sku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` + Identity *identity.UserAssignedMap `json:"identity,omitempty"` + Sku *Sku `json:"sku,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` } diff --git a/resource-manager/sql/2023-08-01-preview/jobagents/model_jobagentuserassignedidentity.go b/resource-manager/sql/2023-08-01-preview/jobagents/model_jobagentuserassignedidentity.go deleted file mode 100644 index 3dc6c7368d6..00000000000 --- a/resource-manager/sql/2023-08-01-preview/jobagents/model_jobagentuserassignedidentity.go +++ /dev/null @@ -1,9 +0,0 @@ -package jobagents - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type JobAgentUserAssignedIdentity struct { - ClientId *string `json:"clientId,omitempty"` - PrincipalId *string `json:"principalId,omitempty"` -}