Skip to content

Commit

Permalink
Merge pull request #120 from RedisLabs/statuses-for-acl-entities
Browse files Browse the repository at this point in the history
Added statuses for RedisRule and Role (so we can wait on them)
  • Loading branch information
JohnSharpe committed Jul 13, 2023
2 parents 82d1a2f + 35d3bf4 commit 4ddc60c
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
17 changes: 17 additions & 0 deletions fixture_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ package rediscloud_api
import (
"testing"

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

"github.com/RedisLabs/rediscloud-go-api/service/cloud_accounts"
"github.com/RedisLabs/rediscloud-go-api/service/databases"
"github.com/RedisLabs/rediscloud-go-api/service/subscriptions"
Expand Down Expand Up @@ -98,3 +101,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 4ddc60c

Please sign in to comment.