Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,17 @@ func (r *ThingListResource) List(ctx context.Context, req list.ListRequest, stre
// Set the ID of the resource for the ResourceData object
rd.SetId("a_unique_id_related_to_the_thing")

// Get the existing identity data from ResourceData and set relevant identity attributes
identity, err := rd.Identity()
if err != nil {
result.Diagnostics.AddError(
"Retrieving identity data",
"An error was encountered when retrieving the identity data: "+err.Error(),
)
}

identity.Set("an_identity_attribute", thing.IdentityAttribute)

// Set the attributes of interest into the resource state
rd.Set("name", thing.Name)
rd.Set("attribute_one", thing.AttributeOne)
Expand Down
Loading