This commit is contained in:
2024-11-12 13:41:38 +03:00
parent 040af43607
commit 36879efd58
517 changed files with 37877 additions and 1900 deletions

View File

@@ -126,6 +126,11 @@ func dataSourceAccountFlipGroupsListSchemaMake() map[string]*schema.Schema {
Optional: true,
Description: "Filter by flipgroup ID",
},
"sort_by": {
Type: schema.TypeString,
Optional: true,
Description: "sort by one of supported fields, format +|-(field)",
},
"page": {
Type: schema.TypeInt,
Optional: true,

View File

@@ -315,9 +315,8 @@ func resourceAccountUpdate(ctx context.Context, d *schema.ResourceData, m interf
userConv := user.(map[string]interface{})
req := account.DeleteUserRequest{
AccountID: accountId,
UserID: userConv["user_id"].(string),
RecursiveDelete: userConv["recursive_delete"].(bool),
AccountID: accountId,
UserID: userConv["user_id"].(string),
}
_, err := c.CloudAPI().Account().DeleteUser(ctx, req)
if err != nil {
@@ -381,8 +380,7 @@ func isChangedUser(els []interface{}, el interface{}) bool {
elOldConv := elOld.(map[string]interface{})
elConv := el.(map[string]interface{})
if elOldConv["user_id"].(string) == elConv["user_id"].(string) &&
(!strings.EqualFold(elOldConv["access_type"].(string), elConv["access_type"].(string)) ||
elOldConv["recursive_delete"].(bool) != elConv["recursive_delete"].(bool)) {
(!strings.EqualFold(elOldConv["access_type"].(string), elConv["access_type"].(string))) {
return true
}
}
@@ -424,11 +422,6 @@ func resourceAccountSchemaMake() map[string]*schema.Schema {
Type: schema.TypeString,
Required: true,
},
"recursive_delete": {
Type: schema.TypeBool,
Optional: true,
Default: false,
},
},
},
},

View File

@@ -72,6 +72,10 @@ func utilityAccountFlipGroupsListCheckPresence(ctx context.Context, d *schema.Re
req.ByIP = by_ip.(string)
}
if sortBy, ok := d.GetOk("sort_by"); ok {
req.SortBy = sortBy.(string)
}
if flipgroup_id, ok := d.GetOk("flipgroup_id"); ok {
req.FLIPGroupID = uint64(flipgroup_id.(int))
}