Skip to content

Commit

Permalink
Generate plural data source schema
Browse files Browse the repository at this point in the history
  • Loading branch information
cveticm committed Oct 22, 2024
1 parent 8ba03cf commit 264f7f5
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions internal/service/flexcluster/plural_data_source_schema.go
Original file line number Diff line number Diff line change
@@ -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"`
}

0 comments on commit 264f7f5

Please sign in to comment.