diff --git a/role_test.go b/role_test.go index 5c75b1b..1f561c3 100644 --- a/role_test.go +++ b/role_test.go @@ -679,7 +679,7 @@ func TestListRoles(t *testing.T) { }, }, Users: []*roles.GetUserInRoleResponse{}, - Status: redis.String("active"), + Status: redis.String(roles.StatusActive), }, { ID: redis.Int(999), @@ -711,7 +711,7 @@ func TestListRoles(t *testing.T) { Name: redis.String("test-user"), }, }, - Status: redis.String("active"), + Status: redis.String(roles.StatusActive), }, }, actual) @@ -905,7 +905,7 @@ func TestGetRole(t *testing.T) { Name: redis.String("test-user"), }, }, - Status: redis.String("active"), + Status: redis.String(roles.StatusActive), }, actual) } diff --git a/service/access_control_lists/users/model.go b/service/access_control_lists/users/model.go index fe62efa..8ed17bd 100644 --- a/service/access_control_lists/users/model.go +++ b/service/access_control_lists/users/model.go @@ -14,9 +14,10 @@ func (o ListUsersResponse) String() string { } type GetUserResponse struct { - ID *int `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Role *string `json:"role,omitempty"` + ID *int `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Role *string `json:"role,omitempty"` + Status *string `json:"status,omitempty"` } func (o GetUserResponse) String() string { @@ -45,3 +46,14 @@ type UpdateUserRequest struct { func (o UpdateUserRequest) String() string { return internal.ToString(o) } + +const ( + // StatusActive is the active value of the `Status` field in `User` + StatusActive = "active" + // StatusPending is the pending value of the `Status` field in `User` + StatusPending = "pending" + // StatusError is the error value of the `Status` field in `User` + StatusError = "error" + // StatusDeleting is the deleting value of the `Status` field in `User` + StatusDeleting = "deleting" +) diff --git a/user_test.go b/user_test.go index 7e0421f..50ebc1f 100644 --- a/user_test.go +++ b/user_test.go @@ -526,6 +526,7 @@ func TestGetUser(t *testing.T) { "id": 20000, "name": "test-user", "role": "test-role", + "status": "pending", "links": [ { "rel": "self", @@ -544,8 +545,9 @@ func TestGetUser(t *testing.T) { require.NoError(t, err) assert.Equal(t, &users.GetUserResponse{ - ID: redis.Int(20000), - Name: redis.String("test-user"), - Role: redis.String("test-role"), + ID: redis.Int(20000), + Name: redis.String("test-user"), + Role: redis.String("test-role"), + Status: redis.String(users.StatusPending), }, actual) }