From 264f7f51f11fade02bfe526b83b9178f3d4c050d Mon Sep 17 00:00:00 2001 From: Melanija Cvetic Date: Tue, 22 Oct 2024 15:40:15 +0100 Subject: [PATCH] Generate plural data source schema --- .../flexcluster/plural_data_source_schema.go | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 internal/service/flexcluster/plural_data_source_schema.go diff --git a/internal/service/flexcluster/plural_data_source_schema.go b/internal/service/flexcluster/plural_data_source_schema.go new file mode 100644 index 0000000000..57410b6a9c --- /dev/null +++ b/internal/service/flexcluster/plural_data_source_schema.go @@ -0,0 +1,31 @@ +package flexcluster + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-framework/datasource/schema" + "github.com/hashicorp/terraform-plugin-framework/types" +) + +func DataSourcePluralSchema(ctx context.Context) schema.Schema { + return schema.Schema{ + Attributes: map[string]schema.Attribute{ + "project_id": schema.StringAttribute{ + Required: true, + MarkdownDescription: "Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access.\n\n**NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups.", + }, + "flex_clusters": schema.ListNestedAttribute{ + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: dataSourceSchema(true), + }, + MarkdownDescription: "List of returned documents that MongoDB Cloud provides when completing this request.", + }, + }, + } +} + +type TFModelDSP struct { + ProjectId types.String `tfsdk:"project_id"` + FlexClusters []TFModel `tfsdk:"flex_clusters"` +}