-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add resource identity support to protocol v6
copied from protocol v5
- Loading branch information
Showing
23 changed files
with
1,259 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright (c) HashiCorp, Inc. | ||
// SPDX-License-Identifier: MPL-2.0 | ||
|
||
package fromproto | ||
|
||
import ( | ||
"github.com/hashicorp/terraform-plugin-go/tfprotov6" | ||
) | ||
|
||
func RawIdentity(in []byte) *tfprotov6.RawIdentity { | ||
if in == nil { | ||
return nil | ||
} | ||
|
||
resp := &tfprotov6.RawIdentity{ | ||
JSON: in, | ||
} | ||
|
||
return resp | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright (c) HashiCorp, Inc. | ||
// SPDX-License-Identifier: MPL-2.0 | ||
|
||
package fromproto_test | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/hashicorp/terraform-plugin-go/tfprotov6" | ||
) | ||
|
||
func testTfprotov6RawIdentity(t *testing.T, json []byte) *tfprotov6.RawIdentity { | ||
t.Helper() | ||
|
||
return &tfprotov6.RawIdentity{ | ||
JSON: json, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright (c) HashiCorp, Inc. | ||
// SPDX-License-Identifier: MPL-2.0 | ||
|
||
package fromproto | ||
|
||
import ( | ||
"github.com/hashicorp/terraform-plugin-go/tfprotov6" | ||
"github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6" | ||
) | ||
|
||
func ResourceIdentityData(in *tfplugin6.ResourceIdentityData) *tfprotov6.ResourceIdentityData { | ||
if in == nil { | ||
return nil | ||
} | ||
|
||
resp := &tfprotov6.ResourceIdentityData{ | ||
IdentityData: DynamicValue(in.IdentityData), | ||
} | ||
|
||
return resp | ||
} |
20 changes: 20 additions & 0 deletions
20
tfprotov6/internal/fromproto/resource_identity_data_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright (c) HashiCorp, Inc. | ||
// SPDX-License-Identifier: MPL-2.0 | ||
|
||
package fromproto_test | ||
|
||
import ( | ||
"github.com/hashicorp/terraform-plugin-go/tfprotov6" | ||
"github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6" | ||
"github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/toproto" | ||
) | ||
|
||
func testTfplugin6ResourceIdentityData() *tfplugin6.ResourceIdentityData { | ||
return toproto.ResourceIdentityData(testTfprotov6ResourceIdentityData()) | ||
} | ||
|
||
func testTfprotov6ResourceIdentityData() *tfprotov6.ResourceIdentityData { | ||
return &tfprotov6.ResourceIdentityData{ | ||
IdentityData: testTfprotov6DynamicValue(), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.