diff --git a/internal/provider/provider.go b/internal/provider/provider.go index a0c85031..24d7d298 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -78,7 +78,7 @@ func providerAuthenticate(d *schema.ResourceData, client *api.Client) (*authtoke return nil, errors.New("auth method password not set, please set the auth_method_password on the provider") } - am := authmethods.NewAuthMethodsClient(client) + am := authmethods.NewClient(client) ctx := context.Background() // note: Authenticate() calls SetToken() under the hood to set the diff --git a/internal/provider/provider_test.go b/internal/provider/provider_test.go index c4143664..145349b8 100644 --- a/internal/provider/provider_test.go +++ b/internal/provider/provider_test.go @@ -51,7 +51,7 @@ provider "boundary" { } func setGrantScopeIDonProject(projID string, principalID string, client *api.Client) error { - roleClient := roles.NewRolesClient(client) + roleClient := roles.NewClient(client) _, err, _ := roleClient.Create( context.Background(), roles.WithName(fmt.Sprintf("TestRole_%s", projID)), diff --git a/internal/provider/resource_group.go b/internal/provider/resource_group.go index 8e847739..a08d2368 100644 --- a/internal/provider/resource_group.go +++ b/internal/provider/resource_group.go @@ -117,7 +117,7 @@ func resourceGroupCreate(d *schema.ResourceData, meta interface{}) error { ctx := md.ctx g := convertResourceDataToGroup(d, md) - grps := groups.NewGroupsClient(client) + grps := groups.NewClient(client) memIDs := g.MemberIds @@ -157,7 +157,7 @@ func resourceGroupRead(d *schema.ResourceData, meta interface{}) error { ctx := md.ctx g := convertResourceDataToGroup(d, md) - grps := groups.NewGroupsClient(client) + grps := groups.NewClient(client) g, apiErr, err := grps.Read(ctx, g.Id, groups.WithScopeId(g.Scope.Id)) if err != nil { @@ -176,7 +176,7 @@ func resourceGroupUpdate(d *schema.ResourceData, meta interface{}) error { ctx := md.ctx g := convertResourceDataToGroup(d, md) - grps := groups.NewGroupsClient(client) + grps := groups.NewClient(client) if d.HasChange(groupNameKey) { g.Name = d.Get(groupNameKey).(string) @@ -230,7 +230,7 @@ func resourceGroupDelete(d *schema.ResourceData, meta interface{}) error { ctx := md.ctx g := convertResourceDataToGroup(d, md) - grps := groups.NewGroupsClient(client) + grps := groups.NewClient(client) _, apiErr, err := grps.Delete(ctx, g.Id, groups.WithScopeId(g.Scope.Id)) if err != nil { diff --git a/internal/provider/resource_group_test.go b/internal/provider/resource_group_test.go index 3fa3f211..060edb55 100644 --- a/internal/provider/resource_group_test.go +++ b/internal/provider/resource_group_test.go @@ -230,7 +230,7 @@ func testAccCheckGroupResourceMembersSet(name string, members []string) resource if ok { client.SetScopeId(projID) } - grpsClient := groups.NewGroupsClient(client) + grpsClient := groups.NewClient(client) g, _, err := grpsClient.Read(md.ctx, id) if err != nil { @@ -278,7 +278,7 @@ func testAccCheckGroupProjectScope(name string) resource.TestCheckFunc { if ok { projClient.SetScopeId(stateProjID) } - grps := groups.NewGroupsClient(projClient) + grps := groups.NewClient(projClient) g, _, err := grps.Read(md.ctx, id) if err != nil { @@ -311,7 +311,7 @@ func testAccCheckGroupResourceExists(name string) resource.TestCheckFunc { if ok && projID != "" { projClient.SetScopeId(projID) } - grps := groups.NewGroupsClient(projClient) + grps := groups.NewClient(projClient) if _, _, err := grps.Read(md.ctx, id); err != nil { return fmt.Errorf("Got an error when reading group %q: %v", id, err) @@ -343,7 +343,7 @@ func testAccCheckGroupResourceDestroy(t *testing.T) resource.TestCheckFunc { if ok { projClient.SetScopeId(projID) } - grps := groups.NewGroupsClient(projClient) + grps := groups.NewClient(projClient) id := rs.Primary.ID diff --git a/internal/provider/resource_host.go b/internal/provider/resource_host.go index b49d7717..b3b5681c 100644 --- a/internal/provider/resource_host.go +++ b/internal/provider/resource_host.go @@ -133,7 +133,7 @@ func resourceHostCreate(d *schema.ResourceData, meta interface{}) error { ctx := md.ctx h := convertResourceDataToHost(d) - usrs := hosts.NewHostsClient(client) + usrs := hosts.NewClient(client) h, apiErr, err := usrs.Create( ctx, @@ -162,7 +162,7 @@ func resourceHostRead(d *schema.ResourceData, meta interface{}) error { ctx := md.ctx h := convertResourceDataToHost(d) - usrs := hosts.NewHostsClient(client) + usrs := hosts.NewClient(client) h, apiErr, err := usrs.Read(ctx, h.HostCatalogId, h.Id, hosts.WithScopeId(h.Scope.Id)) if err != nil { @@ -181,7 +181,7 @@ func resourceHostUpdate(d *schema.ResourceData, meta interface{}) error { ctx := md.ctx h := convertResourceDataToHost(d) - usrs := hosts.NewHostsClient(client) + usrs := hosts.NewClient(client) if d.HasChange(hostNameKey) { h.Name = d.Get(hostNameKey).(string) @@ -223,7 +223,7 @@ func resourceHostDelete(d *schema.ResourceData, meta interface{}) error { ctx := md.ctx h := convertResourceDataToHost(d) - usrs := hosts.NewHostsClient(client) + usrs := hosts.NewClient(client) _, apiErr, err := usrs.Delete(ctx, h.HostCatalogId, h.Id, hosts.WithScopeId(h.Scope.Id)) if err != nil { diff --git a/internal/provider/resource_host_catalog.go b/internal/provider/resource_host_catalog.go index 13ecb808..7a2c1758 100644 --- a/internal/provider/resource_host_catalog.go +++ b/internal/provider/resource_host_catalog.go @@ -4,7 +4,7 @@ import ( "errors" "fmt" - "github.com/hashicorp/boundary/api/hosts" + "github.com/hashicorp/boundary/api/hostcatalogs" "github.com/hashicorp/boundary/api/scopes" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) @@ -62,7 +62,7 @@ func validateHostCatalogType(val interface{}, key string) (warns []string, errs } // convertHostCatalogToResourceData creates a ResourceData type from a HostCatalog -func convertHostCatalogToResourceData(h *hosts.HostCatalog, d *schema.ResourceData) error { +func convertHostCatalogToResourceData(h *hostcatalogs.HostCatalog, d *schema.ResourceData) error { if h.Name != "" { if err := d.Set(hostCatalogNameKey, h.Name); err != nil { return err @@ -93,8 +93,8 @@ func convertHostCatalogToResourceData(h *hosts.HostCatalog, d *schema.ResourceDa } // convertResourceDataToHostCatalog returns a localy built HostCatalog using the values provided in the ResourceData. -func convertResourceDataToHostCatalog(d *schema.ResourceData) *hosts.HostCatalog { - h := &hosts.HostCatalog{Scope: &scopes.ScopeInfo{}} +func convertResourceDataToHostCatalog(d *schema.ResourceData) *hostcatalogs.HostCatalog { + h := &hostcatalogs.HostCatalog{Scope: &scopes.ScopeInfo{}} if descVal, ok := d.GetOk(hostCatalogDescriptionKey); ok { h.Description = descVal.(string) @@ -128,14 +128,14 @@ func resourceHostCatalogCreate(d *schema.ResourceData, meta interface{}) error { ctx := md.ctx h := convertResourceDataToHostCatalog(d) - hcClient := hosts.NewHostCatalogsClient(client) + hcClient := hostcatalogs.NewClient(client) h, apiErr, err := hcClient.Create( ctx, h.Type, - hosts.WithName(h.Name), - hosts.WithDescription(h.Description), - hosts.WithScopeId(h.Scope.Id)) + hostcatalogs.WithName(h.Name), + hostcatalogs.WithDescription(h.Description), + hostcatalogs.WithScopeId(h.Scope.Id)) if err != nil { return fmt.Errorf("error calling new host catalog: %s", err.Error()) } @@ -154,9 +154,9 @@ func resourceHostCatalogRead(d *schema.ResourceData, meta interface{}) error { ctx := md.ctx h := convertResourceDataToHostCatalog(d) - hcClient := hosts.NewHostCatalogsClient(client) + hcClient := hostcatalogs.NewClient(client) - h, apiErr, err := hcClient.Read(ctx, h.Id, hosts.WithScopeId(h.Scope.Id)) + h, apiErr, err := hcClient.Read(ctx, h.Id, hostcatalogs.WithScopeId(h.Scope.Id)) if err != nil { return fmt.Errorf("error calling new host catalog: %s", err.Error()) } @@ -173,7 +173,7 @@ func resourceHostCatalogUpdate(d *schema.ResourceData, meta interface{}) error { ctx := md.ctx h := convertResourceDataToHostCatalog(d) - hcClient := hosts.NewHostCatalogsClient(client) + hcClient := hostcatalogs.NewClient(client) if d.HasChange(hostCatalogNameKey) { h.Name = d.Get(hostCatalogNameKey).(string) @@ -198,10 +198,10 @@ func resourceHostCatalogUpdate(d *schema.ResourceData, meta interface{}) error { ctx, h.Id, 0, - hosts.WithScopeId(h.Scope.Id), - hosts.WithAutomaticVersioning(), - hosts.WithName(h.Name), - hosts.WithDescription(h.Description)) + hostcatalogs.WithScopeId(h.Scope.Id), + hostcatalogs.WithAutomaticVersioning(), + hostcatalogs.WithName(h.Name), + hostcatalogs.WithDescription(h.Description)) if err != nil { return err } @@ -218,9 +218,9 @@ func resourceHostCatalogDelete(d *schema.ResourceData, meta interface{}) error { ctx := md.ctx h := convertResourceDataToHostCatalog(d) - hcClient := hosts.NewHostCatalogsClient(client) + hcClient := hostcatalogs.NewClient(client) - _, apiErr, err := hcClient.Delete(ctx, h.Id, hosts.WithScopeId(h.Scope.Id)) + _, apiErr, err := hcClient.Delete(ctx, h.Id, hostcatalogs.WithScopeId(h.Scope.Id)) if err != nil { return fmt.Errorf("error calling new host catalog: %s", err.Error()) } diff --git a/internal/provider/resource_host_catalog_test.go b/internal/provider/resource_host_catalog_test.go index c2022cd4..417ce461 100644 --- a/internal/provider/resource_host_catalog_test.go +++ b/internal/provider/resource_host_catalog_test.go @@ -5,7 +5,7 @@ import ( "net/http" "testing" - "github.com/hashicorp/boundary/api/hosts" + "github.com/hashicorp/boundary/api/hostcatalogs" "github.com/hashicorp/boundary/testing/controller" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" @@ -83,11 +83,9 @@ func testAccCheckHostCatalogResourceExists(name string) resource.TestCheckFunc { if !ok { return fmt.Errorf("scope_id is not set") } - projClient := md.client.Clone() - projClient.SetScopeId(projID) - hcClient := hosts.NewHostCatalogsClient(projClient) + hcClient := hostcatalogs.NewClient(md.client) - if _, _, err := hcClient.Read(md.ctx, id); err != nil { + if _, _, err := hcClient.Read(md.ctx, id, hostcatalogs.WithScopeId(projID)); err != nil { return fmt.Errorf("Got an error when reading host catalog %q: %v", id, err) } @@ -110,11 +108,10 @@ func testAccCheckHostCatalogResourceDestroy(t *testing.T) resource.TestCheckFunc if !ok { return fmt.Errorf("scope_id is not set") } - projClient := md.client.Clone() - projClient.SetScopeId(projID) - hcClient := hosts.NewHostCatalogsClient(projClient) - _, apiErr, _ := hcClient.Read(md.ctx, id) + hcClient := hostcatalogs.NewClient(md.client) + + _, apiErr, _ := hcClient.Read(md.ctx, id, hostcatalogs.WithScopeId(projID)) if apiErr == nil || apiErr.Status != http.StatusNotFound && apiErr.Status != http.StatusForbidden { return fmt.Errorf("Didn't get a 404 or 403 when reading destroyed host catalog %q: %v", id, apiErr) } diff --git a/internal/provider/resource_host_test.go b/internal/provider/resource_host_test.go index 325c0cb3..27ebb2ef 100644 --- a/internal/provider/resource_host_test.go +++ b/internal/provider/resource_host_test.go @@ -113,7 +113,7 @@ func testAccCheckHostResourceExists(name string) resource.TestCheckFunc { projClient := md.client.Clone() projClient.SetScopeId(projID) - hostsClient := hosts.NewHostsClient(projClient) + hostsClient := hosts.NewClient(projClient) if _, _, err := hostsClient.Read(md.ctx, hostCatalogID, id); err != nil { return fmt.Errorf("Got an error when reading host %q: %v", id, err) @@ -147,7 +147,7 @@ func testAccCheckHostAttributeSet(name, attrKey, wantAttrVal string) resource.Te } projClient := md.client.Clone() projClient.SetScopeId(projID) - hostsClient := hosts.NewHostsClient(projClient) + hostsClient := hosts.NewClient(projClient) h, _, err := hostsClient.Read(md.ctx, hostCatalogID, id) if err != nil { @@ -199,7 +199,7 @@ func testAccCheckHostResourceDestroy(t *testing.T) resource.TestCheckFunc { projClient := md.client.Clone() projClient.SetScopeId(projID) - hostsClient := hosts.NewHostsClient(projClient) + hostsClient := hosts.NewClient(projClient) _, apiErr, _ := hostsClient.Read(md.ctx, hostCatalogID, id) if apiErr == nil || apiErr.Status != http.StatusNotFound && apiErr.Status != http.StatusForbidden { diff --git a/internal/provider/resource_organization.go b/internal/provider/resource_organization.go index 748eac4c..6905d943 100644 --- a/internal/provider/resource_organization.go +++ b/internal/provider/resource_organization.go @@ -75,7 +75,7 @@ func resourceOrganizationCreate(d *schema.ResourceData, meta interface{}) error client := md.client ctx := md.ctx - scp := scopes.NewScopesClient(client) + scp := scopes.NewClient(client) o, err := convertResourceDataToOrganization(d) if err != nil { return err @@ -99,7 +99,7 @@ func resourceOrganizationRead(d *schema.ResourceData, meta interface{}) error { client := md.client ctx := md.ctx - scp := scopes.NewScopesClient(client) + scp := scopes.NewClient(client) o, _, err := scp.Read(ctx, d.Id()) if err != nil { @@ -115,7 +115,7 @@ func resourceOrganizationUpdate(d *schema.ResourceData, meta interface{}) error projClient := client.Clone() projClient.SetScopeId(d.Id()) - scp := scopes.NewScopesClient(projClient) + scp := scopes.NewClient(projClient) o, err := convertResourceDataToOrganization(d) if err != nil { return err @@ -153,7 +153,7 @@ func resourceOrganizationDelete(d *schema.ResourceData, meta interface{}) error projClient := client.Clone() projClient.SetScopeId(d.Id()) - scp := scopes.NewScopesClient(projClient) + scp := scopes.NewClient(projClient) o, err := convertResourceDataToOrganization(d) if err != nil { return err diff --git a/internal/provider/resource_organization_test.go b/internal/provider/resource_organization_test.go index fee53285..a1be0000 100644 --- a/internal/provider/resource_organization_test.go +++ b/internal/provider/resource_organization_test.go @@ -82,7 +82,7 @@ func testAccCheckOrganizationResourceExists(name string) resource.TestCheckFunc } md := testProvider.Meta().(*metaData) - scp := scopes.NewScopesClient(md.client) + scp := scopes.NewClient(md.client) if _, _, err := scp.Read(md.ctx, id); err != nil { return fmt.Errorf("Got an error when reading organization %q: %v", id, err) @@ -96,7 +96,7 @@ func testAccCheckOrganizationResourceDestroy(t *testing.T) resource.TestCheckFun return func(s *terraform.State) error { // retrieve the connection established in Provider configuration md := testProvider.Meta().(*metaData) - scp := scopes.NewScopesClient(md.client) + scp := scopes.NewClient(md.client) for _, rs := range s.RootModule().Resources { id := rs.Primary.ID diff --git a/internal/provider/resource_project.go b/internal/provider/resource_project.go index e9196c90..e616e773 100644 --- a/internal/provider/resource_project.go +++ b/internal/provider/resource_project.go @@ -97,7 +97,7 @@ func resourceProjectCreate(d *schema.ResourceData, meta interface{}) error { client := md.client ctx := md.ctx - scp := scopes.NewScopesClient(client) + scp := scopes.NewClient(client) p, err := convertResourceDataToProject(d) if err != nil { return err @@ -121,7 +121,7 @@ func resourceProjectRead(d *schema.ResourceData, meta interface{}) error { client := md.client ctx := md.ctx - scp := scopes.NewScopesClient(client) + scp := scopes.NewClient(client) p, _, err := scp.Read(ctx, d.Id()) if err != nil { @@ -137,7 +137,7 @@ func resourceProjectUpdate(d *schema.ResourceData, meta interface{}) error { //projClient := client.Clone() //projClient.SetScopeId(d.Id()) - scp := scopes.NewScopesClient(client) //projClient) + scp := scopes.NewClient(client) //projClient) p, err := convertResourceDataToProject(d) if err != nil { return err @@ -175,7 +175,7 @@ func resourceProjectDelete(d *schema.ResourceData, meta interface{}) error { //projClient := client.Clone() //projClient.SetScopeId(d.Id()) - scp := scopes.NewScopesClient(client) //projClient) + scp := scopes.NewClient(client) //projClient) p, err := convertResourceDataToProject(d) if err != nil { return err diff --git a/internal/provider/resource_project_test.go b/internal/provider/resource_project_test.go index c2411384..59837afa 100644 --- a/internal/provider/resource_project_test.go +++ b/internal/provider/resource_project_test.go @@ -94,7 +94,7 @@ func testAccCheckProjectResourceExists(name string) resource.TestCheckFunc { return fmt.Errorf("ID not formatted as expected, expected prefix 'p_', got %s", id) } md := testProvider.Meta().(*metaData) - scp := scopes.NewScopesClient(md.client) + scp := scopes.NewClient(md.client) if _, _, err := scp.Read(md.ctx, id); err != nil { return fmt.Errorf("Got an error when reading project %q: %v", id, err) @@ -108,7 +108,7 @@ func testAccCheckProjectResourceDestroy(t *testing.T) resource.TestCheckFunc { return func(s *terraform.State) error { // retrieve the connection established in Provider configuration md := testProvider.Meta().(*metaData) - scp := scopes.NewScopesClient(md.client) + scp := scopes.NewClient(md.client) for _, rs := range s.RootModule().Resources { id := rs.Primary.ID diff --git a/internal/provider/resource_role.go b/internal/provider/resource_role.go index 46e3ad83..fc50459a 100644 --- a/internal/provider/resource_role.go +++ b/internal/provider/resource_role.go @@ -136,7 +136,7 @@ func resourceRoleCreate(d *schema.ResourceData, meta interface{}) error { ctx := md.ctx r := convertResourceDataToRole(d) - rolesClient := roles.NewRolesClient(client) + rolesClient := roles.NewClient(client) principals := r.PrincipalIds grants := []string{} @@ -198,7 +198,7 @@ func resourceRoleRead(d *schema.ResourceData, meta interface{}) error { ctx := md.ctx r := convertResourceDataToRole(d) - rolesClient := roles.NewRolesClient(client) + rolesClient := roles.NewClient(client) r, apiErr, err := rolesClient.Read(ctx, r.Id, roles.WithScopeId(r.Scope.Id)) if err != nil { @@ -217,7 +217,7 @@ func resourceRoleUpdate(d *schema.ResourceData, meta interface{}) error { ctx := md.ctx r := convertResourceDataToRole(d) - rolesClient := roles.NewRolesClient(client) + rolesClient := roles.NewClient(client) if d.HasChange(roleNameKey) { r.Name = d.Get(roleNameKey).(string) @@ -285,7 +285,7 @@ func resourceRoleDelete(d *schema.ResourceData, meta interface{}) error { ctx := md.ctx r := convertResourceDataToRole(d) - rolesClient := roles.NewRolesClient(client) + rolesClient := roles.NewClient(client) _, apiErr, err := rolesClient.Delete(ctx, r.Id, roles.WithScopeId(r.Scope.Id)) if apiErr != nil || err != nil { diff --git a/internal/provider/resource_role_test.go b/internal/provider/resource_role_test.go index 9cfe505b..8e79c0d2 100644 --- a/internal/provider/resource_role_test.go +++ b/internal/provider/resource_role_test.go @@ -320,7 +320,7 @@ func testAccCheckRoleDestroyed(name string) resource.TestCheckFunc { } projClient := md.client.Clone() projClient.SetScopeId(projID) - rolesClient := roles.NewRolesClient(projClient) + rolesClient := roles.NewClient(projClient) if _, apiErr, _ := rolesClient.Read(md.ctx, id); apiErr == nil || apiErr.Status != http.StatusNotFound { errs = append(errs, fmt.Sprintf("Role not destroyed %q: %v", id, apiErr)) @@ -349,7 +349,7 @@ func testAccCheckRoleResourceExists(name string) resource.TestCheckFunc { } projClient := md.client.Clone() projClient.SetScopeId(projID) - rolesClient := roles.NewRolesClient(projClient) + rolesClient := roles.NewClient(projClient) if _, _, err := rolesClient.Read(md.ctx, id); err != nil { return fmt.Errorf("Got an error when reading role %q: %v", id, err) @@ -393,7 +393,7 @@ func testAccCheckRoleResourcePrincipalsSet(name string, principals []string) res } projClient := md.client.Clone() projClient.SetScopeId(projID) - rolesClient := roles.NewRolesClient(projClient) + rolesClient := roles.NewClient(projClient) r, _, err := rolesClient.Read(md.ctx, id) if err != nil { @@ -456,7 +456,7 @@ func testAccCheckRoleResourceGroupsSet(name string, groups []string) resource.Te } projClient := md.client.Clone() projClient.SetScopeId(projID) - rolesClient := roles.NewRolesClient(projClient) + rolesClient := roles.NewClient(projClient) r, _, err := rolesClient.Read(md.ctx, id) if err != nil { @@ -504,7 +504,7 @@ func testAccCheckRoleResourceGrantsSet(name string, expectedGrants []string) res } projClient := md.client.Clone() projClient.SetScopeId(projID) - rolesClient := roles.NewRolesClient(projClient) + rolesClient := roles.NewClient(projClient) r, _, err := rolesClient.Read(md.ctx, id) if err != nil { @@ -556,7 +556,7 @@ func testAccCheckRoleResourceDestroy(t *testing.T) resource.TestCheckFunc { } projClient := md.client.Clone() projClient.SetScopeId(projID) - rolesClient := roles.NewRolesClient(projClient) + rolesClient := roles.NewClient(projClient) _, apiErr, _ := rolesClient.Read(md.ctx, id) if apiErr == nil || apiErr.Status != http.StatusNotFound && apiErr.Status != http.StatusForbidden { diff --git a/internal/provider/resource_user.go b/internal/provider/resource_user.go index e5d3cfe2..98fb0e32 100644 --- a/internal/provider/resource_user.go +++ b/internal/provider/resource_user.go @@ -93,7 +93,7 @@ func resourceUserCreate(d *schema.ResourceData, meta interface{}) error { ctx := md.ctx u := convertResourceDataToUser(d) - usrs := users.NewUsersClient(client) + usrs := users.NewClient(client) u, apiErr, err := usrs.Create( ctx, @@ -118,7 +118,7 @@ func resourceUserRead(d *schema.ResourceData, meta interface{}) error { ctx := md.ctx u := convertResourceDataToUser(d) - usrs := users.NewUsersClient(client) + usrs := users.NewClient(client) u, apiErr, err := usrs.Read(ctx, u.Id, users.WithScopeId(u.Scope.Id)) if err != nil { @@ -137,7 +137,7 @@ func resourceUserUpdate(d *schema.ResourceData, meta interface{}) error { ctx := md.ctx u := convertResourceDataToUser(d) - usrs := users.NewUsersClient(client) + usrs := users.NewClient(client) if d.HasChange(userNameKey) { u.Name = d.Get(userNameKey).(string) @@ -173,7 +173,7 @@ func resourceUserDelete(d *schema.ResourceData, meta interface{}) error { ctx := md.ctx u := convertResourceDataToUser(d) - usrs := users.NewUsersClient(client) + usrs := users.NewClient(client) _, apiErr, err := usrs.Delete(ctx, u.Id, users.WithScopeId(u.Scope.Id)) if err != nil { diff --git a/internal/provider/resource_user_test.go b/internal/provider/resource_user_test.go index a7768a18..11a9a189 100644 --- a/internal/provider/resource_user_test.go +++ b/internal/provider/resource_user_test.go @@ -83,7 +83,7 @@ func testAccCheckUserResourceExists(name string) resource.TestCheckFunc { } projClient := md.client.Clone() projClient.SetScopeId(projID) - usrs := users.NewUsersClient(projClient) + usrs := users.NewClient(projClient) if _, _, err := usrs.Read(md.ctx, id); err != nil { return fmt.Errorf("Got an error when reading user %q: %v", id, err) @@ -111,7 +111,7 @@ func testAccCheckUserResourceDestroy(t *testing.T) resource.TestCheckFunc { } projClient := md.client.Clone() projClient.SetScopeId(projID) - usrs := users.NewUsersClient(projClient) + usrs := users.NewClient(projClient) _, apiErr, _ := usrs.Read(md.ctx, id) if apiErr == nil || apiErr.Status != http.StatusNotFound && apiErr.Status != http.StatusForbidden {