From 8552c97122e4ff9171fc18c155b8b583e05d35ec Mon Sep 17 00:00:00 2001 From: Nelson Susanto Date: Wed, 9 Oct 2024 15:54:23 +1100 Subject: [PATCH] Add deprecation message to space id --- docs/data-sources/users.md | 2 +- octopusdeploy_framework/schemas/user.go | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/data-sources/users.md b/docs/data-sources/users.md index 142876db..b2ebf335 100644 --- a/docs/data-sources/users.md +++ b/docs/data-sources/users.md @@ -28,7 +28,7 @@ data "octopusdeploy_users" "example" { - `filter` (String) A filter search by username, display name or email - `ids` (List of String) A filter to search by a list of IDs. - `skip` (Number) A filter to specify the number of items to skip in the response. -- `space_id` (String) The space ID associated with this user. +- `space_id` (String, Deprecated) The space ID of this user. - `take` (Number) A filter to specify the number of items to take (or return) in the response. ### Read-Only diff --git a/octopusdeploy_framework/schemas/user.go b/octopusdeploy_framework/schemas/user.go index 61e08b28..cd180a6b 100644 --- a/octopusdeploy_framework/schemas/user.go +++ b/octopusdeploy_framework/schemas/user.go @@ -40,7 +40,7 @@ func (u UserSchema) GetDatasourceSchema() datasourceSchema.Schema { Attributes: map[string]datasourceSchema.Attribute{ //request "ids": GetQueryIDsDatasourceSchema(), - "space_id": GetSpaceIdDatasourceSchema(UserResourceDescription, false), + "space_id": GetUserSpaceIdDatasourceSchema(), "filter": GetFilterDatasourceSchema(), "skip": GetQuerySkipDatasourceSchema(), "take": GetQueryTakeDatasourceSchema(), @@ -94,6 +94,14 @@ func (u UserSchema) GetDatasourceSchemaAttributes() map[string]datasourceSchema. } } +func GetUserSpaceIdDatasourceSchema() datasourceSchema.Attribute { + return datasourceSchema.StringAttribute{ + Description: "The space ID of this user.", + Optional: true, + DeprecationMessage: "This attribute is deprecated and will be removed in a future release. Users are not scoped to spaces, meaning providing a space ID will not affect the result.", + } +} + func GetFilterDatasourceSchema() datasourceSchema.Attribute { return datasourceSchema.StringAttribute{ Description: "A filter search by username, display name or email",