Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tfprotov5+tfprotov6: Additional Go documentation for private state handling #193

Merged
merged 1 commit into from
May 16, 2022
Merged
Show file tree
Hide file tree
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
17 changes: 17 additions & 0 deletions tfprotov5/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ type ReadResourceRequest struct {
// Private is any provider-defined private state stored with the
// resource. It is used for keeping state with the resource that is not
// meant to be included when calculating diffs.
//
// To ensure private state data is preserved, copy any necessary data to
// the ReadResourceResponse type Private field.
Private []byte

// ProviderMeta supplies the provider metadata configuration for the
Expand Down Expand Up @@ -215,6 +218,9 @@ type PlanResourceChangeRequest struct {
// PriorPrivate is any provider-defined private state stored with the
// resource. It is used for keeping state with the resource that is not
// meant to be included when calculating diffs.
//
// To ensure private state data is preserved, copy any necessary data to
// the PlanResourceChangeResponse type PlannedPrivate field.
PriorPrivate []byte

// ProviderMeta supplies the provider metadata configuration for the
Expand Down Expand Up @@ -283,6 +289,10 @@ type PlanResourceChangeResponse struct {
// like sent with requests for this resource. This state will be
// associated with the resource, but will not be considered when
// calculating diffs.
//
// This private state data will be sent in the ApplyResourceChange RPC, in
// relation to the types of this package, the ApplyResourceChangeRequest
// type PlannedPrivate field.
PlannedPrivate []byte

// Diagnostics report errors or warnings related to determining the
Expand Down Expand Up @@ -344,6 +354,13 @@ type ApplyResourceChangeRequest struct {
// PlannedPrivate is any provider-defined private state stored with the
// resource. It is used for keeping state with the resource that is not
// meant to be included when calculating diffs.
//
// This private state data is sourced from the PlanResourceChange RPC, in
// relation to the types in this package, the PlanResourceChangeResponse
// type PlannedPrivate field.
//
// To ensure private state data is preserved, copy any necessary data to
// the ApplyResourceChangeResponse type Private field.
PlannedPrivate []byte

// ProviderMeta supplies the provider metadata configuration for the
Expand Down
17 changes: 17 additions & 0 deletions tfprotov6/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ type ReadResourceRequest struct {
// Private is any provider-defined private state stored with the
// resource. It is used for keeping state with the resource that is not
// meant to be included when calculating diffs.
//
// To ensure private state data is preserved, copy any necessary data to
// the ReadResourceResponse type Private field.
Private []byte

// ProviderMeta supplies the provider metadata configuration for the
Expand Down Expand Up @@ -212,6 +215,9 @@ type PlanResourceChangeRequest struct {
// PriorPrivate is any provider-defined private state stored with the
// resource. It is used for keeping state with the resource that is not
// meant to be included when calculating diffs.
//
// To ensure private state data is preserved, copy any necessary data to
// the PlanResourceChangeResponse type PlannedPrivate field.
PriorPrivate []byte

// ProviderMeta supplies the provider metadata configuration for the
Expand Down Expand Up @@ -280,6 +286,10 @@ type PlanResourceChangeResponse struct {
// like sent with requests for this resource. This state will be
// associated with the resource, but will not be considered when
// calculating diffs.
//
// This private state data will be sent in the ApplyResourceChange RPC, in
// relation to the types of this package, the ApplyResourceChangeRequest
// type PlannedPrivate field.
PlannedPrivate []byte

// Diagnostics report errors or warnings related to determining the
Expand Down Expand Up @@ -341,6 +351,13 @@ type ApplyResourceChangeRequest struct {
// PlannedPrivate is any provider-defined private state stored with the
// resource. It is used for keeping state with the resource that is not
// meant to be included when calculating diffs.
//
// This private state data is sourced from the PlanResourceChange RPC, in
// relation to the types in this package, the PlanResourceChangeResponse
// type PlannedPrivate field.
//
// To ensure private state data is preserved, copy any necessary data to
// the ApplyResourceChangeResponse type Private field.
PlannedPrivate []byte

// ProviderMeta supplies the provider metadata configuration for the
Expand Down