Skip to content

Commit 71629ab

Browse files
author
Paddy Carver
committed
Document usage of Private fields in the protocol.
1 parent e227023 commit 71629ab

File tree

1 file changed

+22
-7
lines changed

1 file changed

+22
-7
lines changed

tfprotov5/resource.go

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,9 @@ type ReadResourceRequest struct {
122122
// and nested block getting its own key and value.
123123
CurrentState *DynamicValue
124124

125-
// TODO: what is private for
125+
// Private is any provider-defined private state stored with the
126+
// resource. It is used for keeping state with the resource that is not
127+
// meant to be included when calculating diffs.
126128
Private []byte
127129

128130
// ProviderMeta supplies the provider metadata configuration for the
@@ -158,7 +160,9 @@ type ReadResourceResponse struct {
158160
// generated.
159161
Diagnostics []*Diagnostic
160162

161-
// TODO: what is private for
163+
// Private should be set to any state that the provider would like sent
164+
// with requests for this resource. This state will be associated with
165+
// the resource, but will not be considered when calculating diffs.
162166
Private []byte
163167
}
164168

@@ -205,7 +209,9 @@ type PlanResourceChangeRequest struct {
205209
// from knowing the value at request time.
206210
Config *DynamicValue
207211

208-
// TODO: what is prior private for
212+
// PriorPrivate is any provider-defined private state stored with the
213+
// resource. It is used for keeping state with the resource that is not
214+
// meant to be included when calculating diffs.
209215
PriorPrivate []byte
210216

211217
// ProviderMeta supplies the provider metadata configuration for the
@@ -270,7 +276,10 @@ type PlanResourceChangeResponse struct {
270276
// recreated.
271277
RequiresReplace []*tftypes.AttributePath
272278

273-
// TODO: what is planned private for
279+
// PlannedPrivate should be set to any state that the provider would
280+
// like sent with requests for this resource. This state will be
281+
// associated with the resource, but will not be considered when
282+
// calculating diffs.
274283
PlannedPrivate []byte
275284

276285
// Diagnostics report errors or warnings related to determining the
@@ -329,7 +338,9 @@ type ApplyResourceChangeRequest struct {
329338
// This configuration may contain unknown values.
330339
Config *DynamicValue
331340

332-
// TODO: what is planned private
341+
// PlannedPrivate is any provider-defined private state stored with the
342+
// resource. It is used for keeping state with the resource that is not
343+
// meant to be included when calculating diffs.
333344
PlannedPrivate []byte
334345

335346
// ProviderMeta supplies the provider metadata configuration for the
@@ -367,7 +378,9 @@ type ApplyResourceChangeResponse struct {
367378
// attribute and nested block getting its own key and value.
368379
NewState *DynamicValue
369380

370-
// TODO: what is private
381+
// Private should be set to any state that the provider would like sent
382+
// with requests for this resource. This state will be associated with
383+
// the resource, but will not be considered when calculating diffs.
371384
Private []byte
372385

373386
// Diagnostics report errors or warnings related to applying changes to
@@ -431,6 +444,8 @@ type ImportedResource struct {
431444
// attribute and nested block getting its own key and value.
432445
State *DynamicValue
433446

434-
// TODO: what is private
447+
// Private should be set to any state that the provider would like sent
448+
// with requests for this resource. This state will be associated with
449+
// the resource, but will not be considered when calculating diffs.
435450
Private []byte
436451
}

0 commit comments

Comments
 (0)