Skip to content

Commit

Permalink
Adjusting schema attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
shaun-od committed Dec 5, 2024
1 parent 6012509 commit 7f02f7a
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 75 deletions.
24 changes: 12 additions & 12 deletions docs/data-sources/teams.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
page_title: "octopusdeploy_teams Data Source - terraform-provider-octopusdeploy"
subcategory: ""
description: |-
Provides information about existing users.
Provides information about existing teams.
---

# octopusdeploy_teams (Data Source)

Provides information about existing users.
Provides information about existing teams.



Expand All @@ -27,7 +27,7 @@ Provides information about existing users.
### Read-Only

- `id` (String) An auto-generated identifier that includes the timestamp when this data source was last modified.
- `teams` (List of Object) A list of teams that match the filter(s). (see [below for nested schema](#nestedatt--teams))
- `teams` (Attributes List) A list of teams that match the filter(s). (see [below for nested schema](#nestedatt--teams))

<a id="nestedatt--teams"></a>
### Nested Schema for `teams`
Expand All @@ -38,20 +38,20 @@ Read-Only:
- `can_be_renamed` (Boolean)
- `can_change_members` (Boolean)
- `can_change_roles` (Boolean)
- `description` (String)
- `external_security_group` (List of Object) (see [below for nested schema](#nestedobjatt--teams--external_security_group))
- `id` (String)
- `name` (String)
- `space_id` (String)
- `users` (Set of String)

<a id="nestedobjatt--teams--external_security_group"></a>
- `description` (String) The user-friendly description of this team.
- `external_security_group` (Attributes List) (see [below for nested schema](#nestedatt--teams--external_security_group))
- `id` (String) The unique ID for this resource.
- `name` (String) The name of this team.
- `space_id` (String) The space associated with this team.
- `users` (Set of String) A list of user IDs designated to be members of this team.

<a id="nestedatt--teams--external_security_group"></a>
### Nested Schema for `teams.external_security_group`

Read-Only:

- `display_id_and_name` (Boolean)
- `display_name` (String)
- `id` (String)
- `id` (String) The unique ID for this resource.


46 changes: 0 additions & 46 deletions octopusdeploy/data_source_teams.go

This file was deleted.

33 changes: 16 additions & 17 deletions octopusdeploy_framework/schemas/team.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func (l TeamSchema) GetDatasourceSchema() datasourceSchema.Schema {
Description: "Provides information about existing teams.",
Attributes: map[string]datasourceSchema.Attribute{
"id": util.DataSourceString().Computed().Description("An auto-generated identifier that includes the timestamp when this data source was last modified.").Build(),
"ids": util.DataSourceList(types.StringType).Optional().Description("A filter to search by a list of IDs..").Build(),
"ids": util.DataSourceList(types.StringType).Optional().Description("A filter to search by a list of IDs.").Build(),
"include_system": util.DataSourceBool().Optional().Description("A filter to include system teams.").Build(),
"partial_name": util.DataSourceString().Optional().Description("A filter to search by the partial match of a name.").Build(),
"spaces": util.DataSourceList(types.StringType).Optional().Description("A filter to search by a list of space IDs.").Build(),
Expand All @@ -46,30 +46,29 @@ func getDatasourceTeamsAttributes() datasourceSchema.ListNestedAttribute {
Optional: false,
NestedObject: datasourceSchema.NestedAttributeObject{
Attributes: map[string]datasourceSchema.Attribute{
"can_be_deleted": util.DataSourceBool().Computed().Optional().Build(),
"can_be_renamed": util.DataSourceBool().Computed().Optional().Build(),
"can_change_members": util.DataSourceBool().Computed().Optional().Build(),
"can_change_roles": util.DataSourceBool().Computed().Optional().Build(),
"description": util.DataSourceString().Optional().Description("The user-friendly description of this team.").Build(),
"external_security_group": getDatasrouceExternalSecurityGroupsAttributes(),
"id": util.DataSourceString().Computed().Optional().Description("The unique ID for this resource.").Build(),
"name": util.DataSourceString().Required().Description("The name of this team.").Build(),
"space_id": util.DataSourceString().Computed().Optional().Description("The space associated with this team.").Build(),
"users": util.DataSourceSet(types.StringType).Computed().Optional().Description("A list of user IDs designated to be members of this team.").Build(),
"can_be_deleted": util.DataSourceBool().Computed().Build(),
"can_be_renamed": util.DataSourceBool().Computed().Build(),
"can_change_members": util.DataSourceBool().Computed().Build(),
"can_change_roles": util.DataSourceBool().Computed().Build(),
"description": util.DataSourceString().Computed().Description("The user-friendly description of this team.").Build(),
"external_security_group": getDatasourceExternalSecurityGroupsAttributes(),
"id": util.DataSourceString().Computed().Description("The unique ID for this resource.").Build(),
"name": util.DataSourceString().Computed().Description("The name of this team.").Build(),
"space_id": util.DataSourceString().Computed().Description("The space associated with this team.").Build(),
"users": util.DataSourceSet(types.StringType).Computed().Description("A list of user IDs designated to be members of this team.").Build(),
},
},
}
}

func getDatasrouceExternalSecurityGroupsAttributes() datasourceSchema.ListNestedAttribute {
func getDatasourceExternalSecurityGroupsAttributes() datasourceSchema.ListNestedAttribute {
return datasourceSchema.ListNestedAttribute{
Computed: false,
Optional: true,
Computed: true,
NestedObject: datasourceSchema.NestedAttributeObject{
Attributes: map[string]datasourceSchema.Attribute{
"display_id_and_name": util.DataSourceBool().Computed().Optional().Build(),
"display_name": util.DataSourceString().Computed().Optional().Build(),
"id": util.DataSourceString().Computed().Optional().Description("The unique ID for this resource.").Build(),
"display_id_and_name": util.DataSourceBool().Computed().Build(),
"display_name": util.DataSourceString().Computed().Build(),
"id": util.DataSourceString().Computed().Description("The unique ID for this resource.").Build(),
},
},
}
Expand Down

0 comments on commit 7f02f7a

Please sign in to comment.