diff --git a/internal/services/authorization/azuresdkhacks/definitions.go b/internal/services/authorization/azuresdkhacks/definitions.go deleted file mode 100644 index b410c1826ec0..000000000000 --- a/internal/services/authorization/azuresdkhacks/definitions.go +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) HashiCorp, Inc. -// SPDX-License-Identifier: MPL-2.0 - -package azuresdkhacks - -import ( - "context" - "net/http" - - "github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2018-01-01-preview/roledefinitions" - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -type RoleDefinitionsWorkaroundClient struct { - client *resourcemanager.Client -} - -func NewRoleDefinitionsWorkaroundClient(resourcemanagerClient *resourcemanager.Client) RoleDefinitionsWorkaroundClient { - return RoleDefinitionsWorkaroundClient{ - client: resourcemanagerClient, - } -} - -// CreateOrUpdate ... -func (c RoleDefinitionsWorkaroundClient) CreateOrUpdate(ctx context.Context, id roledefinitions.ScopedRoleDefinitionId, input RoleDefinition) (result CreateOrUpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusCreated, - }, - HttpMethod: http.MethodPut, - Path: id.ID(), - } - - req, err := c.client.NewRequest(ctx, opts) - if err != nil { - return - } - - if err = req.Marshal(input); err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - if err = resp.Unmarshal(&result.Model); err != nil { - return - } - - return -} - -func (c RoleDefinitionsWorkaroundClient) Get(ctx context.Context, id roledefinitions.ScopedRoleDefinitionId) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - } - - req, err := c.client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - if err = resp.Unmarshal(&result.Model); err != nil { - return - } - - return -} - -type CreateOrUpdateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *RoleDefinition -} - -type GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *RoleDefinition -} - -type RoleDefinition struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RoleDefinitionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} - -type RoleDefinitionProperties struct { - AssignableScopes *[]string `json:"assignableScopes,omitempty"` - Description *string `json:"description,omitempty"` - Permissions *[]roledefinitions.Permission `json:"permissions,omitempty"` - RoleName *string `json:"roleName,omitempty"` - Type *string `json:"type,omitempty"` - // not exposed in the sdk - CreatedOn *string `json:"createdOn,omitempty"` - UpdatedOn *string `json:"updatedOn,omitempty"` - CreatedBy *string `json:"createdBy,omitempty"` - UpdatedBy *string `json:"updatedBy,omitempty"` -} diff --git a/internal/services/authorization/client/client.go b/internal/services/authorization/client/client.go index 971997611066..0c7bf9d11201 100644 --- a/internal/services/authorization/client/client.go +++ b/internal/services/authorization/client/client.go @@ -9,19 +9,17 @@ import ( "github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2020-04-01-preview/authorization" // nolint: staticcheck // nolint: staticcheck // To swap sdk for `azurerm_role_definition` without changing API version - oldRoleDefinitions "github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2018-01-01-preview/roledefinitions" "github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2020-10-01/roleassignmentscheduleinstances" "github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2020-10-01/roleassignmentschedulerequests" "github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2020-10-01/roleeligibilityscheduleinstances" "github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2020-10-01/roleeligibilityschedulerequests" "github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2022-04-01/roleassignments" - "github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2022-04-01/roledefinitions" + "github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2022-05-01-preview/roledefinitions" "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) type Client struct { RoleAssignmentsClient *authorization.RoleAssignmentsClient - RoleDefinitionsClient *oldRoleDefinitions.RoleDefinitionsClient RoleAssignmentScheduleRequestClient *roleassignmentschedulerequests.RoleAssignmentScheduleRequestsClient RoleAssignmentScheduleInstancesClient *roleassignmentscheduleinstances.RoleAssignmentScheduleInstancesClient RoleEligibilityScheduleRequestClient *roleeligibilityschedulerequests.RoleEligibilityScheduleRequestsClient @@ -34,12 +32,6 @@ func NewClient(o *common.ClientOptions) (*Client, error) { roleAssignmentsClient := authorization.NewRoleAssignmentsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) o.ConfigureClient(&roleAssignmentsClient.Client, o.ResourceManagerAuthorizer) - roleDefinitionsClient, err := oldRoleDefinitions.NewRoleDefinitionsClientWithBaseURI(o.Environment.ResourceManager) - if err != nil { - return nil, fmt.Errorf("creating roleDefinitionsClient: %+v", err) - } - o.Configure(roleDefinitionsClient.Client, o.Authorizers.ResourceManager) - roleAssignmentScheduleRequestsClient, err := roleassignmentschedulerequests.NewRoleAssignmentScheduleRequestsClientWithBaseURI(o.Environment.ResourceManager) if err != nil { return nil, fmt.Errorf("creating roleAssignmentScheduleRequestsClient: %+v", err) @@ -79,7 +71,6 @@ func NewClient(o *common.ClientOptions) (*Client, error) { return &Client{ RoleAssignmentsClient: &roleAssignmentsClient, - RoleDefinitionsClient: roleDefinitionsClient, RoleAssignmentScheduleRequestClient: roleAssignmentScheduleRequestsClient, RoleAssignmentScheduleInstancesClient: roleAssignmentScheduleInstancesClient, RoleEligibilityScheduleRequestClient: roleEligibilityScheduleRequestClient, diff --git a/internal/services/authorization/role_assignment_marketplace_resource_test.go b/internal/services/authorization/role_assignment_marketplace_resource_test.go index 821569a0ee6c..41f7a8075b8d 100644 --- a/internal/services/authorization/role_assignment_marketplace_resource_test.go +++ b/internal/services/authorization/role_assignment_marketplace_resource_test.go @@ -14,7 +14,7 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2022-04-01/roleassignments" - "github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2022-04-01/roledefinitions" + "github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2022-05-01-preview/roledefinitions" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/testclient" diff --git a/internal/services/authorization/role_assignment_resource.go b/internal/services/authorization/role_assignment_resource.go index 60a2d3aec3f0..0c4311cdf070 100644 --- a/internal/services/authorization/role_assignment_resource.go +++ b/internal/services/authorization/role_assignment_resource.go @@ -14,7 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2020-04-01-preview/authorization" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/pointer" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" - "github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2018-01-01-preview/roledefinitions" + "github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2022-05-01-preview/roledefinitions" "github.com/hashicorp/go-azure-sdk/resource-manager/resources/2022-12-01/subscriptions" "github.com/hashicorp/go-uuid" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" @@ -156,7 +156,7 @@ func resourceArmRoleAssignment() *pluginsdk.Resource { func resourceArmRoleAssignmentCreate(d *pluginsdk.ResourceData, meta interface{}) error { roleAssignmentsClient := meta.(*clients.Client).Authorization.RoleAssignmentsClient - roleDefinitionsClient := meta.(*clients.Client).Authorization.RoleDefinitionsClient + roleDefinitionsClient := meta.(*clients.Client).Authorization.ScopedRoleDefinitionsClient subscriptionClient := meta.(*clients.Client).Subscription.SubscriptionsClient subscriptionId := meta.(*clients.Client).Account.SubscriptionId ctx, cancel := timeouts.ForCreate(meta.(*clients.Client).StopContext, d) @@ -271,7 +271,7 @@ func resourceArmRoleAssignmentCreate(d *pluginsdk.ResourceData, meta interface{} func resourceArmRoleAssignmentRead(d *pluginsdk.ResourceData, meta interface{}) error { client := meta.(*clients.Client).Authorization.RoleAssignmentsClient - roleDefinitionsClient := meta.(*clients.Client).Authorization.RoleDefinitionsClient + roleDefinitionsClient := meta.(*clients.Client).Authorization.ScopedRoleDefinitionsClient ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() diff --git a/internal/services/authorization/role_assignment_resource_base.go b/internal/services/authorization/role_assignment_resource_base.go index b2ddb8d3d7f7..607ca106da20 100644 --- a/internal/services/authorization/role_assignment_resource_base.go +++ b/internal/services/authorization/role_assignment_resource_base.go @@ -14,7 +14,7 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2022-04-01/roleassignments" - "github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2022-04-01/roledefinitions" + "github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2022-05-01-preview/roledefinitions" "github.com/hashicorp/go-uuid" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/authorization/role_assignment_resource_test.go b/internal/services/authorization/role_assignment_resource_test.go index d0c822f498c9..fe48ab290a1e 100644 --- a/internal/services/authorization/role_assignment_resource_test.go +++ b/internal/services/authorization/role_assignment_resource_test.go @@ -328,7 +328,7 @@ data "azurerm_client_config" "test" { } resource "azurerm_resource_group" "test" { - name = "acctestRG-role-assigment-%d" + name = "acctestRG-role-assignment-%d" location = "%s" } diff --git a/internal/services/authorization/role_definition_data_source.go b/internal/services/authorization/role_definition_data_source.go index f723d65792f1..783a420c86c3 100644 --- a/internal/services/authorization/role_definition_data_source.go +++ b/internal/services/authorization/role_definition_data_source.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/pointer" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" - "github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2018-01-01-preview/roledefinitions" + "github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2022-05-01-preview/roledefinitions" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" @@ -145,7 +145,7 @@ func (a RoleDefinitionDataSource) Read() sdk.ResourceFunc { return sdk.ResourceFunc{ Timeout: 5 * time.Minute, Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { - client := metadata.Client.Authorization.RoleDefinitionsClient + client := metadata.Client.Authorization.ScopedRoleDefinitionsClient var config RoleDefinitionDataSourceModel if err := metadata.Decode(&config); err != nil { @@ -218,7 +218,7 @@ func (a RoleDefinitionDataSource) Read() sdk.ResourceFunc { } // The sdk managed id start with two "/" when scope is tenant level (empty). - // So we use the id from response without parsing and reformating it. + // So we use the id from response without parsing and reformatting it. // Tracked on https://github.com/hashicorp/pandora/issues/3257 metadata.ResourceData.SetId(*role.Id) return metadata.Encode(&state) diff --git a/internal/services/authorization/role_definition_resource.go b/internal/services/authorization/role_definition_resource.go index c1a0cff96234..b264695914b4 100644 --- a/internal/services/authorization/role_definition_resource.go +++ b/internal/services/authorization/role_definition_resource.go @@ -12,10 +12,9 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/pointer" "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" - "github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2018-01-01-preview/roledefinitions" + "github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2022-05-01-preview/roledefinitions" "github.com/hashicorp/go-uuid" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/authorization/azuresdkhacks" "github.com/hashicorp/terraform-provider-azurerm/internal/services/authorization/migration" "github.com/hashicorp/terraform-provider-azurerm/internal/services/authorization/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" @@ -164,7 +163,7 @@ func (r RoleDefinitionResource) Create() sdk.ResourceFunc { return sdk.ResourceFunc{ Timeout: 30 * time.Minute, Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { - client := metadata.Client.Authorization.RoleDefinitionsClient + client := metadata.Client.Authorization.ScopedRoleDefinitionsClient var config RoleDefinitionModel if err := metadata.Decode(&config); err != nil { @@ -232,7 +231,7 @@ func (r RoleDefinitionResource) Read() sdk.ResourceFunc { return sdk.ResourceFunc{ Timeout: 5 * time.Minute, Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { - client := metadata.Client.Authorization.RoleDefinitionsClient + client := metadata.Client.Authorization.ScopedRoleDefinitionsClient stateId, err := parse.RoleDefinitionId(metadata.ResourceData.Id()) if err != nil { @@ -276,8 +275,7 @@ func (r RoleDefinitionResource) Update() sdk.ResourceFunc { return sdk.ResourceFunc{ Timeout: 60 * time.Minute, Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { - sdkClient := metadata.Client.Authorization.RoleDefinitionsClient - client := azuresdkhacks.NewRoleDefinitionsWorkaroundClient(sdkClient.Client) + client := metadata.Client.Authorization.ScopedRoleDefinitionsClient stateId, err := parse.RoleDefinitionId(metadata.ResourceData.Id()) if err != nil { @@ -291,16 +289,16 @@ func (r RoleDefinitionResource) Update() sdk.ResourceFunc { return err } - exisiting, err := client.Get(ctx, id) + existing, err := client.Get(ctx, id) if err != nil { return fmt.Errorf("retrieving %s: %+v", stateId, err) } - if exisiting.Model == nil { + if existing.Model == nil { return fmt.Errorf("retrieving %s: model was nil", stateId) } - model := *exisiting.Model + model := *existing.Model if model.Properties == nil { return fmt.Errorf("retrieving %s: properties was nil", stateId) @@ -378,7 +376,7 @@ func (r RoleDefinitionResource) Delete() sdk.ResourceFunc { return sdk.ResourceFunc{ Timeout: 30 * time.Minute, Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { - client := metadata.Client.Authorization.RoleDefinitionsClient + client := metadata.Client.Authorization.ScopedRoleDefinitionsClient stateId, err := parse.RoleDefinitionId(metadata.ResourceData.Id()) if err != nil { @@ -432,7 +430,7 @@ func (RoleDefinitionResource) StateUpgraders() sdk.StateUpgradeData { } } -func roleDefinitionEventualConsistencyUpdate(ctx context.Context, client azuresdkhacks.RoleDefinitionsWorkaroundClient, id roledefinitions.ScopedRoleDefinitionId, updateRequestDate string) pluginsdk.StateRefreshFunc { +func roleDefinitionEventualConsistencyUpdate(ctx context.Context, client *roledefinitions.RoleDefinitionsClient, id roledefinitions.ScopedRoleDefinitionId, updateRequestDate string) pluginsdk.StateRefreshFunc { return func() (interface{}, string, error) { resp, err := client.Get(ctx, id) if err != nil { diff --git a/internal/services/authorization/role_definition_resource_test.go b/internal/services/authorization/role_definition_resource_test.go index 7e1d0f12225b..dc8290d069ba 100644 --- a/internal/services/authorization/role_definition_resource_test.go +++ b/internal/services/authorization/role_definition_resource_test.go @@ -11,7 +11,7 @@ import ( "github.com/google/uuid" "github.com/hashicorp/go-azure-helpers/lang/pointer" "github.com/hashicorp/go-azure-helpers/lang/response" - "github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2018-01-01-preview/roledefinitions" + "github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2022-05-01-preview/roledefinitions" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" @@ -196,7 +196,7 @@ func (RoleDefinitionResource) Exists(ctx context.Context, client *clients.Client roleId := state.Attributes["role_definition_id"] id := roledefinitions.NewScopedRoleDefinitionID(scope, roleId) - resp, err := client.Authorization.RoleDefinitionsClient.Get(ctx, id) + resp, err := client.Authorization.ScopedRoleDefinitionsClient.Get(ctx, id) if err != nil { if response.WasNotFound(resp.HttpResponse) { return pointer.To(false), nil diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2018-01-01-preview/roledefinitions/model_permission.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2018-01-01-preview/roledefinitions/model_permission.go deleted file mode 100644 index b8e01a191420..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2018-01-01-preview/roledefinitions/model_permission.go +++ /dev/null @@ -1,11 +0,0 @@ -package roledefinitions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Permission struct { - Actions *[]string `json:"actions,omitempty"` - DataActions *[]string `json:"dataActions,omitempty"` - NotActions *[]string `json:"notActions,omitempty"` - NotDataActions *[]string `json:"notDataActions,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2018-01-01-preview/roledefinitions/model_roledefinitionproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2018-01-01-preview/roledefinitions/model_roledefinitionproperties.go deleted file mode 100644 index a63082845507..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2018-01-01-preview/roledefinitions/model_roledefinitionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package roledefinitions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoleDefinitionProperties struct { - AssignableScopes *[]string `json:"assignableScopes,omitempty"` - Description *string `json:"description,omitempty"` - Permissions *[]Permission `json:"permissions,omitempty"` - RoleName *string `json:"roleName,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2018-01-01-preview/roledefinitions/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2022-05-01-preview/roledefinitions/README.md similarity index 93% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2018-01-01-preview/roledefinitions/README.md rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2022-05-01-preview/roledefinitions/README.md index 8e80229f3d75..78baf074c64e 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2018-01-01-preview/roledefinitions/README.md +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2022-05-01-preview/roledefinitions/README.md @@ -1,7 +1,7 @@ -## `github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2018-01-01-preview/roledefinitions` Documentation +## `github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2022-05-01-preview/roledefinitions` Documentation -The `roledefinitions` SDK allows for interaction with the Azure Resource Manager Service `authorization` (API Version `2018-01-01-preview`). +The `roledefinitions` SDK allows for interaction with the Azure Resource Manager Service `authorization` (API Version `2022-05-01-preview`). This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). @@ -9,7 +9,7 @@ This readme covers example usages, but further information on [using this SDK ca ```go import "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2018-01-01-preview/roledefinitions" +import "github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2022-05-01-preview/roledefinitions" ``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2018-01-01-preview/roledefinitions/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2022-05-01-preview/roledefinitions/client.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2018-01-01-preview/roledefinitions/client.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2022-05-01-preview/roledefinitions/client.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2018-01-01-preview/roledefinitions/id_scopedroledefinition.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2022-05-01-preview/roledefinitions/id_scopedroledefinition.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2018-01-01-preview/roledefinitions/id_scopedroledefinition.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2022-05-01-preview/roledefinitions/id_scopedroledefinition.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2018-01-01-preview/roledefinitions/method_createorupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2022-05-01-preview/roledefinitions/method_createorupdate.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2018-01-01-preview/roledefinitions/method_createorupdate.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2022-05-01-preview/roledefinitions/method_createorupdate.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2018-01-01-preview/roledefinitions/method_delete.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2022-05-01-preview/roledefinitions/method_delete.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2018-01-01-preview/roledefinitions/method_delete.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2022-05-01-preview/roledefinitions/method_delete.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2018-01-01-preview/roledefinitions/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2022-05-01-preview/roledefinitions/method_get.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2018-01-01-preview/roledefinitions/method_get.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2022-05-01-preview/roledefinitions/method_get.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2018-01-01-preview/roledefinitions/method_list.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2022-05-01-preview/roledefinitions/method_list.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2018-01-01-preview/roledefinitions/method_list.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2022-05-01-preview/roledefinitions/method_list.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2022-05-01-preview/roledefinitions/model_permission.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2022-05-01-preview/roledefinitions/model_permission.go new file mode 100644 index 000000000000..1022cf7d6d72 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2022-05-01-preview/roledefinitions/model_permission.go @@ -0,0 +1,13 @@ +package roledefinitions + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Permission struct { + Actions *[]string `json:"actions,omitempty"` + Condition *string `json:"condition,omitempty"` + ConditionVersion *string `json:"conditionVersion,omitempty"` + DataActions *[]string `json:"dataActions,omitempty"` + NotActions *[]string `json:"notActions,omitempty"` + NotDataActions *[]string `json:"notDataActions,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2018-01-01-preview/roledefinitions/model_roledefinition.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2022-05-01-preview/roledefinitions/model_roledefinition.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2018-01-01-preview/roledefinitions/model_roledefinition.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2022-05-01-preview/roledefinitions/model_roledefinition.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2022-05-01-preview/roledefinitions/model_roledefinitionproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2022-05-01-preview/roledefinitions/model_roledefinitionproperties.go new file mode 100644 index 000000000000..886c2c6c75da --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2022-05-01-preview/roledefinitions/model_roledefinitionproperties.go @@ -0,0 +1,46 @@ +package roledefinitions + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RoleDefinitionProperties struct { + AssignableScopes *[]string `json:"assignableScopes,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + CreatedOn *string `json:"createdOn,omitempty"` + Description *string `json:"description,omitempty"` + Permissions *[]Permission `json:"permissions,omitempty"` + RoleName *string `json:"roleName,omitempty"` + Type *string `json:"type,omitempty"` + UpdatedBy *string `json:"updatedBy,omitempty"` + UpdatedOn *string `json:"updatedOn,omitempty"` +} + +func (o *RoleDefinitionProperties) GetCreatedOnAsTime() (*time.Time, error) { + if o.CreatedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreatedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *RoleDefinitionProperties) SetCreatedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreatedOn = &formatted +} + +func (o *RoleDefinitionProperties) GetUpdatedOnAsTime() (*time.Time, error) { + if o.UpdatedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.UpdatedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *RoleDefinitionProperties) SetUpdatedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.UpdatedOn = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2018-01-01-preview/roledefinitions/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2022-05-01-preview/roledefinitions/predicates.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2018-01-01-preview/roledefinitions/predicates.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2022-05-01-preview/roledefinitions/predicates.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2018-01-01-preview/roledefinitions/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2022-05-01-preview/roledefinitions/version.go similarity index 86% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2018-01-01-preview/roledefinitions/version.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2022-05-01-preview/roledefinitions/version.go index dea43e714b28..e5d77c5278e2 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2018-01-01-preview/roledefinitions/version.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2022-05-01-preview/roledefinitions/version.go @@ -5,7 +5,7 @@ import "fmt" // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -const defaultApiVersion = "2018-01-01-preview" +const defaultApiVersion = "2022-05-01-preview" func userAgent() string { return fmt.Sprintf("hashicorp/go-azure-sdk/roledefinitions/%s", defaultApiVersion) diff --git a/vendor/modules.txt b/vendor/modules.txt index 27ee46c6fd70..8f22255ce882 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -219,13 +219,13 @@ github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-04-0 github.com/hashicorp/go-azure-sdk/resource-manager/applicationinsights/2022-06-15/webtestsapis github.com/hashicorp/go-azure-sdk/resource-manager/appplatform/2024-01-01-preview/appplatform github.com/hashicorp/go-azure-sdk/resource-manager/attestation/2020-10-01/attestationproviders -github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2018-01-01-preview/roledefinitions github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2020-10-01/roleassignmentscheduleinstances github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2020-10-01/roleassignmentschedulerequests github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2020-10-01/roleeligibilityscheduleinstances github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2020-10-01/roleeligibilityschedulerequests github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2022-04-01/roleassignments github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2022-04-01/roledefinitions +github.com/hashicorp/go-azure-sdk/resource-manager/authorization/2022-05-01-preview/roledefinitions github.com/hashicorp/go-azure-sdk/resource-manager/automation/2015-10-31/webhook github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/agentregistrationinformation github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/softwareupdateconfiguration