File tree Expand file tree Collapse file tree 14 files changed +481
-371
lines changed Expand file tree Collapse file tree 14 files changed +481
-371
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,7 @@ func MoveResourceStateRequest(in *tfplugin5.MoveResourceState_Request) *tfprotov
103
103
}
104
104
105
105
resp := & tfprotov5.MoveResourceStateRequest {
106
+ SourcePrivate : in .SourcePrivate ,
106
107
SourceProviderAddress : in .SourceProviderAddress ,
107
108
SourceSchemaVersion : in .SourceSchemaVersion ,
108
109
SourceState : RawState (in .SourceState ),
Original file line number Diff line number Diff line change @@ -155,6 +155,14 @@ func TestMoveResourceStateRequest(t *testing.T) {
155
155
in : & tfplugin5.MoveResourceState_Request {},
156
156
expected : & tfprotov5.MoveResourceStateRequest {},
157
157
},
158
+ "SourcePrivate" : {
159
+ in : & tfplugin5.MoveResourceState_Request {
160
+ SourcePrivate : []byte (`{}` ),
161
+ },
162
+ expected : & tfprotov5.MoveResourceStateRequest {
163
+ SourcePrivate : []byte (`{}` ),
164
+ },
165
+ },
158
166
"SourceProviderAddress" : {
159
167
in : & tfplugin5.MoveResourceState_Request {
160
168
SourceProviderAddress : "test" ,
Original file line number Diff line number Diff line change @@ -490,13 +490,20 @@ message MoveResourceState {
490
490
491
491
// The resource type that the resource is being moved to.
492
492
string target_type_name = 5 ;
493
+
494
+ // The private state of the resource being moved.
495
+ bytes source_private = 6 ;
493
496
}
497
+
494
498
message Response {
495
499
// The state of the resource after it has been moved.
496
500
DynamicValue target_state = 1 ;
497
501
498
502
// Any diagnostics that occurred during the move.
499
503
repeated Diagnostic diagnostics = 2 ;
504
+
505
+ // The private state of the resource after it has been moved.
506
+ bytes target_private = 3 ;
500
507
}
501
508
}
502
509
Original file line number Diff line number Diff line change @@ -133,8 +133,9 @@ func MoveResourceState_Response(in *tfprotov5.MoveResourceStateResponse) *tfplug
133
133
}
134
134
135
135
resp := & tfplugin5.MoveResourceState_Response {
136
- Diagnostics : Diagnostics (in .Diagnostics ),
137
- TargetState : DynamicValue (in .TargetState ),
136
+ Diagnostics : Diagnostics (in .Diagnostics ),
137
+ TargetPrivate : in .TargetPrivate ,
138
+ TargetState : DynamicValue (in .TargetState ),
138
139
}
139
140
140
141
return resp
Original file line number Diff line number Diff line change @@ -386,6 +386,15 @@ func TestMoveResourceState_Response(t *testing.T) {
386
386
},
387
387
},
388
388
},
389
+ "TargetPrivate" : {
390
+ in : & tfprotov5.MoveResourceStateResponse {
391
+ TargetPrivate : []byte (`{}` ),
392
+ },
393
+ expected : & tfplugin5.MoveResourceState_Response {
394
+ Diagnostics : []* tfplugin5.Diagnostic {},
395
+ TargetPrivate : []byte (`{}` ),
396
+ },
397
+ },
389
398
"TargetState" : {
390
399
in : & tfprotov5.MoveResourceStateResponse {
391
400
TargetState : testTfprotov5DynamicValue (),
Original file line number Diff line number Diff line change @@ -510,6 +510,9 @@ type ImportedResource struct {
510
510
// must have enabled the MoveResourceState server capability to enable these
511
511
// requests.
512
512
type MoveResourceStateRequest struct {
513
+ // SourcePrivate is the private state of the source resource.
514
+ SourcePrivate []byte
515
+
513
516
// SourceProviderAddress is the address of the provider for the source
514
517
// resource type.
515
518
SourceProviderAddress string
@@ -532,6 +535,9 @@ type MoveResourceStateRequest struct {
532
535
// MoveResourceStateResponse is the response from the provider containing
533
536
// the moved state for the given resource.
534
537
type MoveResourceStateResponse struct {
538
+ // TargetPrivate is the target resource private state after the move.
539
+ TargetPrivate []byte
540
+
535
541
// TargetState is the target resource state after the move.
536
542
TargetState * DynamicValue
537
543
Original file line number Diff line number Diff line change @@ -103,6 +103,7 @@ func MoveResourceStateRequest(in *tfplugin6.MoveResourceState_Request) *tfprotov
103
103
}
104
104
105
105
resp := & tfprotov6.MoveResourceStateRequest {
106
+ SourcePrivate : in .SourcePrivate ,
106
107
SourceProviderAddress : in .SourceProviderAddress ,
107
108
SourceSchemaVersion : in .SourceSchemaVersion ,
108
109
SourceState : RawState (in .SourceState ),
Original file line number Diff line number Diff line change @@ -155,6 +155,14 @@ func TestMoveResourceStateRequest(t *testing.T) {
155
155
in : & tfplugin6.MoveResourceState_Request {},
156
156
expected : & tfprotov6.MoveResourceStateRequest {},
157
157
},
158
+ "SourcePrivate" : {
159
+ in : & tfplugin6.MoveResourceState_Request {
160
+ SourcePrivate : []byte (`{}` ),
161
+ },
162
+ expected : & tfprotov6.MoveResourceStateRequest {
163
+ SourcePrivate : []byte (`{}` ),
164
+ },
165
+ },
158
166
"SourceProviderAddress" : {
159
167
in : & tfplugin6.MoveResourceState_Request {
160
168
SourceProviderAddress : "test" ,
Original file line number Diff line number Diff line change @@ -507,13 +507,20 @@ message MoveResourceState {
507
507
508
508
// The resource type that the resource is being moved to.
509
509
string target_type_name = 5 ;
510
+
511
+ // The private state of the resource being moved.
512
+ bytes source_private = 6 ;
510
513
}
514
+
511
515
message Response {
512
516
// The state of the resource after it has been moved.
513
517
DynamicValue target_state = 1 ;
514
518
515
519
// Any diagnostics that occurred during the move.
516
520
repeated Diagnostic diagnostics = 2 ;
521
+
522
+ // The private state of the resource after it has been moved.
523
+ bytes target_private = 3 ;
517
524
}
518
525
}
519
526
Original file line number Diff line number Diff line change @@ -133,8 +133,9 @@ func MoveResourceState_Response(in *tfprotov6.MoveResourceStateResponse) *tfplug
133
133
}
134
134
135
135
resp := & tfplugin6.MoveResourceState_Response {
136
- Diagnostics : Diagnostics (in .Diagnostics ),
137
- TargetState : DynamicValue (in .TargetState ),
136
+ Diagnostics : Diagnostics (in .Diagnostics ),
137
+ TargetPrivate : in .TargetPrivate ,
138
+ TargetState : DynamicValue (in .TargetState ),
138
139
}
139
140
140
141
return resp
Original file line number Diff line number Diff line change @@ -386,6 +386,15 @@ func TestMoveResourceState_Response(t *testing.T) {
386
386
},
387
387
},
388
388
},
389
+ "TargetPrivate" : {
390
+ in : & tfprotov6.MoveResourceStateResponse {
391
+ TargetPrivate : []byte (`{}` ),
392
+ },
393
+ expected : & tfplugin6.MoveResourceState_Response {
394
+ Diagnostics : []* tfplugin6.Diagnostic {},
395
+ TargetPrivate : []byte (`{}` ),
396
+ },
397
+ },
389
398
"TargetState" : {
390
399
in : & tfprotov6.MoveResourceStateResponse {
391
400
TargetState : testTfprotov6DynamicValue (),
Original file line number Diff line number Diff line change @@ -507,6 +507,9 @@ type ImportedResource struct {
507
507
// must have enabled the MoveResourceState server capability to enable these
508
508
// requests.
509
509
type MoveResourceStateRequest struct {
510
+ // SourcePrivate is the private state of the source resource.
511
+ SourcePrivate []byte
512
+
510
513
// SourceProviderAddress is the address of the provider for the source
511
514
// resource type.
512
515
SourceProviderAddress string
@@ -529,6 +532,9 @@ type MoveResourceStateRequest struct {
529
532
// MoveResourceStateResponse is the response from the provider containing
530
533
// the moved state for the given resource.
531
534
type MoveResourceStateResponse struct {
535
+ // TargetPrivate is the target resource private state after the move.
536
+ TargetPrivate []byte
537
+
532
538
// TargetState is the target resource state after the move.
533
539
TargetState * DynamicValue
534
540
You can’t perform that action at this time.
0 commit comments