@@ -8,6 +8,40 @@ import (
88 "github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5"
99)
1010
11+ func GetMetadataRequest (in * tfplugin5.GetMetadata_Request ) (* tfprotov5.GetMetadataRequest , error ) {
12+ return & tfprotov5.GetMetadataRequest {}, nil
13+ }
14+
15+ func GetMetadataResponse (in * tfplugin5.GetMetadata_Response ) (* tfprotov5.GetMetadataResponse , error ) {
16+ if in == nil {
17+ return nil , nil
18+ }
19+
20+ resp := & tfprotov5.GetMetadataResponse {
21+ DataSources : make ([]tfprotov5.DataSourceMetadata , 0 , len (in .DataSources )),
22+ Resources : make ([]tfprotov5.ResourceMetadata , 0 , len (in .Resources )),
23+ ServerCapabilities : ServerCapabilities (in .ServerCapabilities ),
24+ }
25+
26+ for _ , datasource := range in .DataSources {
27+ resp .DataSources = append (resp .DataSources , * DataSourceMetadata (datasource ))
28+ }
29+
30+ for _ , resource := range in .Resources {
31+ resp .Resources = append (resp .Resources , * ResourceMetadata (resource ))
32+ }
33+
34+ diags , err := Diagnostics (in .Diagnostics )
35+
36+ if err != nil {
37+ return resp , err
38+ }
39+
40+ resp .Diagnostics = diags
41+
42+ return resp , nil
43+ }
44+
1145func GetProviderSchemaRequest (in * tfplugin5.GetProviderSchema_Request ) (* tfprotov5.GetProviderSchemaRequest , error ) {
1246 return & tfprotov5.GetProviderSchemaRequest {}, nil
1347}
0 commit comments