Skip to content

Commit ae81738

Browse files
committed
Add ProviderWithListResources interface
1 parent ee84f77 commit ae81738

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

provider/provider.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"github.com/hashicorp/terraform-plugin-framework/datasource"
1010
"github.com/hashicorp/terraform-plugin-framework/ephemeral"
1111
"github.com/hashicorp/terraform-plugin-framework/function"
12+
"github.com/hashicorp/terraform-plugin-framework/list"
1213
"github.com/hashicorp/terraform-plugin-framework/resource"
1314
)
1415

@@ -122,6 +123,17 @@ type ProviderWithMetaSchema interface {
122123
MetaSchema(context.Context, MetaSchemaRequest, *MetaSchemaResponse)
123124
}
124125

126+
type ProviderWithListResources interface {
127+
Provider
128+
129+
// ListResources returns a slice of functions to instantiate each Resource
130+
// List implementation.
131+
//
132+
// The resource type name is determined by the Resource List implementing
133+
// the Metadata method. All resource lists must have unique names.
134+
ListResources(context.Context) []func() list.ListResource
135+
}
136+
125137
// ProviderWithValidateConfig is an interface type that extends Provider to include imperative validation.
126138
//
127139
// Declaring validation using this methodology simplifies one-off

0 commit comments

Comments
 (0)