diff options
author | Julien Dessaux | 2023-06-24 14:39:13 +0200 |
---|---|---|
committer | Julien Dessaux | 2023-06-24 17:29:20 +0200 |
commit | 575c4ed22881e9b906346b17fe95c3b358a1c883 (patch) | |
tree | 494d00ef9a31ba73ddb311597e91ffb4ca98dc88 /internal | |
parent | Terraform registry documentation bootstrap (diff) | |
download | terraform-provider-eventline-575c4ed22881e9b906346b17fe95c3b358a1c883.tar.gz terraform-provider-eventline-575c4ed22881e9b906346b17fe95c3b358a1c883.tar.bz2 terraform-provider-eventline-575c4ed22881e9b906346b17fe95c3b358a1c883.zip |
Update projects data source schema to use an extended attributes definition
Diffstat (limited to 'internal')
-rw-r--r-- | internal/provider/projects_data_source.go | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/internal/provider/projects_data_source.go b/internal/provider/projects_data_source.go index 4559b46..6f44a93 100644 --- a/internal/provider/projects_data_source.go +++ b/internal/provider/projects_data_source.go @@ -5,7 +5,6 @@ import ( "fmt" "git.adyxax.org/adyxax/terraform-provider-eventline/external/evcli" - "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/datasource" "github.com/hashicorp/terraform-plugin-framework/datasource/schema" "github.com/hashicorp/terraform-plugin-framework/types" @@ -35,18 +34,24 @@ func (d *ProjectsDataSource) Metadata(ctx context.Context, req datasource.Metada func (d *ProjectsDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) { resp.Schema = schema.Schema{ Attributes: map[string]schema.Attribute{ - "elements": schema.ListAttribute{ - Computed: true, - ElementType: types.ObjectType{ - AttrTypes: map[string]attr.Type{ - "id": types.StringType, - "name": types.StringType, + "elements": schema.ListNestedAttribute{ + Computed: true, + MarkdownDescription: "The list of projects.", + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "id": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "The identifier of the project.", + }, + "name": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "The name of the project.", + }, }, }, - MarkdownDescription: "Projects list", }, }, - MarkdownDescription: "Eventline projects data source", + MarkdownDescription: "Use this data source to retrieve information about existing eventline projects.", } } |