Skip to content

Commit c4ccf44

Browse files
committed
Rename ResourceObject to Resource
1 parent 012fb27 commit c4ccf44

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

list/list_resource.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ type ListResourceRequest struct {
9494
// instances.
9595
Config tfsdk.Config
9696

97-
// IncludeResourceObject indicates whether the provider should populate
98-
// the ResourceObject field in the ListResourceEvent struct.
99-
IncludeResourceObject bool
97+
// IncludeResource indicates whether the provider should populate the
98+
// Resource field in the ListResourceEvent struct.
99+
IncludeResource bool
100100
}
101101

102102
// ListResourceStream represents a streaming response to a ListResourceRequest.
@@ -123,12 +123,12 @@ type ListResourceEvent struct {
123123
// A nil value will raise will raise a diagnostic.
124124
Identity *tfsdk.ResourceIdentity
125125

126-
// ResourceObject is the provider's representation of the attributes of the
126+
// Resource is the provider's representation of the attributes of the
127127
// listed managed resource instance.
128128
//
129-
// If ListResourceRequest.IncludeResourceObject is true, a nil value will raise
129+
// If ListResourceRequest.IncludeResource is true, a nil value will raise
130130
// a warning diagnostic.
131-
ResourceObject *tfsdk.ResourceObject
131+
Resource *tfsdk.Resource
132132

133133
// DisplayName is a provider-defined human-readable description of the
134134
// listed managed resource instance, intended for CLI and browser UIs.

tfsdk/resource_object.go renamed to tfsdk/resource.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ import (
1313
"github.com/hashicorp/terraform-plugin-go/tftypes"
1414
)
1515

16-
// ResourceObject represents a Terraform resource.
17-
type ResourceObject struct {
16+
// Resource represents a Terraform resource.
17+
type Resource struct {
1818
Raw tftypes.Value
1919
Schema fwschema.Schema
2020
}
2121

2222
// Get populates the struct passed as `target` with the resource.
23-
func (c ResourceObject) Get(ctx context.Context, target interface{}) diag.Diagnostics {
23+
func (c Resource) Get(ctx context.Context, target interface{}) diag.Diagnostics {
2424
return c.data().Get(ctx, target)
2525
}
2626

@@ -31,7 +31,7 @@ func (c ResourceObject) Get(ctx context.Context, target interface{}) diag.Diagno
3131
//
3232
// Attributes or elements under null or unknown collections return null
3333
// values, however this behavior is not protected by compatibility promises.
34-
func (c ResourceObject) GetAttribute(ctx context.Context, path path.Path, target interface{}) diag.Diagnostics {
34+
func (c Resource) GetAttribute(ctx context.Context, path path.Path, target interface{}) diag.Diagnostics {
3535
return c.data().GetAtPath(ctx, path, target)
3636
}
3737

@@ -40,11 +40,11 @@ func (c ResourceObject) GetAttribute(ctx context.Context, path path.Path, target
4040
// If a parent path is null or unknown, which would prevent a full expression
4141
// from matching, the parent path is returned rather than no match to prevent
4242
// false positives.
43-
func (c ResourceObject) PathMatches(ctx context.Context, pathExpr path.Expression) (path.Paths, diag.Diagnostics) {
43+
func (c Resource) PathMatches(ctx context.Context, pathExpr path.Expression) (path.Paths, diag.Diagnostics) {
4444
return c.data().PathMatches(ctx, pathExpr)
4545
}
4646

47-
func (c ResourceObject) data() fwschemadata.Data {
47+
func (c Resource) data() fwschemadata.Data {
4848
return fwschemadata.Data{
4949
Description: fwschemadata.DataDescriptionConfiguration,
5050
Schema: c.Schema,

0 commit comments

Comments
 (0)