Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dependencies: updating to v0.20240227.1172434 of github.com/hashicorp/go-azure-sdk #25055

Merged
merged 7 commits into from Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions go.mod
Expand Up @@ -17,8 +17,8 @@ require (
github.com/google/go-cmp v0.5.9
github.com/google/uuid v1.3.1
github.com/hashicorp/go-azure-helpers v0.66.2
github.com/hashicorp/go-azure-sdk/resource-manager v0.20240222.1164640
github.com/hashicorp/go-azure-sdk/sdk v0.20240222.1164640
github.com/hashicorp/go-azure-sdk/resource-manager v0.20240227.1172434
github.com/hashicorp/go-azure-sdk/sdk v0.20240227.1172434
github.com/hashicorp/go-hclog v1.5.0
github.com/hashicorp/go-multierror v1.1.1
github.com/hashicorp/go-uuid v1.0.3
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Expand Up @@ -115,10 +115,10 @@ github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brv
github.com/hashicorp/go-azure-helpers v0.12.0/go.mod h1:Zc3v4DNeX6PDdy7NljlYpnrdac1++qNW0I4U+ofGwpg=
github.com/hashicorp/go-azure-helpers v0.66.2 h1:+Pzuo7pdKl0hBXXr5ymmhs4Q40tHAo2nAvHq4WgSjx8=
github.com/hashicorp/go-azure-helpers v0.66.2/go.mod h1:kJxXrFtJKJdOEqvad8pllAe7dhP4DbN8J6sqFZe47+4=
github.com/hashicorp/go-azure-sdk/resource-manager v0.20240222.1164640 h1:SkPXJcSTQ+Y1rONZLu0X9ur7IaMTXMx1E4/mUfN9uQQ=
github.com/hashicorp/go-azure-sdk/resource-manager v0.20240222.1164640/go.mod h1:ZqVMnNEXjBN2y96Ax7QGwczXLaYbU9jRPnr5VW4MERw=
github.com/hashicorp/go-azure-sdk/sdk v0.20240222.1164640 h1:fueP5grEuugdoLX8cSSxSPU5ewskUoHXhpThakZeQfI=
github.com/hashicorp/go-azure-sdk/sdk v0.20240222.1164640/go.mod h1:IKIPyL+hfFWBHABKT0NOWlIEzlusiUBG0SxIfaiv278=
github.com/hashicorp/go-azure-sdk/resource-manager v0.20240227.1172434 h1:UNp65kdO4noJDrEe99Od5NfXSnjrrTs0dEyw2MM8jK0=
github.com/hashicorp/go-azure-sdk/resource-manager v0.20240227.1172434/go.mod h1:8Pmp8Bg+FDUjkbuuiLLqysKrKUu5dOIf1dX3KFKNSU8=
github.com/hashicorp/go-azure-sdk/sdk v0.20240227.1172434 h1:IX9e6DRUYl+1skjZPpfdhnEV3cx8dNX1qECYSVcD288=
github.com/hashicorp/go-azure-sdk/sdk v0.20240227.1172434/go.mod h1:IKIPyL+hfFWBHABKT0NOWlIEzlusiUBG0SxIfaiv278=
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=
Expand Down
Expand Up @@ -94,17 +94,15 @@ func (r ApiManagementNotificationRecipientEmailResource) Create() sdk.ResourceFu

// CheckEntityExists can not be used, it returns autorest error
notificationId := notificationrecipientemail.NewNotificationID(subscriptionId, apiManagementId.ResourceGroupName, apiManagementId.ServiceName, notificationrecipientemail.NotificationName(model.NotificationName))
emails, err := client.ListByNotification(ctx, notificationId)
emails, err := client.ListByNotificationComplete(ctx, notificationId)
if err != nil {
if !response.WasNotFound(emails.HttpResponse) {
if !response.WasNotFound(emails.LatestHttpResponse) {
return fmt.Errorf("checking for presence of existing %s: %+v", id, err)
}
}
if m := emails.Model; m != nil && m.Value != nil {
for _, existing := range *m.Value {
if existing.Properties != nil && existing.Properties.Email != nil && *existing.Properties.Email == model.Email {
return metadata.ResourceRequiresImport(r.ResourceType(), id)
}
for _, existing := range emails.Items {
if existing.Properties != nil && existing.Properties.Email != nil && *existing.Properties.Email == model.Email {
return metadata.ResourceRequiresImport(r.ResourceType(), id)
}
}

Expand Down Expand Up @@ -132,19 +130,17 @@ func (r ApiManagementNotificationRecipientEmailResource) Read() sdk.ResourceFunc

// CheckEntityExists can not be used, it returns autorest error
notificationId := notificationrecipientemail.NewNotificationID(id.SubscriptionId, id.ResourceGroupName, id.ServiceName, id.NotificationName)
emails, err := client.ListByNotification(ctx, notificationId)
emails, err := client.ListByNotificationComplete(ctx, notificationId)
if err != nil {
if !response.WasNotFound(emails.HttpResponse) {
if !response.WasNotFound(emails.LatestHttpResponse) {
return fmt.Errorf("retrieving %s: %+v", notificationId, err)
}
}

found := false
if model := emails.Model; model != nil && model.Value != nil {
for _, existing := range *model.Value {
if existing.Properties != nil && existing.Properties.Email != nil && *existing.Properties.Email == id.RecipientEmailName {
found = true
}
for _, existing := range emails.Items {
if existing.Properties != nil && existing.Properties.Email != nil && *existing.Properties.Email == id.RecipientEmailName {
found = true
}
}

Expand Down
Expand Up @@ -56,17 +56,15 @@ func (ApiManagementNotificationRecipientEmailResource) Exists(ctx context.Contex
}

notificationId := notificationrecipientemail.NewNotificationID(id.SubscriptionId, id.ResourceGroupName, id.ServiceName, id.NotificationName)
emails, err := client.ApiManagement.NotificationRecipientEmailClient.ListByNotification(ctx, notificationId)
emails, err := client.ApiManagement.NotificationRecipientEmailClient.ListByNotificationComplete(ctx, notificationId)
if err != nil {
if !response.WasNotFound(emails.HttpResponse) {
if !response.WasNotFound(emails.LatestHttpResponse) {
return nil, fmt.Errorf("retrieving %s: %+v", *id, err)
}
}
if model := emails.Model; model != nil && model.Value != nil {
for _, existing := range *model.Value {
if existing.Properties != nil && existing.Properties.Email != nil && *existing.Properties.Email == id.RecipientEmailName {
return pointer.To(true), nil
}
for _, existing := range emails.Items {
if existing.Properties != nil && existing.Properties.Email != nil && *existing.Properties.Email == id.RecipientEmailName {
return pointer.To(true), nil
}
}
return pointer.To(false), nil
Expand Down
Expand Up @@ -94,17 +94,15 @@ func (r ApiManagementNotificationRecipientUserResource) Create() sdk.ResourceFun

// CheckEntityExists can not be used, it returns autorest error
notificationId := notificationrecipientuser.NewNotificationID(subscriptionId, apiManagementId.ResourceGroupName, apiManagementId.ServiceName, notificationrecipientuser.NotificationName(model.NotificationName))
users, err := client.ListByNotification(ctx, notificationId)
users, err := client.ListByNotificationComplete(ctx, notificationId)
if err != nil {
if !response.WasNotFound(users.HttpResponse) {
if !response.WasNotFound(users.LatestHttpResponse) {
return fmt.Errorf("checking for presence of existing %s: %+v", id, err)
}
}
if m := users.Model; m != nil && m.Value != nil {
for _, existing := range *m.Value {
if existing.Name != nil && *existing.Name == model.UserId {
return metadata.ResourceRequiresImport(r.ResourceType(), id)
}
for _, existing := range users.Items {
if existing.Name != nil && *existing.Name == model.UserId {
return metadata.ResourceRequiresImport(r.ResourceType(), id)
}
}

Expand Down Expand Up @@ -132,19 +130,17 @@ func (r ApiManagementNotificationRecipientUserResource) Read() sdk.ResourceFunc

// CheckEntityExists can not be used, it returns autorest error
notificationId := notificationrecipientuser.NewNotificationID(id.SubscriptionId, id.ResourceGroupName, id.ServiceName, id.NotificationName)
users, err := client.ListByNotification(ctx, notificationId)
users, err := client.ListByNotificationComplete(ctx, notificationId)
if err != nil {
if !response.WasNotFound(users.HttpResponse) {
if !response.WasNotFound(users.LatestHttpResponse) {
return fmt.Errorf("retrieving %s: %+v", id, err)
}
}

found := false
if m := users.Model; m != nil && m.Value != nil {
for _, existing := range *m.Value {
if existing.Name != nil && *existing.Name == id.UserId {
found = true
}
for _, existing := range users.Items {
if existing.Name != nil && *existing.Name == id.UserId {
found = true
}
}

Expand Down
Expand Up @@ -56,17 +56,15 @@ func (ApiManagementNotificationRecipientUserResource) Exists(ctx context.Context
}

notificationId := notificationrecipientuser.NewNotificationID(id.SubscriptionId, id.ResourceGroupName, id.ServiceName, id.NotificationName)
users, err := client.ApiManagement.NotificationRecipientUserClient.ListByNotification(ctx, notificationId)
users, err := client.ApiManagement.NotificationRecipientUserClient.ListByNotificationComplete(ctx, notificationId)
if err != nil {
if !response.WasNotFound(users.HttpResponse) {
if !response.WasNotFound(users.LatestHttpResponse) {
return nil, fmt.Errorf("retrieving %s: %+v", *id, err)
}
}
if model := users.Model; model != nil && model.Value != nil {
for _, existing := range *model.Value {
if existing.Name != nil && *existing.Name == id.UserId {
return pointer.To(true), nil
}
for _, existing := range users.Items {
if existing.Name != nil && *existing.Name == id.UserId {
return pointer.To(true), nil
}
}
return pointer.To(false), nil
Expand Down
Expand Up @@ -155,7 +155,7 @@ func (r ApplicationInsightsWorkbookResource) Create() sdk.ResourceFunc {
properties := &workbooks.Workbook{
Identity: identityValue,
Kind: &kindValue,
Location: utils.String(location.Normalize(model.Location)),
Location: location.Normalize(model.Location),
Properties: &workbooks.WorkbookProperties{
Category: model.Category,
DisplayName: model.DisplayName,
Expand Down Expand Up @@ -270,7 +270,7 @@ func (r ApplicationInsightsWorkbookResource) Read() sdk.ResourceFunc {
state := ApplicationInsightsWorkbookModel{
Name: id.WorkbookName,
ResourceGroupName: id.ResourceGroupName,
Location: location.NormalizeNilable(model.Location),
Location: location.Normalize(model.Location),
}

identityValue, err := identity.FlattenLegacySystemAndUserAssignedMap(model.Identity)
Expand Down
8 changes: 4 additions & 4 deletions internal/services/batch/batch_account_resource.go
Expand Up @@ -272,7 +272,7 @@ func resourceBatchAccountCreate(d *pluginsdk.ResourceData, meta interface{}) err
return fmt.Errorf("`storage_account_authentication_mode` is required when `storage_account_id` ")
}
parameters.Properties.AutoStorage = &batchaccount.AutoStorageBaseProperties{
StorageAccountId: &storageAccountId,
StorageAccountId: storageAccountId,
AuthenticationMode: pointer.To(batchaccount.AutoStorageAuthenticationMode(authMode)),
}
}
Expand Down Expand Up @@ -435,11 +435,11 @@ func resourceBatchAccountUpdate(d *pluginsdk.ResourceData, meta interface{}) err
if d.HasChange("storage_account_id") {
if v, ok := d.GetOk("storage_account_id"); ok {
parameters.Properties.AutoStorage = &batchaccount.AutoStorageBaseProperties{
StorageAccountId: utils.String(v.(string)),
StorageAccountId: v.(string),
}
} else {
parameters.Properties.AutoStorage = &batchaccount.AutoStorageBaseProperties{
StorageAccountId: nil,
StorageAccountId: "",
}
}
}
Expand All @@ -452,7 +452,7 @@ func resourceBatchAccountUpdate(d *pluginsdk.ResourceData, meta interface{}) err
storageAccountId := d.Get("storage_account_id").(string)
if storageAccountId != "" {
parameters.Properties.AutoStorage = &batchaccount.AutoStorageBaseProperties{
StorageAccountId: &storageAccountId,
StorageAccountId: storageAccountId,
AuthenticationMode: pointer.To(batchaccount.AutoStorageAuthenticationMode(authMode)),
}
}
Expand Down
15 changes: 7 additions & 8 deletions internal/services/batch/client/client.go
Expand Up @@ -66,17 +66,16 @@ func (r *Client) JobClient(ctx context.Context, accountId batchaccount.BatchAcco
if err != nil {
return nil, fmt.Errorf("retrieving %s: %v", accountId, err)
}
if model := account.Model; model != nil {
if model.Properties == nil {
return nil, fmt.Errorf(`unexpected nil of "AccountProperties" of %s`, accountId)
}
if model.Properties.AccountEndpoint == nil {
return nil, fmt.Errorf(`unexpected nil of "AccountProperties.AccountEndpoint" of %s`, accountId)
}

endpoint := ""
if account.Model != nil && account.Model.Properties != nil {
endpoint = fmt.Sprintf("https://%s", *account.Model.Properties.AccountEndpoint)
}
if endpoint == "" {
return nil, fmt.Errorf("retrieving %s: `properties.AccountEndpoint` was empty", accountId)
}

// Copy the client since we'll manipulate its BatchURL
endpoint := "https://" + *account.Model.Properties.AccountEndpoint
c := batchDataplane.NewJobClient(endpoint)
c.BaseClient.Client.Authorizer = r.BatchManagementAuthorizer
return &c, nil
Expand Down
Expand Up @@ -107,7 +107,7 @@ func dataSourceBlueprintDefinitionRead(d *pluginsdk.ResourceData, meta interface
d.Set("display_name", pointer.From(p.DisplayName))
d.Set("last_modified", p.Status.LastModified)
d.Set("time_created", p.Status.TimeCreated)
d.Set("target_scope", p.TargetScope)
d.Set("target_scope", pointer.From(p.TargetScope))

publishedId := publishedblueprint.NewScopedBlueprintID(id.ResourceScope, id.BlueprintName)

Expand Down
Expand Up @@ -84,7 +84,7 @@ func dataSourceDataProtectionBackupVaultRead(d *pluginsdk.ResourceData, meta int
d.Set("resource_group_name", id.ResourceGroupName)

if model := resp.Model; model != nil {
d.Set("location", location.NormalizeNilable(&model.Location))
d.Set("location", location.NormalizeNilable(model.Location))

props := model.Properties
if props.StorageSettings != nil && len(props.StorageSettings) > 0 {
Expand Down
Expand Up @@ -157,7 +157,7 @@ func resourceDataProtectionBackupVaultCreateUpdate(d *pluginsdk.ResourceData, me
storageSettingType := backupvaults.StorageSettingTypes(d.Get("redundancy").(string))

parameters := backupvaults.BackupVaultResource{
Location: location.Normalize(d.Get("location").(string)),
Location: pointer.To(location.Normalize(d.Get("location").(string))),
Properties: backupvaults.BackupVault{
StorageSettings: []backupvaults.StorageSetting{
{
Expand Down Expand Up @@ -211,7 +211,7 @@ func resourceDataProtectionBackupVaultRead(d *pluginsdk.ResourceData, meta inter
d.Set("resource_group_name", id.ResourceGroupName)

if model := resp.Model; model != nil {
d.Set("location", location.NormalizeNilable(&model.Location))
d.Set("location", location.NormalizeNilable(model.Location))
props := model.Properties
if props.StorageSettings != nil && len(props.StorageSettings) > 0 {
d.Set("datastore_type", string(pointer.From((props.StorageSettings)[0].DatastoreType)))
Expand Down
Expand Up @@ -170,7 +170,7 @@ func resourceDedicatedHardwareSecurityModuleCreate(d *pluginsdk.ResourceData, me
NetworkProfile: expandDedicatedHsmNetworkProfile(d.Get("network_profile").([]interface{})),
ManagementNetworkProfile: expandDedicatedHsmNetworkProfile(d.Get("management_network_profile").([]interface{})),
},
Sku: dedicatedhsms.Sku{
Sku: &dedicatedhsms.Sku{
Name: &skuName,
},
Tags: tags.Expand(d.Get("tags").(map[string]interface{})),
Expand Down
Expand Up @@ -142,7 +142,7 @@ func resourceIoTTimeSeriesInsightsEventSourceEventhubCreateUpdate(d *pluginsdk.R
SharedAccessKey: d.Get("shared_access_key").(string),
ConsumerGroupName: d.Get("consumer_group_name").(string),
KeyName: d.Get("shared_access_key_name").(string),
EventSourceResourceId: utils.String(d.Get("event_source_resource_id").(string)),
EventSourceResourceId: d.Get("event_source_resource_id").(string),
TimestampPropertyName: utils.String(d.Get("timestamp_property_name").(string)),
},
}
Expand Down
Expand Up @@ -136,7 +136,7 @@ func resourceIoTTimeSeriesInsightsEventSourceIoTHubCreateUpdate(d *pluginsdk.Res
SharedAccessKey: d.Get("shared_access_key").(string),
ConsumerGroupName: d.Get("consumer_group_name").(string),
KeyName: d.Get("shared_access_key_name").(string),
EventSourceResourceId: utils.String(d.Get("event_source_resource_id").(string)),
EventSourceResourceId: d.Get("event_source_resource_id").(string),
TimestampPropertyName: utils.String(d.Get("timestamp_property_name").(string)),
},
}
Expand Down