Skip to content

Commit

Permalink
feat: spaceID support gcp account
Browse files Browse the repository at this point in the history
  • Loading branch information
domenicsim1 committed Oct 16, 2023
1 parent 0e5a651 commit 9830a58
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions octopusdeploy/resource_gcp_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func resourceGoogleCloudPlatformAccountCreate(ctx context.Context, d *schema.Res
log.Printf("[INFO] creating GCP account: %#v", account)

client := m.(*client.Client)
createdAccount, err := client.Accounts.Add(account)
createdAccount, err := accounts.Add(client, account)
if err != nil {
return diag.FromErr(err)
}
Expand All @@ -48,7 +48,7 @@ func resourceGoogleCloudPlatformAccountDelete(ctx context.Context, d *schema.Res
log.Printf("[INFO] deleting GCP account (%s)", d.Id())

client := m.(*client.Client)
if err := client.Accounts.DeleteByID(d.Id()); err != nil {
if err := accounts.DeleteByID(client, d.Get("space_id").(string), d.Id()); err != nil {
return diag.FromErr(err)
}

Expand All @@ -62,7 +62,7 @@ func resourceGoogleCloudPlatformAccountRead(ctx context.Context, d *schema.Resou
log.Printf("[INFO] reading GCP account (%s)", d.Id())

client := m.(*client.Client)
accountResource, err := client.Accounts.GetByID(d.Id())
accountResource, err := accounts.GetByID(client, d.Get("space_id").(string), d.Id())
if err != nil {
return errors.ProcessApiError(ctx, d, err, "GCP account")
}
Expand All @@ -82,7 +82,7 @@ func resourceGoogleCloudPlatformAccountUpdate(ctx context.Context, d *schema.Res
log.Printf("[INFO] updating GCP account: %#v", account)

client := m.(*client.Client)
updatedAccount, err := client.Accounts.Update(account)
updatedAccount, err := accounts.Update(client, account)
if err != nil {
return diag.FromErr(err)
}
Expand Down

0 comments on commit 9830a58

Please sign in to comment.