Skip to content

Commit

Permalink
Added statuses for RedisRule and Role (so we can wait on them)
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnSharpe committed Jul 13, 2023
1 parent 82d1a2f commit ef4793f
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
16 changes: 16 additions & 0 deletions fixture_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package rediscloud_api

import (
"github.com/RedisLabs/rediscloud-go-api/service/access_control_lists/redis_rules"
"github.com/RedisLabs/rediscloud-go-api/service/access_control_lists/roles"
"testing"

"github.com/RedisLabs/rediscloud-go-api/service/cloud_accounts"
Expand Down Expand Up @@ -98,3 +100,17 @@ func TestCloudAccountFixtures(t *testing.T) {
assert.Equal(t, "error", cloud_accounts.StatusError)
assert.Equal(t, []string{"AWS", "GCP"}, cloud_accounts.ProviderValues())
}

func TestRedisRuleFixtures(t *testing.T) {
assert.Equal(t, "active", redis_rules.StatusActive)
assert.Equal(t, "pending", redis_rules.StatusPending)
assert.Equal(t, "error", redis_rules.StatusError)
assert.Equal(t, "deleting", redis_rules.StatusDeleting)
}

func TestRoleFixtures(t *testing.T) {
assert.Equal(t, "active", roles.StatusActive)
assert.Equal(t, "pending", roles.StatusPending)
assert.Equal(t, "error", roles.StatusError)
assert.Equal(t, "deleting", roles.StatusDeleting)
}
11 changes: 11 additions & 0 deletions service/access_control_lists/redis_rules/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,14 @@ type CreateRedisRuleRequest struct {
func (o CreateRedisRuleRequest) String() string {
return internal.ToString(o)
}

const (
// StatusActive is the active value of the `Status` field in `RedisRule`
StatusActive = "active"
// StatusPending is the pending value of the `Status` field in `RedisRule`
StatusPending = "pending"
// StatusError is the error value of the `Status` field in `RedisRule`
StatusError = "error"
// StatusDeleting is the deleting value of the `Status` field in `RedisRule`
StatusDeleting = "deleting"
)
11 changes: 11 additions & 0 deletions service/access_control_lists/roles/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,14 @@ type CreateDatabaseInRuleInRoleRequest struct {
func (o CreateDatabaseInRuleInRoleRequest) String() string {
return internal.ToString(o)
}

const (
// StatusActive is the active value of the `Status` field in `Role`
StatusActive = "active"
// StatusPending is the pending value of the `Status` field in `Role`
StatusPending = "pending"
// StatusError is the error value of the `Status` field in `Role`
StatusError = "error"
// StatusDeleting is the deleting value of the `Status` field in `Role`
StatusDeleting = "deleting"
)

0 comments on commit ef4793f

Please sign in to comment.