910ccdb092
Bumps [github.com/hashicorp/terraform-plugin-sdk/v2](https://github.com/hashicorp/terraform-plugin-sdk) from 2.26.1 to 2.27.0. - [Release notes](https://github.com/hashicorp/terraform-plugin-sdk/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-sdk/compare/v2.26.1...v2.27.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-sdk/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
57 lines
1.5 KiB
Go
57 lines
1.5 KiB
Go
// 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 ValidateDataResourceConfigRequest(in *tfplugin6.ValidateDataResourceConfig_Request) (*tfprotov6.ValidateDataResourceConfigRequest, error) {
|
|
resp := &tfprotov6.ValidateDataResourceConfigRequest{
|
|
TypeName: in.TypeName,
|
|
}
|
|
if in.Config != nil {
|
|
resp.Config = DynamicValue(in.Config)
|
|
}
|
|
return resp, nil
|
|
}
|
|
|
|
func ValidateDataResourceConfigResponse(in *tfplugin6.ValidateDataResourceConfig_Response) (*tfprotov6.ValidateDataResourceConfigResponse, error) {
|
|
diags, err := Diagnostics(in.Diagnostics)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &tfprotov6.ValidateDataResourceConfigResponse{
|
|
Diagnostics: diags,
|
|
}, nil
|
|
}
|
|
|
|
func ReadDataSourceRequest(in *tfplugin6.ReadDataSource_Request) (*tfprotov6.ReadDataSourceRequest, error) {
|
|
resp := &tfprotov6.ReadDataSourceRequest{
|
|
TypeName: in.TypeName,
|
|
}
|
|
if in.Config != nil {
|
|
resp.Config = DynamicValue(in.Config)
|
|
}
|
|
if in.ProviderMeta != nil {
|
|
resp.ProviderMeta = DynamicValue(in.ProviderMeta)
|
|
}
|
|
return resp, nil
|
|
}
|
|
|
|
func ReadDataSourceResponse(in *tfplugin6.ReadDataSource_Response) (*tfprotov6.ReadDataSourceResponse, error) {
|
|
diags, err := Diagnostics(in.Diagnostics)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
resp := &tfprotov6.ReadDataSourceResponse{
|
|
Diagnostics: diags,
|
|
}
|
|
if in.State != nil {
|
|
resp.State = DynamicValue(in.State)
|
|
}
|
|
return resp, nil
|
|
}
|