Skip to content

Commit

Permalink
fix build issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jkroepke committed Aug 14, 2024
1 parent be233b7 commit b349c6b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 21 deletions.
15 changes: 8 additions & 7 deletions internal/services/authorization/role_definition_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ type RoleDefinitionDataSource struct{}
var _ sdk.DataSource = RoleDefinitionDataSource{}

type RoleDefinitionDataSourceModel struct {
Name string `tfschema:"name"`
RoleDefinitionId string `tfschema:"role_definition_id"`
Scope string `tfschema:"scope"`
Description string `tfschema:"description"`
Type string `tfschema:"type"`
Permissions []PermissionDataSourceModel `tfschema:"permissions"`
AssignableScopes []string `tfschema:"assignable_scopes"`
Name string `tfschema:"name"`
RoleDefinitionId string `tfschema:"role_definition_id"`
RoleDefinitionGUID string `tfschema:"role_definition_guid"`
Scope string `tfschema:"scope"`
Description string `tfschema:"description"`
Type string `tfschema:"type"`
Permissions []PermissionDataSourceModel `tfschema:"permissions"`
AssignableScopes []string `tfschema:"assignable_scopes"`
}

type PermissionDataSourceModel struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func (r SiteRecoveryRecoveryVaultDataSource) Read() sdk.ResourceFunc {
return err
}

id := vaults.NewVaultID(subscriptionId, recoveryServiceVault.RecoveryGroupName, recoveryServiceVault.Name)
id := vaults.NewVaultID(subscriptionId, recoveryServiceVault.ResourceGroupName, recoveryServiceVault.Name)
resp, err := client.Get(ctx, id)
if err != nil {
if response.WasNotFound(resp.HttpResponse) {
Expand All @@ -86,24 +86,24 @@ func (r SiteRecoveryRecoveryVaultDataSource) Read() sdk.ResourceFunc {
return fmt.Errorf("retrieving %s: %+v", id, err)
}

model := resp.Model
if model := resp.Model; model != nil {
flattenedIdentity, err := identity.FlattenSystemAndUserAssignedMapToModel(model.Identity)

flattenedIdentity, err := identity.FlattenSystemAndUserAssignedMapToModel(model.Identity)
if err != nil {
return fmt.Errorf("flattening `identity`: %+v", err)
}

if err != nil {
return fmt.Errorf("flattening `identity`: %+v", err)
}
skuName := ""
if model.Sku != nil {
skuName = string(model.Sku.Name)
}

skuName := ""
if model.Sku != nil {
skuName = string(model.Sku.Name)
recoveryServiceVault.Sku = skuName
recoveryServiceVault.Location = location.Normalize(model.Location)
recoveryServiceVault.Tags = pointer.From(model.Tags)
recoveryServiceVault.Identity = pointer.From(flattenedIdentity)
}

recoveryServiceVault.Sku = skuName
recoveryServiceVault.Location = location.Normalize(model.Location)
recoveryServiceVault.Tags = pointer.From(model.Tags)
recoveryServiceVault.Identity = pointer.From(flattenedIdentity)

metadata.SetID(id)

if err := metadata.Encode(&recoveryServiceVault); err != nil {
Expand Down

0 comments on commit b349c6b

Please sign in to comment.