diff options
Diffstat (limited to 'vendor/github.com/hashicorp/terraform/internal')
23 files changed, 5905 insertions, 0 deletions
diff --git a/vendor/github.com/hashicorp/terraform/internal/earlyconfig/config.go b/vendor/github.com/hashicorp/terraform/internal/earlyconfig/config.go new file mode 100644 index 0000000..a9b8f98 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/internal/earlyconfig/config.go | |||
@@ -0,0 +1,123 @@ | |||
1 | package earlyconfig | ||
2 | |||
3 | import ( | ||
4 | "fmt" | ||
5 | "sort" | ||
6 | |||
7 | version "github.com/hashicorp/go-version" | ||
8 | "github.com/hashicorp/terraform-config-inspect/tfconfig" | ||
9 | "github.com/hashicorp/terraform/addrs" | ||
10 | "github.com/hashicorp/terraform/moduledeps" | ||
11 | "github.com/hashicorp/terraform/plugin/discovery" | ||
12 | "github.com/hashicorp/terraform/tfdiags" | ||
13 | ) | ||
14 | |||
15 | // A Config is a node in the tree of modules within a configuration. | ||
16 | // | ||
17 | // The module tree is constructed by following ModuleCall instances recursively | ||
18 | // through the root module transitively into descendent modules. | ||
19 | type Config struct { | ||
20 | // RootModule points to the Config for the root module within the same | ||
21 | // module tree as this module. If this module _is_ the root module then | ||
22 | // this is self-referential. | ||
23 | Root *Config | ||
24 | |||
25 | // ParentModule points to the Config for the module that directly calls | ||
26 | // this module. If this is the root module then this field is nil. | ||
27 | Parent *Config | ||
28 | |||
29 | // Path is a sequence of module logical names that traverse from the root | ||
30 | // module to this config. Path is empty for the root module. | ||
31 | // | ||
32 | // This should only be used to display paths to the end-user in rare cases | ||
33 | // where we are talking about the static module tree, before module calls | ||
34 | // have been resolved. In most cases, an addrs.ModuleInstance describing | ||
35 | // a node in the dynamic module tree is better, since it will then include | ||
36 | // any keys resulting from evaluating "count" and "for_each" arguments. | ||
37 | Path addrs.Module | ||
38 | |||
39 | // ChildModules points to the Config for each of the direct child modules | ||
40 | // called from this module. The keys in this map match the keys in | ||
41 | // Module.ModuleCalls. | ||
42 | Children map[string]*Config | ||
43 | |||
44 | // Module points to the object describing the configuration for the | ||
45 | // various elements (variables, resources, etc) defined by this module. | ||
46 | Module *tfconfig.Module | ||
47 | |||
48 | // CallPos is the source position for the header of the module block that | ||
49 | // requested this module. | ||
50 | // | ||
51 | // This field is meaningless for the root module, where its contents are undefined. | ||
52 | CallPos tfconfig.SourcePos | ||
53 | |||
54 | // SourceAddr is the source address that the referenced module was requested | ||
55 | // from, as specified in configuration. | ||
56 | // | ||
57 | // This field is meaningless for the root module, where its contents are undefined. | ||
58 | SourceAddr string | ||
59 | |||
60 | // Version is the specific version that was selected for this module, | ||
61 | // based on version constraints given in configuration. | ||
62 | // | ||
63 | // This field is nil if the module was loaded from a non-registry source, | ||
64 | // since versions are not supported for other sources. | ||
65 | // | ||
66 | // This field is meaningless for the root module, where it will always | ||
67 | // be nil. | ||
68 | Version *version.Version | ||
69 | } | ||
70 | |||
71 | // ProviderDependencies returns the provider dependencies for the recieving | ||
72 | // config, including all of its descendent modules. | ||
73 | func (c *Config) ProviderDependencies() (*moduledeps.Module, tfdiags.Diagnostics) { | ||
74 | var diags tfdiags.Diagnostics | ||
75 | |||
76 | var name string | ||
77 | if len(c.Path) > 0 { | ||
78 | name = c.Path[len(c.Path)-1] | ||
79 | } | ||
80 | |||
81 | ret := &moduledeps.Module{ | ||
82 | Name: name, | ||
83 | } | ||
84 | |||
85 | providers := make(moduledeps.Providers) | ||
86 | for name, reqs := range c.Module.RequiredProviders { | ||
87 | inst := moduledeps.ProviderInstance(name) | ||
88 | var constraints version.Constraints | ||
89 | for _, reqStr := range reqs { | ||
90 | if reqStr != "" { | ||
91 | constraint, err := version.NewConstraint(reqStr) | ||
92 | if err != nil { | ||
93 | diags = diags.Append(wrapDiagnostic(tfconfig.Diagnostic{ | ||
94 | Severity: tfconfig.DiagError, | ||
95 | Summary: "Invalid provider version constraint", | ||
96 | Detail: fmt.Sprintf("Invalid version constraint %q for provider %s.", reqStr, name), | ||
97 | })) | ||
98 | continue | ||
99 | } | ||
100 | constraints = append(constraints, constraint...) | ||
101 | } | ||
102 | } | ||
103 | providers[inst] = moduledeps.ProviderDependency{ | ||
104 | Constraints: discovery.NewConstraints(constraints), | ||
105 | Reason: moduledeps.ProviderDependencyExplicit, | ||
106 | } | ||
107 | } | ||
108 | ret.Providers = providers | ||
109 | |||
110 | childNames := make([]string, 0, len(c.Children)) | ||
111 | for name := range c.Children { | ||
112 | childNames = append(childNames, name) | ||
113 | } | ||
114 | sort.Strings(childNames) | ||
115 | |||
116 | for _, name := range childNames { | ||
117 | child, childDiags := c.Children[name].ProviderDependencies() | ||
118 | ret.Children = append(ret.Children, child) | ||
119 | diags = diags.Append(childDiags) | ||
120 | } | ||
121 | |||
122 | return ret, diags | ||
123 | } | ||
diff --git a/vendor/github.com/hashicorp/terraform/internal/earlyconfig/config_build.go b/vendor/github.com/hashicorp/terraform/internal/earlyconfig/config_build.go new file mode 100644 index 0000000..770d5df --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/internal/earlyconfig/config_build.go | |||
@@ -0,0 +1,144 @@ | |||
1 | package earlyconfig | ||
2 | |||
3 | import ( | ||
4 | "fmt" | ||
5 | "sort" | ||
6 | "strings" | ||
7 | |||
8 | version "github.com/hashicorp/go-version" | ||
9 | "github.com/hashicorp/terraform-config-inspect/tfconfig" | ||
10 | "github.com/hashicorp/terraform/addrs" | ||
11 | "github.com/hashicorp/terraform/tfdiags" | ||
12 | ) | ||
13 | |||
14 | // BuildConfig constructs a Config from a root module by loading all of its | ||
15 | // descendent modules via the given ModuleWalker. | ||
16 | func BuildConfig(root *tfconfig.Module, walker ModuleWalker) (*Config, tfdiags.Diagnostics) { | ||
17 | var diags tfdiags.Diagnostics | ||
18 | cfg := &Config{ | ||
19 | Module: root, | ||
20 | } | ||
21 | cfg.Root = cfg // Root module is self-referential. | ||
22 | cfg.Children, diags = buildChildModules(cfg, walker) | ||
23 | return cfg, diags | ||
24 | } | ||
25 | |||
26 | func buildChildModules(parent *Config, walker ModuleWalker) (map[string]*Config, tfdiags.Diagnostics) { | ||
27 | var diags tfdiags.Diagnostics | ||
28 | ret := map[string]*Config{} | ||
29 | calls := parent.Module.ModuleCalls | ||
30 | |||
31 | // We'll sort the calls by their local names so that they'll appear in a | ||
32 | // predictable order in any logging that's produced during the walk. | ||
33 | callNames := make([]string, 0, len(calls)) | ||
34 | for k := range calls { | ||
35 | callNames = append(callNames, k) | ||
36 | } | ||
37 | sort.Strings(callNames) | ||
38 | |||
39 | for _, callName := range callNames { | ||
40 | call := calls[callName] | ||
41 | path := make([]string, len(parent.Path)+1) | ||
42 | copy(path, parent.Path) | ||
43 | path[len(path)-1] = call.Name | ||
44 | |||
45 | var vc version.Constraints | ||
46 | if strings.TrimSpace(call.Version) != "" { | ||
47 | var err error | ||
48 | vc, err = version.NewConstraint(call.Version) | ||
49 | if err != nil { | ||
50 | diags = diags.Append(wrapDiagnostic(tfconfig.Diagnostic{ | ||
51 | Severity: tfconfig.DiagError, | ||
52 | Summary: "Invalid version constraint", | ||
53 | Detail: fmt.Sprintf("Module %q (declared at %s line %d) has invalid version constraint %q: %s.", callName, call.Pos.Filename, call.Pos.Line, call.Version, err), | ||
54 | })) | ||
55 | continue | ||
56 | } | ||
57 | } | ||
58 | |||
59 | req := ModuleRequest{ | ||
60 | Name: call.Name, | ||
61 | Path: path, | ||
62 | SourceAddr: call.Source, | ||
63 | VersionConstraints: vc, | ||
64 | Parent: parent, | ||
65 | CallPos: call.Pos, | ||
66 | } | ||
67 | |||
68 | mod, ver, modDiags := walker.LoadModule(&req) | ||
69 | diags = append(diags, modDiags...) | ||
70 | if mod == nil { | ||
71 | // nil can be returned if the source address was invalid and so | ||
72 | // nothing could be loaded whatsoever. LoadModule should've | ||
73 | // returned at least one error diagnostic in that case. | ||
74 | continue | ||
75 | } | ||
76 | |||
77 | child := &Config{ | ||
78 | Parent: parent, | ||
79 | Root: parent.Root, | ||
80 | Path: path, | ||
81 | Module: mod, | ||
82 | CallPos: call.Pos, | ||
83 | SourceAddr: call.Source, | ||
84 | Version: ver, | ||
85 | } | ||
86 | |||
87 | child.Children, modDiags = buildChildModules(child, walker) | ||
88 | diags = diags.Append(modDiags) | ||
89 | |||
90 | ret[call.Name] = child | ||
91 | } | ||
92 | |||
93 | return ret, diags | ||
94 | } | ||
95 | |||
96 | // ModuleRequest is used as part of the ModuleWalker interface used with | ||
97 | // function BuildConfig. | ||
98 | type ModuleRequest struct { | ||
99 | // Name is the "logical name" of the module call within configuration. | ||
100 | // This is provided in case the name is used as part of a storage key | ||
101 | // for the module, but implementations must otherwise treat it as an | ||
102 | // opaque string. It is guaranteed to have already been validated as an | ||
103 | // HCL identifier and UTF-8 encoded. | ||
104 | Name string | ||
105 | |||
106 | // Path is a list of logical names that traverse from the root module to | ||
107 | // this module. This can be used, for example, to form a lookup key for | ||
108 | // each distinct module call in a configuration, allowing for multiple | ||
109 | // calls with the same name at different points in the tree. | ||
110 | Path addrs.Module | ||
111 | |||
112 | // SourceAddr is the source address string provided by the user in | ||
113 | // configuration. | ||
114 | SourceAddr string | ||
115 | |||
116 | // VersionConstraint is the version constraint applied to the module in | ||
117 | // configuration. | ||
118 | VersionConstraints version.Constraints | ||
119 | |||
120 | // Parent is the partially-constructed module tree node that the loaded | ||
121 | // module will be added to. Callers may refer to any field of this | ||
122 | // structure except Children, which is still under construction when | ||
123 | // ModuleRequest objects are created and thus has undefined content. | ||
124 | // The main reason this is provided is so that full module paths can | ||
125 | // be constructed for uniqueness. | ||
126 | Parent *Config | ||
127 | |||
128 | // CallRange is the source position for the header of the "module" block | ||
129 | // in configuration that prompted this request. | ||
130 | CallPos tfconfig.SourcePos | ||
131 | } | ||
132 | |||
133 | // ModuleWalker is an interface used with BuildConfig. | ||
134 | type ModuleWalker interface { | ||
135 | LoadModule(req *ModuleRequest) (*tfconfig.Module, *version.Version, tfdiags.Diagnostics) | ||
136 | } | ||
137 | |||
138 | // ModuleWalkerFunc is an implementation of ModuleWalker that directly wraps | ||
139 | // a callback function, for more convenient use of that interface. | ||
140 | type ModuleWalkerFunc func(req *ModuleRequest) (*tfconfig.Module, *version.Version, tfdiags.Diagnostics) | ||
141 | |||
142 | func (f ModuleWalkerFunc) LoadModule(req *ModuleRequest) (*tfconfig.Module, *version.Version, tfdiags.Diagnostics) { | ||
143 | return f(req) | ||
144 | } | ||
diff --git a/vendor/github.com/hashicorp/terraform/internal/earlyconfig/diagnostics.go b/vendor/github.com/hashicorp/terraform/internal/earlyconfig/diagnostics.go new file mode 100644 index 0000000..9b2fd7f --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/internal/earlyconfig/diagnostics.go | |||
@@ -0,0 +1,78 @@ | |||
1 | package earlyconfig | ||
2 | |||
3 | import ( | ||
4 | "fmt" | ||
5 | |||
6 | "github.com/hashicorp/terraform-config-inspect/tfconfig" | ||
7 | "github.com/hashicorp/terraform/tfdiags" | ||
8 | ) | ||
9 | |||
10 | func wrapDiagnostics(diags tfconfig.Diagnostics) tfdiags.Diagnostics { | ||
11 | ret := make(tfdiags.Diagnostics, len(diags)) | ||
12 | for i, diag := range diags { | ||
13 | ret[i] = wrapDiagnostic(diag) | ||
14 | } | ||
15 | return ret | ||
16 | } | ||
17 | |||
18 | func wrapDiagnostic(diag tfconfig.Diagnostic) tfdiags.Diagnostic { | ||
19 | return wrappedDiagnostic{ | ||
20 | d: diag, | ||
21 | } | ||
22 | } | ||
23 | |||
24 | type wrappedDiagnostic struct { | ||
25 | d tfconfig.Diagnostic | ||
26 | } | ||
27 | |||
28 | func (d wrappedDiagnostic) Severity() tfdiags.Severity { | ||
29 | switch d.d.Severity { | ||
30 | case tfconfig.DiagError: | ||
31 | return tfdiags.Error | ||
32 | case tfconfig.DiagWarning: | ||
33 | return tfdiags.Warning | ||
34 | default: | ||
35 | // Should never happen since there are no other severities | ||
36 | return 0 | ||
37 | } | ||
38 | } | ||
39 | |||
40 | func (d wrappedDiagnostic) Description() tfdiags.Description { | ||
41 | // Since the inspect library doesn't produce precise source locations, | ||
42 | // we include the position information as part of the error message text. | ||
43 | // See the comment inside method "Source" for more information. | ||
44 | switch { | ||
45 | case d.d.Pos == nil: | ||
46 | return tfdiags.Description{ | ||
47 | Summary: d.d.Summary, | ||
48 | Detail: d.d.Detail, | ||
49 | } | ||
50 | case d.d.Detail != "": | ||
51 | return tfdiags.Description{ | ||
52 | Summary: d.d.Summary, | ||
53 | Detail: fmt.Sprintf("On %s line %d: %s", d.d.Pos.Filename, d.d.Pos.Line, d.d.Detail), | ||
54 | } | ||
55 | default: | ||
56 | return tfdiags.Description{ | ||
57 | Summary: fmt.Sprintf("%s (on %s line %d)", d.d.Summary, d.d.Pos.Filename, d.d.Pos.Line), | ||
58 | } | ||
59 | } | ||
60 | } | ||
61 | |||
62 | func (d wrappedDiagnostic) Source() tfdiags.Source { | ||
63 | // Since the inspect library is constrained by the lowest common denominator | ||
64 | // between legacy HCL and modern HCL, it only returns ranges at whole-line | ||
65 | // granularity, and that isn't sufficient to populate a tfdiags.Source | ||
66 | // and so we'll just omit ranges altogether and include the line number in | ||
67 | // the Description text. | ||
68 | // | ||
69 | // Callers that want to return nicer errors should consider reacting to | ||
70 | // earlyconfig errors by attempting a follow-up parse with the normal | ||
71 | // config loader, which can produce more precise source location | ||
72 | // information. | ||
73 | return tfdiags.Source{} | ||
74 | } | ||
75 | |||
76 | func (d wrappedDiagnostic) FromExpr() *tfdiags.FromExpr { | ||
77 | return nil | ||
78 | } | ||
diff --git a/vendor/github.com/hashicorp/terraform/internal/earlyconfig/doc.go b/vendor/github.com/hashicorp/terraform/internal/earlyconfig/doc.go new file mode 100644 index 0000000..a9cf10f --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/internal/earlyconfig/doc.go | |||
@@ -0,0 +1,20 @@ | |||
1 | // Package earlyconfig is a specialized alternative to the top-level "configs" | ||
2 | // package that does only shallow processing of configuration and is therefore | ||
3 | // able to be much more liberal than the full config loader in what it accepts. | ||
4 | // | ||
5 | // In particular, it can accept both current and legacy HCL syntax, and it | ||
6 | // ignores top-level blocks that it doesn't recognize. These two characteristics | ||
7 | // make this package ideal for dependency-checking use-cases so that we are | ||
8 | // more likely to be able to return an error message about an explicit | ||
9 | // incompatibility than to return a less-actionable message about a construct | ||
10 | // not being supported. | ||
11 | // | ||
12 | // However, its liberal approach also means it should be used sparingly. It | ||
13 | // exists primarily for "terraform init", so that it is able to detect | ||
14 | // incompatibilities more robustly when installing dependencies. For most | ||
15 | // other use-cases, use the "configs" and "configs/configload" packages. | ||
16 | // | ||
17 | // Package earlyconfig is a wrapper around the terraform-config-inspect | ||
18 | // codebase, adding to it just some helper functionality for Terraform's own | ||
19 | // use-cases. | ||
20 | package earlyconfig | ||
diff --git a/vendor/github.com/hashicorp/terraform/internal/earlyconfig/module.go b/vendor/github.com/hashicorp/terraform/internal/earlyconfig/module.go new file mode 100644 index 0000000..d2d6287 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/internal/earlyconfig/module.go | |||
@@ -0,0 +1,13 @@ | |||
1 | package earlyconfig | ||
2 | |||
3 | import ( | ||
4 | "github.com/hashicorp/terraform-config-inspect/tfconfig" | ||
5 | "github.com/hashicorp/terraform/tfdiags" | ||
6 | ) | ||
7 | |||
8 | // LoadModule loads some top-level metadata for the module in the given | ||
9 | // directory. | ||
10 | func LoadModule(dir string) (*tfconfig.Module, tfdiags.Diagnostics) { | ||
11 | mod, diags := tfconfig.LoadModule(dir) | ||
12 | return mod, wrapDiagnostics(diags) | ||
13 | } | ||
diff --git a/vendor/github.com/hashicorp/terraform/internal/initwd/copy_dir.go b/vendor/github.com/hashicorp/terraform/internal/initwd/copy_dir.go new file mode 100644 index 0000000..7096ff7 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/internal/initwd/copy_dir.go | |||
@@ -0,0 +1,125 @@ | |||
1 | package initwd | ||
2 | |||
3 | import ( | ||
4 | "io" | ||
5 | "os" | ||
6 | "path/filepath" | ||
7 | "strings" | ||
8 | ) | ||
9 | |||
10 | // copyDir copies the src directory contents into dst. Both directories | ||
11 | // should already exist. | ||
12 | func copyDir(dst, src string) error { | ||
13 | src, err := filepath.EvalSymlinks(src) | ||
14 | if err != nil { | ||
15 | return err | ||
16 | } | ||
17 | |||
18 | walkFn := func(path string, info os.FileInfo, err error) error { | ||
19 | if err != nil { | ||
20 | return err | ||
21 | } | ||
22 | |||
23 | if path == src { | ||
24 | return nil | ||
25 | } | ||
26 | |||
27 | if strings.HasPrefix(filepath.Base(path), ".") { | ||
28 | // Skip any dot files | ||
29 | if info.IsDir() { | ||
30 | return filepath.SkipDir | ||
31 | } else { | ||
32 | return nil | ||
33 | } | ||
34 | } | ||
35 | |||
36 | // The "path" has the src prefixed to it. We need to join our | ||
37 | // destination with the path without the src on it. | ||
38 | dstPath := filepath.Join(dst, path[len(src):]) | ||
39 | |||
40 | // we don't want to try and copy the same file over itself. | ||
41 | if eq, err := sameFile(path, dstPath); eq { | ||
42 | return nil | ||
43 | } else if err != nil { | ||
44 | return err | ||
45 | } | ||
46 | |||
47 | // If we have a directory, make that subdirectory, then continue | ||
48 | // the walk. | ||
49 | if info.IsDir() { | ||
50 | if path == filepath.Join(src, dst) { | ||
51 | // dst is in src; don't walk it. | ||
52 | return nil | ||
53 | } | ||
54 | |||
55 | if err := os.MkdirAll(dstPath, 0755); err != nil { | ||
56 | return err | ||
57 | } | ||
58 | |||
59 | return nil | ||
60 | } | ||
61 | |||
62 | // If the current path is a symlink, recreate the symlink relative to | ||
63 | // the dst directory | ||
64 | if info.Mode()&os.ModeSymlink == os.ModeSymlink { | ||
65 | target, err := os.Readlink(path) | ||
66 | if err != nil { | ||
67 | return err | ||
68 | } | ||
69 | |||
70 | return os.Symlink(target, dstPath) | ||
71 | } | ||
72 | |||
73 | // If we have a file, copy the contents. | ||
74 | srcF, err := os.Open(path) | ||
75 | if err != nil { | ||
76 | return err | ||
77 | } | ||
78 | defer srcF.Close() | ||
79 | |||
80 | dstF, err := os.Create(dstPath) | ||
81 | if err != nil { | ||
82 | return err | ||
83 | } | ||
84 | defer dstF.Close() | ||
85 | |||
86 | if _, err := io.Copy(dstF, srcF); err != nil { | ||
87 | return err | ||
88 | } | ||
89 | |||
90 | // Chmod it | ||
91 | return os.Chmod(dstPath, info.Mode()) | ||
92 | } | ||
93 | |||
94 | return filepath.Walk(src, walkFn) | ||
95 | } | ||
96 | |||
97 | // sameFile tried to determine if to paths are the same file. | ||
98 | // If the paths don't match, we lookup the inode on supported systems. | ||
99 | func sameFile(a, b string) (bool, error) { | ||
100 | if a == b { | ||
101 | return true, nil | ||
102 | } | ||
103 | |||
104 | aIno, err := inode(a) | ||
105 | if err != nil { | ||
106 | if os.IsNotExist(err) { | ||
107 | return false, nil | ||
108 | } | ||
109 | return false, err | ||
110 | } | ||
111 | |||
112 | bIno, err := inode(b) | ||
113 | if err != nil { | ||
114 | if os.IsNotExist(err) { | ||
115 | return false, nil | ||
116 | } | ||
117 | return false, err | ||
118 | } | ||
119 | |||
120 | if aIno > 0 && aIno == bIno { | ||
121 | return true, nil | ||
122 | } | ||
123 | |||
124 | return false, nil | ||
125 | } | ||
diff --git a/vendor/github.com/hashicorp/terraform/internal/initwd/doc.go b/vendor/github.com/hashicorp/terraform/internal/initwd/doc.go new file mode 100644 index 0000000..b9d938d --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/internal/initwd/doc.go | |||
@@ -0,0 +1,7 @@ | |||
1 | // Package initwd contains various helper functions used by the "terraform init" | ||
2 | // command to initialize a working directory. | ||
3 | // | ||
4 | // These functions may also be used from testing code to simulate the behaviors | ||
5 | // of "terraform init" against test fixtures, but should not be used elsewhere | ||
6 | // in the main code. | ||
7 | package initwd | ||
diff --git a/vendor/github.com/hashicorp/terraform/internal/initwd/from_module.go b/vendor/github.com/hashicorp/terraform/internal/initwd/from_module.go new file mode 100644 index 0000000..6b40d08 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/internal/initwd/from_module.go | |||
@@ -0,0 +1,363 @@ | |||
1 | package initwd | ||
2 | |||
3 | import ( | ||
4 | "fmt" | ||
5 | "github.com/hashicorp/terraform/internal/earlyconfig" | ||
6 | "io/ioutil" | ||
7 | "log" | ||
8 | "os" | ||
9 | "path/filepath" | ||
10 | "sort" | ||
11 | "strings" | ||
12 | |||
13 | version "github.com/hashicorp/go-version" | ||
14 | "github.com/hashicorp/terraform-config-inspect/tfconfig" | ||
15 | "github.com/hashicorp/terraform/internal/modsdir" | ||
16 | "github.com/hashicorp/terraform/registry" | ||
17 | "github.com/hashicorp/terraform/tfdiags" | ||
18 | ) | ||
19 | |||
20 | const initFromModuleRootCallName = "root" | ||
21 | const initFromModuleRootKeyPrefix = initFromModuleRootCallName + "." | ||
22 | |||
23 | // DirFromModule populates the given directory (which must exist and be | ||
24 | // empty) with the contents of the module at the given source address. | ||
25 | // | ||
26 | // It does this by installing the given module and all of its descendent | ||
27 | // modules in a temporary root directory and then copying the installed | ||
28 | // files into suitable locations. As a consequence, any diagnostics it | ||
29 | // generates will reveal the location of this temporary directory to the | ||
30 | // user. | ||
31 | // | ||
32 | // This rather roundabout installation approach is taken to ensure that | ||
33 | // installation proceeds in a manner identical to normal module installation. | ||
34 | // | ||
35 | // If the given source address specifies a sub-directory of the given | ||
36 | // package then only the sub-directory and its descendents will be copied | ||
37 | // into the given root directory, which will cause any relative module | ||
38 | // references using ../ from that module to be unresolvable. Error diagnostics | ||
39 | // are produced in that case, to prompt the user to rewrite the source strings | ||
40 | // to be absolute references to the original remote module. | ||
41 | func DirFromModule(rootDir, modulesDir, sourceAddr string, reg *registry.Client, hooks ModuleInstallHooks) tfdiags.Diagnostics { | ||
42 | var diags tfdiags.Diagnostics | ||
43 | |||
44 | // The way this function works is pretty ugly, but we accept it because | ||
45 | // -from-module is a less important case than normal module installation | ||
46 | // and so it's better to keep this ugly complexity out here rather than | ||
47 | // adding even more complexity to the normal module installer. | ||
48 | |||
49 | // The target directory must exist but be empty. | ||
50 | { | ||
51 | entries, err := ioutil.ReadDir(rootDir) | ||
52 | if err != nil { | ||
53 | if os.IsNotExist(err) { | ||
54 | diags = diags.Append(tfdiags.Sourceless( | ||
55 | tfdiags.Error, | ||
56 | "Target directory does not exist", | ||
57 | fmt.Sprintf("Cannot initialize non-existent directory %s.", rootDir), | ||
58 | )) | ||
59 | } else { | ||
60 | diags = diags.Append(tfdiags.Sourceless( | ||
61 | tfdiags.Error, | ||
62 | "Failed to read target directory", | ||
63 | fmt.Sprintf("Error reading %s to ensure it is empty: %s.", rootDir, err), | ||
64 | )) | ||
65 | } | ||
66 | return diags | ||
67 | } | ||
68 | haveEntries := false | ||
69 | for _, entry := range entries { | ||
70 | if entry.Name() == "." || entry.Name() == ".." || entry.Name() == ".terraform" { | ||
71 | continue | ||
72 | } | ||
73 | haveEntries = true | ||
74 | } | ||
75 | if haveEntries { | ||
76 | diags = diags.Append(tfdiags.Sourceless( | ||
77 | tfdiags.Error, | ||
78 | "Can't populate non-empty directory", | ||
79 | fmt.Sprintf("The target directory %s is not empty, so it cannot be initialized with the -from-module=... option.", rootDir), | ||
80 | )) | ||
81 | return diags | ||
82 | } | ||
83 | } | ||
84 | |||
85 | instDir := filepath.Join(rootDir, ".terraform/init-from-module") | ||
86 | inst := NewModuleInstaller(instDir, reg) | ||
87 | log.Printf("[DEBUG] installing modules in %s to initialize working directory from %q", instDir, sourceAddr) | ||
88 | os.RemoveAll(instDir) // if this fails then we'll fail on MkdirAll below too | ||
89 | err := os.MkdirAll(instDir, os.ModePerm) | ||
90 | if err != nil { | ||
91 | diags = diags.Append(tfdiags.Sourceless( | ||
92 | tfdiags.Error, | ||
93 | "Failed to create temporary directory", | ||
94 | fmt.Sprintf("Failed to create temporary directory %s: %s.", instDir, err), | ||
95 | )) | ||
96 | return diags | ||
97 | } | ||
98 | |||
99 | instManifest := make(modsdir.Manifest) | ||
100 | retManifest := make(modsdir.Manifest) | ||
101 | |||
102 | fakeFilename := fmt.Sprintf("-from-module=%q", sourceAddr) | ||
103 | fakePos := tfconfig.SourcePos{ | ||
104 | Filename: fakeFilename, | ||
105 | Line: 1, | ||
106 | } | ||
107 | |||
108 | // -from-module allows relative paths but it's different than a normal | ||
109 | // module address where it'd be resolved relative to the module call | ||
110 | // (which is synthetic, here.) To address this, we'll just patch up any | ||
111 | // relative paths to be absolute paths before we run, ensuring we'll | ||
112 | // get the right result. This also, as an important side-effect, ensures | ||
113 | // that the result will be "downloaded" with go-getter (copied from the | ||
114 | // source location), rather than just recorded as a relative path. | ||
115 | { | ||
116 | maybePath := filepath.ToSlash(sourceAddr) | ||
117 | if maybePath == "." || strings.HasPrefix(maybePath, "./") || strings.HasPrefix(maybePath, "../") { | ||
118 | if wd, err := os.Getwd(); err == nil { | ||
119 | sourceAddr = filepath.Join(wd, sourceAddr) | ||
120 | log.Printf("[TRACE] -from-module relative path rewritten to absolute path %s", sourceAddr) | ||
121 | } | ||
122 | } | ||
123 | } | ||
124 | |||
125 | // Now we need to create an artificial root module that will seed our | ||
126 | // installation process. | ||
127 | fakeRootModule := &tfconfig.Module{ | ||
128 | ModuleCalls: map[string]*tfconfig.ModuleCall{ | ||
129 | initFromModuleRootCallName: { | ||
130 | Name: initFromModuleRootCallName, | ||
131 | Source: sourceAddr, | ||
132 | Pos: fakePos, | ||
133 | }, | ||
134 | }, | ||
135 | } | ||
136 | |||
137 | // wrapHooks filters hook notifications to only include Download calls | ||
138 | // and to trim off the initFromModuleRootCallName prefix. We'll produce | ||
139 | // our own Install notifications directly below. | ||
140 | wrapHooks := installHooksInitDir{ | ||
141 | Wrapped: hooks, | ||
142 | } | ||
143 | getter := reusingGetter{} | ||
144 | _, instDiags := inst.installDescendentModules(fakeRootModule, rootDir, instManifest, true, wrapHooks, getter) | ||
145 | diags = append(diags, instDiags...) | ||
146 | if instDiags.HasErrors() { | ||
147 | return diags | ||
148 | } | ||
149 | |||
150 | // If all of that succeeded then we'll now migrate what was installed | ||
151 | // into the final directory structure. | ||
152 | err = os.MkdirAll(modulesDir, os.ModePerm) | ||
153 | if err != nil { | ||
154 | diags = diags.Append(tfdiags.Sourceless( | ||
155 | tfdiags.Error, | ||
156 | "Failed to create local modules directory", | ||
157 | fmt.Sprintf("Failed to create modules directory %s: %s.", modulesDir, err), | ||
158 | )) | ||
159 | return diags | ||
160 | } | ||
161 | |||
162 | recordKeys := make([]string, 0, len(instManifest)) | ||
163 | for k := range instManifest { | ||
164 | recordKeys = append(recordKeys, k) | ||
165 | } | ||
166 | sort.Strings(recordKeys) | ||
167 | |||
168 | for _, recordKey := range recordKeys { | ||
169 | record := instManifest[recordKey] | ||
170 | |||
171 | if record.Key == initFromModuleRootCallName { | ||
172 | // We've found the module the user requested, which we must | ||
173 | // now copy into rootDir so it can be used directly. | ||
174 | log.Printf("[TRACE] copying new root module from %s to %s", record.Dir, rootDir) | ||
175 | err := copyDir(rootDir, record.Dir) | ||
176 | if err != nil { | ||
177 | diags = diags.Append(tfdiags.Sourceless( | ||
178 | tfdiags.Error, | ||
179 | "Failed to copy root module", | ||
180 | fmt.Sprintf("Error copying root module %q from %s to %s: %s.", sourceAddr, record.Dir, rootDir, err), | ||
181 | )) | ||
182 | continue | ||
183 | } | ||
184 | |||
185 | // We'll try to load the newly-copied module here just so we can | ||
186 | // sniff for any module calls that ../ out of the root directory | ||
187 | // and must thus be rewritten to be absolute addresses again. | ||
188 | // For now we can't do this rewriting automatically, but we'll | ||
189 | // generate an error to help the user do it manually. | ||
190 | mod, _ := earlyconfig.LoadModule(rootDir) // ignore diagnostics since we're just doing value-add here anyway | ||
191 | if mod != nil { | ||
192 | for _, mc := range mod.ModuleCalls { | ||
193 | if pathTraversesUp(mc.Source) { | ||
194 | packageAddr, givenSubdir := splitAddrSubdir(sourceAddr) | ||
195 | newSubdir := filepath.Join(givenSubdir, mc.Source) | ||
196 | if pathTraversesUp(newSubdir) { | ||
197 | // This should never happen in any reasonable | ||
198 | // configuration since this suggests a path that | ||
199 | // traverses up out of the package root. We'll just | ||
200 | // ignore this, since we'll fail soon enough anyway | ||
201 | // trying to resolve this path when this module is | ||
202 | // loaded. | ||
203 | continue | ||
204 | } | ||
205 | |||
206 | var newAddr = packageAddr | ||
207 | if newSubdir != "" { | ||
208 | newAddr = fmt.Sprintf("%s//%s", newAddr, filepath.ToSlash(newSubdir)) | ||
209 | } | ||
210 | diags = diags.Append(tfdiags.Sourceless( | ||
211 | tfdiags.Error, | ||
212 | "Root module references parent directory", | ||
213 | fmt.Sprintf("The requested module %q refers to a module via its parent directory. To use this as a new root module this source string must be rewritten as a remote source address, such as %q.", sourceAddr, newAddr), | ||
214 | )) | ||
215 | continue | ||
216 | } | ||
217 | } | ||
218 | } | ||
219 | |||
220 | retManifest[""] = modsdir.Record{ | ||
221 | Key: "", | ||
222 | Dir: rootDir, | ||
223 | } | ||
224 | continue | ||
225 | } | ||
226 | |||
227 | if !strings.HasPrefix(record.Key, initFromModuleRootKeyPrefix) { | ||
228 | // Ignore the *real* root module, whose key is empty, since | ||
229 | // we're only interested in the module named "root" and its | ||
230 | // descendents. | ||
231 | continue | ||
232 | } | ||
233 | |||
234 | newKey := record.Key[len(initFromModuleRootKeyPrefix):] | ||
235 | instPath := filepath.Join(modulesDir, newKey) | ||
236 | tempPath := filepath.Join(instDir, record.Key) | ||
237 | |||
238 | // tempPath won't be present for a module that was installed from | ||
239 | // a relative path, so in that case we just record the installation | ||
240 | // directory and assume it was already copied into place as part | ||
241 | // of its parent. | ||
242 | if _, err := os.Stat(tempPath); err != nil { | ||
243 | if !os.IsNotExist(err) { | ||
244 | diags = diags.Append(tfdiags.Sourceless( | ||
245 | tfdiags.Error, | ||
246 | "Failed to stat temporary module install directory", | ||
247 | fmt.Sprintf("Error from stat %s for module %s: %s.", instPath, newKey, err), | ||
248 | )) | ||
249 | continue | ||
250 | } | ||
251 | |||
252 | var parentKey string | ||
253 | if lastDot := strings.LastIndexByte(newKey, '.'); lastDot != -1 { | ||
254 | parentKey = newKey[:lastDot] | ||
255 | } else { | ||
256 | parentKey = "" // parent is the root module | ||
257 | } | ||
258 | |||
259 | parentOld := instManifest[initFromModuleRootKeyPrefix+parentKey] | ||
260 | parentNew := retManifest[parentKey] | ||
261 | |||
262 | // We need to figure out which portion of our directory is the | ||
263 | // parent package path and which portion is the subdirectory | ||
264 | // under that. | ||
265 | baseDirRel, err := filepath.Rel(parentOld.Dir, record.Dir) | ||
266 | if err != nil { | ||
267 | // Should never happen, because we constructed both directories | ||
268 | // from the same base and so they must have a common prefix. | ||
269 | panic(err) | ||
270 | } | ||
271 | |||
272 | newDir := filepath.Join(parentNew.Dir, baseDirRel) | ||
273 | log.Printf("[TRACE] relative reference for %s rewritten from %s to %s", newKey, record.Dir, newDir) | ||
274 | newRecord := record // shallow copy | ||
275 | newRecord.Dir = newDir | ||
276 | newRecord.Key = newKey | ||
277 | retManifest[newKey] = newRecord | ||
278 | hooks.Install(newRecord.Key, newRecord.Version, newRecord.Dir) | ||
279 | continue | ||
280 | } | ||
281 | |||
282 | err = os.MkdirAll(instPath, os.ModePerm) | ||
283 | if err != nil { | ||
284 | diags = diags.Append(tfdiags.Sourceless( | ||
285 | tfdiags.Error, | ||
286 | "Failed to create module install directory", | ||
287 | fmt.Sprintf("Error creating directory %s for module %s: %s.", instPath, newKey, err), | ||
288 | )) | ||
289 | continue | ||
290 | } | ||
291 | |||
292 | // We copy rather than "rename" here because renaming between directories | ||
293 | // can be tricky in edge-cases like network filesystems, etc. | ||
294 | log.Printf("[TRACE] copying new module %s from %s to %s", newKey, record.Dir, instPath) | ||
295 | err := copyDir(instPath, tempPath) | ||
296 | if err != nil { | ||
297 | diags = diags.Append(tfdiags.Sourceless( | ||
298 | tfdiags.Error, | ||
299 | "Failed to copy descendent module", | ||
300 | fmt.Sprintf("Error copying module %q from %s to %s: %s.", newKey, tempPath, rootDir, err), | ||
301 | )) | ||
302 | continue | ||
303 | } | ||
304 | |||
305 | subDir, err := filepath.Rel(tempPath, record.Dir) | ||
306 | if err != nil { | ||
307 | // Should never happen, because we constructed both directories | ||
308 | // from the same base and so they must have a common prefix. | ||
309 | panic(err) | ||
310 | } | ||
311 | |||
312 | newRecord := record // shallow copy | ||
313 | newRecord.Dir = filepath.Join(instPath, subDir) | ||
314 | newRecord.Key = newKey | ||
315 | retManifest[newKey] = newRecord | ||
316 | hooks.Install(newRecord.Key, newRecord.Version, newRecord.Dir) | ||
317 | } | ||
318 | |||
319 | retManifest.WriteSnapshotToDir(modulesDir) | ||
320 | if err != nil { | ||
321 | diags = diags.Append(tfdiags.Sourceless( | ||
322 | tfdiags.Error, | ||
323 | "Failed to write module manifest", | ||
324 | fmt.Sprintf("Error writing module manifest: %s.", err), | ||
325 | )) | ||
326 | } | ||
327 | |||
328 | if !diags.HasErrors() { | ||
329 | // Try to clean up our temporary directory, but don't worry if we don't | ||
330 | // succeed since it shouldn't hurt anything. | ||
331 | os.RemoveAll(instDir) | ||
332 | } | ||
333 | |||
334 | return diags | ||
335 | } | ||
336 | |||
337 | func pathTraversesUp(path string) bool { | ||
338 | return strings.HasPrefix(filepath.ToSlash(path), "../") | ||
339 | } | ||
340 | |||
341 | // installHooksInitDir is an adapter wrapper for an InstallHooks that | ||
342 | // does some fakery to make downloads look like they are happening in their | ||
343 | // final locations, rather than in the temporary loader we use. | ||
344 | // | ||
345 | // It also suppresses "Install" calls entirely, since InitDirFromModule | ||
346 | // does its own installation steps after the initial installation pass | ||
347 | // has completed. | ||
348 | type installHooksInitDir struct { | ||
349 | Wrapped ModuleInstallHooks | ||
350 | ModuleInstallHooksImpl | ||
351 | } | ||
352 | |||
353 | func (h installHooksInitDir) Download(moduleAddr, packageAddr string, version *version.Version) { | ||
354 | if !strings.HasPrefix(moduleAddr, initFromModuleRootKeyPrefix) { | ||
355 | // We won't announce the root module, since hook implementations | ||
356 | // don't expect to see that and the caller will usually have produced | ||
357 | // its own user-facing notification about what it's doing anyway. | ||
358 | return | ||
359 | } | ||
360 | |||
361 | trimAddr := moduleAddr[len(initFromModuleRootKeyPrefix):] | ||
362 | h.Wrapped.Download(trimAddr, packageAddr, version) | ||
363 | } | ||
diff --git a/vendor/github.com/hashicorp/terraform/internal/initwd/getter.go b/vendor/github.com/hashicorp/terraform/internal/initwd/getter.go new file mode 100644 index 0000000..50e2572 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/internal/initwd/getter.go | |||
@@ -0,0 +1,210 @@ | |||
1 | package initwd | ||
2 | |||
3 | import ( | ||
4 | "fmt" | ||
5 | "log" | ||
6 | "os" | ||
7 | "path/filepath" | ||
8 | "strings" | ||
9 | |||
10 | cleanhttp "github.com/hashicorp/go-cleanhttp" | ||
11 | getter "github.com/hashicorp/go-getter" | ||
12 | "github.com/hashicorp/terraform/registry/regsrc" | ||
13 | ) | ||
14 | |||
15 | // We configure our own go-getter detector and getter sets here, because | ||
16 | // the set of sources we support is part of Terraform's documentation and | ||
17 | // so we don't want any new sources introduced in go-getter to sneak in here | ||
18 | // and work even though they aren't documented. This also insulates us from | ||
19 | // any meddling that might be done by other go-getter callers linked into our | ||
20 | // executable. | ||
21 | |||
22 | var goGetterDetectors = []getter.Detector{ | ||
23 | new(getter.GitHubDetector), | ||
24 | new(getter.BitBucketDetector), | ||
25 | new(getter.S3Detector), | ||
26 | new(getter.FileDetector), | ||
27 | } | ||
28 | |||
29 | var goGetterNoDetectors = []getter.Detector{} | ||
30 | |||
31 | var goGetterDecompressors = map[string]getter.Decompressor{ | ||
32 | "bz2": new(getter.Bzip2Decompressor), | ||
33 | "gz": new(getter.GzipDecompressor), | ||
34 | "xz": new(getter.XzDecompressor), | ||
35 | "zip": new(getter.ZipDecompressor), | ||
36 | |||
37 | "tar.bz2": new(getter.TarBzip2Decompressor), | ||
38 | "tar.tbz2": new(getter.TarBzip2Decompressor), | ||
39 | |||
40 | "tar.gz": new(getter.TarGzipDecompressor), | ||
41 | "tgz": new(getter.TarGzipDecompressor), | ||
42 | |||
43 | "tar.xz": new(getter.TarXzDecompressor), | ||
44 | "txz": new(getter.TarXzDecompressor), | ||
45 | } | ||
46 | |||
47 | var goGetterGetters = map[string]getter.Getter{ | ||
48 | "file": new(getter.FileGetter), | ||
49 | "git": new(getter.GitGetter), | ||
50 | "hg": new(getter.HgGetter), | ||
51 | "s3": new(getter.S3Getter), | ||
52 | "http": getterHTTPGetter, | ||
53 | "https": getterHTTPGetter, | ||
54 | } | ||
55 | |||
56 | var getterHTTPClient = cleanhttp.DefaultClient() | ||
57 | |||
58 | var getterHTTPGetter = &getter.HttpGetter{ | ||
59 | Client: getterHTTPClient, | ||
60 | Netrc: true, | ||
61 | } | ||
62 | |||
63 | // A reusingGetter is a helper for the module installer that remembers | ||
64 | // the final resolved addresses of all of the sources it has already been | ||
65 | // asked to install, and will copy from a prior installation directory if | ||
66 | // it has the same resolved source address. | ||
67 | // | ||
68 | // The keys in a reusingGetter are resolved and trimmed source addresses | ||
69 | // (with a scheme always present, and without any "subdir" component), | ||
70 | // and the values are the paths where each source was previously installed. | ||
71 | type reusingGetter map[string]string | ||
72 | |||
73 | // getWithGoGetter retrieves the package referenced in the given address | ||
74 | // into the installation path and then returns the full path to any subdir | ||
75 | // indicated in the address. | ||
76 | // | ||
77 | // The errors returned by this function are those surfaced by the underlying | ||
78 | // go-getter library, which have very inconsistent quality as | ||
79 | // end-user-actionable error messages. At this time we do not have any | ||
80 | // reasonable way to improve these error messages at this layer because | ||
81 | // the underlying errors are not separately recognizable. | ||
82 | func (g reusingGetter) getWithGoGetter(instPath, addr string) (string, error) { | ||
83 | packageAddr, subDir := splitAddrSubdir(addr) | ||
84 | |||
85 | log.Printf("[DEBUG] will download %q to %s", packageAddr, instPath) | ||
86 | |||
87 | realAddr, err := getter.Detect(packageAddr, instPath, getter.Detectors) | ||
88 | if err != nil { | ||
89 | return "", err | ||
90 | } | ||
91 | |||
92 | if isMaybeRelativeLocalPath(realAddr) { | ||
93 | return "", &MaybeRelativePathErr{addr} | ||
94 | } | ||
95 | |||
96 | var realSubDir string | ||
97 | realAddr, realSubDir = splitAddrSubdir(realAddr) | ||
98 | if realSubDir != "" { | ||
99 | subDir = filepath.Join(realSubDir, subDir) | ||
100 | } | ||
101 | |||
102 | if realAddr != packageAddr { | ||
103 | log.Printf("[TRACE] go-getter detectors rewrote %q to %q", packageAddr, realAddr) | ||
104 | } | ||
105 | |||
106 | if prevDir, exists := g[realAddr]; exists { | ||
107 | log.Printf("[TRACE] copying previous install %s to %s", prevDir, instPath) | ||
108 | err := os.Mkdir(instPath, os.ModePerm) | ||
109 | if err != nil { | ||
110 | return "", fmt.Errorf("failed to create directory %s: %s", instPath, err) | ||
111 | } | ||
112 | err = copyDir(instPath, prevDir) | ||
113 | if err != nil { | ||
114 | return "", fmt.Errorf("failed to copy from %s to %s: %s", prevDir, instPath, err) | ||
115 | } | ||
116 | } else { | ||
117 | log.Printf("[TRACE] fetching %q to %q", realAddr, instPath) | ||
118 | client := getter.Client{ | ||
119 | Src: realAddr, | ||
120 | Dst: instPath, | ||
121 | Pwd: instPath, | ||
122 | |||
123 | Mode: getter.ClientModeDir, | ||
124 | |||
125 | Detectors: goGetterNoDetectors, // we already did detection above | ||
126 | Decompressors: goGetterDecompressors, | ||
127 | Getters: goGetterGetters, | ||
128 | } | ||
129 | err = client.Get() | ||
130 | if err != nil { | ||
131 | return "", err | ||
132 | } | ||
133 | // Remember where we installed this so we might reuse this directory | ||
134 | // on subsequent calls to avoid re-downloading. | ||
135 | g[realAddr] = instPath | ||
136 | } | ||
137 | |||
138 | // Our subDir string can contain wildcards until this point, so that | ||
139 | // e.g. a subDir of * can expand to one top-level directory in a .tar.gz | ||
140 | // archive. Now that we've expanded the archive successfully we must | ||
141 | // resolve that into a concrete path. | ||
142 | var finalDir string | ||
143 | if subDir != "" { | ||
144 | finalDir, err = getter.SubdirGlob(instPath, subDir) | ||
145 | log.Printf("[TRACE] expanded %q to %q", subDir, finalDir) | ||
146 | if err != nil { | ||
147 | return "", err | ||
148 | } | ||
149 | } else { | ||
150 | finalDir = instPath | ||
151 | } | ||
152 | |||
153 | // If we got this far then we have apparently succeeded in downloading | ||
154 | // the requested object! | ||
155 | return filepath.Clean(finalDir), nil | ||
156 | } | ||
157 | |||
158 | // splitAddrSubdir splits the given address (which is assumed to be a | ||
159 | // registry address or go-getter-style address) into a package portion | ||
160 | // and a sub-directory portion. | ||
161 | // | ||
162 | // The package portion defines what should be downloaded and then the | ||
163 | // sub-directory portion, if present, specifies a sub-directory within | ||
164 | // the downloaded object (an archive, VCS repository, etc) that contains | ||
165 | // the module's configuration files. | ||
166 | // | ||
167 | // The subDir portion will be returned as empty if no subdir separator | ||
168 | // ("//") is present in the address. | ||
169 | func splitAddrSubdir(addr string) (packageAddr, subDir string) { | ||
170 | return getter.SourceDirSubdir(addr) | ||
171 | } | ||
172 | |||
173 | var localSourcePrefixes = []string{ | ||
174 | "./", | ||
175 | "../", | ||
176 | ".\\", | ||
177 | "..\\", | ||
178 | } | ||
179 | |||
180 | func isLocalSourceAddr(addr string) bool { | ||
181 | for _, prefix := range localSourcePrefixes { | ||
182 | if strings.HasPrefix(addr, prefix) { | ||
183 | return true | ||
184 | } | ||
185 | } | ||
186 | return false | ||
187 | } | ||
188 | |||
189 | func isRegistrySourceAddr(addr string) bool { | ||
190 | _, err := regsrc.ParseModuleSource(addr) | ||
191 | return err == nil | ||
192 | } | ||
193 | |||
194 | type MaybeRelativePathErr struct { | ||
195 | Addr string | ||
196 | } | ||
197 | |||
198 | func (e *MaybeRelativePathErr) Error() string { | ||
199 | return fmt.Sprintf("Terraform cannot determine the module source for %s", e.Addr) | ||
200 | } | ||
201 | |||
202 | func isMaybeRelativeLocalPath(addr string) bool { | ||
203 | if strings.HasPrefix(addr, "file://") { | ||
204 | _, err := os.Stat(addr[7:]) | ||
205 | if err != nil { | ||
206 | return true | ||
207 | } | ||
208 | } | ||
209 | return false | ||
210 | } | ||
diff --git a/vendor/github.com/hashicorp/terraform/internal/initwd/inode.go b/vendor/github.com/hashicorp/terraform/internal/initwd/inode.go new file mode 100644 index 0000000..1150b09 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/internal/initwd/inode.go | |||
@@ -0,0 +1,21 @@ | |||
1 | // +build linux darwin openbsd netbsd solaris dragonfly | ||
2 | |||
3 | package initwd | ||
4 | |||
5 | import ( | ||
6 | "fmt" | ||
7 | "os" | ||
8 | "syscall" | ||
9 | ) | ||
10 | |||
11 | // lookup the inode of a file on posix systems | ||
12 | func inode(path string) (uint64, error) { | ||
13 | stat, err := os.Stat(path) | ||
14 | if err != nil { | ||
15 | return 0, err | ||
16 | } | ||
17 | if st, ok := stat.Sys().(*syscall.Stat_t); ok { | ||
18 | return st.Ino, nil | ||
19 | } | ||
20 | return 0, fmt.Errorf("could not determine file inode") | ||
21 | } | ||
diff --git a/vendor/github.com/hashicorp/terraform/internal/initwd/inode_freebsd.go b/vendor/github.com/hashicorp/terraform/internal/initwd/inode_freebsd.go new file mode 100644 index 0000000..30532f5 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/internal/initwd/inode_freebsd.go | |||
@@ -0,0 +1,21 @@ | |||
1 | // +build freebsd | ||
2 | |||
3 | package initwd | ||
4 | |||
5 | import ( | ||
6 | "fmt" | ||
7 | "os" | ||
8 | "syscall" | ||
9 | ) | ||
10 | |||
11 | // lookup the inode of a file on posix systems | ||
12 | func inode(path string) (uint64, error) { | ||
13 | stat, err := os.Stat(path) | ||
14 | if err != nil { | ||
15 | return 0, err | ||
16 | } | ||
17 | if st, ok := stat.Sys().(*syscall.Stat_t); ok { | ||
18 | return uint64(st.Ino), nil | ||
19 | } | ||
20 | return 0, fmt.Errorf("could not determine file inode") | ||
21 | } | ||
diff --git a/vendor/github.com/hashicorp/terraform/internal/initwd/inode_windows.go b/vendor/github.com/hashicorp/terraform/internal/initwd/inode_windows.go new file mode 100644 index 0000000..3ed58e4 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/internal/initwd/inode_windows.go | |||
@@ -0,0 +1,8 @@ | |||
1 | // +build windows | ||
2 | |||
3 | package initwd | ||
4 | |||
5 | // no syscall.Stat_t on windows, return 0 for inodes | ||
6 | func inode(path string) (uint64, error) { | ||
7 | return 0, nil | ||
8 | } | ||
diff --git a/vendor/github.com/hashicorp/terraform/internal/initwd/load_config.go b/vendor/github.com/hashicorp/terraform/internal/initwd/load_config.go new file mode 100644 index 0000000..6f77dcd --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/internal/initwd/load_config.go | |||
@@ -0,0 +1,56 @@ | |||
1 | package initwd | ||
2 | |||
3 | import ( | ||
4 | "fmt" | ||
5 | |||
6 | version "github.com/hashicorp/go-version" | ||
7 | "github.com/hashicorp/terraform-config-inspect/tfconfig" | ||
8 | "github.com/hashicorp/terraform/internal/earlyconfig" | ||
9 | "github.com/hashicorp/terraform/internal/modsdir" | ||
10 | "github.com/hashicorp/terraform/tfdiags" | ||
11 | ) | ||
12 | |||
13 | // LoadConfig loads a full configuration tree that has previously had all of | ||
14 | // its dependent modules installed to the given modulesDir using a | ||
15 | // ModuleInstaller. | ||
16 | // | ||
17 | // This uses the early configuration loader and thus only reads top-level | ||
18 | // metadata from the modules in the configuration. Most callers should use | ||
19 | // the configs/configload package to fully load a configuration. | ||
20 | func LoadConfig(rootDir, modulesDir string) (*earlyconfig.Config, tfdiags.Diagnostics) { | ||
21 | rootMod, diags := earlyconfig.LoadModule(rootDir) | ||
22 | if rootMod == nil { | ||
23 | return nil, diags | ||
24 | } | ||
25 | |||
26 | manifest, err := modsdir.ReadManifestSnapshotForDir(modulesDir) | ||
27 | if err != nil { | ||
28 | diags = diags.Append(tfdiags.Sourceless( | ||
29 | tfdiags.Error, | ||
30 | "Failed to read module manifest", | ||
31 | fmt.Sprintf("Terraform failed to read its manifest of locally-cached modules: %s.", err), | ||
32 | )) | ||
33 | return nil, diags | ||
34 | } | ||
35 | |||
36 | return earlyconfig.BuildConfig(rootMod, earlyconfig.ModuleWalkerFunc( | ||
37 | func(req *earlyconfig.ModuleRequest) (*tfconfig.Module, *version.Version, tfdiags.Diagnostics) { | ||
38 | var diags tfdiags.Diagnostics | ||
39 | |||
40 | key := manifest.ModuleKey(req.Path) | ||
41 | record, exists := manifest[key] | ||
42 | if !exists { | ||
43 | diags = diags.Append(tfdiags.Sourceless( | ||
44 | tfdiags.Error, | ||
45 | "Module not installed", | ||
46 | fmt.Sprintf("Module %s is not yet installed. Run \"terraform init\" to install all modules required by this configuration.", req.Path.String()), | ||
47 | )) | ||
48 | return nil, nil, diags | ||
49 | } | ||
50 | |||
51 | mod, mDiags := earlyconfig.LoadModule(record.Dir) | ||
52 | diags = diags.Append(mDiags) | ||
53 | return mod, record.Version, diags | ||
54 | }, | ||
55 | )) | ||
56 | } | ||
diff --git a/vendor/github.com/hashicorp/terraform/internal/initwd/module_install.go b/vendor/github.com/hashicorp/terraform/internal/initwd/module_install.go new file mode 100644 index 0000000..531310a --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/internal/initwd/module_install.go | |||
@@ -0,0 +1,558 @@ | |||
1 | package initwd | ||
2 | |||
3 | import ( | ||
4 | "fmt" | ||
5 | "log" | ||
6 | "os" | ||
7 | "path/filepath" | ||
8 | "strings" | ||
9 | |||
10 | version "github.com/hashicorp/go-version" | ||
11 | "github.com/hashicorp/terraform-config-inspect/tfconfig" | ||
12 | "github.com/hashicorp/terraform/addrs" | ||
13 | "github.com/hashicorp/terraform/internal/earlyconfig" | ||
14 | "github.com/hashicorp/terraform/internal/modsdir" | ||
15 | "github.com/hashicorp/terraform/registry" | ||
16 | "github.com/hashicorp/terraform/registry/regsrc" | ||
17 | "github.com/hashicorp/terraform/tfdiags" | ||
18 | ) | ||
19 | |||
20 | type ModuleInstaller struct { | ||
21 | modsDir string | ||
22 | reg *registry.Client | ||
23 | } | ||
24 | |||
25 | func NewModuleInstaller(modsDir string, reg *registry.Client) *ModuleInstaller { | ||
26 | return &ModuleInstaller{ | ||
27 | modsDir: modsDir, | ||
28 | reg: reg, | ||
29 | } | ||
30 | } | ||
31 | |||
32 | // InstallModules analyses the root module in the given directory and installs | ||
33 | // all of its direct and transitive dependencies into the given modules | ||
34 | // directory, which must already exist. | ||
35 | // | ||
36 | // Since InstallModules makes possibly-time-consuming calls to remote services, | ||
37 | // a hook interface is supported to allow the caller to be notified when | ||
38 | // each module is installed and, for remote modules, when downloading begins. | ||
39 | // LoadConfig guarantees that two hook calls will not happen concurrently but | ||
40 | // it does not guarantee any particular ordering of hook calls. This mechanism | ||
41 | // is for UI feedback only and does not give the caller any control over the | ||
42 | // process. | ||
43 | // | ||
44 | // If modules are already installed in the target directory, they will be | ||
45 | // skipped unless their source address or version have changed or unless | ||
46 | // the upgrade flag is set. | ||
47 | // | ||
48 | // InstallModules never deletes any directory, except in the case where it | ||
49 | // needs to replace a directory that is already present with a newly-extracted | ||
50 | // package. | ||
51 | // | ||
52 | // If the returned diagnostics contains errors then the module installation | ||
53 | // may have wholly or partially completed. Modules must be loaded in order | ||
54 | // to find their dependencies, so this function does many of the same checks | ||
55 | // as LoadConfig as a side-effect. | ||
56 | // | ||
57 | // If successful (the returned diagnostics contains no errors) then the | ||
58 | // first return value is the early configuration tree that was constructed by | ||
59 | // the installation process. | ||
60 | func (i *ModuleInstaller) InstallModules(rootDir string, upgrade bool, hooks ModuleInstallHooks) (*earlyconfig.Config, tfdiags.Diagnostics) { | ||
61 | log.Printf("[TRACE] ModuleInstaller: installing child modules for %s into %s", rootDir, i.modsDir) | ||
62 | |||
63 | rootMod, diags := earlyconfig.LoadModule(rootDir) | ||
64 | if rootMod == nil { | ||
65 | return nil, diags | ||
66 | } | ||
67 | |||
68 | manifest, err := modsdir.ReadManifestSnapshotForDir(i.modsDir) | ||
69 | if err != nil { | ||
70 | diags = diags.Append(tfdiags.Sourceless( | ||
71 | tfdiags.Error, | ||
72 | "Failed to read modules manifest file", | ||
73 | fmt.Sprintf("Error reading manifest for %s: %s.", i.modsDir, err), | ||
74 | )) | ||
75 | return nil, diags | ||
76 | } | ||
77 | |||
78 | getter := reusingGetter{} | ||
79 | cfg, instDiags := i.installDescendentModules(rootMod, rootDir, manifest, upgrade, hooks, getter) | ||
80 | diags = append(diags, instDiags...) | ||
81 | |||
82 | return cfg, diags | ||
83 | } | ||
84 | |||
85 | func (i *ModuleInstaller) installDescendentModules(rootMod *tfconfig.Module, rootDir string, manifest modsdir.Manifest, upgrade bool, hooks ModuleInstallHooks, getter reusingGetter) (*earlyconfig.Config, tfdiags.Diagnostics) { | ||
86 | var diags tfdiags.Diagnostics | ||
87 | |||
88 | if hooks == nil { | ||
89 | // Use our no-op implementation as a placeholder | ||
90 | hooks = ModuleInstallHooksImpl{} | ||
91 | } | ||
92 | |||
93 | // Create a manifest record for the root module. This will be used if | ||
94 | // there are any relative-pathed modules in the root. | ||
95 | manifest[""] = modsdir.Record{ | ||
96 | Key: "", | ||
97 | Dir: rootDir, | ||
98 | } | ||
99 | |||
100 | cfg, cDiags := earlyconfig.BuildConfig(rootMod, earlyconfig.ModuleWalkerFunc( | ||
101 | func(req *earlyconfig.ModuleRequest) (*tfconfig.Module, *version.Version, tfdiags.Diagnostics) { | ||
102 | |||
103 | key := manifest.ModuleKey(req.Path) | ||
104 | instPath := i.packageInstallPath(req.Path) | ||
105 | |||
106 | log.Printf("[DEBUG] Module installer: begin %s", key) | ||
107 | |||
108 | // First we'll check if we need to upgrade/replace an existing | ||
109 | // installed module, and delete it out of the way if so. | ||
110 | replace := upgrade | ||
111 | if !replace { | ||
112 | record, recorded := manifest[key] | ||
113 | switch { | ||
114 | case !recorded: | ||
115 | log.Printf("[TRACE] ModuleInstaller: %s is not yet installed", key) | ||
116 | replace = true | ||
117 | case record.SourceAddr != req.SourceAddr: | ||
118 | log.Printf("[TRACE] ModuleInstaller: %s source address has changed from %q to %q", key, record.SourceAddr, req.SourceAddr) | ||
119 | replace = true | ||
120 | case record.Version != nil && !req.VersionConstraints.Check(record.Version): | ||
121 | log.Printf("[TRACE] ModuleInstaller: %s version %s no longer compatible with constraints %s", key, record.Version, req.VersionConstraints) | ||
122 | replace = true | ||
123 | } | ||
124 | } | ||
125 | |||
126 | // If we _are_ planning to replace this module, then we'll remove | ||
127 | // it now so our installation code below won't conflict with any | ||
128 | // existing remnants. | ||
129 | if replace { | ||
130 | if _, recorded := manifest[key]; recorded { | ||
131 | log.Printf("[TRACE] ModuleInstaller: discarding previous record of %s prior to reinstall", key) | ||
132 | } | ||
133 | delete(manifest, key) | ||
134 | // Deleting a module invalidates all of its descendent modules too. | ||
135 | keyPrefix := key + "." | ||
136 | for subKey := range manifest { | ||
137 | if strings.HasPrefix(subKey, keyPrefix) { | ||
138 | if _, recorded := manifest[subKey]; recorded { | ||
139 | log.Printf("[TRACE] ModuleInstaller: also discarding downstream %s", subKey) | ||
140 | } | ||
141 | delete(manifest, subKey) | ||
142 | } | ||
143 | } | ||
144 | } | ||
145 | |||
146 | record, recorded := manifest[key] | ||
147 | if !recorded { | ||
148 | // Clean up any stale cache directory that might be present. | ||
149 | // If this is a local (relative) source then the dir will | ||
150 | // not exist, but we'll ignore that. | ||
151 | log.Printf("[TRACE] ModuleInstaller: cleaning directory %s prior to install of %s", instPath, key) | ||
152 | err := os.RemoveAll(instPath) | ||
153 | if err != nil && !os.IsNotExist(err) { | ||
154 | log.Printf("[TRACE] ModuleInstaller: failed to remove %s: %s", key, err) | ||
155 | diags = diags.Append(tfdiags.Sourceless( | ||
156 | tfdiags.Error, | ||
157 | "Failed to remove local module cache", | ||
158 | fmt.Sprintf( | ||
159 | "Terraform tried to remove %s in order to reinstall this module, but encountered an error: %s", | ||
160 | instPath, err, | ||
161 | ), | ||
162 | )) | ||
163 | return nil, nil, diags | ||
164 | } | ||
165 | } else { | ||
166 | // If this module is already recorded and its root directory | ||
167 | // exists then we will just load what's already there and | ||
168 | // keep our existing record. | ||
169 | info, err := os.Stat(record.Dir) | ||
170 | if err == nil && info.IsDir() { | ||
171 | mod, mDiags := earlyconfig.LoadModule(record.Dir) | ||
172 | diags = diags.Append(mDiags) | ||
173 | |||
174 | log.Printf("[TRACE] ModuleInstaller: Module installer: %s %s already installed in %s", key, record.Version, record.Dir) | ||
175 | return mod, record.Version, diags | ||
176 | } | ||
177 | } | ||
178 | |||
179 | // If we get down here then it's finally time to actually install | ||
180 | // the module. There are some variants to this process depending | ||
181 | // on what type of module source address we have. | ||
182 | switch { | ||
183 | |||
184 | case isLocalSourceAddr(req.SourceAddr): | ||
185 | log.Printf("[TRACE] ModuleInstaller: %s has local path %q", key, req.SourceAddr) | ||
186 | mod, mDiags := i.installLocalModule(req, key, manifest, hooks) | ||
187 | diags = append(diags, mDiags...) | ||
188 | return mod, nil, diags | ||
189 | |||
190 | case isRegistrySourceAddr(req.SourceAddr): | ||
191 | addr, err := regsrc.ParseModuleSource(req.SourceAddr) | ||
192 | if err != nil { | ||
193 | // Should never happen because isRegistrySourceAddr already validated | ||
194 | panic(err) | ||
195 | } | ||
196 | log.Printf("[TRACE] ModuleInstaller: %s is a registry module at %s", key, addr) | ||
197 | |||
198 | mod, v, mDiags := i.installRegistryModule(req, key, instPath, addr, manifest, hooks, getter) | ||
199 | diags = append(diags, mDiags...) | ||
200 | return mod, v, diags | ||
201 | |||
202 | default: | ||
203 | log.Printf("[TRACE] ModuleInstaller: %s address %q will be handled by go-getter", key, req.SourceAddr) | ||
204 | |||
205 | mod, mDiags := i.installGoGetterModule(req, key, instPath, manifest, hooks, getter) | ||
206 | diags = append(diags, mDiags...) | ||
207 | return mod, nil, diags | ||
208 | } | ||
209 | |||
210 | }, | ||
211 | )) | ||
212 | diags = append(diags, cDiags...) | ||
213 | |||
214 | err := manifest.WriteSnapshotToDir(i.modsDir) | ||
215 | if err != nil { | ||
216 | diags = diags.Append(tfdiags.Sourceless( | ||
217 | tfdiags.Error, | ||
218 | "Failed to update module manifest", | ||
219 | fmt.Sprintf("Unable to write the module manifest file: %s", err), | ||
220 | )) | ||
221 | } | ||
222 | |||
223 | return cfg, diags | ||
224 | } | ||
225 | |||
226 | func (i *ModuleInstaller) installLocalModule(req *earlyconfig.ModuleRequest, key string, manifest modsdir.Manifest, hooks ModuleInstallHooks) (*tfconfig.Module, tfdiags.Diagnostics) { | ||
227 | var diags tfdiags.Diagnostics | ||
228 | |||
229 | parentKey := manifest.ModuleKey(req.Parent.Path) | ||
230 | parentRecord, recorded := manifest[parentKey] | ||
231 | if !recorded { | ||
232 | // This is indicative of a bug rather than a user-actionable error | ||
233 | panic(fmt.Errorf("missing manifest record for parent module %s", parentKey)) | ||
234 | } | ||
235 | |||
236 | if len(req.VersionConstraints) != 0 { | ||
237 | diags = diags.Append(tfdiags.Sourceless( | ||
238 | tfdiags.Error, | ||
239 | "Invalid version constraint", | ||
240 | fmt.Sprintf("Cannot apply a version constraint to module %q (at %s:%d) because it has a relative local path.", req.Name, req.CallPos.Filename, req.CallPos.Line), | ||
241 | )) | ||
242 | } | ||
243 | |||
244 | // For local sources we don't actually need to modify the | ||
245 | // filesystem at all because the parent already wrote | ||
246 | // the files we need, and so we just load up what's already here. | ||
247 | newDir := filepath.Join(parentRecord.Dir, req.SourceAddr) | ||
248 | |||
249 | log.Printf("[TRACE] ModuleInstaller: %s uses directory from parent: %s", key, newDir) | ||
250 | // it is possible that the local directory is a symlink | ||
251 | newDir, err := filepath.EvalSymlinks(newDir) | ||
252 | if err != nil { | ||
253 | diags = diags.Append(tfdiags.Sourceless( | ||
254 | tfdiags.Error, | ||
255 | "Unreadable module directory", | ||
256 | fmt.Sprintf("Unable to evaluate directory symlink: %s", err.Error()), | ||
257 | )) | ||
258 | } | ||
259 | |||
260 | mod, mDiags := earlyconfig.LoadModule(newDir) | ||
261 | if mod == nil { | ||
262 | // nil indicates missing or unreadable directory, so we'll | ||
263 | // discard the returned diags and return a more specific | ||
264 | // error message here. | ||
265 | diags = diags.Append(tfdiags.Sourceless( | ||
266 | tfdiags.Error, | ||
267 | "Unreadable module directory", | ||
268 | fmt.Sprintf("The directory %s could not be read for module %q at %s:%d.", newDir, req.Name, req.CallPos.Filename, req.CallPos.Line), | ||
269 | )) | ||
270 | } else { | ||
271 | diags = diags.Append(mDiags) | ||
272 | } | ||
273 | |||
274 | // Note the local location in our manifest. | ||
275 | manifest[key] = modsdir.Record{ | ||
276 | Key: key, | ||
277 | Dir: newDir, | ||
278 | SourceAddr: req.SourceAddr, | ||
279 | } | ||
280 | log.Printf("[DEBUG] Module installer: %s installed at %s", key, newDir) | ||
281 | hooks.Install(key, nil, newDir) | ||
282 | |||
283 | return mod, diags | ||
284 | } | ||
285 | |||
286 | func (i *ModuleInstaller) installRegistryModule(req *earlyconfig.ModuleRequest, key string, instPath string, addr *regsrc.Module, manifest modsdir.Manifest, hooks ModuleInstallHooks, getter reusingGetter) (*tfconfig.Module, *version.Version, tfdiags.Diagnostics) { | ||
287 | var diags tfdiags.Diagnostics | ||
288 | |||
289 | hostname, err := addr.SvcHost() | ||
290 | if err != nil { | ||
291 | // If it looks like the user was trying to use punycode then we'll generate | ||
292 | // a specialized error for that case. We require the unicode form of | ||
293 | // hostname so that hostnames are always human-readable in configuration | ||
294 | // and punycode can't be used to hide a malicious module hostname. | ||
295 | if strings.HasPrefix(addr.RawHost.Raw, "xn--") { | ||
296 | diags = diags.Append(tfdiags.Sourceless( | ||
297 | tfdiags.Error, | ||
298 | "Invalid module registry hostname", | ||
299 | fmt.Sprintf("The hostname portion of the module %q source address (at %s:%d) is not an acceptable hostname. Internationalized domain names must be given in unicode form rather than ASCII (\"punycode\") form.", req.Name, req.CallPos.Filename, req.CallPos.Line), | ||
300 | )) | ||
301 | } else { | ||
302 | diags = diags.Append(tfdiags.Sourceless( | ||
303 | tfdiags.Error, | ||
304 | "Invalid module registry hostname", | ||
305 | fmt.Sprintf("The hostname portion of the module %q source address (at %s:%d) is not a valid hostname.", req.Name, req.CallPos.Filename, req.CallPos.Line), | ||
306 | )) | ||
307 | } | ||
308 | return nil, nil, diags | ||
309 | } | ||
310 | |||
311 | reg := i.reg | ||
312 | |||
313 | log.Printf("[DEBUG] %s listing available versions of %s at %s", key, addr, hostname) | ||
314 | resp, err := reg.ModuleVersions(addr) | ||
315 | if err != nil { | ||
316 | if registry.IsModuleNotFound(err) { | ||
317 | diags = diags.Append(tfdiags.Sourceless( | ||
318 | tfdiags.Error, | ||
319 | "Module not found", | ||
320 | fmt.Sprintf("Module %q (from %s:%d) cannot be found in the module registry at %s.", req.Name, req.CallPos.Filename, req.CallPos.Line, hostname), | ||
321 | )) | ||
322 | } else { | ||
323 | diags = diags.Append(tfdiags.Sourceless( | ||
324 | tfdiags.Error, | ||
325 | "Error accessing remote module registry", | ||
326 | fmt.Sprintf("Failed to retrieve available versions for module %q (%s:%d) from %s: %s.", req.Name, req.CallPos.Filename, req.CallPos.Line, hostname, err), | ||
327 | )) | ||
328 | } | ||
329 | return nil, nil, diags | ||
330 | } | ||
331 | |||
332 | // The response might contain information about dependencies to allow us | ||
333 | // to potentially optimize future requests, but we don't currently do that | ||
334 | // and so for now we'll just take the first item which is guaranteed to | ||
335 | // be the address we requested. | ||
336 | if len(resp.Modules) < 1 { | ||
337 | // Should never happen, but since this is a remote service that may | ||
338 | // be implemented by third-parties we will handle it gracefully. | ||
339 | diags = diags.Append(tfdiags.Sourceless( | ||
340 | tfdiags.Error, | ||
341 | "Invalid response from remote module registry", | ||
342 | fmt.Sprintf("The registry at %s returned an invalid response when Terraform requested available versions for module %q (%s:%d).", hostname, req.Name, req.CallPos.Filename, req.CallPos.Line), | ||
343 | )) | ||
344 | return nil, nil, diags | ||
345 | } | ||
346 | |||
347 | modMeta := resp.Modules[0] | ||
348 | |||
349 | var latestMatch *version.Version | ||
350 | var latestVersion *version.Version | ||
351 | for _, mv := range modMeta.Versions { | ||
352 | v, err := version.NewVersion(mv.Version) | ||
353 | if err != nil { | ||
354 | // Should never happen if the registry server is compliant with | ||
355 | // the protocol, but we'll warn if not to assist someone who | ||
356 | // might be developing a module registry server. | ||
357 | diags = diags.Append(tfdiags.Sourceless( | ||
358 | tfdiags.Warning, | ||
359 | "Invalid response from remote module registry", | ||
360 | fmt.Sprintf("The registry at %s returned an invalid version string %q for module %q (%s:%d), which Terraform ignored.", hostname, mv.Version, req.Name, req.CallPos.Filename, req.CallPos.Line), | ||
361 | )) | ||
362 | continue | ||
363 | } | ||
364 | |||
365 | // If we've found a pre-release version then we'll ignore it unless | ||
366 | // it was exactly requested. | ||
367 | if v.Prerelease() != "" && req.VersionConstraints.String() != v.String() { | ||
368 | log.Printf("[TRACE] ModuleInstaller: %s ignoring %s because it is a pre-release and was not requested exactly", key, v) | ||
369 | continue | ||
370 | } | ||
371 | |||
372 | if latestVersion == nil || v.GreaterThan(latestVersion) { | ||
373 | latestVersion = v | ||
374 | } | ||
375 | |||
376 | if req.VersionConstraints.Check(v) { | ||
377 | if latestMatch == nil || v.GreaterThan(latestMatch) { | ||
378 | latestMatch = v | ||
379 | } | ||
380 | } | ||
381 | } | ||
382 | |||
383 | if latestVersion == nil { | ||
384 | diags = diags.Append(tfdiags.Sourceless( | ||
385 | tfdiags.Error, | ||
386 | "Module has no versions", | ||
387 | fmt.Sprintf("Module %q (%s:%d) has no versions available on %s.", addr, req.CallPos.Filename, req.CallPos.Line, hostname), | ||
388 | )) | ||
389 | return nil, nil, diags | ||
390 | } | ||
391 | |||
392 | if latestMatch == nil { | ||
393 | diags = diags.Append(tfdiags.Sourceless( | ||
394 | tfdiags.Error, | ||
395 | "Unresolvable module version constraint", | ||
396 | fmt.Sprintf("There is no available version of module %q (%s:%d) which matches the given version constraint. The newest available version is %s.", addr, req.CallPos.Filename, req.CallPos.Line, latestVersion), | ||
397 | )) | ||
398 | return nil, nil, diags | ||
399 | } | ||
400 | |||
401 | // Report up to the caller that we're about to start downloading. | ||
402 | packageAddr, _ := splitAddrSubdir(req.SourceAddr) | ||
403 | hooks.Download(key, packageAddr, latestMatch) | ||
404 | |||
405 | // If we manage to get down here then we've found a suitable version to | ||
406 | // install, so we need to ask the registry where we should download it from. | ||
407 | // The response to this is a go-getter-style address string. | ||
408 | dlAddr, err := reg.ModuleLocation(addr, latestMatch.String()) | ||
409 | if err != nil { | ||
410 | log.Printf("[ERROR] %s from %s %s: %s", key, addr, latestMatch, err) | ||
411 | diags = diags.Append(tfdiags.Sourceless( | ||
412 | tfdiags.Error, | ||
413 | "Invalid response from remote module registry", | ||
414 | fmt.Sprintf("The remote registry at %s failed to return a download URL for %s %s.", hostname, addr, latestMatch), | ||
415 | )) | ||
416 | return nil, nil, diags | ||
417 | } | ||
418 | |||
419 | log.Printf("[TRACE] ModuleInstaller: %s %s %s is available at %q", key, addr, latestMatch, dlAddr) | ||
420 | |||
421 | modDir, err := getter.getWithGoGetter(instPath, dlAddr) | ||
422 | if err != nil { | ||
423 | // Errors returned by go-getter have very inconsistent quality as | ||
424 | // end-user error messages, but for now we're accepting that because | ||
425 | // we have no way to recognize any specific errors to improve them | ||
426 | // and masking the error entirely would hide valuable diagnostic | ||
427 | // information from the user. | ||
428 | diags = diags.Append(tfdiags.Sourceless( | ||
429 | tfdiags.Error, | ||
430 | "Failed to download module", | ||
431 | fmt.Sprintf("Could not download module %q (%s:%d) source code from %q: %s.", req.Name, req.CallPos.Filename, req.CallPos.Line, dlAddr, err), | ||
432 | )) | ||
433 | return nil, nil, diags | ||
434 | } | ||
435 | |||
436 | log.Printf("[TRACE] ModuleInstaller: %s %q was downloaded to %s", key, dlAddr, modDir) | ||
437 | |||
438 | if addr.RawSubmodule != "" { | ||
439 | // Append the user's requested subdirectory to any subdirectory that | ||
440 | // was implied by any of the nested layers we expanded within go-getter. | ||
441 | modDir = filepath.Join(modDir, addr.RawSubmodule) | ||
442 | } | ||
443 | |||
444 | log.Printf("[TRACE] ModuleInstaller: %s should now be at %s", key, modDir) | ||
445 | |||
446 | // Finally we are ready to try actually loading the module. | ||
447 | mod, mDiags := earlyconfig.LoadModule(modDir) | ||
448 | if mod == nil { | ||
449 | // nil indicates missing or unreadable directory, so we'll | ||
450 | // discard the returned diags and return a more specific | ||
451 | // error message here. For registry modules this actually | ||
452 | // indicates a bug in the code above, since it's not the | ||
453 | // user's responsibility to create the directory in this case. | ||
454 | diags = diags.Append(tfdiags.Sourceless( | ||
455 | tfdiags.Error, | ||
456 | "Unreadable module directory", | ||
457 | fmt.Sprintf("The directory %s could not be read. This is a bug in Terraform and should be reported.", modDir), | ||
458 | )) | ||
459 | } else { | ||
460 | diags = append(diags, mDiags...) | ||
461 | } | ||
462 | |||
463 | // Note the local location in our manifest. | ||
464 | manifest[key] = modsdir.Record{ | ||
465 | Key: key, | ||
466 | Version: latestMatch, | ||
467 | Dir: modDir, | ||
468 | SourceAddr: req.SourceAddr, | ||
469 | } | ||
470 | log.Printf("[DEBUG] Module installer: %s installed at %s", key, modDir) | ||
471 | hooks.Install(key, latestMatch, modDir) | ||
472 | |||
473 | return mod, latestMatch, diags | ||
474 | } | ||
475 | |||
476 | func (i *ModuleInstaller) installGoGetterModule(req *earlyconfig.ModuleRequest, key string, instPath string, manifest modsdir.Manifest, hooks ModuleInstallHooks, getter reusingGetter) (*tfconfig.Module, tfdiags.Diagnostics) { | ||
477 | var diags tfdiags.Diagnostics | ||
478 | |||
479 | // Report up to the caller that we're about to start downloading. | ||
480 | packageAddr, _ := splitAddrSubdir(req.SourceAddr) | ||
481 | hooks.Download(key, packageAddr, nil) | ||
482 | |||
483 | if len(req.VersionConstraints) != 0 { | ||
484 | diags = diags.Append(tfdiags.Sourceless( | ||
485 | tfdiags.Error, | ||
486 | "Invalid version constraint", | ||
487 | fmt.Sprintf("Cannot apply a version constraint to module %q (at %s:%d) because it has a non Registry URL.", req.Name, req.CallPos.Filename, req.CallPos.Line), | ||
488 | )) | ||
489 | return nil, diags | ||
490 | } | ||
491 | |||
492 | modDir, err := getter.getWithGoGetter(instPath, req.SourceAddr) | ||
493 | if err != nil { | ||
494 | if _, ok := err.(*MaybeRelativePathErr); ok { | ||
495 | log.Printf( | ||
496 | "[TRACE] ModuleInstaller: %s looks like a local path but is missing ./ or ../", | ||
497 | req.SourceAddr, | ||
498 | ) | ||
499 | diags = diags.Append(tfdiags.Sourceless( | ||
500 | tfdiags.Error, | ||
501 | "Module not found", | ||
502 | fmt.Sprintf( | ||
503 | "The module address %q could not be resolved.\n\n"+ | ||
504 | "If you intended this as a path relative to the current "+ | ||
505 | "module, use \"./%s\" instead. The \"./\" prefix "+ | ||
506 | "indicates that the address is a relative filesystem path.", | ||
507 | req.SourceAddr, req.SourceAddr, | ||
508 | ), | ||
509 | )) | ||
510 | } else { | ||
511 | // Errors returned by go-getter have very inconsistent quality as | ||
512 | // end-user error messages, but for now we're accepting that because | ||
513 | // we have no way to recognize any specific errors to improve them | ||
514 | // and masking the error entirely would hide valuable diagnostic | ||
515 | // information from the user. | ||
516 | diags = diags.Append(tfdiags.Sourceless( | ||
517 | tfdiags.Error, | ||
518 | "Failed to download module", | ||
519 | fmt.Sprintf("Could not download module %q (%s:%d) source code from %q: %s", req.Name, req.CallPos.Filename, req.CallPos.Line, packageAddr, err), | ||
520 | )) | ||
521 | } | ||
522 | return nil, diags | ||
523 | |||
524 | } | ||
525 | |||
526 | log.Printf("[TRACE] ModuleInstaller: %s %q was downloaded to %s", key, req.SourceAddr, modDir) | ||
527 | |||
528 | mod, mDiags := earlyconfig.LoadModule(modDir) | ||
529 | if mod == nil { | ||
530 | // nil indicates missing or unreadable directory, so we'll | ||
531 | // discard the returned diags and return a more specific | ||
532 | // error message here. For go-getter modules this actually | ||
533 | // indicates a bug in the code above, since it's not the | ||
534 | // user's responsibility to create the directory in this case. | ||
535 | diags = diags.Append(tfdiags.Sourceless( | ||
536 | tfdiags.Error, | ||
537 | "Unreadable module directory", | ||
538 | fmt.Sprintf("The directory %s could not be read. This is a bug in Terraform and should be reported.", modDir), | ||
539 | )) | ||
540 | } else { | ||
541 | diags = append(diags, mDiags...) | ||
542 | } | ||
543 | |||
544 | // Note the local location in our manifest. | ||
545 | manifest[key] = modsdir.Record{ | ||
546 | Key: key, | ||
547 | Dir: modDir, | ||
548 | SourceAddr: req.SourceAddr, | ||
549 | } | ||
550 | log.Printf("[DEBUG] Module installer: %s installed at %s", key, modDir) | ||
551 | hooks.Install(key, nil, modDir) | ||
552 | |||
553 | return mod, diags | ||
554 | } | ||
555 | |||
556 | func (i *ModuleInstaller) packageInstallPath(modulePath addrs.Module) string { | ||
557 | return filepath.Join(i.modsDir, strings.Join(modulePath, ".")) | ||
558 | } | ||
diff --git a/vendor/github.com/hashicorp/terraform/internal/initwd/module_install_hooks.go b/vendor/github.com/hashicorp/terraform/internal/initwd/module_install_hooks.go new file mode 100644 index 0000000..817a6dc --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/internal/initwd/module_install_hooks.go | |||
@@ -0,0 +1,36 @@ | |||
1 | package initwd | ||
2 | |||
3 | import ( | ||
4 | version "github.com/hashicorp/go-version" | ||
5 | ) | ||
6 | |||
7 | // ModuleInstallHooks is an interface used to provide notifications about the | ||
8 | // installation process being orchestrated by InstallModules. | ||
9 | // | ||
10 | // This interface may have new methods added in future, so implementers should | ||
11 | // embed InstallHooksImpl to get no-op implementations of any unimplemented | ||
12 | // methods. | ||
13 | type ModuleInstallHooks interface { | ||
14 | // Download is called for modules that are retrieved from a remote source | ||
15 | // before that download begins, to allow a caller to give feedback | ||
16 | // on progress through a possibly-long sequence of downloads. | ||
17 | Download(moduleAddr, packageAddr string, version *version.Version) | ||
18 | |||
19 | // Install is called for each module that is installed, even if it did | ||
20 | // not need to be downloaded from a remote source. | ||
21 | Install(moduleAddr string, version *version.Version, localPath string) | ||
22 | } | ||
23 | |||
24 | // ModuleInstallHooksImpl is a do-nothing implementation of InstallHooks that | ||
25 | // can be embedded in another implementation struct to allow only partial | ||
26 | // implementation of the interface. | ||
27 | type ModuleInstallHooksImpl struct { | ||
28 | } | ||
29 | |||
30 | func (h ModuleInstallHooksImpl) Download(moduleAddr, packageAddr string, version *version.Version) { | ||
31 | } | ||
32 | |||
33 | func (h ModuleInstallHooksImpl) Install(moduleAddr string, version *version.Version, localPath string) { | ||
34 | } | ||
35 | |||
36 | var _ ModuleInstallHooks = ModuleInstallHooksImpl{} | ||
diff --git a/vendor/github.com/hashicorp/terraform/internal/initwd/testing.go b/vendor/github.com/hashicorp/terraform/internal/initwd/testing.go new file mode 100644 index 0000000..8cef80a --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/internal/initwd/testing.go | |||
@@ -0,0 +1,73 @@ | |||
1 | package initwd | ||
2 | |||
3 | import ( | ||
4 | "github.com/hashicorp/terraform/registry" | ||
5 | "testing" | ||
6 | |||
7 | "github.com/hashicorp/terraform/configs" | ||
8 | "github.com/hashicorp/terraform/configs/configload" | ||
9 | "github.com/hashicorp/terraform/tfdiags" | ||
10 | ) | ||
11 | |||
12 | // LoadConfigForTests is a convenience wrapper around configload.NewLoaderForTests, | ||
13 | // ModuleInstaller.InstallModules and configload.Loader.LoadConfig that allows | ||
14 | // a test configuration to be loaded in a single step. | ||
15 | // | ||
16 | // If module installation fails, t.Fatal (or similar) is called to halt | ||
17 | // execution of the test, under the assumption that installation failures are | ||
18 | // not expected. If installation failures _are_ expected then use | ||
19 | // NewLoaderForTests and work with the loader object directly. If module | ||
20 | // installation succeeds but generates warnings, these warnings are discarded. | ||
21 | // | ||
22 | // If installation succeeds but errors are detected during loading then a | ||
23 | // possibly-incomplete config is returned along with error diagnostics. The | ||
24 | // test run is not aborted in this case, so that the caller can make assertions | ||
25 | // against the returned diagnostics. | ||
26 | // | ||
27 | // As with NewLoaderForTests, a cleanup function is returned which must be | ||
28 | // called before the test completes in order to remove the temporary | ||
29 | // modules directory. | ||
30 | func LoadConfigForTests(t *testing.T, rootDir string) (*configs.Config, *configload.Loader, func(), tfdiags.Diagnostics) { | ||
31 | t.Helper() | ||
32 | |||
33 | var diags tfdiags.Diagnostics | ||
34 | |||
35 | loader, cleanup := configload.NewLoaderForTests(t) | ||
36 | inst := NewModuleInstaller(loader.ModulesDir(), registry.NewClient(nil, nil)) | ||
37 | |||
38 | _, moreDiags := inst.InstallModules(rootDir, true, ModuleInstallHooksImpl{}) | ||
39 | diags = diags.Append(moreDiags) | ||
40 | if diags.HasErrors() { | ||
41 | cleanup() | ||
42 | t.Fatal(diags.Err()) | ||
43 | return nil, nil, func() {}, diags | ||
44 | } | ||
45 | |||
46 | // Since module installer has modified the module manifest on disk, we need | ||
47 | // to refresh the cache of it in the loader. | ||
48 | if err := loader.RefreshModules(); err != nil { | ||
49 | t.Fatalf("failed to refresh modules after installation: %s", err) | ||
50 | } | ||
51 | |||
52 | config, hclDiags := loader.LoadConfig(rootDir) | ||
53 | diags = diags.Append(hclDiags) | ||
54 | return config, loader, cleanup, diags | ||
55 | } | ||
56 | |||
57 | // MustLoadConfigForTests is a variant of LoadConfigForTests which calls | ||
58 | // t.Fatal (or similar) if there are any errors during loading, and thus | ||
59 | // does not return diagnostics at all. | ||
60 | // | ||
61 | // This is useful for concisely writing tests that don't expect errors at | ||
62 | // all. For tests that expect errors and need to assert against them, use | ||
63 | // LoadConfigForTests instead. | ||
64 | func MustLoadConfigForTests(t *testing.T, rootDir string) (*configs.Config, *configload.Loader, func()) { | ||
65 | t.Helper() | ||
66 | |||
67 | config, loader, cleanup, diags := LoadConfigForTests(t, rootDir) | ||
68 | if diags.HasErrors() { | ||
69 | cleanup() | ||
70 | t.Fatal(diags.Err()) | ||
71 | } | ||
72 | return config, loader, cleanup | ||
73 | } | ||
diff --git a/vendor/github.com/hashicorp/terraform/internal/initwd/version_required.go b/vendor/github.com/hashicorp/terraform/internal/initwd/version_required.go new file mode 100644 index 0000000..104840b --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/internal/initwd/version_required.go | |||
@@ -0,0 +1,83 @@ | |||
1 | package initwd | ||
2 | |||
3 | import ( | ||
4 | "fmt" | ||
5 | |||
6 | version "github.com/hashicorp/go-version" | ||
7 | "github.com/hashicorp/terraform/internal/earlyconfig" | ||
8 | "github.com/hashicorp/terraform/tfdiags" | ||
9 | tfversion "github.com/hashicorp/terraform/version" | ||
10 | ) | ||
11 | |||
12 | // CheckCoreVersionRequirements visits each of the modules in the given | ||
13 | // early configuration tree and verifies that any given Core version constraints | ||
14 | // match with the version of Terraform Core that is being used. | ||
15 | // | ||
16 | // The returned diagnostics will contain errors if any constraints do not match. | ||
17 | // The returned diagnostics might also return warnings, which should be | ||
18 | // displayed to the user. | ||
19 | func CheckCoreVersionRequirements(earlyConfig *earlyconfig.Config) tfdiags.Diagnostics { | ||
20 | if earlyConfig == nil { | ||
21 | return nil | ||
22 | } | ||
23 | |||
24 | var diags tfdiags.Diagnostics | ||
25 | module := earlyConfig.Module | ||
26 | |||
27 | var constraints version.Constraints | ||
28 | for _, constraintStr := range module.RequiredCore { | ||
29 | constraint, err := version.NewConstraint(constraintStr) | ||
30 | if err != nil { | ||
31 | // Unfortunately the early config parser doesn't preserve a source | ||
32 | // location for this, so we're unable to indicate a specific | ||
33 | // location where this constraint came from, but we can at least | ||
34 | // say which module set it. | ||
35 | switch { | ||
36 | case len(earlyConfig.Path) == 0: | ||
37 | diags = diags.Append(tfdiags.Sourceless( | ||
38 | tfdiags.Error, | ||
39 | "Invalid provider version constraint", | ||
40 | fmt.Sprintf("Invalid version core constraint %q in the root module.", constraintStr), | ||
41 | )) | ||
42 | default: | ||
43 | diags = diags.Append(tfdiags.Sourceless( | ||
44 | tfdiags.Error, | ||
45 | "Invalid provider version constraint", | ||
46 | fmt.Sprintf("Invalid version core constraint %q in %s.", constraintStr, earlyConfig.Path), | ||
47 | )) | ||
48 | } | ||
49 | continue | ||
50 | } | ||
51 | constraints = append(constraints, constraint...) | ||
52 | } | ||
53 | |||
54 | if !constraints.Check(tfversion.SemVer) { | ||
55 | switch { | ||
56 | case len(earlyConfig.Path) == 0: | ||
57 | diags = diags.Append(tfdiags.Sourceless( | ||
58 | tfdiags.Error, | ||
59 | "Unsupported Terraform Core version", | ||
60 | fmt.Sprintf( | ||
61 | "This configuration does not support Terraform version %s. To proceed, either choose another supported Terraform version or update the root module's version constraint. Version constraints are normally set for good reason, so updating the constraint may lead to other errors or unexpected behavior.", | ||
62 | tfversion.String(), | ||
63 | ), | ||
64 | )) | ||
65 | default: | ||
66 | diags = diags.Append(tfdiags.Sourceless( | ||
67 | tfdiags.Error, | ||
68 | "Unsupported Terraform Core version", | ||
69 | fmt.Sprintf( | ||
70 | "Module %s (from %q) does not support Terraform version %s. To proceed, either choose another supported Terraform version or update the module's version constraint. Version constraints are normally set for good reason, so updating the constraint may lead to other errors or unexpected behavior.", | ||
71 | earlyConfig.Path, earlyConfig.SourceAddr, tfversion.String(), | ||
72 | ), | ||
73 | )) | ||
74 | } | ||
75 | } | ||
76 | |||
77 | for _, c := range earlyConfig.Children { | ||
78 | childDiags := CheckCoreVersionRequirements(c) | ||
79 | diags = diags.Append(childDiags) | ||
80 | } | ||
81 | |||
82 | return diags | ||
83 | } | ||
diff --git a/vendor/github.com/hashicorp/terraform/internal/modsdir/doc.go b/vendor/github.com/hashicorp/terraform/internal/modsdir/doc.go new file mode 100644 index 0000000..0d7d664 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/internal/modsdir/doc.go | |||
@@ -0,0 +1,3 @@ | |||
1 | // Package modsdir is an internal package containing the model types used to | ||
2 | // represent the manifest of modules in a local modules cache directory. | ||
3 | package modsdir | ||
diff --git a/vendor/github.com/hashicorp/terraform/internal/modsdir/manifest.go b/vendor/github.com/hashicorp/terraform/internal/modsdir/manifest.go new file mode 100644 index 0000000..36f6c03 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/internal/modsdir/manifest.go | |||
@@ -0,0 +1,138 @@ | |||
1 | package modsdir | ||
2 | |||
3 | import ( | ||
4 | "encoding/json" | ||
5 | "fmt" | ||
6 | "io" | ||
7 | "io/ioutil" | ||
8 | "log" | ||
9 | "os" | ||
10 | "path/filepath" | ||
11 | |||
12 | version "github.com/hashicorp/go-version" | ||
13 | |||
14 | "github.com/hashicorp/terraform/addrs" | ||
15 | ) | ||
16 | |||
17 | // Record represents some metadata about an installed module, as part | ||
18 | // of a ModuleManifest. | ||
19 | type Record struct { | ||
20 | // Key is a unique identifier for this particular module, based on its | ||
21 | // position within the static module tree. | ||
22 | Key string `json:"Key"` | ||
23 | |||
24 | // SourceAddr is the source address given for this module in configuration. | ||
25 | // This is used only to detect if the source was changed in configuration | ||
26 | // since the module was last installed, which means that the installer | ||
27 | // must re-install it. | ||
28 | SourceAddr string `json:"Source"` | ||
29 | |||
30 | // Version is the exact version of the module, which results from parsing | ||
31 | // VersionStr. nil for un-versioned modules. | ||
32 | Version *version.Version `json:"-"` | ||
33 | |||
34 | // VersionStr is the version specifier string. This is used only for | ||
35 | // serialization in snapshots and should not be accessed or updated | ||
36 | // by any other codepaths; use "Version" instead. | ||
37 | VersionStr string `json:"Version,omitempty"` | ||
38 | |||
39 | // Dir is the path to the local directory where the module is installed. | ||
40 | Dir string `json:"Dir"` | ||
41 | } | ||
42 | |||
43 | // Manifest is a map used to keep track of the filesystem locations | ||
44 | // and other metadata about installed modules. | ||
45 | // | ||
46 | // The configuration loader refers to this, while the module installer updates | ||
47 | // it to reflect any changes to the installed modules. | ||
48 | type Manifest map[string]Record | ||
49 | |||
50 | func (m Manifest) ModuleKey(path addrs.Module) string { | ||
51 | return path.String() | ||
52 | } | ||
53 | |||
54 | // manifestSnapshotFile is an internal struct used only to assist in our JSON | ||
55 | // serialization of manifest snapshots. It should not be used for any other | ||
56 | // purpose. | ||
57 | type manifestSnapshotFile struct { | ||
58 | Records []Record `json:"Modules"` | ||
59 | } | ||
60 | |||
61 | func ReadManifestSnapshot(r io.Reader) (Manifest, error) { | ||
62 | src, err := ioutil.ReadAll(r) | ||
63 | if err != nil { | ||
64 | return nil, err | ||
65 | } | ||
66 | |||
67 | if len(src) == 0 { | ||
68 | // This should never happen, but we'll tolerate it as if it were | ||
69 | // a valid empty JSON object. | ||
70 | return make(Manifest), nil | ||
71 | } | ||
72 | |||
73 | var read manifestSnapshotFile | ||
74 | err = json.Unmarshal(src, &read) | ||
75 | |||
76 | new := make(Manifest) | ||
77 | for _, record := range read.Records { | ||
78 | if record.VersionStr != "" { | ||
79 | record.Version, err = version.NewVersion(record.VersionStr) | ||
80 | if err != nil { | ||
81 | return nil, fmt.Errorf("invalid version %q for %s: %s", record.VersionStr, record.Key, err) | ||
82 | } | ||
83 | } | ||
84 | if _, exists := new[record.Key]; exists { | ||
85 | // This should never happen in any valid file, so we'll catch it | ||
86 | // and report it to avoid confusing/undefined behavior if the | ||
87 | // snapshot file was edited incorrectly outside of Terraform. | ||
88 | return nil, fmt.Errorf("snapshot file contains two records for path %s", record.Key) | ||
89 | } | ||
90 | new[record.Key] = record | ||
91 | } | ||
92 | return new, nil | ||
93 | } | ||
94 | |||
95 | func ReadManifestSnapshotForDir(dir string) (Manifest, error) { | ||
96 | fn := filepath.Join(dir, ManifestSnapshotFilename) | ||
97 | r, err := os.Open(fn) | ||
98 | if err != nil { | ||
99 | if os.IsNotExist(err) { | ||
100 | return make(Manifest), nil // missing file is okay and treated as empty | ||
101 | } | ||
102 | return nil, err | ||
103 | } | ||
104 | return ReadManifestSnapshot(r) | ||
105 | } | ||
106 | |||
107 | func (m Manifest) WriteSnapshot(w io.Writer) error { | ||
108 | var write manifestSnapshotFile | ||
109 | |||
110 | for _, record := range m { | ||
111 | // Make sure VersionStr is in sync with Version, since we encourage | ||
112 | // callers to manipulate Version and ignore VersionStr. | ||
113 | if record.Version != nil { | ||
114 | record.VersionStr = record.Version.String() | ||
115 | } else { | ||
116 | record.VersionStr = "" | ||
117 | } | ||
118 | write.Records = append(write.Records, record) | ||
119 | } | ||
120 | |||
121 | src, err := json.Marshal(write) | ||
122 | if err != nil { | ||
123 | return err | ||
124 | } | ||
125 | |||
126 | _, err = w.Write(src) | ||
127 | return err | ||
128 | } | ||
129 | |||
130 | func (m Manifest) WriteSnapshotToDir(dir string) error { | ||
131 | fn := filepath.Join(dir, ManifestSnapshotFilename) | ||
132 | log.Printf("[TRACE] modsdir: writing modules manifest to %s", fn) | ||
133 | w, err := os.Create(fn) | ||
134 | if err != nil { | ||
135 | return err | ||
136 | } | ||
137 | return m.WriteSnapshot(w) | ||
138 | } | ||
diff --git a/vendor/github.com/hashicorp/terraform/internal/modsdir/paths.go b/vendor/github.com/hashicorp/terraform/internal/modsdir/paths.go new file mode 100644 index 0000000..9ebb524 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/internal/modsdir/paths.go | |||
@@ -0,0 +1,3 @@ | |||
1 | package modsdir | ||
2 | |||
3 | const ManifestSnapshotFilename = "modules.json" | ||
diff --git a/vendor/github.com/hashicorp/terraform/internal/tfplugin5/generate.sh b/vendor/github.com/hashicorp/terraform/internal/tfplugin5/generate.sh new file mode 100644 index 0000000..de1d693 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/internal/tfplugin5/generate.sh | |||
@@ -0,0 +1,16 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | # We do not run protoc under go:generate because we want to ensure that all | ||
4 | # dependencies of go:generate are "go get"-able for general dev environment | ||
5 | # usability. To compile all protobuf files in this repository, run | ||
6 | # "make protobuf" at the top-level. | ||
7 | |||
8 | set -eu | ||
9 | |||
10 | SOURCE="${BASH_SOURCE[0]}" | ||
11 | while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done | ||
12 | DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" | ||
13 | |||
14 | cd "$DIR" | ||
15 | |||
16 | protoc -I ./ tfplugin5.proto --go_out=plugins=grpc:./ | ||
diff --git a/vendor/github.com/hashicorp/terraform/internal/tfplugin5/tfplugin5.pb.go b/vendor/github.com/hashicorp/terraform/internal/tfplugin5/tfplugin5.pb.go new file mode 100644 index 0000000..87a6bec --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/internal/tfplugin5/tfplugin5.pb.go | |||
@@ -0,0 +1,3455 @@ | |||
1 | // Code generated by protoc-gen-go. DO NOT EDIT. | ||
2 | // source: tfplugin5.proto | ||
3 | |||
4 | package tfplugin5 | ||
5 | |||
6 | import proto "github.com/golang/protobuf/proto" | ||
7 | import fmt "fmt" | ||
8 | import math "math" | ||
9 | |||
10 | import ( | ||
11 | context "golang.org/x/net/context" | ||
12 | grpc "google.golang.org/grpc" | ||
13 | ) | ||
14 | |||
15 | // Reference imports to suppress errors if they are not otherwise used. | ||
16 | var _ = proto.Marshal | ||
17 | var _ = fmt.Errorf | ||
18 | var _ = math.Inf | ||
19 | |||
20 | // This is a compile-time assertion to ensure that this generated file | ||
21 | // is compatible with the proto package it is being compiled against. | ||
22 | // A compilation error at this line likely means your copy of the | ||
23 | // proto package needs to be updated. | ||
24 | const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package | ||
25 | |||
26 | type Diagnostic_Severity int32 | ||
27 | |||
28 | const ( | ||
29 | Diagnostic_INVALID Diagnostic_Severity = 0 | ||
30 | Diagnostic_ERROR Diagnostic_Severity = 1 | ||
31 | Diagnostic_WARNING Diagnostic_Severity = 2 | ||
32 | ) | ||
33 | |||
34 | var Diagnostic_Severity_name = map[int32]string{ | ||
35 | 0: "INVALID", | ||
36 | 1: "ERROR", | ||
37 | 2: "WARNING", | ||
38 | } | ||
39 | var Diagnostic_Severity_value = map[string]int32{ | ||
40 | "INVALID": 0, | ||
41 | "ERROR": 1, | ||
42 | "WARNING": 2, | ||
43 | } | ||
44 | |||
45 | func (x Diagnostic_Severity) String() string { | ||
46 | return proto.EnumName(Diagnostic_Severity_name, int32(x)) | ||
47 | } | ||
48 | func (Diagnostic_Severity) EnumDescriptor() ([]byte, []int) { | ||
49 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{1, 0} | ||
50 | } | ||
51 | |||
52 | type Schema_NestedBlock_NestingMode int32 | ||
53 | |||
54 | const ( | ||
55 | Schema_NestedBlock_INVALID Schema_NestedBlock_NestingMode = 0 | ||
56 | Schema_NestedBlock_SINGLE Schema_NestedBlock_NestingMode = 1 | ||
57 | Schema_NestedBlock_LIST Schema_NestedBlock_NestingMode = 2 | ||
58 | Schema_NestedBlock_SET Schema_NestedBlock_NestingMode = 3 | ||
59 | Schema_NestedBlock_MAP Schema_NestedBlock_NestingMode = 4 | ||
60 | Schema_NestedBlock_GROUP Schema_NestedBlock_NestingMode = 5 | ||
61 | ) | ||
62 | |||
63 | var Schema_NestedBlock_NestingMode_name = map[int32]string{ | ||
64 | 0: "INVALID", | ||
65 | 1: "SINGLE", | ||
66 | 2: "LIST", | ||
67 | 3: "SET", | ||
68 | 4: "MAP", | ||
69 | 5: "GROUP", | ||
70 | } | ||
71 | var Schema_NestedBlock_NestingMode_value = map[string]int32{ | ||
72 | "INVALID": 0, | ||
73 | "SINGLE": 1, | ||
74 | "LIST": 2, | ||
75 | "SET": 3, | ||
76 | "MAP": 4, | ||
77 | "GROUP": 5, | ||
78 | } | ||
79 | |||
80 | func (x Schema_NestedBlock_NestingMode) String() string { | ||
81 | return proto.EnumName(Schema_NestedBlock_NestingMode_name, int32(x)) | ||
82 | } | ||
83 | func (Schema_NestedBlock_NestingMode) EnumDescriptor() ([]byte, []int) { | ||
84 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{5, 2, 0} | ||
85 | } | ||
86 | |||
87 | // DynamicValue is an opaque encoding of terraform data, with the field name | ||
88 | // indicating the encoding scheme used. | ||
89 | type DynamicValue struct { | ||
90 | Msgpack []byte `protobuf:"bytes,1,opt,name=msgpack,proto3" json:"msgpack,omitempty"` | ||
91 | Json []byte `protobuf:"bytes,2,opt,name=json,proto3" json:"json,omitempty"` | ||
92 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
93 | XXX_unrecognized []byte `json:"-"` | ||
94 | XXX_sizecache int32 `json:"-"` | ||
95 | } | ||
96 | |||
97 | func (m *DynamicValue) Reset() { *m = DynamicValue{} } | ||
98 | func (m *DynamicValue) String() string { return proto.CompactTextString(m) } | ||
99 | func (*DynamicValue) ProtoMessage() {} | ||
100 | func (*DynamicValue) Descriptor() ([]byte, []int) { | ||
101 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{0} | ||
102 | } | ||
103 | func (m *DynamicValue) XXX_Unmarshal(b []byte) error { | ||
104 | return xxx_messageInfo_DynamicValue.Unmarshal(m, b) | ||
105 | } | ||
106 | func (m *DynamicValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
107 | return xxx_messageInfo_DynamicValue.Marshal(b, m, deterministic) | ||
108 | } | ||
109 | func (dst *DynamicValue) XXX_Merge(src proto.Message) { | ||
110 | xxx_messageInfo_DynamicValue.Merge(dst, src) | ||
111 | } | ||
112 | func (m *DynamicValue) XXX_Size() int { | ||
113 | return xxx_messageInfo_DynamicValue.Size(m) | ||
114 | } | ||
115 | func (m *DynamicValue) XXX_DiscardUnknown() { | ||
116 | xxx_messageInfo_DynamicValue.DiscardUnknown(m) | ||
117 | } | ||
118 | |||
119 | var xxx_messageInfo_DynamicValue proto.InternalMessageInfo | ||
120 | |||
121 | func (m *DynamicValue) GetMsgpack() []byte { | ||
122 | if m != nil { | ||
123 | return m.Msgpack | ||
124 | } | ||
125 | return nil | ||
126 | } | ||
127 | |||
128 | func (m *DynamicValue) GetJson() []byte { | ||
129 | if m != nil { | ||
130 | return m.Json | ||
131 | } | ||
132 | return nil | ||
133 | } | ||
134 | |||
135 | type Diagnostic struct { | ||
136 | Severity Diagnostic_Severity `protobuf:"varint,1,opt,name=severity,proto3,enum=tfplugin5.Diagnostic_Severity" json:"severity,omitempty"` | ||
137 | Summary string `protobuf:"bytes,2,opt,name=summary,proto3" json:"summary,omitempty"` | ||
138 | Detail string `protobuf:"bytes,3,opt,name=detail,proto3" json:"detail,omitempty"` | ||
139 | Attribute *AttributePath `protobuf:"bytes,4,opt,name=attribute,proto3" json:"attribute,omitempty"` | ||
140 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
141 | XXX_unrecognized []byte `json:"-"` | ||
142 | XXX_sizecache int32 `json:"-"` | ||
143 | } | ||
144 | |||
145 | func (m *Diagnostic) Reset() { *m = Diagnostic{} } | ||
146 | func (m *Diagnostic) String() string { return proto.CompactTextString(m) } | ||
147 | func (*Diagnostic) ProtoMessage() {} | ||
148 | func (*Diagnostic) Descriptor() ([]byte, []int) { | ||
149 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{1} | ||
150 | } | ||
151 | func (m *Diagnostic) XXX_Unmarshal(b []byte) error { | ||
152 | return xxx_messageInfo_Diagnostic.Unmarshal(m, b) | ||
153 | } | ||
154 | func (m *Diagnostic) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
155 | return xxx_messageInfo_Diagnostic.Marshal(b, m, deterministic) | ||
156 | } | ||
157 | func (dst *Diagnostic) XXX_Merge(src proto.Message) { | ||
158 | xxx_messageInfo_Diagnostic.Merge(dst, src) | ||
159 | } | ||
160 | func (m *Diagnostic) XXX_Size() int { | ||
161 | return xxx_messageInfo_Diagnostic.Size(m) | ||
162 | } | ||
163 | func (m *Diagnostic) XXX_DiscardUnknown() { | ||
164 | xxx_messageInfo_Diagnostic.DiscardUnknown(m) | ||
165 | } | ||
166 | |||
167 | var xxx_messageInfo_Diagnostic proto.InternalMessageInfo | ||
168 | |||
169 | func (m *Diagnostic) GetSeverity() Diagnostic_Severity { | ||
170 | if m != nil { | ||
171 | return m.Severity | ||
172 | } | ||
173 | return Diagnostic_INVALID | ||
174 | } | ||
175 | |||
176 | func (m *Diagnostic) GetSummary() string { | ||
177 | if m != nil { | ||
178 | return m.Summary | ||
179 | } | ||
180 | return "" | ||
181 | } | ||
182 | |||
183 | func (m *Diagnostic) GetDetail() string { | ||
184 | if m != nil { | ||
185 | return m.Detail | ||
186 | } | ||
187 | return "" | ||
188 | } | ||
189 | |||
190 | func (m *Diagnostic) GetAttribute() *AttributePath { | ||
191 | if m != nil { | ||
192 | return m.Attribute | ||
193 | } | ||
194 | return nil | ||
195 | } | ||
196 | |||
197 | type AttributePath struct { | ||
198 | Steps []*AttributePath_Step `protobuf:"bytes,1,rep,name=steps,proto3" json:"steps,omitempty"` | ||
199 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
200 | XXX_unrecognized []byte `json:"-"` | ||
201 | XXX_sizecache int32 `json:"-"` | ||
202 | } | ||
203 | |||
204 | func (m *AttributePath) Reset() { *m = AttributePath{} } | ||
205 | func (m *AttributePath) String() string { return proto.CompactTextString(m) } | ||
206 | func (*AttributePath) ProtoMessage() {} | ||
207 | func (*AttributePath) Descriptor() ([]byte, []int) { | ||
208 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{2} | ||
209 | } | ||
210 | func (m *AttributePath) XXX_Unmarshal(b []byte) error { | ||
211 | return xxx_messageInfo_AttributePath.Unmarshal(m, b) | ||
212 | } | ||
213 | func (m *AttributePath) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
214 | return xxx_messageInfo_AttributePath.Marshal(b, m, deterministic) | ||
215 | } | ||
216 | func (dst *AttributePath) XXX_Merge(src proto.Message) { | ||
217 | xxx_messageInfo_AttributePath.Merge(dst, src) | ||
218 | } | ||
219 | func (m *AttributePath) XXX_Size() int { | ||
220 | return xxx_messageInfo_AttributePath.Size(m) | ||
221 | } | ||
222 | func (m *AttributePath) XXX_DiscardUnknown() { | ||
223 | xxx_messageInfo_AttributePath.DiscardUnknown(m) | ||
224 | } | ||
225 | |||
226 | var xxx_messageInfo_AttributePath proto.InternalMessageInfo | ||
227 | |||
228 | func (m *AttributePath) GetSteps() []*AttributePath_Step { | ||
229 | if m != nil { | ||
230 | return m.Steps | ||
231 | } | ||
232 | return nil | ||
233 | } | ||
234 | |||
235 | type AttributePath_Step struct { | ||
236 | // Types that are valid to be assigned to Selector: | ||
237 | // *AttributePath_Step_AttributeName | ||
238 | // *AttributePath_Step_ElementKeyString | ||
239 | // *AttributePath_Step_ElementKeyInt | ||
240 | Selector isAttributePath_Step_Selector `protobuf_oneof:"selector"` | ||
241 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
242 | XXX_unrecognized []byte `json:"-"` | ||
243 | XXX_sizecache int32 `json:"-"` | ||
244 | } | ||
245 | |||
246 | func (m *AttributePath_Step) Reset() { *m = AttributePath_Step{} } | ||
247 | func (m *AttributePath_Step) String() string { return proto.CompactTextString(m) } | ||
248 | func (*AttributePath_Step) ProtoMessage() {} | ||
249 | func (*AttributePath_Step) Descriptor() ([]byte, []int) { | ||
250 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{2, 0} | ||
251 | } | ||
252 | func (m *AttributePath_Step) XXX_Unmarshal(b []byte) error { | ||
253 | return xxx_messageInfo_AttributePath_Step.Unmarshal(m, b) | ||
254 | } | ||
255 | func (m *AttributePath_Step) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
256 | return xxx_messageInfo_AttributePath_Step.Marshal(b, m, deterministic) | ||
257 | } | ||
258 | func (dst *AttributePath_Step) XXX_Merge(src proto.Message) { | ||
259 | xxx_messageInfo_AttributePath_Step.Merge(dst, src) | ||
260 | } | ||
261 | func (m *AttributePath_Step) XXX_Size() int { | ||
262 | return xxx_messageInfo_AttributePath_Step.Size(m) | ||
263 | } | ||
264 | func (m *AttributePath_Step) XXX_DiscardUnknown() { | ||
265 | xxx_messageInfo_AttributePath_Step.DiscardUnknown(m) | ||
266 | } | ||
267 | |||
268 | var xxx_messageInfo_AttributePath_Step proto.InternalMessageInfo | ||
269 | |||
270 | type isAttributePath_Step_Selector interface { | ||
271 | isAttributePath_Step_Selector() | ||
272 | } | ||
273 | |||
274 | type AttributePath_Step_AttributeName struct { | ||
275 | AttributeName string `protobuf:"bytes,1,opt,name=attribute_name,json=attributeName,proto3,oneof"` | ||
276 | } | ||
277 | |||
278 | type AttributePath_Step_ElementKeyString struct { | ||
279 | ElementKeyString string `protobuf:"bytes,2,opt,name=element_key_string,json=elementKeyString,proto3,oneof"` | ||
280 | } | ||
281 | |||
282 | type AttributePath_Step_ElementKeyInt struct { | ||
283 | ElementKeyInt int64 `protobuf:"varint,3,opt,name=element_key_int,json=elementKeyInt,proto3,oneof"` | ||
284 | } | ||
285 | |||
286 | func (*AttributePath_Step_AttributeName) isAttributePath_Step_Selector() {} | ||
287 | |||
288 | func (*AttributePath_Step_ElementKeyString) isAttributePath_Step_Selector() {} | ||
289 | |||
290 | func (*AttributePath_Step_ElementKeyInt) isAttributePath_Step_Selector() {} | ||
291 | |||
292 | func (m *AttributePath_Step) GetSelector() isAttributePath_Step_Selector { | ||
293 | if m != nil { | ||
294 | return m.Selector | ||
295 | } | ||
296 | return nil | ||
297 | } | ||
298 | |||
299 | func (m *AttributePath_Step) GetAttributeName() string { | ||
300 | if x, ok := m.GetSelector().(*AttributePath_Step_AttributeName); ok { | ||
301 | return x.AttributeName | ||
302 | } | ||
303 | return "" | ||
304 | } | ||
305 | |||
306 | func (m *AttributePath_Step) GetElementKeyString() string { | ||
307 | if x, ok := m.GetSelector().(*AttributePath_Step_ElementKeyString); ok { | ||
308 | return x.ElementKeyString | ||
309 | } | ||
310 | return "" | ||
311 | } | ||
312 | |||
313 | func (m *AttributePath_Step) GetElementKeyInt() int64 { | ||
314 | if x, ok := m.GetSelector().(*AttributePath_Step_ElementKeyInt); ok { | ||
315 | return x.ElementKeyInt | ||
316 | } | ||
317 | return 0 | ||
318 | } | ||
319 | |||
320 | // XXX_OneofFuncs is for the internal use of the proto package. | ||
321 | func (*AttributePath_Step) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { | ||
322 | return _AttributePath_Step_OneofMarshaler, _AttributePath_Step_OneofUnmarshaler, _AttributePath_Step_OneofSizer, []interface{}{ | ||
323 | (*AttributePath_Step_AttributeName)(nil), | ||
324 | (*AttributePath_Step_ElementKeyString)(nil), | ||
325 | (*AttributePath_Step_ElementKeyInt)(nil), | ||
326 | } | ||
327 | } | ||
328 | |||
329 | func _AttributePath_Step_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { | ||
330 | m := msg.(*AttributePath_Step) | ||
331 | // selector | ||
332 | switch x := m.Selector.(type) { | ||
333 | case *AttributePath_Step_AttributeName: | ||
334 | b.EncodeVarint(1<<3 | proto.WireBytes) | ||
335 | b.EncodeStringBytes(x.AttributeName) | ||
336 | case *AttributePath_Step_ElementKeyString: | ||
337 | b.EncodeVarint(2<<3 | proto.WireBytes) | ||
338 | b.EncodeStringBytes(x.ElementKeyString) | ||
339 | case *AttributePath_Step_ElementKeyInt: | ||
340 | b.EncodeVarint(3<<3 | proto.WireVarint) | ||
341 | b.EncodeVarint(uint64(x.ElementKeyInt)) | ||
342 | case nil: | ||
343 | default: | ||
344 | return fmt.Errorf("AttributePath_Step.Selector has unexpected type %T", x) | ||
345 | } | ||
346 | return nil | ||
347 | } | ||
348 | |||
349 | func _AttributePath_Step_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { | ||
350 | m := msg.(*AttributePath_Step) | ||
351 | switch tag { | ||
352 | case 1: // selector.attribute_name | ||
353 | if wire != proto.WireBytes { | ||
354 | return true, proto.ErrInternalBadWireType | ||
355 | } | ||
356 | x, err := b.DecodeStringBytes() | ||
357 | m.Selector = &AttributePath_Step_AttributeName{x} | ||
358 | return true, err | ||
359 | case 2: // selector.element_key_string | ||
360 | if wire != proto.WireBytes { | ||
361 | return true, proto.ErrInternalBadWireType | ||
362 | } | ||
363 | x, err := b.DecodeStringBytes() | ||
364 | m.Selector = &AttributePath_Step_ElementKeyString{x} | ||
365 | return true, err | ||
366 | case 3: // selector.element_key_int | ||
367 | if wire != proto.WireVarint { | ||
368 | return true, proto.ErrInternalBadWireType | ||
369 | } | ||
370 | x, err := b.DecodeVarint() | ||
371 | m.Selector = &AttributePath_Step_ElementKeyInt{int64(x)} | ||
372 | return true, err | ||
373 | default: | ||
374 | return false, nil | ||
375 | } | ||
376 | } | ||
377 | |||
378 | func _AttributePath_Step_OneofSizer(msg proto.Message) (n int) { | ||
379 | m := msg.(*AttributePath_Step) | ||
380 | // selector | ||
381 | switch x := m.Selector.(type) { | ||
382 | case *AttributePath_Step_AttributeName: | ||
383 | n += 1 // tag and wire | ||
384 | n += proto.SizeVarint(uint64(len(x.AttributeName))) | ||
385 | n += len(x.AttributeName) | ||
386 | case *AttributePath_Step_ElementKeyString: | ||
387 | n += 1 // tag and wire | ||
388 | n += proto.SizeVarint(uint64(len(x.ElementKeyString))) | ||
389 | n += len(x.ElementKeyString) | ||
390 | case *AttributePath_Step_ElementKeyInt: | ||
391 | n += 1 // tag and wire | ||
392 | n += proto.SizeVarint(uint64(x.ElementKeyInt)) | ||
393 | case nil: | ||
394 | default: | ||
395 | panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) | ||
396 | } | ||
397 | return n | ||
398 | } | ||
399 | |||
400 | type Stop struct { | ||
401 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
402 | XXX_unrecognized []byte `json:"-"` | ||
403 | XXX_sizecache int32 `json:"-"` | ||
404 | } | ||
405 | |||
406 | func (m *Stop) Reset() { *m = Stop{} } | ||
407 | func (m *Stop) String() string { return proto.CompactTextString(m) } | ||
408 | func (*Stop) ProtoMessage() {} | ||
409 | func (*Stop) Descriptor() ([]byte, []int) { | ||
410 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{3} | ||
411 | } | ||
412 | func (m *Stop) XXX_Unmarshal(b []byte) error { | ||
413 | return xxx_messageInfo_Stop.Unmarshal(m, b) | ||
414 | } | ||
415 | func (m *Stop) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
416 | return xxx_messageInfo_Stop.Marshal(b, m, deterministic) | ||
417 | } | ||
418 | func (dst *Stop) XXX_Merge(src proto.Message) { | ||
419 | xxx_messageInfo_Stop.Merge(dst, src) | ||
420 | } | ||
421 | func (m *Stop) XXX_Size() int { | ||
422 | return xxx_messageInfo_Stop.Size(m) | ||
423 | } | ||
424 | func (m *Stop) XXX_DiscardUnknown() { | ||
425 | xxx_messageInfo_Stop.DiscardUnknown(m) | ||
426 | } | ||
427 | |||
428 | var xxx_messageInfo_Stop proto.InternalMessageInfo | ||
429 | |||
430 | type Stop_Request struct { | ||
431 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
432 | XXX_unrecognized []byte `json:"-"` | ||
433 | XXX_sizecache int32 `json:"-"` | ||
434 | } | ||
435 | |||
436 | func (m *Stop_Request) Reset() { *m = Stop_Request{} } | ||
437 | func (m *Stop_Request) String() string { return proto.CompactTextString(m) } | ||
438 | func (*Stop_Request) ProtoMessage() {} | ||
439 | func (*Stop_Request) Descriptor() ([]byte, []int) { | ||
440 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{3, 0} | ||
441 | } | ||
442 | func (m *Stop_Request) XXX_Unmarshal(b []byte) error { | ||
443 | return xxx_messageInfo_Stop_Request.Unmarshal(m, b) | ||
444 | } | ||
445 | func (m *Stop_Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
446 | return xxx_messageInfo_Stop_Request.Marshal(b, m, deterministic) | ||
447 | } | ||
448 | func (dst *Stop_Request) XXX_Merge(src proto.Message) { | ||
449 | xxx_messageInfo_Stop_Request.Merge(dst, src) | ||
450 | } | ||
451 | func (m *Stop_Request) XXX_Size() int { | ||
452 | return xxx_messageInfo_Stop_Request.Size(m) | ||
453 | } | ||
454 | func (m *Stop_Request) XXX_DiscardUnknown() { | ||
455 | xxx_messageInfo_Stop_Request.DiscardUnknown(m) | ||
456 | } | ||
457 | |||
458 | var xxx_messageInfo_Stop_Request proto.InternalMessageInfo | ||
459 | |||
460 | type Stop_Response struct { | ||
461 | Error string `protobuf:"bytes,1,opt,name=Error,proto3" json:"Error,omitempty"` | ||
462 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
463 | XXX_unrecognized []byte `json:"-"` | ||
464 | XXX_sizecache int32 `json:"-"` | ||
465 | } | ||
466 | |||
467 | func (m *Stop_Response) Reset() { *m = Stop_Response{} } | ||
468 | func (m *Stop_Response) String() string { return proto.CompactTextString(m) } | ||
469 | func (*Stop_Response) ProtoMessage() {} | ||
470 | func (*Stop_Response) Descriptor() ([]byte, []int) { | ||
471 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{3, 1} | ||
472 | } | ||
473 | func (m *Stop_Response) XXX_Unmarshal(b []byte) error { | ||
474 | return xxx_messageInfo_Stop_Response.Unmarshal(m, b) | ||
475 | } | ||
476 | func (m *Stop_Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
477 | return xxx_messageInfo_Stop_Response.Marshal(b, m, deterministic) | ||
478 | } | ||
479 | func (dst *Stop_Response) XXX_Merge(src proto.Message) { | ||
480 | xxx_messageInfo_Stop_Response.Merge(dst, src) | ||
481 | } | ||
482 | func (m *Stop_Response) XXX_Size() int { | ||
483 | return xxx_messageInfo_Stop_Response.Size(m) | ||
484 | } | ||
485 | func (m *Stop_Response) XXX_DiscardUnknown() { | ||
486 | xxx_messageInfo_Stop_Response.DiscardUnknown(m) | ||
487 | } | ||
488 | |||
489 | var xxx_messageInfo_Stop_Response proto.InternalMessageInfo | ||
490 | |||
491 | func (m *Stop_Response) GetError() string { | ||
492 | if m != nil { | ||
493 | return m.Error | ||
494 | } | ||
495 | return "" | ||
496 | } | ||
497 | |||
498 | // RawState holds the stored state for a resource to be upgraded by the | ||
499 | // provider. It can be in one of two formats, the current json encoded format | ||
500 | // in bytes, or the legacy flatmap format as a map of strings. | ||
501 | type RawState struct { | ||
502 | Json []byte `protobuf:"bytes,1,opt,name=json,proto3" json:"json,omitempty"` | ||
503 | Flatmap map[string]string `protobuf:"bytes,2,rep,name=flatmap,proto3" json:"flatmap,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` | ||
504 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
505 | XXX_unrecognized []byte `json:"-"` | ||
506 | XXX_sizecache int32 `json:"-"` | ||
507 | } | ||
508 | |||
509 | func (m *RawState) Reset() { *m = RawState{} } | ||
510 | func (m *RawState) String() string { return proto.CompactTextString(m) } | ||
511 | func (*RawState) ProtoMessage() {} | ||
512 | func (*RawState) Descriptor() ([]byte, []int) { | ||
513 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{4} | ||
514 | } | ||
515 | func (m *RawState) XXX_Unmarshal(b []byte) error { | ||
516 | return xxx_messageInfo_RawState.Unmarshal(m, b) | ||
517 | } | ||
518 | func (m *RawState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
519 | return xxx_messageInfo_RawState.Marshal(b, m, deterministic) | ||
520 | } | ||
521 | func (dst *RawState) XXX_Merge(src proto.Message) { | ||
522 | xxx_messageInfo_RawState.Merge(dst, src) | ||
523 | } | ||
524 | func (m *RawState) XXX_Size() int { | ||
525 | return xxx_messageInfo_RawState.Size(m) | ||
526 | } | ||
527 | func (m *RawState) XXX_DiscardUnknown() { | ||
528 | xxx_messageInfo_RawState.DiscardUnknown(m) | ||
529 | } | ||
530 | |||
531 | var xxx_messageInfo_RawState proto.InternalMessageInfo | ||
532 | |||
533 | func (m *RawState) GetJson() []byte { | ||
534 | if m != nil { | ||
535 | return m.Json | ||
536 | } | ||
537 | return nil | ||
538 | } | ||
539 | |||
540 | func (m *RawState) GetFlatmap() map[string]string { | ||
541 | if m != nil { | ||
542 | return m.Flatmap | ||
543 | } | ||
544 | return nil | ||
545 | } | ||
546 | |||
547 | // Schema is the configuration schema for a Resource, Provider, or Provisioner. | ||
548 | type Schema struct { | ||
549 | // The version of the schema. | ||
550 | // Schemas are versioned, so that providers can upgrade a saved resource | ||
551 | // state when the schema is changed. | ||
552 | Version int64 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` | ||
553 | // Block is the top level configuration block for this schema. | ||
554 | Block *Schema_Block `protobuf:"bytes,2,opt,name=block,proto3" json:"block,omitempty"` | ||
555 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
556 | XXX_unrecognized []byte `json:"-"` | ||
557 | XXX_sizecache int32 `json:"-"` | ||
558 | } | ||
559 | |||
560 | func (m *Schema) Reset() { *m = Schema{} } | ||
561 | func (m *Schema) String() string { return proto.CompactTextString(m) } | ||
562 | func (*Schema) ProtoMessage() {} | ||
563 | func (*Schema) Descriptor() ([]byte, []int) { | ||
564 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{5} | ||
565 | } | ||
566 | func (m *Schema) XXX_Unmarshal(b []byte) error { | ||
567 | return xxx_messageInfo_Schema.Unmarshal(m, b) | ||
568 | } | ||
569 | func (m *Schema) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
570 | return xxx_messageInfo_Schema.Marshal(b, m, deterministic) | ||
571 | } | ||
572 | func (dst *Schema) XXX_Merge(src proto.Message) { | ||
573 | xxx_messageInfo_Schema.Merge(dst, src) | ||
574 | } | ||
575 | func (m *Schema) XXX_Size() int { | ||
576 | return xxx_messageInfo_Schema.Size(m) | ||
577 | } | ||
578 | func (m *Schema) XXX_DiscardUnknown() { | ||
579 | xxx_messageInfo_Schema.DiscardUnknown(m) | ||
580 | } | ||
581 | |||
582 | var xxx_messageInfo_Schema proto.InternalMessageInfo | ||
583 | |||
584 | func (m *Schema) GetVersion() int64 { | ||
585 | if m != nil { | ||
586 | return m.Version | ||
587 | } | ||
588 | return 0 | ||
589 | } | ||
590 | |||
591 | func (m *Schema) GetBlock() *Schema_Block { | ||
592 | if m != nil { | ||
593 | return m.Block | ||
594 | } | ||
595 | return nil | ||
596 | } | ||
597 | |||
598 | type Schema_Block struct { | ||
599 | Version int64 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` | ||
600 | Attributes []*Schema_Attribute `protobuf:"bytes,2,rep,name=attributes,proto3" json:"attributes,omitempty"` | ||
601 | BlockTypes []*Schema_NestedBlock `protobuf:"bytes,3,rep,name=block_types,json=blockTypes,proto3" json:"block_types,omitempty"` | ||
602 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
603 | XXX_unrecognized []byte `json:"-"` | ||
604 | XXX_sizecache int32 `json:"-"` | ||
605 | } | ||
606 | |||
607 | func (m *Schema_Block) Reset() { *m = Schema_Block{} } | ||
608 | func (m *Schema_Block) String() string { return proto.CompactTextString(m) } | ||
609 | func (*Schema_Block) ProtoMessage() {} | ||
610 | func (*Schema_Block) Descriptor() ([]byte, []int) { | ||
611 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{5, 0} | ||
612 | } | ||
613 | func (m *Schema_Block) XXX_Unmarshal(b []byte) error { | ||
614 | return xxx_messageInfo_Schema_Block.Unmarshal(m, b) | ||
615 | } | ||
616 | func (m *Schema_Block) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
617 | return xxx_messageInfo_Schema_Block.Marshal(b, m, deterministic) | ||
618 | } | ||
619 | func (dst *Schema_Block) XXX_Merge(src proto.Message) { | ||
620 | xxx_messageInfo_Schema_Block.Merge(dst, src) | ||
621 | } | ||
622 | func (m *Schema_Block) XXX_Size() int { | ||
623 | return xxx_messageInfo_Schema_Block.Size(m) | ||
624 | } | ||
625 | func (m *Schema_Block) XXX_DiscardUnknown() { | ||
626 | xxx_messageInfo_Schema_Block.DiscardUnknown(m) | ||
627 | } | ||
628 | |||
629 | var xxx_messageInfo_Schema_Block proto.InternalMessageInfo | ||
630 | |||
631 | func (m *Schema_Block) GetVersion() int64 { | ||
632 | if m != nil { | ||
633 | return m.Version | ||
634 | } | ||
635 | return 0 | ||
636 | } | ||
637 | |||
638 | func (m *Schema_Block) GetAttributes() []*Schema_Attribute { | ||
639 | if m != nil { | ||
640 | return m.Attributes | ||
641 | } | ||
642 | return nil | ||
643 | } | ||
644 | |||
645 | func (m *Schema_Block) GetBlockTypes() []*Schema_NestedBlock { | ||
646 | if m != nil { | ||
647 | return m.BlockTypes | ||
648 | } | ||
649 | return nil | ||
650 | } | ||
651 | |||
652 | type Schema_Attribute struct { | ||
653 | Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` | ||
654 | Type []byte `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` | ||
655 | Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` | ||
656 | Required bool `protobuf:"varint,4,opt,name=required,proto3" json:"required,omitempty"` | ||
657 | Optional bool `protobuf:"varint,5,opt,name=optional,proto3" json:"optional,omitempty"` | ||
658 | Computed bool `protobuf:"varint,6,opt,name=computed,proto3" json:"computed,omitempty"` | ||
659 | Sensitive bool `protobuf:"varint,7,opt,name=sensitive,proto3" json:"sensitive,omitempty"` | ||
660 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
661 | XXX_unrecognized []byte `json:"-"` | ||
662 | XXX_sizecache int32 `json:"-"` | ||
663 | } | ||
664 | |||
665 | func (m *Schema_Attribute) Reset() { *m = Schema_Attribute{} } | ||
666 | func (m *Schema_Attribute) String() string { return proto.CompactTextString(m) } | ||
667 | func (*Schema_Attribute) ProtoMessage() {} | ||
668 | func (*Schema_Attribute) Descriptor() ([]byte, []int) { | ||
669 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{5, 1} | ||
670 | } | ||
671 | func (m *Schema_Attribute) XXX_Unmarshal(b []byte) error { | ||
672 | return xxx_messageInfo_Schema_Attribute.Unmarshal(m, b) | ||
673 | } | ||
674 | func (m *Schema_Attribute) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
675 | return xxx_messageInfo_Schema_Attribute.Marshal(b, m, deterministic) | ||
676 | } | ||
677 | func (dst *Schema_Attribute) XXX_Merge(src proto.Message) { | ||
678 | xxx_messageInfo_Schema_Attribute.Merge(dst, src) | ||
679 | } | ||
680 | func (m *Schema_Attribute) XXX_Size() int { | ||
681 | return xxx_messageInfo_Schema_Attribute.Size(m) | ||
682 | } | ||
683 | func (m *Schema_Attribute) XXX_DiscardUnknown() { | ||
684 | xxx_messageInfo_Schema_Attribute.DiscardUnknown(m) | ||
685 | } | ||
686 | |||
687 | var xxx_messageInfo_Schema_Attribute proto.InternalMessageInfo | ||
688 | |||
689 | func (m *Schema_Attribute) GetName() string { | ||
690 | if m != nil { | ||
691 | return m.Name | ||
692 | } | ||
693 | return "" | ||
694 | } | ||
695 | |||
696 | func (m *Schema_Attribute) GetType() []byte { | ||
697 | if m != nil { | ||
698 | return m.Type | ||
699 | } | ||
700 | return nil | ||
701 | } | ||
702 | |||
703 | func (m *Schema_Attribute) GetDescription() string { | ||
704 | if m != nil { | ||
705 | return m.Description | ||
706 | } | ||
707 | return "" | ||
708 | } | ||
709 | |||
710 | func (m *Schema_Attribute) GetRequired() bool { | ||
711 | if m != nil { | ||
712 | return m.Required | ||
713 | } | ||
714 | return false | ||
715 | } | ||
716 | |||
717 | func (m *Schema_Attribute) GetOptional() bool { | ||
718 | if m != nil { | ||
719 | return m.Optional | ||
720 | } | ||
721 | return false | ||
722 | } | ||
723 | |||
724 | func (m *Schema_Attribute) GetComputed() bool { | ||
725 | if m != nil { | ||
726 | return m.Computed | ||
727 | } | ||
728 | return false | ||
729 | } | ||
730 | |||
731 | func (m *Schema_Attribute) GetSensitive() bool { | ||
732 | if m != nil { | ||
733 | return m.Sensitive | ||
734 | } | ||
735 | return false | ||
736 | } | ||
737 | |||
738 | type Schema_NestedBlock struct { | ||
739 | TypeName string `protobuf:"bytes,1,opt,name=type_name,json=typeName,proto3" json:"type_name,omitempty"` | ||
740 | Block *Schema_Block `protobuf:"bytes,2,opt,name=block,proto3" json:"block,omitempty"` | ||
741 | Nesting Schema_NestedBlock_NestingMode `protobuf:"varint,3,opt,name=nesting,proto3,enum=tfplugin5.Schema_NestedBlock_NestingMode" json:"nesting,omitempty"` | ||
742 | MinItems int64 `protobuf:"varint,4,opt,name=min_items,json=minItems,proto3" json:"min_items,omitempty"` | ||
743 | MaxItems int64 `protobuf:"varint,5,opt,name=max_items,json=maxItems,proto3" json:"max_items,omitempty"` | ||
744 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
745 | XXX_unrecognized []byte `json:"-"` | ||
746 | XXX_sizecache int32 `json:"-"` | ||
747 | } | ||
748 | |||
749 | func (m *Schema_NestedBlock) Reset() { *m = Schema_NestedBlock{} } | ||
750 | func (m *Schema_NestedBlock) String() string { return proto.CompactTextString(m) } | ||
751 | func (*Schema_NestedBlock) ProtoMessage() {} | ||
752 | func (*Schema_NestedBlock) Descriptor() ([]byte, []int) { | ||
753 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{5, 2} | ||
754 | } | ||
755 | func (m *Schema_NestedBlock) XXX_Unmarshal(b []byte) error { | ||
756 | return xxx_messageInfo_Schema_NestedBlock.Unmarshal(m, b) | ||
757 | } | ||
758 | func (m *Schema_NestedBlock) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
759 | return xxx_messageInfo_Schema_NestedBlock.Marshal(b, m, deterministic) | ||
760 | } | ||
761 | func (dst *Schema_NestedBlock) XXX_Merge(src proto.Message) { | ||
762 | xxx_messageInfo_Schema_NestedBlock.Merge(dst, src) | ||
763 | } | ||
764 | func (m *Schema_NestedBlock) XXX_Size() int { | ||
765 | return xxx_messageInfo_Schema_NestedBlock.Size(m) | ||
766 | } | ||
767 | func (m *Schema_NestedBlock) XXX_DiscardUnknown() { | ||
768 | xxx_messageInfo_Schema_NestedBlock.DiscardUnknown(m) | ||
769 | } | ||
770 | |||
771 | var xxx_messageInfo_Schema_NestedBlock proto.InternalMessageInfo | ||
772 | |||
773 | func (m *Schema_NestedBlock) GetTypeName() string { | ||
774 | if m != nil { | ||
775 | return m.TypeName | ||
776 | } | ||
777 | return "" | ||
778 | } | ||
779 | |||
780 | func (m *Schema_NestedBlock) GetBlock() *Schema_Block { | ||
781 | if m != nil { | ||
782 | return m.Block | ||
783 | } | ||
784 | return nil | ||
785 | } | ||
786 | |||
787 | func (m *Schema_NestedBlock) GetNesting() Schema_NestedBlock_NestingMode { | ||
788 | if m != nil { | ||
789 | return m.Nesting | ||
790 | } | ||
791 | return Schema_NestedBlock_INVALID | ||
792 | } | ||
793 | |||
794 | func (m *Schema_NestedBlock) GetMinItems() int64 { | ||
795 | if m != nil { | ||
796 | return m.MinItems | ||
797 | } | ||
798 | return 0 | ||
799 | } | ||
800 | |||
801 | func (m *Schema_NestedBlock) GetMaxItems() int64 { | ||
802 | if m != nil { | ||
803 | return m.MaxItems | ||
804 | } | ||
805 | return 0 | ||
806 | } | ||
807 | |||
808 | type GetProviderSchema struct { | ||
809 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
810 | XXX_unrecognized []byte `json:"-"` | ||
811 | XXX_sizecache int32 `json:"-"` | ||
812 | } | ||
813 | |||
814 | func (m *GetProviderSchema) Reset() { *m = GetProviderSchema{} } | ||
815 | func (m *GetProviderSchema) String() string { return proto.CompactTextString(m) } | ||
816 | func (*GetProviderSchema) ProtoMessage() {} | ||
817 | func (*GetProviderSchema) Descriptor() ([]byte, []int) { | ||
818 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{6} | ||
819 | } | ||
820 | func (m *GetProviderSchema) XXX_Unmarshal(b []byte) error { | ||
821 | return xxx_messageInfo_GetProviderSchema.Unmarshal(m, b) | ||
822 | } | ||
823 | func (m *GetProviderSchema) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
824 | return xxx_messageInfo_GetProviderSchema.Marshal(b, m, deterministic) | ||
825 | } | ||
826 | func (dst *GetProviderSchema) XXX_Merge(src proto.Message) { | ||
827 | xxx_messageInfo_GetProviderSchema.Merge(dst, src) | ||
828 | } | ||
829 | func (m *GetProviderSchema) XXX_Size() int { | ||
830 | return xxx_messageInfo_GetProviderSchema.Size(m) | ||
831 | } | ||
832 | func (m *GetProviderSchema) XXX_DiscardUnknown() { | ||
833 | xxx_messageInfo_GetProviderSchema.DiscardUnknown(m) | ||
834 | } | ||
835 | |||
836 | var xxx_messageInfo_GetProviderSchema proto.InternalMessageInfo | ||
837 | |||
838 | type GetProviderSchema_Request struct { | ||
839 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
840 | XXX_unrecognized []byte `json:"-"` | ||
841 | XXX_sizecache int32 `json:"-"` | ||
842 | } | ||
843 | |||
844 | func (m *GetProviderSchema_Request) Reset() { *m = GetProviderSchema_Request{} } | ||
845 | func (m *GetProviderSchema_Request) String() string { return proto.CompactTextString(m) } | ||
846 | func (*GetProviderSchema_Request) ProtoMessage() {} | ||
847 | func (*GetProviderSchema_Request) Descriptor() ([]byte, []int) { | ||
848 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{6, 0} | ||
849 | } | ||
850 | func (m *GetProviderSchema_Request) XXX_Unmarshal(b []byte) error { | ||
851 | return xxx_messageInfo_GetProviderSchema_Request.Unmarshal(m, b) | ||
852 | } | ||
853 | func (m *GetProviderSchema_Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
854 | return xxx_messageInfo_GetProviderSchema_Request.Marshal(b, m, deterministic) | ||
855 | } | ||
856 | func (dst *GetProviderSchema_Request) XXX_Merge(src proto.Message) { | ||
857 | xxx_messageInfo_GetProviderSchema_Request.Merge(dst, src) | ||
858 | } | ||
859 | func (m *GetProviderSchema_Request) XXX_Size() int { | ||
860 | return xxx_messageInfo_GetProviderSchema_Request.Size(m) | ||
861 | } | ||
862 | func (m *GetProviderSchema_Request) XXX_DiscardUnknown() { | ||
863 | xxx_messageInfo_GetProviderSchema_Request.DiscardUnknown(m) | ||
864 | } | ||
865 | |||
866 | var xxx_messageInfo_GetProviderSchema_Request proto.InternalMessageInfo | ||
867 | |||
868 | type GetProviderSchema_Response struct { | ||
869 | Provider *Schema `protobuf:"bytes,1,opt,name=provider,proto3" json:"provider,omitempty"` | ||
870 | ResourceSchemas map[string]*Schema `protobuf:"bytes,2,rep,name=resource_schemas,json=resourceSchemas,proto3" json:"resource_schemas,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` | ||
871 | DataSourceSchemas map[string]*Schema `protobuf:"bytes,3,rep,name=data_source_schemas,json=dataSourceSchemas,proto3" json:"data_source_schemas,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` | ||
872 | Diagnostics []*Diagnostic `protobuf:"bytes,4,rep,name=diagnostics,proto3" json:"diagnostics,omitempty"` | ||
873 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
874 | XXX_unrecognized []byte `json:"-"` | ||
875 | XXX_sizecache int32 `json:"-"` | ||
876 | } | ||
877 | |||
878 | func (m *GetProviderSchema_Response) Reset() { *m = GetProviderSchema_Response{} } | ||
879 | func (m *GetProviderSchema_Response) String() string { return proto.CompactTextString(m) } | ||
880 | func (*GetProviderSchema_Response) ProtoMessage() {} | ||
881 | func (*GetProviderSchema_Response) Descriptor() ([]byte, []int) { | ||
882 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{6, 1} | ||
883 | } | ||
884 | func (m *GetProviderSchema_Response) XXX_Unmarshal(b []byte) error { | ||
885 | return xxx_messageInfo_GetProviderSchema_Response.Unmarshal(m, b) | ||
886 | } | ||
887 | func (m *GetProviderSchema_Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
888 | return xxx_messageInfo_GetProviderSchema_Response.Marshal(b, m, deterministic) | ||
889 | } | ||
890 | func (dst *GetProviderSchema_Response) XXX_Merge(src proto.Message) { | ||
891 | xxx_messageInfo_GetProviderSchema_Response.Merge(dst, src) | ||
892 | } | ||
893 | func (m *GetProviderSchema_Response) XXX_Size() int { | ||
894 | return xxx_messageInfo_GetProviderSchema_Response.Size(m) | ||
895 | } | ||
896 | func (m *GetProviderSchema_Response) XXX_DiscardUnknown() { | ||
897 | xxx_messageInfo_GetProviderSchema_Response.DiscardUnknown(m) | ||
898 | } | ||
899 | |||
900 | var xxx_messageInfo_GetProviderSchema_Response proto.InternalMessageInfo | ||
901 | |||
902 | func (m *GetProviderSchema_Response) GetProvider() *Schema { | ||
903 | if m != nil { | ||
904 | return m.Provider | ||
905 | } | ||
906 | return nil | ||
907 | } | ||
908 | |||
909 | func (m *GetProviderSchema_Response) GetResourceSchemas() map[string]*Schema { | ||
910 | if m != nil { | ||
911 | return m.ResourceSchemas | ||
912 | } | ||
913 | return nil | ||
914 | } | ||
915 | |||
916 | func (m *GetProviderSchema_Response) GetDataSourceSchemas() map[string]*Schema { | ||
917 | if m != nil { | ||
918 | return m.DataSourceSchemas | ||
919 | } | ||
920 | return nil | ||
921 | } | ||
922 | |||
923 | func (m *GetProviderSchema_Response) GetDiagnostics() []*Diagnostic { | ||
924 | if m != nil { | ||
925 | return m.Diagnostics | ||
926 | } | ||
927 | return nil | ||
928 | } | ||
929 | |||
930 | type PrepareProviderConfig struct { | ||
931 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
932 | XXX_unrecognized []byte `json:"-"` | ||
933 | XXX_sizecache int32 `json:"-"` | ||
934 | } | ||
935 | |||
936 | func (m *PrepareProviderConfig) Reset() { *m = PrepareProviderConfig{} } | ||
937 | func (m *PrepareProviderConfig) String() string { return proto.CompactTextString(m) } | ||
938 | func (*PrepareProviderConfig) ProtoMessage() {} | ||
939 | func (*PrepareProviderConfig) Descriptor() ([]byte, []int) { | ||
940 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{7} | ||
941 | } | ||
942 | func (m *PrepareProviderConfig) XXX_Unmarshal(b []byte) error { | ||
943 | return xxx_messageInfo_PrepareProviderConfig.Unmarshal(m, b) | ||
944 | } | ||
945 | func (m *PrepareProviderConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
946 | return xxx_messageInfo_PrepareProviderConfig.Marshal(b, m, deterministic) | ||
947 | } | ||
948 | func (dst *PrepareProviderConfig) XXX_Merge(src proto.Message) { | ||
949 | xxx_messageInfo_PrepareProviderConfig.Merge(dst, src) | ||
950 | } | ||
951 | func (m *PrepareProviderConfig) XXX_Size() int { | ||
952 | return xxx_messageInfo_PrepareProviderConfig.Size(m) | ||
953 | } | ||
954 | func (m *PrepareProviderConfig) XXX_DiscardUnknown() { | ||
955 | xxx_messageInfo_PrepareProviderConfig.DiscardUnknown(m) | ||
956 | } | ||
957 | |||
958 | var xxx_messageInfo_PrepareProviderConfig proto.InternalMessageInfo | ||
959 | |||
960 | type PrepareProviderConfig_Request struct { | ||
961 | Config *DynamicValue `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"` | ||
962 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
963 | XXX_unrecognized []byte `json:"-"` | ||
964 | XXX_sizecache int32 `json:"-"` | ||
965 | } | ||
966 | |||
967 | func (m *PrepareProviderConfig_Request) Reset() { *m = PrepareProviderConfig_Request{} } | ||
968 | func (m *PrepareProviderConfig_Request) String() string { return proto.CompactTextString(m) } | ||
969 | func (*PrepareProviderConfig_Request) ProtoMessage() {} | ||
970 | func (*PrepareProviderConfig_Request) Descriptor() ([]byte, []int) { | ||
971 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{7, 0} | ||
972 | } | ||
973 | func (m *PrepareProviderConfig_Request) XXX_Unmarshal(b []byte) error { | ||
974 | return xxx_messageInfo_PrepareProviderConfig_Request.Unmarshal(m, b) | ||
975 | } | ||
976 | func (m *PrepareProviderConfig_Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
977 | return xxx_messageInfo_PrepareProviderConfig_Request.Marshal(b, m, deterministic) | ||
978 | } | ||
979 | func (dst *PrepareProviderConfig_Request) XXX_Merge(src proto.Message) { | ||
980 | xxx_messageInfo_PrepareProviderConfig_Request.Merge(dst, src) | ||
981 | } | ||
982 | func (m *PrepareProviderConfig_Request) XXX_Size() int { | ||
983 | return xxx_messageInfo_PrepareProviderConfig_Request.Size(m) | ||
984 | } | ||
985 | func (m *PrepareProviderConfig_Request) XXX_DiscardUnknown() { | ||
986 | xxx_messageInfo_PrepareProviderConfig_Request.DiscardUnknown(m) | ||
987 | } | ||
988 | |||
989 | var xxx_messageInfo_PrepareProviderConfig_Request proto.InternalMessageInfo | ||
990 | |||
991 | func (m *PrepareProviderConfig_Request) GetConfig() *DynamicValue { | ||
992 | if m != nil { | ||
993 | return m.Config | ||
994 | } | ||
995 | return nil | ||
996 | } | ||
997 | |||
998 | type PrepareProviderConfig_Response struct { | ||
999 | PreparedConfig *DynamicValue `protobuf:"bytes,1,opt,name=prepared_config,json=preparedConfig,proto3" json:"prepared_config,omitempty"` | ||
1000 | Diagnostics []*Diagnostic `protobuf:"bytes,2,rep,name=diagnostics,proto3" json:"diagnostics,omitempty"` | ||
1001 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
1002 | XXX_unrecognized []byte `json:"-"` | ||
1003 | XXX_sizecache int32 `json:"-"` | ||
1004 | } | ||
1005 | |||
1006 | func (m *PrepareProviderConfig_Response) Reset() { *m = PrepareProviderConfig_Response{} } | ||
1007 | func (m *PrepareProviderConfig_Response) String() string { return proto.CompactTextString(m) } | ||
1008 | func (*PrepareProviderConfig_Response) ProtoMessage() {} | ||
1009 | func (*PrepareProviderConfig_Response) Descriptor() ([]byte, []int) { | ||
1010 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{7, 1} | ||
1011 | } | ||
1012 | func (m *PrepareProviderConfig_Response) XXX_Unmarshal(b []byte) error { | ||
1013 | return xxx_messageInfo_PrepareProviderConfig_Response.Unmarshal(m, b) | ||
1014 | } | ||
1015 | func (m *PrepareProviderConfig_Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
1016 | return xxx_messageInfo_PrepareProviderConfig_Response.Marshal(b, m, deterministic) | ||
1017 | } | ||
1018 | func (dst *PrepareProviderConfig_Response) XXX_Merge(src proto.Message) { | ||
1019 | xxx_messageInfo_PrepareProviderConfig_Response.Merge(dst, src) | ||
1020 | } | ||
1021 | func (m *PrepareProviderConfig_Response) XXX_Size() int { | ||
1022 | return xxx_messageInfo_PrepareProviderConfig_Response.Size(m) | ||
1023 | } | ||
1024 | func (m *PrepareProviderConfig_Response) XXX_DiscardUnknown() { | ||
1025 | xxx_messageInfo_PrepareProviderConfig_Response.DiscardUnknown(m) | ||
1026 | } | ||
1027 | |||
1028 | var xxx_messageInfo_PrepareProviderConfig_Response proto.InternalMessageInfo | ||
1029 | |||
1030 | func (m *PrepareProviderConfig_Response) GetPreparedConfig() *DynamicValue { | ||
1031 | if m != nil { | ||
1032 | return m.PreparedConfig | ||
1033 | } | ||
1034 | return nil | ||
1035 | } | ||
1036 | |||
1037 | func (m *PrepareProviderConfig_Response) GetDiagnostics() []*Diagnostic { | ||
1038 | if m != nil { | ||
1039 | return m.Diagnostics | ||
1040 | } | ||
1041 | return nil | ||
1042 | } | ||
1043 | |||
1044 | type UpgradeResourceState struct { | ||
1045 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
1046 | XXX_unrecognized []byte `json:"-"` | ||
1047 | XXX_sizecache int32 `json:"-"` | ||
1048 | } | ||
1049 | |||
1050 | func (m *UpgradeResourceState) Reset() { *m = UpgradeResourceState{} } | ||
1051 | func (m *UpgradeResourceState) String() string { return proto.CompactTextString(m) } | ||
1052 | func (*UpgradeResourceState) ProtoMessage() {} | ||
1053 | func (*UpgradeResourceState) Descriptor() ([]byte, []int) { | ||
1054 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{8} | ||
1055 | } | ||
1056 | func (m *UpgradeResourceState) XXX_Unmarshal(b []byte) error { | ||
1057 | return xxx_messageInfo_UpgradeResourceState.Unmarshal(m, b) | ||
1058 | } | ||
1059 | func (m *UpgradeResourceState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
1060 | return xxx_messageInfo_UpgradeResourceState.Marshal(b, m, deterministic) | ||
1061 | } | ||
1062 | func (dst *UpgradeResourceState) XXX_Merge(src proto.Message) { | ||
1063 | xxx_messageInfo_UpgradeResourceState.Merge(dst, src) | ||
1064 | } | ||
1065 | func (m *UpgradeResourceState) XXX_Size() int { | ||
1066 | return xxx_messageInfo_UpgradeResourceState.Size(m) | ||
1067 | } | ||
1068 | func (m *UpgradeResourceState) XXX_DiscardUnknown() { | ||
1069 | xxx_messageInfo_UpgradeResourceState.DiscardUnknown(m) | ||
1070 | } | ||
1071 | |||
1072 | var xxx_messageInfo_UpgradeResourceState proto.InternalMessageInfo | ||
1073 | |||
1074 | type UpgradeResourceState_Request struct { | ||
1075 | TypeName string `protobuf:"bytes,1,opt,name=type_name,json=typeName,proto3" json:"type_name,omitempty"` | ||
1076 | // version is the schema_version number recorded in the state file | ||
1077 | Version int64 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` | ||
1078 | // raw_state is the raw states as stored for the resource. Core does | ||
1079 | // not have access to the schema of prior_version, so it's the | ||
1080 | // provider's responsibility to interpret this value using the | ||
1081 | // appropriate older schema. The raw_state will be the json encoded | ||
1082 | // state, or a legacy flat-mapped format. | ||
1083 | RawState *RawState `protobuf:"bytes,3,opt,name=raw_state,json=rawState,proto3" json:"raw_state,omitempty"` | ||
1084 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
1085 | XXX_unrecognized []byte `json:"-"` | ||
1086 | XXX_sizecache int32 `json:"-"` | ||
1087 | } | ||
1088 | |||
1089 | func (m *UpgradeResourceState_Request) Reset() { *m = UpgradeResourceState_Request{} } | ||
1090 | func (m *UpgradeResourceState_Request) String() string { return proto.CompactTextString(m) } | ||
1091 | func (*UpgradeResourceState_Request) ProtoMessage() {} | ||
1092 | func (*UpgradeResourceState_Request) Descriptor() ([]byte, []int) { | ||
1093 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{8, 0} | ||
1094 | } | ||
1095 | func (m *UpgradeResourceState_Request) XXX_Unmarshal(b []byte) error { | ||
1096 | return xxx_messageInfo_UpgradeResourceState_Request.Unmarshal(m, b) | ||
1097 | } | ||
1098 | func (m *UpgradeResourceState_Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
1099 | return xxx_messageInfo_UpgradeResourceState_Request.Marshal(b, m, deterministic) | ||
1100 | } | ||
1101 | func (dst *UpgradeResourceState_Request) XXX_Merge(src proto.Message) { | ||
1102 | xxx_messageInfo_UpgradeResourceState_Request.Merge(dst, src) | ||
1103 | } | ||
1104 | func (m *UpgradeResourceState_Request) XXX_Size() int { | ||
1105 | return xxx_messageInfo_UpgradeResourceState_Request.Size(m) | ||
1106 | } | ||
1107 | func (m *UpgradeResourceState_Request) XXX_DiscardUnknown() { | ||
1108 | xxx_messageInfo_UpgradeResourceState_Request.DiscardUnknown(m) | ||
1109 | } | ||
1110 | |||
1111 | var xxx_messageInfo_UpgradeResourceState_Request proto.InternalMessageInfo | ||
1112 | |||
1113 | func (m *UpgradeResourceState_Request) GetTypeName() string { | ||
1114 | if m != nil { | ||
1115 | return m.TypeName | ||
1116 | } | ||
1117 | return "" | ||
1118 | } | ||
1119 | |||
1120 | func (m *UpgradeResourceState_Request) GetVersion() int64 { | ||
1121 | if m != nil { | ||
1122 | return m.Version | ||
1123 | } | ||
1124 | return 0 | ||
1125 | } | ||
1126 | |||
1127 | func (m *UpgradeResourceState_Request) GetRawState() *RawState { | ||
1128 | if m != nil { | ||
1129 | return m.RawState | ||
1130 | } | ||
1131 | return nil | ||
1132 | } | ||
1133 | |||
1134 | type UpgradeResourceState_Response struct { | ||
1135 | // new_state is a msgpack-encoded data structure that, when interpreted with | ||
1136 | // the _current_ schema for this resource type, is functionally equivalent to | ||
1137 | // that which was given in prior_state_raw. | ||
1138 | UpgradedState *DynamicValue `protobuf:"bytes,1,opt,name=upgraded_state,json=upgradedState,proto3" json:"upgraded_state,omitempty"` | ||
1139 | // diagnostics describes any errors encountered during migration that could not | ||
1140 | // be safely resolved, and warnings about any possibly-risky assumptions made | ||
1141 | // in the upgrade process. | ||
1142 | Diagnostics []*Diagnostic `protobuf:"bytes,2,rep,name=diagnostics,proto3" json:"diagnostics,omitempty"` | ||
1143 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
1144 | XXX_unrecognized []byte `json:"-"` | ||
1145 | XXX_sizecache int32 `json:"-"` | ||
1146 | } | ||
1147 | |||
1148 | func (m *UpgradeResourceState_Response) Reset() { *m = UpgradeResourceState_Response{} } | ||
1149 | func (m *UpgradeResourceState_Response) String() string { return proto.CompactTextString(m) } | ||
1150 | func (*UpgradeResourceState_Response) ProtoMessage() {} | ||
1151 | func (*UpgradeResourceState_Response) Descriptor() ([]byte, []int) { | ||
1152 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{8, 1} | ||
1153 | } | ||
1154 | func (m *UpgradeResourceState_Response) XXX_Unmarshal(b []byte) error { | ||
1155 | return xxx_messageInfo_UpgradeResourceState_Response.Unmarshal(m, b) | ||
1156 | } | ||
1157 | func (m *UpgradeResourceState_Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
1158 | return xxx_messageInfo_UpgradeResourceState_Response.Marshal(b, m, deterministic) | ||
1159 | } | ||
1160 | func (dst *UpgradeResourceState_Response) XXX_Merge(src proto.Message) { | ||
1161 | xxx_messageInfo_UpgradeResourceState_Response.Merge(dst, src) | ||
1162 | } | ||
1163 | func (m *UpgradeResourceState_Response) XXX_Size() int { | ||
1164 | return xxx_messageInfo_UpgradeResourceState_Response.Size(m) | ||
1165 | } | ||
1166 | func (m *UpgradeResourceState_Response) XXX_DiscardUnknown() { | ||
1167 | xxx_messageInfo_UpgradeResourceState_Response.DiscardUnknown(m) | ||
1168 | } | ||
1169 | |||
1170 | var xxx_messageInfo_UpgradeResourceState_Response proto.InternalMessageInfo | ||
1171 | |||
1172 | func (m *UpgradeResourceState_Response) GetUpgradedState() *DynamicValue { | ||
1173 | if m != nil { | ||
1174 | return m.UpgradedState | ||
1175 | } | ||
1176 | return nil | ||
1177 | } | ||
1178 | |||
1179 | func (m *UpgradeResourceState_Response) GetDiagnostics() []*Diagnostic { | ||
1180 | if m != nil { | ||
1181 | return m.Diagnostics | ||
1182 | } | ||
1183 | return nil | ||
1184 | } | ||
1185 | |||
1186 | type ValidateResourceTypeConfig struct { | ||
1187 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
1188 | XXX_unrecognized []byte `json:"-"` | ||
1189 | XXX_sizecache int32 `json:"-"` | ||
1190 | } | ||
1191 | |||
1192 | func (m *ValidateResourceTypeConfig) Reset() { *m = ValidateResourceTypeConfig{} } | ||
1193 | func (m *ValidateResourceTypeConfig) String() string { return proto.CompactTextString(m) } | ||
1194 | func (*ValidateResourceTypeConfig) ProtoMessage() {} | ||
1195 | func (*ValidateResourceTypeConfig) Descriptor() ([]byte, []int) { | ||
1196 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{9} | ||
1197 | } | ||
1198 | func (m *ValidateResourceTypeConfig) XXX_Unmarshal(b []byte) error { | ||
1199 | return xxx_messageInfo_ValidateResourceTypeConfig.Unmarshal(m, b) | ||
1200 | } | ||
1201 | func (m *ValidateResourceTypeConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
1202 | return xxx_messageInfo_ValidateResourceTypeConfig.Marshal(b, m, deterministic) | ||
1203 | } | ||
1204 | func (dst *ValidateResourceTypeConfig) XXX_Merge(src proto.Message) { | ||
1205 | xxx_messageInfo_ValidateResourceTypeConfig.Merge(dst, src) | ||
1206 | } | ||
1207 | func (m *ValidateResourceTypeConfig) XXX_Size() int { | ||
1208 | return xxx_messageInfo_ValidateResourceTypeConfig.Size(m) | ||
1209 | } | ||
1210 | func (m *ValidateResourceTypeConfig) XXX_DiscardUnknown() { | ||
1211 | xxx_messageInfo_ValidateResourceTypeConfig.DiscardUnknown(m) | ||
1212 | } | ||
1213 | |||
1214 | var xxx_messageInfo_ValidateResourceTypeConfig proto.InternalMessageInfo | ||
1215 | |||
1216 | type ValidateResourceTypeConfig_Request struct { | ||
1217 | TypeName string `protobuf:"bytes,1,opt,name=type_name,json=typeName,proto3" json:"type_name,omitempty"` | ||
1218 | Config *DynamicValue `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"` | ||
1219 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
1220 | XXX_unrecognized []byte `json:"-"` | ||
1221 | XXX_sizecache int32 `json:"-"` | ||
1222 | } | ||
1223 | |||
1224 | func (m *ValidateResourceTypeConfig_Request) Reset() { *m = ValidateResourceTypeConfig_Request{} } | ||
1225 | func (m *ValidateResourceTypeConfig_Request) String() string { return proto.CompactTextString(m) } | ||
1226 | func (*ValidateResourceTypeConfig_Request) ProtoMessage() {} | ||
1227 | func (*ValidateResourceTypeConfig_Request) Descriptor() ([]byte, []int) { | ||
1228 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{9, 0} | ||
1229 | } | ||
1230 | func (m *ValidateResourceTypeConfig_Request) XXX_Unmarshal(b []byte) error { | ||
1231 | return xxx_messageInfo_ValidateResourceTypeConfig_Request.Unmarshal(m, b) | ||
1232 | } | ||
1233 | func (m *ValidateResourceTypeConfig_Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
1234 | return xxx_messageInfo_ValidateResourceTypeConfig_Request.Marshal(b, m, deterministic) | ||
1235 | } | ||
1236 | func (dst *ValidateResourceTypeConfig_Request) XXX_Merge(src proto.Message) { | ||
1237 | xxx_messageInfo_ValidateResourceTypeConfig_Request.Merge(dst, src) | ||
1238 | } | ||
1239 | func (m *ValidateResourceTypeConfig_Request) XXX_Size() int { | ||
1240 | return xxx_messageInfo_ValidateResourceTypeConfig_Request.Size(m) | ||
1241 | } | ||
1242 | func (m *ValidateResourceTypeConfig_Request) XXX_DiscardUnknown() { | ||
1243 | xxx_messageInfo_ValidateResourceTypeConfig_Request.DiscardUnknown(m) | ||
1244 | } | ||
1245 | |||
1246 | var xxx_messageInfo_ValidateResourceTypeConfig_Request proto.InternalMessageInfo | ||
1247 | |||
1248 | func (m *ValidateResourceTypeConfig_Request) GetTypeName() string { | ||
1249 | if m != nil { | ||
1250 | return m.TypeName | ||
1251 | } | ||
1252 | return "" | ||
1253 | } | ||
1254 | |||
1255 | func (m *ValidateResourceTypeConfig_Request) GetConfig() *DynamicValue { | ||
1256 | if m != nil { | ||
1257 | return m.Config | ||
1258 | } | ||
1259 | return nil | ||
1260 | } | ||
1261 | |||
1262 | type ValidateResourceTypeConfig_Response struct { | ||
1263 | Diagnostics []*Diagnostic `protobuf:"bytes,1,rep,name=diagnostics,proto3" json:"diagnostics,omitempty"` | ||
1264 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
1265 | XXX_unrecognized []byte `json:"-"` | ||
1266 | XXX_sizecache int32 `json:"-"` | ||
1267 | } | ||
1268 | |||
1269 | func (m *ValidateResourceTypeConfig_Response) Reset() { *m = ValidateResourceTypeConfig_Response{} } | ||
1270 | func (m *ValidateResourceTypeConfig_Response) String() string { return proto.CompactTextString(m) } | ||
1271 | func (*ValidateResourceTypeConfig_Response) ProtoMessage() {} | ||
1272 | func (*ValidateResourceTypeConfig_Response) Descriptor() ([]byte, []int) { | ||
1273 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{9, 1} | ||
1274 | } | ||
1275 | func (m *ValidateResourceTypeConfig_Response) XXX_Unmarshal(b []byte) error { | ||
1276 | return xxx_messageInfo_ValidateResourceTypeConfig_Response.Unmarshal(m, b) | ||
1277 | } | ||
1278 | func (m *ValidateResourceTypeConfig_Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
1279 | return xxx_messageInfo_ValidateResourceTypeConfig_Response.Marshal(b, m, deterministic) | ||
1280 | } | ||
1281 | func (dst *ValidateResourceTypeConfig_Response) XXX_Merge(src proto.Message) { | ||
1282 | xxx_messageInfo_ValidateResourceTypeConfig_Response.Merge(dst, src) | ||
1283 | } | ||
1284 | func (m *ValidateResourceTypeConfig_Response) XXX_Size() int { | ||
1285 | return xxx_messageInfo_ValidateResourceTypeConfig_Response.Size(m) | ||
1286 | } | ||
1287 | func (m *ValidateResourceTypeConfig_Response) XXX_DiscardUnknown() { | ||
1288 | xxx_messageInfo_ValidateResourceTypeConfig_Response.DiscardUnknown(m) | ||
1289 | } | ||
1290 | |||
1291 | var xxx_messageInfo_ValidateResourceTypeConfig_Response proto.InternalMessageInfo | ||
1292 | |||
1293 | func (m *ValidateResourceTypeConfig_Response) GetDiagnostics() []*Diagnostic { | ||
1294 | if m != nil { | ||
1295 | return m.Diagnostics | ||
1296 | } | ||
1297 | return nil | ||
1298 | } | ||
1299 | |||
1300 | type ValidateDataSourceConfig struct { | ||
1301 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
1302 | XXX_unrecognized []byte `json:"-"` | ||
1303 | XXX_sizecache int32 `json:"-"` | ||
1304 | } | ||
1305 | |||
1306 | func (m *ValidateDataSourceConfig) Reset() { *m = ValidateDataSourceConfig{} } | ||
1307 | func (m *ValidateDataSourceConfig) String() string { return proto.CompactTextString(m) } | ||
1308 | func (*ValidateDataSourceConfig) ProtoMessage() {} | ||
1309 | func (*ValidateDataSourceConfig) Descriptor() ([]byte, []int) { | ||
1310 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{10} | ||
1311 | } | ||
1312 | func (m *ValidateDataSourceConfig) XXX_Unmarshal(b []byte) error { | ||
1313 | return xxx_messageInfo_ValidateDataSourceConfig.Unmarshal(m, b) | ||
1314 | } | ||
1315 | func (m *ValidateDataSourceConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
1316 | return xxx_messageInfo_ValidateDataSourceConfig.Marshal(b, m, deterministic) | ||
1317 | } | ||
1318 | func (dst *ValidateDataSourceConfig) XXX_Merge(src proto.Message) { | ||
1319 | xxx_messageInfo_ValidateDataSourceConfig.Merge(dst, src) | ||
1320 | } | ||
1321 | func (m *ValidateDataSourceConfig) XXX_Size() int { | ||
1322 | return xxx_messageInfo_ValidateDataSourceConfig.Size(m) | ||
1323 | } | ||
1324 | func (m *ValidateDataSourceConfig) XXX_DiscardUnknown() { | ||
1325 | xxx_messageInfo_ValidateDataSourceConfig.DiscardUnknown(m) | ||
1326 | } | ||
1327 | |||
1328 | var xxx_messageInfo_ValidateDataSourceConfig proto.InternalMessageInfo | ||
1329 | |||
1330 | type ValidateDataSourceConfig_Request struct { | ||
1331 | TypeName string `protobuf:"bytes,1,opt,name=type_name,json=typeName,proto3" json:"type_name,omitempty"` | ||
1332 | Config *DynamicValue `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"` | ||
1333 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
1334 | XXX_unrecognized []byte `json:"-"` | ||
1335 | XXX_sizecache int32 `json:"-"` | ||
1336 | } | ||
1337 | |||
1338 | func (m *ValidateDataSourceConfig_Request) Reset() { *m = ValidateDataSourceConfig_Request{} } | ||
1339 | func (m *ValidateDataSourceConfig_Request) String() string { return proto.CompactTextString(m) } | ||
1340 | func (*ValidateDataSourceConfig_Request) ProtoMessage() {} | ||
1341 | func (*ValidateDataSourceConfig_Request) Descriptor() ([]byte, []int) { | ||
1342 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{10, 0} | ||
1343 | } | ||
1344 | func (m *ValidateDataSourceConfig_Request) XXX_Unmarshal(b []byte) error { | ||
1345 | return xxx_messageInfo_ValidateDataSourceConfig_Request.Unmarshal(m, b) | ||
1346 | } | ||
1347 | func (m *ValidateDataSourceConfig_Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
1348 | return xxx_messageInfo_ValidateDataSourceConfig_Request.Marshal(b, m, deterministic) | ||
1349 | } | ||
1350 | func (dst *ValidateDataSourceConfig_Request) XXX_Merge(src proto.Message) { | ||
1351 | xxx_messageInfo_ValidateDataSourceConfig_Request.Merge(dst, src) | ||
1352 | } | ||
1353 | func (m *ValidateDataSourceConfig_Request) XXX_Size() int { | ||
1354 | return xxx_messageInfo_ValidateDataSourceConfig_Request.Size(m) | ||
1355 | } | ||
1356 | func (m *ValidateDataSourceConfig_Request) XXX_DiscardUnknown() { | ||
1357 | xxx_messageInfo_ValidateDataSourceConfig_Request.DiscardUnknown(m) | ||
1358 | } | ||
1359 | |||
1360 | var xxx_messageInfo_ValidateDataSourceConfig_Request proto.InternalMessageInfo | ||
1361 | |||
1362 | func (m *ValidateDataSourceConfig_Request) GetTypeName() string { | ||
1363 | if m != nil { | ||
1364 | return m.TypeName | ||
1365 | } | ||
1366 | return "" | ||
1367 | } | ||
1368 | |||
1369 | func (m *ValidateDataSourceConfig_Request) GetConfig() *DynamicValue { | ||
1370 | if m != nil { | ||
1371 | return m.Config | ||
1372 | } | ||
1373 | return nil | ||
1374 | } | ||
1375 | |||
1376 | type ValidateDataSourceConfig_Response struct { | ||
1377 | Diagnostics []*Diagnostic `protobuf:"bytes,1,rep,name=diagnostics,proto3" json:"diagnostics,omitempty"` | ||
1378 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
1379 | XXX_unrecognized []byte `json:"-"` | ||
1380 | XXX_sizecache int32 `json:"-"` | ||
1381 | } | ||
1382 | |||
1383 | func (m *ValidateDataSourceConfig_Response) Reset() { *m = ValidateDataSourceConfig_Response{} } | ||
1384 | func (m *ValidateDataSourceConfig_Response) String() string { return proto.CompactTextString(m) } | ||
1385 | func (*ValidateDataSourceConfig_Response) ProtoMessage() {} | ||
1386 | func (*ValidateDataSourceConfig_Response) Descriptor() ([]byte, []int) { | ||
1387 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{10, 1} | ||
1388 | } | ||
1389 | func (m *ValidateDataSourceConfig_Response) XXX_Unmarshal(b []byte) error { | ||
1390 | return xxx_messageInfo_ValidateDataSourceConfig_Response.Unmarshal(m, b) | ||
1391 | } | ||
1392 | func (m *ValidateDataSourceConfig_Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
1393 | return xxx_messageInfo_ValidateDataSourceConfig_Response.Marshal(b, m, deterministic) | ||
1394 | } | ||
1395 | func (dst *ValidateDataSourceConfig_Response) XXX_Merge(src proto.Message) { | ||
1396 | xxx_messageInfo_ValidateDataSourceConfig_Response.Merge(dst, src) | ||
1397 | } | ||
1398 | func (m *ValidateDataSourceConfig_Response) XXX_Size() int { | ||
1399 | return xxx_messageInfo_ValidateDataSourceConfig_Response.Size(m) | ||
1400 | } | ||
1401 | func (m *ValidateDataSourceConfig_Response) XXX_DiscardUnknown() { | ||
1402 | xxx_messageInfo_ValidateDataSourceConfig_Response.DiscardUnknown(m) | ||
1403 | } | ||
1404 | |||
1405 | var xxx_messageInfo_ValidateDataSourceConfig_Response proto.InternalMessageInfo | ||
1406 | |||
1407 | func (m *ValidateDataSourceConfig_Response) GetDiagnostics() []*Diagnostic { | ||
1408 | if m != nil { | ||
1409 | return m.Diagnostics | ||
1410 | } | ||
1411 | return nil | ||
1412 | } | ||
1413 | |||
1414 | type Configure struct { | ||
1415 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
1416 | XXX_unrecognized []byte `json:"-"` | ||
1417 | XXX_sizecache int32 `json:"-"` | ||
1418 | } | ||
1419 | |||
1420 | func (m *Configure) Reset() { *m = Configure{} } | ||
1421 | func (m *Configure) String() string { return proto.CompactTextString(m) } | ||
1422 | func (*Configure) ProtoMessage() {} | ||
1423 | func (*Configure) Descriptor() ([]byte, []int) { | ||
1424 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{11} | ||
1425 | } | ||
1426 | func (m *Configure) XXX_Unmarshal(b []byte) error { | ||
1427 | return xxx_messageInfo_Configure.Unmarshal(m, b) | ||
1428 | } | ||
1429 | func (m *Configure) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
1430 | return xxx_messageInfo_Configure.Marshal(b, m, deterministic) | ||
1431 | } | ||
1432 | func (dst *Configure) XXX_Merge(src proto.Message) { | ||
1433 | xxx_messageInfo_Configure.Merge(dst, src) | ||
1434 | } | ||
1435 | func (m *Configure) XXX_Size() int { | ||
1436 | return xxx_messageInfo_Configure.Size(m) | ||
1437 | } | ||
1438 | func (m *Configure) XXX_DiscardUnknown() { | ||
1439 | xxx_messageInfo_Configure.DiscardUnknown(m) | ||
1440 | } | ||
1441 | |||
1442 | var xxx_messageInfo_Configure proto.InternalMessageInfo | ||
1443 | |||
1444 | type Configure_Request struct { | ||
1445 | TerraformVersion string `protobuf:"bytes,1,opt,name=terraform_version,json=terraformVersion,proto3" json:"terraform_version,omitempty"` | ||
1446 | Config *DynamicValue `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"` | ||
1447 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
1448 | XXX_unrecognized []byte `json:"-"` | ||
1449 | XXX_sizecache int32 `json:"-"` | ||
1450 | } | ||
1451 | |||
1452 | func (m *Configure_Request) Reset() { *m = Configure_Request{} } | ||
1453 | func (m *Configure_Request) String() string { return proto.CompactTextString(m) } | ||
1454 | func (*Configure_Request) ProtoMessage() {} | ||
1455 | func (*Configure_Request) Descriptor() ([]byte, []int) { | ||
1456 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{11, 0} | ||
1457 | } | ||
1458 | func (m *Configure_Request) XXX_Unmarshal(b []byte) error { | ||
1459 | return xxx_messageInfo_Configure_Request.Unmarshal(m, b) | ||
1460 | } | ||
1461 | func (m *Configure_Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
1462 | return xxx_messageInfo_Configure_Request.Marshal(b, m, deterministic) | ||
1463 | } | ||
1464 | func (dst *Configure_Request) XXX_Merge(src proto.Message) { | ||
1465 | xxx_messageInfo_Configure_Request.Merge(dst, src) | ||
1466 | } | ||
1467 | func (m *Configure_Request) XXX_Size() int { | ||
1468 | return xxx_messageInfo_Configure_Request.Size(m) | ||
1469 | } | ||
1470 | func (m *Configure_Request) XXX_DiscardUnknown() { | ||
1471 | xxx_messageInfo_Configure_Request.DiscardUnknown(m) | ||
1472 | } | ||
1473 | |||
1474 | var xxx_messageInfo_Configure_Request proto.InternalMessageInfo | ||
1475 | |||
1476 | func (m *Configure_Request) GetTerraformVersion() string { | ||
1477 | if m != nil { | ||
1478 | return m.TerraformVersion | ||
1479 | } | ||
1480 | return "" | ||
1481 | } | ||
1482 | |||
1483 | func (m *Configure_Request) GetConfig() *DynamicValue { | ||
1484 | if m != nil { | ||
1485 | return m.Config | ||
1486 | } | ||
1487 | return nil | ||
1488 | } | ||
1489 | |||
1490 | type Configure_Response struct { | ||
1491 | Diagnostics []*Diagnostic `protobuf:"bytes,1,rep,name=diagnostics,proto3" json:"diagnostics,omitempty"` | ||
1492 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
1493 | XXX_unrecognized []byte `json:"-"` | ||
1494 | XXX_sizecache int32 `json:"-"` | ||
1495 | } | ||
1496 | |||
1497 | func (m *Configure_Response) Reset() { *m = Configure_Response{} } | ||
1498 | func (m *Configure_Response) String() string { return proto.CompactTextString(m) } | ||
1499 | func (*Configure_Response) ProtoMessage() {} | ||
1500 | func (*Configure_Response) Descriptor() ([]byte, []int) { | ||
1501 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{11, 1} | ||
1502 | } | ||
1503 | func (m *Configure_Response) XXX_Unmarshal(b []byte) error { | ||
1504 | return xxx_messageInfo_Configure_Response.Unmarshal(m, b) | ||
1505 | } | ||
1506 | func (m *Configure_Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
1507 | return xxx_messageInfo_Configure_Response.Marshal(b, m, deterministic) | ||
1508 | } | ||
1509 | func (dst *Configure_Response) XXX_Merge(src proto.Message) { | ||
1510 | xxx_messageInfo_Configure_Response.Merge(dst, src) | ||
1511 | } | ||
1512 | func (m *Configure_Response) XXX_Size() int { | ||
1513 | return xxx_messageInfo_Configure_Response.Size(m) | ||
1514 | } | ||
1515 | func (m *Configure_Response) XXX_DiscardUnknown() { | ||
1516 | xxx_messageInfo_Configure_Response.DiscardUnknown(m) | ||
1517 | } | ||
1518 | |||
1519 | var xxx_messageInfo_Configure_Response proto.InternalMessageInfo | ||
1520 | |||
1521 | func (m *Configure_Response) GetDiagnostics() []*Diagnostic { | ||
1522 | if m != nil { | ||
1523 | return m.Diagnostics | ||
1524 | } | ||
1525 | return nil | ||
1526 | } | ||
1527 | |||
1528 | type ReadResource struct { | ||
1529 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
1530 | XXX_unrecognized []byte `json:"-"` | ||
1531 | XXX_sizecache int32 `json:"-"` | ||
1532 | } | ||
1533 | |||
1534 | func (m *ReadResource) Reset() { *m = ReadResource{} } | ||
1535 | func (m *ReadResource) String() string { return proto.CompactTextString(m) } | ||
1536 | func (*ReadResource) ProtoMessage() {} | ||
1537 | func (*ReadResource) Descriptor() ([]byte, []int) { | ||
1538 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{12} | ||
1539 | } | ||
1540 | func (m *ReadResource) XXX_Unmarshal(b []byte) error { | ||
1541 | return xxx_messageInfo_ReadResource.Unmarshal(m, b) | ||
1542 | } | ||
1543 | func (m *ReadResource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
1544 | return xxx_messageInfo_ReadResource.Marshal(b, m, deterministic) | ||
1545 | } | ||
1546 | func (dst *ReadResource) XXX_Merge(src proto.Message) { | ||
1547 | xxx_messageInfo_ReadResource.Merge(dst, src) | ||
1548 | } | ||
1549 | func (m *ReadResource) XXX_Size() int { | ||
1550 | return xxx_messageInfo_ReadResource.Size(m) | ||
1551 | } | ||
1552 | func (m *ReadResource) XXX_DiscardUnknown() { | ||
1553 | xxx_messageInfo_ReadResource.DiscardUnknown(m) | ||
1554 | } | ||
1555 | |||
1556 | var xxx_messageInfo_ReadResource proto.InternalMessageInfo | ||
1557 | |||
1558 | type ReadResource_Request struct { | ||
1559 | TypeName string `protobuf:"bytes,1,opt,name=type_name,json=typeName,proto3" json:"type_name,omitempty"` | ||
1560 | CurrentState *DynamicValue `protobuf:"bytes,2,opt,name=current_state,json=currentState,proto3" json:"current_state,omitempty"` | ||
1561 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
1562 | XXX_unrecognized []byte `json:"-"` | ||
1563 | XXX_sizecache int32 `json:"-"` | ||
1564 | } | ||
1565 | |||
1566 | func (m *ReadResource_Request) Reset() { *m = ReadResource_Request{} } | ||
1567 | func (m *ReadResource_Request) String() string { return proto.CompactTextString(m) } | ||
1568 | func (*ReadResource_Request) ProtoMessage() {} | ||
1569 | func (*ReadResource_Request) Descriptor() ([]byte, []int) { | ||
1570 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{12, 0} | ||
1571 | } | ||
1572 | func (m *ReadResource_Request) XXX_Unmarshal(b []byte) error { | ||
1573 | return xxx_messageInfo_ReadResource_Request.Unmarshal(m, b) | ||
1574 | } | ||
1575 | func (m *ReadResource_Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
1576 | return xxx_messageInfo_ReadResource_Request.Marshal(b, m, deterministic) | ||
1577 | } | ||
1578 | func (dst *ReadResource_Request) XXX_Merge(src proto.Message) { | ||
1579 | xxx_messageInfo_ReadResource_Request.Merge(dst, src) | ||
1580 | } | ||
1581 | func (m *ReadResource_Request) XXX_Size() int { | ||
1582 | return xxx_messageInfo_ReadResource_Request.Size(m) | ||
1583 | } | ||
1584 | func (m *ReadResource_Request) XXX_DiscardUnknown() { | ||
1585 | xxx_messageInfo_ReadResource_Request.DiscardUnknown(m) | ||
1586 | } | ||
1587 | |||
1588 | var xxx_messageInfo_ReadResource_Request proto.InternalMessageInfo | ||
1589 | |||
1590 | func (m *ReadResource_Request) GetTypeName() string { | ||
1591 | if m != nil { | ||
1592 | return m.TypeName | ||
1593 | } | ||
1594 | return "" | ||
1595 | } | ||
1596 | |||
1597 | func (m *ReadResource_Request) GetCurrentState() *DynamicValue { | ||
1598 | if m != nil { | ||
1599 | return m.CurrentState | ||
1600 | } | ||
1601 | return nil | ||
1602 | } | ||
1603 | |||
1604 | type ReadResource_Response struct { | ||
1605 | NewState *DynamicValue `protobuf:"bytes,1,opt,name=new_state,json=newState,proto3" json:"new_state,omitempty"` | ||
1606 | Diagnostics []*Diagnostic `protobuf:"bytes,2,rep,name=diagnostics,proto3" json:"diagnostics,omitempty"` | ||
1607 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
1608 | XXX_unrecognized []byte `json:"-"` | ||
1609 | XXX_sizecache int32 `json:"-"` | ||
1610 | } | ||
1611 | |||
1612 | func (m *ReadResource_Response) Reset() { *m = ReadResource_Response{} } | ||
1613 | func (m *ReadResource_Response) String() string { return proto.CompactTextString(m) } | ||
1614 | func (*ReadResource_Response) ProtoMessage() {} | ||
1615 | func (*ReadResource_Response) Descriptor() ([]byte, []int) { | ||
1616 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{12, 1} | ||
1617 | } | ||
1618 | func (m *ReadResource_Response) XXX_Unmarshal(b []byte) error { | ||
1619 | return xxx_messageInfo_ReadResource_Response.Unmarshal(m, b) | ||
1620 | } | ||
1621 | func (m *ReadResource_Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
1622 | return xxx_messageInfo_ReadResource_Response.Marshal(b, m, deterministic) | ||
1623 | } | ||
1624 | func (dst *ReadResource_Response) XXX_Merge(src proto.Message) { | ||
1625 | xxx_messageInfo_ReadResource_Response.Merge(dst, src) | ||
1626 | } | ||
1627 | func (m *ReadResource_Response) XXX_Size() int { | ||
1628 | return xxx_messageInfo_ReadResource_Response.Size(m) | ||
1629 | } | ||
1630 | func (m *ReadResource_Response) XXX_DiscardUnknown() { | ||
1631 | xxx_messageInfo_ReadResource_Response.DiscardUnknown(m) | ||
1632 | } | ||
1633 | |||
1634 | var xxx_messageInfo_ReadResource_Response proto.InternalMessageInfo | ||
1635 | |||
1636 | func (m *ReadResource_Response) GetNewState() *DynamicValue { | ||
1637 | if m != nil { | ||
1638 | return m.NewState | ||
1639 | } | ||
1640 | return nil | ||
1641 | } | ||
1642 | |||
1643 | func (m *ReadResource_Response) GetDiagnostics() []*Diagnostic { | ||
1644 | if m != nil { | ||
1645 | return m.Diagnostics | ||
1646 | } | ||
1647 | return nil | ||
1648 | } | ||
1649 | |||
1650 | type PlanResourceChange struct { | ||
1651 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
1652 | XXX_unrecognized []byte `json:"-"` | ||
1653 | XXX_sizecache int32 `json:"-"` | ||
1654 | } | ||
1655 | |||
1656 | func (m *PlanResourceChange) Reset() { *m = PlanResourceChange{} } | ||
1657 | func (m *PlanResourceChange) String() string { return proto.CompactTextString(m) } | ||
1658 | func (*PlanResourceChange) ProtoMessage() {} | ||
1659 | func (*PlanResourceChange) Descriptor() ([]byte, []int) { | ||
1660 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{13} | ||
1661 | } | ||
1662 | func (m *PlanResourceChange) XXX_Unmarshal(b []byte) error { | ||
1663 | return xxx_messageInfo_PlanResourceChange.Unmarshal(m, b) | ||
1664 | } | ||
1665 | func (m *PlanResourceChange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
1666 | return xxx_messageInfo_PlanResourceChange.Marshal(b, m, deterministic) | ||
1667 | } | ||
1668 | func (dst *PlanResourceChange) XXX_Merge(src proto.Message) { | ||
1669 | xxx_messageInfo_PlanResourceChange.Merge(dst, src) | ||
1670 | } | ||
1671 | func (m *PlanResourceChange) XXX_Size() int { | ||
1672 | return xxx_messageInfo_PlanResourceChange.Size(m) | ||
1673 | } | ||
1674 | func (m *PlanResourceChange) XXX_DiscardUnknown() { | ||
1675 | xxx_messageInfo_PlanResourceChange.DiscardUnknown(m) | ||
1676 | } | ||
1677 | |||
1678 | var xxx_messageInfo_PlanResourceChange proto.InternalMessageInfo | ||
1679 | |||
1680 | type PlanResourceChange_Request struct { | ||
1681 | TypeName string `protobuf:"bytes,1,opt,name=type_name,json=typeName,proto3" json:"type_name,omitempty"` | ||
1682 | PriorState *DynamicValue `protobuf:"bytes,2,opt,name=prior_state,json=priorState,proto3" json:"prior_state,omitempty"` | ||
1683 | ProposedNewState *DynamicValue `protobuf:"bytes,3,opt,name=proposed_new_state,json=proposedNewState,proto3" json:"proposed_new_state,omitempty"` | ||
1684 | Config *DynamicValue `protobuf:"bytes,4,opt,name=config,proto3" json:"config,omitempty"` | ||
1685 | PriorPrivate []byte `protobuf:"bytes,5,opt,name=prior_private,json=priorPrivate,proto3" json:"prior_private,omitempty"` | ||
1686 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
1687 | XXX_unrecognized []byte `json:"-"` | ||
1688 | XXX_sizecache int32 `json:"-"` | ||
1689 | } | ||
1690 | |||
1691 | func (m *PlanResourceChange_Request) Reset() { *m = PlanResourceChange_Request{} } | ||
1692 | func (m *PlanResourceChange_Request) String() string { return proto.CompactTextString(m) } | ||
1693 | func (*PlanResourceChange_Request) ProtoMessage() {} | ||
1694 | func (*PlanResourceChange_Request) Descriptor() ([]byte, []int) { | ||
1695 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{13, 0} | ||
1696 | } | ||
1697 | func (m *PlanResourceChange_Request) XXX_Unmarshal(b []byte) error { | ||
1698 | return xxx_messageInfo_PlanResourceChange_Request.Unmarshal(m, b) | ||
1699 | } | ||
1700 | func (m *PlanResourceChange_Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
1701 | return xxx_messageInfo_PlanResourceChange_Request.Marshal(b, m, deterministic) | ||
1702 | } | ||
1703 | func (dst *PlanResourceChange_Request) XXX_Merge(src proto.Message) { | ||
1704 | xxx_messageInfo_PlanResourceChange_Request.Merge(dst, src) | ||
1705 | } | ||
1706 | func (m *PlanResourceChange_Request) XXX_Size() int { | ||
1707 | return xxx_messageInfo_PlanResourceChange_Request.Size(m) | ||
1708 | } | ||
1709 | func (m *PlanResourceChange_Request) XXX_DiscardUnknown() { | ||
1710 | xxx_messageInfo_PlanResourceChange_Request.DiscardUnknown(m) | ||
1711 | } | ||
1712 | |||
1713 | var xxx_messageInfo_PlanResourceChange_Request proto.InternalMessageInfo | ||
1714 | |||
1715 | func (m *PlanResourceChange_Request) GetTypeName() string { | ||
1716 | if m != nil { | ||
1717 | return m.TypeName | ||
1718 | } | ||
1719 | return "" | ||
1720 | } | ||
1721 | |||
1722 | func (m *PlanResourceChange_Request) GetPriorState() *DynamicValue { | ||
1723 | if m != nil { | ||
1724 | return m.PriorState | ||
1725 | } | ||
1726 | return nil | ||
1727 | } | ||
1728 | |||
1729 | func (m *PlanResourceChange_Request) GetProposedNewState() *DynamicValue { | ||
1730 | if m != nil { | ||
1731 | return m.ProposedNewState | ||
1732 | } | ||
1733 | return nil | ||
1734 | } | ||
1735 | |||
1736 | func (m *PlanResourceChange_Request) GetConfig() *DynamicValue { | ||
1737 | if m != nil { | ||
1738 | return m.Config | ||
1739 | } | ||
1740 | return nil | ||
1741 | } | ||
1742 | |||
1743 | func (m *PlanResourceChange_Request) GetPriorPrivate() []byte { | ||
1744 | if m != nil { | ||
1745 | return m.PriorPrivate | ||
1746 | } | ||
1747 | return nil | ||
1748 | } | ||
1749 | |||
1750 | type PlanResourceChange_Response struct { | ||
1751 | PlannedState *DynamicValue `protobuf:"bytes,1,opt,name=planned_state,json=plannedState,proto3" json:"planned_state,omitempty"` | ||
1752 | RequiresReplace []*AttributePath `protobuf:"bytes,2,rep,name=requires_replace,json=requiresReplace,proto3" json:"requires_replace,omitempty"` | ||
1753 | PlannedPrivate []byte `protobuf:"bytes,3,opt,name=planned_private,json=plannedPrivate,proto3" json:"planned_private,omitempty"` | ||
1754 | Diagnostics []*Diagnostic `protobuf:"bytes,4,rep,name=diagnostics,proto3" json:"diagnostics,omitempty"` | ||
1755 | // This may be set only by the helper/schema "SDK" in the main Terraform | ||
1756 | // repository, to request that Terraform Core >=0.12 permit additional | ||
1757 | // inconsistencies that can result from the legacy SDK type system | ||
1758 | // and its imprecise mapping to the >=0.12 type system. | ||
1759 | // The change in behavior implied by this flag makes sense only for the | ||
1760 | // specific details of the legacy SDK type system, and are not a general | ||
1761 | // mechanism to avoid proper type handling in providers. | ||
1762 | // | ||
1763 | // ==== DO NOT USE THIS ==== | ||
1764 | // ==== THIS MUST BE LEFT UNSET IN ALL OTHER SDKS ==== | ||
1765 | // ==== DO NOT USE THIS ==== | ||
1766 | LegacyTypeSystem bool `protobuf:"varint,5,opt,name=legacy_type_system,json=legacyTypeSystem,proto3" json:"legacy_type_system,omitempty"` | ||
1767 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
1768 | XXX_unrecognized []byte `json:"-"` | ||
1769 | XXX_sizecache int32 `json:"-"` | ||
1770 | } | ||
1771 | |||
1772 | func (m *PlanResourceChange_Response) Reset() { *m = PlanResourceChange_Response{} } | ||
1773 | func (m *PlanResourceChange_Response) String() string { return proto.CompactTextString(m) } | ||
1774 | func (*PlanResourceChange_Response) ProtoMessage() {} | ||
1775 | func (*PlanResourceChange_Response) Descriptor() ([]byte, []int) { | ||
1776 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{13, 1} | ||
1777 | } | ||
1778 | func (m *PlanResourceChange_Response) XXX_Unmarshal(b []byte) error { | ||
1779 | return xxx_messageInfo_PlanResourceChange_Response.Unmarshal(m, b) | ||
1780 | } | ||
1781 | func (m *PlanResourceChange_Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
1782 | return xxx_messageInfo_PlanResourceChange_Response.Marshal(b, m, deterministic) | ||
1783 | } | ||
1784 | func (dst *PlanResourceChange_Response) XXX_Merge(src proto.Message) { | ||
1785 | xxx_messageInfo_PlanResourceChange_Response.Merge(dst, src) | ||
1786 | } | ||
1787 | func (m *PlanResourceChange_Response) XXX_Size() int { | ||
1788 | return xxx_messageInfo_PlanResourceChange_Response.Size(m) | ||
1789 | } | ||
1790 | func (m *PlanResourceChange_Response) XXX_DiscardUnknown() { | ||
1791 | xxx_messageInfo_PlanResourceChange_Response.DiscardUnknown(m) | ||
1792 | } | ||
1793 | |||
1794 | var xxx_messageInfo_PlanResourceChange_Response proto.InternalMessageInfo | ||
1795 | |||
1796 | func (m *PlanResourceChange_Response) GetPlannedState() *DynamicValue { | ||
1797 | if m != nil { | ||
1798 | return m.PlannedState | ||
1799 | } | ||
1800 | return nil | ||
1801 | } | ||
1802 | |||
1803 | func (m *PlanResourceChange_Response) GetRequiresReplace() []*AttributePath { | ||
1804 | if m != nil { | ||
1805 | return m.RequiresReplace | ||
1806 | } | ||
1807 | return nil | ||
1808 | } | ||
1809 | |||
1810 | func (m *PlanResourceChange_Response) GetPlannedPrivate() []byte { | ||
1811 | if m != nil { | ||
1812 | return m.PlannedPrivate | ||
1813 | } | ||
1814 | return nil | ||
1815 | } | ||
1816 | |||
1817 | func (m *PlanResourceChange_Response) GetDiagnostics() []*Diagnostic { | ||
1818 | if m != nil { | ||
1819 | return m.Diagnostics | ||
1820 | } | ||
1821 | return nil | ||
1822 | } | ||
1823 | |||
1824 | func (m *PlanResourceChange_Response) GetLegacyTypeSystem() bool { | ||
1825 | if m != nil { | ||
1826 | return m.LegacyTypeSystem | ||
1827 | } | ||
1828 | return false | ||
1829 | } | ||
1830 | |||
1831 | type ApplyResourceChange struct { | ||
1832 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
1833 | XXX_unrecognized []byte `json:"-"` | ||
1834 | XXX_sizecache int32 `json:"-"` | ||
1835 | } | ||
1836 | |||
1837 | func (m *ApplyResourceChange) Reset() { *m = ApplyResourceChange{} } | ||
1838 | func (m *ApplyResourceChange) String() string { return proto.CompactTextString(m) } | ||
1839 | func (*ApplyResourceChange) ProtoMessage() {} | ||
1840 | func (*ApplyResourceChange) Descriptor() ([]byte, []int) { | ||
1841 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{14} | ||
1842 | } | ||
1843 | func (m *ApplyResourceChange) XXX_Unmarshal(b []byte) error { | ||
1844 | return xxx_messageInfo_ApplyResourceChange.Unmarshal(m, b) | ||
1845 | } | ||
1846 | func (m *ApplyResourceChange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
1847 | return xxx_messageInfo_ApplyResourceChange.Marshal(b, m, deterministic) | ||
1848 | } | ||
1849 | func (dst *ApplyResourceChange) XXX_Merge(src proto.Message) { | ||
1850 | xxx_messageInfo_ApplyResourceChange.Merge(dst, src) | ||
1851 | } | ||
1852 | func (m *ApplyResourceChange) XXX_Size() int { | ||
1853 | return xxx_messageInfo_ApplyResourceChange.Size(m) | ||
1854 | } | ||
1855 | func (m *ApplyResourceChange) XXX_DiscardUnknown() { | ||
1856 | xxx_messageInfo_ApplyResourceChange.DiscardUnknown(m) | ||
1857 | } | ||
1858 | |||
1859 | var xxx_messageInfo_ApplyResourceChange proto.InternalMessageInfo | ||
1860 | |||
1861 | type ApplyResourceChange_Request struct { | ||
1862 | TypeName string `protobuf:"bytes,1,opt,name=type_name,json=typeName,proto3" json:"type_name,omitempty"` | ||
1863 | PriorState *DynamicValue `protobuf:"bytes,2,opt,name=prior_state,json=priorState,proto3" json:"prior_state,omitempty"` | ||
1864 | PlannedState *DynamicValue `protobuf:"bytes,3,opt,name=planned_state,json=plannedState,proto3" json:"planned_state,omitempty"` | ||
1865 | Config *DynamicValue `protobuf:"bytes,4,opt,name=config,proto3" json:"config,omitempty"` | ||
1866 | PlannedPrivate []byte `protobuf:"bytes,5,opt,name=planned_private,json=plannedPrivate,proto3" json:"planned_private,omitempty"` | ||
1867 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
1868 | XXX_unrecognized []byte `json:"-"` | ||
1869 | XXX_sizecache int32 `json:"-"` | ||
1870 | } | ||
1871 | |||
1872 | func (m *ApplyResourceChange_Request) Reset() { *m = ApplyResourceChange_Request{} } | ||
1873 | func (m *ApplyResourceChange_Request) String() string { return proto.CompactTextString(m) } | ||
1874 | func (*ApplyResourceChange_Request) ProtoMessage() {} | ||
1875 | func (*ApplyResourceChange_Request) Descriptor() ([]byte, []int) { | ||
1876 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{14, 0} | ||
1877 | } | ||
1878 | func (m *ApplyResourceChange_Request) XXX_Unmarshal(b []byte) error { | ||
1879 | return xxx_messageInfo_ApplyResourceChange_Request.Unmarshal(m, b) | ||
1880 | } | ||
1881 | func (m *ApplyResourceChange_Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
1882 | return xxx_messageInfo_ApplyResourceChange_Request.Marshal(b, m, deterministic) | ||
1883 | } | ||
1884 | func (dst *ApplyResourceChange_Request) XXX_Merge(src proto.Message) { | ||
1885 | xxx_messageInfo_ApplyResourceChange_Request.Merge(dst, src) | ||
1886 | } | ||
1887 | func (m *ApplyResourceChange_Request) XXX_Size() int { | ||
1888 | return xxx_messageInfo_ApplyResourceChange_Request.Size(m) | ||
1889 | } | ||
1890 | func (m *ApplyResourceChange_Request) XXX_DiscardUnknown() { | ||
1891 | xxx_messageInfo_ApplyResourceChange_Request.DiscardUnknown(m) | ||
1892 | } | ||
1893 | |||
1894 | var xxx_messageInfo_ApplyResourceChange_Request proto.InternalMessageInfo | ||
1895 | |||
1896 | func (m *ApplyResourceChange_Request) GetTypeName() string { | ||
1897 | if m != nil { | ||
1898 | return m.TypeName | ||
1899 | } | ||
1900 | return "" | ||
1901 | } | ||
1902 | |||
1903 | func (m *ApplyResourceChange_Request) GetPriorState() *DynamicValue { | ||
1904 | if m != nil { | ||
1905 | return m.PriorState | ||
1906 | } | ||
1907 | return nil | ||
1908 | } | ||
1909 | |||
1910 | func (m *ApplyResourceChange_Request) GetPlannedState() *DynamicValue { | ||
1911 | if m != nil { | ||
1912 | return m.PlannedState | ||
1913 | } | ||
1914 | return nil | ||
1915 | } | ||
1916 | |||
1917 | func (m *ApplyResourceChange_Request) GetConfig() *DynamicValue { | ||
1918 | if m != nil { | ||
1919 | return m.Config | ||
1920 | } | ||
1921 | return nil | ||
1922 | } | ||
1923 | |||
1924 | func (m *ApplyResourceChange_Request) GetPlannedPrivate() []byte { | ||
1925 | if m != nil { | ||
1926 | return m.PlannedPrivate | ||
1927 | } | ||
1928 | return nil | ||
1929 | } | ||
1930 | |||
1931 | type ApplyResourceChange_Response struct { | ||
1932 | NewState *DynamicValue `protobuf:"bytes,1,opt,name=new_state,json=newState,proto3" json:"new_state,omitempty"` | ||
1933 | Private []byte `protobuf:"bytes,2,opt,name=private,proto3" json:"private,omitempty"` | ||
1934 | Diagnostics []*Diagnostic `protobuf:"bytes,3,rep,name=diagnostics,proto3" json:"diagnostics,omitempty"` | ||
1935 | // This may be set only by the helper/schema "SDK" in the main Terraform | ||
1936 | // repository, to request that Terraform Core >=0.12 permit additional | ||
1937 | // inconsistencies that can result from the legacy SDK type system | ||
1938 | // and its imprecise mapping to the >=0.12 type system. | ||
1939 | // The change in behavior implied by this flag makes sense only for the | ||
1940 | // specific details of the legacy SDK type system, and are not a general | ||
1941 | // mechanism to avoid proper type handling in providers. | ||
1942 | // | ||
1943 | // ==== DO NOT USE THIS ==== | ||
1944 | // ==== THIS MUST BE LEFT UNSET IN ALL OTHER SDKS ==== | ||
1945 | // ==== DO NOT USE THIS ==== | ||
1946 | LegacyTypeSystem bool `protobuf:"varint,4,opt,name=legacy_type_system,json=legacyTypeSystem,proto3" json:"legacy_type_system,omitempty"` | ||
1947 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
1948 | XXX_unrecognized []byte `json:"-"` | ||
1949 | XXX_sizecache int32 `json:"-"` | ||
1950 | } | ||
1951 | |||
1952 | func (m *ApplyResourceChange_Response) Reset() { *m = ApplyResourceChange_Response{} } | ||
1953 | func (m *ApplyResourceChange_Response) String() string { return proto.CompactTextString(m) } | ||
1954 | func (*ApplyResourceChange_Response) ProtoMessage() {} | ||
1955 | func (*ApplyResourceChange_Response) Descriptor() ([]byte, []int) { | ||
1956 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{14, 1} | ||
1957 | } | ||
1958 | func (m *ApplyResourceChange_Response) XXX_Unmarshal(b []byte) error { | ||
1959 | return xxx_messageInfo_ApplyResourceChange_Response.Unmarshal(m, b) | ||
1960 | } | ||
1961 | func (m *ApplyResourceChange_Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
1962 | return xxx_messageInfo_ApplyResourceChange_Response.Marshal(b, m, deterministic) | ||
1963 | } | ||
1964 | func (dst *ApplyResourceChange_Response) XXX_Merge(src proto.Message) { | ||
1965 | xxx_messageInfo_ApplyResourceChange_Response.Merge(dst, src) | ||
1966 | } | ||
1967 | func (m *ApplyResourceChange_Response) XXX_Size() int { | ||
1968 | return xxx_messageInfo_ApplyResourceChange_Response.Size(m) | ||
1969 | } | ||
1970 | func (m *ApplyResourceChange_Response) XXX_DiscardUnknown() { | ||
1971 | xxx_messageInfo_ApplyResourceChange_Response.DiscardUnknown(m) | ||
1972 | } | ||
1973 | |||
1974 | var xxx_messageInfo_ApplyResourceChange_Response proto.InternalMessageInfo | ||
1975 | |||
1976 | func (m *ApplyResourceChange_Response) GetNewState() *DynamicValue { | ||
1977 | if m != nil { | ||
1978 | return m.NewState | ||
1979 | } | ||
1980 | return nil | ||
1981 | } | ||
1982 | |||
1983 | func (m *ApplyResourceChange_Response) GetPrivate() []byte { | ||
1984 | if m != nil { | ||
1985 | return m.Private | ||
1986 | } | ||
1987 | return nil | ||
1988 | } | ||
1989 | |||
1990 | func (m *ApplyResourceChange_Response) GetDiagnostics() []*Diagnostic { | ||
1991 | if m != nil { | ||
1992 | return m.Diagnostics | ||
1993 | } | ||
1994 | return nil | ||
1995 | } | ||
1996 | |||
1997 | func (m *ApplyResourceChange_Response) GetLegacyTypeSystem() bool { | ||
1998 | if m != nil { | ||
1999 | return m.LegacyTypeSystem | ||
2000 | } | ||
2001 | return false | ||
2002 | } | ||
2003 | |||
2004 | type ImportResourceState struct { | ||
2005 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
2006 | XXX_unrecognized []byte `json:"-"` | ||
2007 | XXX_sizecache int32 `json:"-"` | ||
2008 | } | ||
2009 | |||
2010 | func (m *ImportResourceState) Reset() { *m = ImportResourceState{} } | ||
2011 | func (m *ImportResourceState) String() string { return proto.CompactTextString(m) } | ||
2012 | func (*ImportResourceState) ProtoMessage() {} | ||
2013 | func (*ImportResourceState) Descriptor() ([]byte, []int) { | ||
2014 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{15} | ||
2015 | } | ||
2016 | func (m *ImportResourceState) XXX_Unmarshal(b []byte) error { | ||
2017 | return xxx_messageInfo_ImportResourceState.Unmarshal(m, b) | ||
2018 | } | ||
2019 | func (m *ImportResourceState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
2020 | return xxx_messageInfo_ImportResourceState.Marshal(b, m, deterministic) | ||
2021 | } | ||
2022 | func (dst *ImportResourceState) XXX_Merge(src proto.Message) { | ||
2023 | xxx_messageInfo_ImportResourceState.Merge(dst, src) | ||
2024 | } | ||
2025 | func (m *ImportResourceState) XXX_Size() int { | ||
2026 | return xxx_messageInfo_ImportResourceState.Size(m) | ||
2027 | } | ||
2028 | func (m *ImportResourceState) XXX_DiscardUnknown() { | ||
2029 | xxx_messageInfo_ImportResourceState.DiscardUnknown(m) | ||
2030 | } | ||
2031 | |||
2032 | var xxx_messageInfo_ImportResourceState proto.InternalMessageInfo | ||
2033 | |||
2034 | type ImportResourceState_Request struct { | ||
2035 | TypeName string `protobuf:"bytes,1,opt,name=type_name,json=typeName,proto3" json:"type_name,omitempty"` | ||
2036 | Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` | ||
2037 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
2038 | XXX_unrecognized []byte `json:"-"` | ||
2039 | XXX_sizecache int32 `json:"-"` | ||
2040 | } | ||
2041 | |||
2042 | func (m *ImportResourceState_Request) Reset() { *m = ImportResourceState_Request{} } | ||
2043 | func (m *ImportResourceState_Request) String() string { return proto.CompactTextString(m) } | ||
2044 | func (*ImportResourceState_Request) ProtoMessage() {} | ||
2045 | func (*ImportResourceState_Request) Descriptor() ([]byte, []int) { | ||
2046 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{15, 0} | ||
2047 | } | ||
2048 | func (m *ImportResourceState_Request) XXX_Unmarshal(b []byte) error { | ||
2049 | return xxx_messageInfo_ImportResourceState_Request.Unmarshal(m, b) | ||
2050 | } | ||
2051 | func (m *ImportResourceState_Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
2052 | return xxx_messageInfo_ImportResourceState_Request.Marshal(b, m, deterministic) | ||
2053 | } | ||
2054 | func (dst *ImportResourceState_Request) XXX_Merge(src proto.Message) { | ||
2055 | xxx_messageInfo_ImportResourceState_Request.Merge(dst, src) | ||
2056 | } | ||
2057 | func (m *ImportResourceState_Request) XXX_Size() int { | ||
2058 | return xxx_messageInfo_ImportResourceState_Request.Size(m) | ||
2059 | } | ||
2060 | func (m *ImportResourceState_Request) XXX_DiscardUnknown() { | ||
2061 | xxx_messageInfo_ImportResourceState_Request.DiscardUnknown(m) | ||
2062 | } | ||
2063 | |||
2064 | var xxx_messageInfo_ImportResourceState_Request proto.InternalMessageInfo | ||
2065 | |||
2066 | func (m *ImportResourceState_Request) GetTypeName() string { | ||
2067 | if m != nil { | ||
2068 | return m.TypeName | ||
2069 | } | ||
2070 | return "" | ||
2071 | } | ||
2072 | |||
2073 | func (m *ImportResourceState_Request) GetId() string { | ||
2074 | if m != nil { | ||
2075 | return m.Id | ||
2076 | } | ||
2077 | return "" | ||
2078 | } | ||
2079 | |||
2080 | type ImportResourceState_ImportedResource struct { | ||
2081 | TypeName string `protobuf:"bytes,1,opt,name=type_name,json=typeName,proto3" json:"type_name,omitempty"` | ||
2082 | State *DynamicValue `protobuf:"bytes,2,opt,name=state,proto3" json:"state,omitempty"` | ||
2083 | Private []byte `protobuf:"bytes,3,opt,name=private,proto3" json:"private,omitempty"` | ||
2084 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
2085 | XXX_unrecognized []byte `json:"-"` | ||
2086 | XXX_sizecache int32 `json:"-"` | ||
2087 | } | ||
2088 | |||
2089 | func (m *ImportResourceState_ImportedResource) Reset() { *m = ImportResourceState_ImportedResource{} } | ||
2090 | func (m *ImportResourceState_ImportedResource) String() string { return proto.CompactTextString(m) } | ||
2091 | func (*ImportResourceState_ImportedResource) ProtoMessage() {} | ||
2092 | func (*ImportResourceState_ImportedResource) Descriptor() ([]byte, []int) { | ||
2093 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{15, 1} | ||
2094 | } | ||
2095 | func (m *ImportResourceState_ImportedResource) XXX_Unmarshal(b []byte) error { | ||
2096 | return xxx_messageInfo_ImportResourceState_ImportedResource.Unmarshal(m, b) | ||
2097 | } | ||
2098 | func (m *ImportResourceState_ImportedResource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
2099 | return xxx_messageInfo_ImportResourceState_ImportedResource.Marshal(b, m, deterministic) | ||
2100 | } | ||
2101 | func (dst *ImportResourceState_ImportedResource) XXX_Merge(src proto.Message) { | ||
2102 | xxx_messageInfo_ImportResourceState_ImportedResource.Merge(dst, src) | ||
2103 | } | ||
2104 | func (m *ImportResourceState_ImportedResource) XXX_Size() int { | ||
2105 | return xxx_messageInfo_ImportResourceState_ImportedResource.Size(m) | ||
2106 | } | ||
2107 | func (m *ImportResourceState_ImportedResource) XXX_DiscardUnknown() { | ||
2108 | xxx_messageInfo_ImportResourceState_ImportedResource.DiscardUnknown(m) | ||
2109 | } | ||
2110 | |||
2111 | var xxx_messageInfo_ImportResourceState_ImportedResource proto.InternalMessageInfo | ||
2112 | |||
2113 | func (m *ImportResourceState_ImportedResource) GetTypeName() string { | ||
2114 | if m != nil { | ||
2115 | return m.TypeName | ||
2116 | } | ||
2117 | return "" | ||
2118 | } | ||
2119 | |||
2120 | func (m *ImportResourceState_ImportedResource) GetState() *DynamicValue { | ||
2121 | if m != nil { | ||
2122 | return m.State | ||
2123 | } | ||
2124 | return nil | ||
2125 | } | ||
2126 | |||
2127 | func (m *ImportResourceState_ImportedResource) GetPrivate() []byte { | ||
2128 | if m != nil { | ||
2129 | return m.Private | ||
2130 | } | ||
2131 | return nil | ||
2132 | } | ||
2133 | |||
2134 | type ImportResourceState_Response struct { | ||
2135 | ImportedResources []*ImportResourceState_ImportedResource `protobuf:"bytes,1,rep,name=imported_resources,json=importedResources,proto3" json:"imported_resources,omitempty"` | ||
2136 | Diagnostics []*Diagnostic `protobuf:"bytes,2,rep,name=diagnostics,proto3" json:"diagnostics,omitempty"` | ||
2137 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
2138 | XXX_unrecognized []byte `json:"-"` | ||
2139 | XXX_sizecache int32 `json:"-"` | ||
2140 | } | ||
2141 | |||
2142 | func (m *ImportResourceState_Response) Reset() { *m = ImportResourceState_Response{} } | ||
2143 | func (m *ImportResourceState_Response) String() string { return proto.CompactTextString(m) } | ||
2144 | func (*ImportResourceState_Response) ProtoMessage() {} | ||
2145 | func (*ImportResourceState_Response) Descriptor() ([]byte, []int) { | ||
2146 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{15, 2} | ||
2147 | } | ||
2148 | func (m *ImportResourceState_Response) XXX_Unmarshal(b []byte) error { | ||
2149 | return xxx_messageInfo_ImportResourceState_Response.Unmarshal(m, b) | ||
2150 | } | ||
2151 | func (m *ImportResourceState_Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
2152 | return xxx_messageInfo_ImportResourceState_Response.Marshal(b, m, deterministic) | ||
2153 | } | ||
2154 | func (dst *ImportResourceState_Response) XXX_Merge(src proto.Message) { | ||
2155 | xxx_messageInfo_ImportResourceState_Response.Merge(dst, src) | ||
2156 | } | ||
2157 | func (m *ImportResourceState_Response) XXX_Size() int { | ||
2158 | return xxx_messageInfo_ImportResourceState_Response.Size(m) | ||
2159 | } | ||
2160 | func (m *ImportResourceState_Response) XXX_DiscardUnknown() { | ||
2161 | xxx_messageInfo_ImportResourceState_Response.DiscardUnknown(m) | ||
2162 | } | ||
2163 | |||
2164 | var xxx_messageInfo_ImportResourceState_Response proto.InternalMessageInfo | ||
2165 | |||
2166 | func (m *ImportResourceState_Response) GetImportedResources() []*ImportResourceState_ImportedResource { | ||
2167 | if m != nil { | ||
2168 | return m.ImportedResources | ||
2169 | } | ||
2170 | return nil | ||
2171 | } | ||
2172 | |||
2173 | func (m *ImportResourceState_Response) GetDiagnostics() []*Diagnostic { | ||
2174 | if m != nil { | ||
2175 | return m.Diagnostics | ||
2176 | } | ||
2177 | return nil | ||
2178 | } | ||
2179 | |||
2180 | type ReadDataSource struct { | ||
2181 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
2182 | XXX_unrecognized []byte `json:"-"` | ||
2183 | XXX_sizecache int32 `json:"-"` | ||
2184 | } | ||
2185 | |||
2186 | func (m *ReadDataSource) Reset() { *m = ReadDataSource{} } | ||
2187 | func (m *ReadDataSource) String() string { return proto.CompactTextString(m) } | ||
2188 | func (*ReadDataSource) ProtoMessage() {} | ||
2189 | func (*ReadDataSource) Descriptor() ([]byte, []int) { | ||
2190 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{16} | ||
2191 | } | ||
2192 | func (m *ReadDataSource) XXX_Unmarshal(b []byte) error { | ||
2193 | return xxx_messageInfo_ReadDataSource.Unmarshal(m, b) | ||
2194 | } | ||
2195 | func (m *ReadDataSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
2196 | return xxx_messageInfo_ReadDataSource.Marshal(b, m, deterministic) | ||
2197 | } | ||
2198 | func (dst *ReadDataSource) XXX_Merge(src proto.Message) { | ||
2199 | xxx_messageInfo_ReadDataSource.Merge(dst, src) | ||
2200 | } | ||
2201 | func (m *ReadDataSource) XXX_Size() int { | ||
2202 | return xxx_messageInfo_ReadDataSource.Size(m) | ||
2203 | } | ||
2204 | func (m *ReadDataSource) XXX_DiscardUnknown() { | ||
2205 | xxx_messageInfo_ReadDataSource.DiscardUnknown(m) | ||
2206 | } | ||
2207 | |||
2208 | var xxx_messageInfo_ReadDataSource proto.InternalMessageInfo | ||
2209 | |||
2210 | type ReadDataSource_Request struct { | ||
2211 | TypeName string `protobuf:"bytes,1,opt,name=type_name,json=typeName,proto3" json:"type_name,omitempty"` | ||
2212 | Config *DynamicValue `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"` | ||
2213 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
2214 | XXX_unrecognized []byte `json:"-"` | ||
2215 | XXX_sizecache int32 `json:"-"` | ||
2216 | } | ||
2217 | |||
2218 | func (m *ReadDataSource_Request) Reset() { *m = ReadDataSource_Request{} } | ||
2219 | func (m *ReadDataSource_Request) String() string { return proto.CompactTextString(m) } | ||
2220 | func (*ReadDataSource_Request) ProtoMessage() {} | ||
2221 | func (*ReadDataSource_Request) Descriptor() ([]byte, []int) { | ||
2222 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{16, 0} | ||
2223 | } | ||
2224 | func (m *ReadDataSource_Request) XXX_Unmarshal(b []byte) error { | ||
2225 | return xxx_messageInfo_ReadDataSource_Request.Unmarshal(m, b) | ||
2226 | } | ||
2227 | func (m *ReadDataSource_Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
2228 | return xxx_messageInfo_ReadDataSource_Request.Marshal(b, m, deterministic) | ||
2229 | } | ||
2230 | func (dst *ReadDataSource_Request) XXX_Merge(src proto.Message) { | ||
2231 | xxx_messageInfo_ReadDataSource_Request.Merge(dst, src) | ||
2232 | } | ||
2233 | func (m *ReadDataSource_Request) XXX_Size() int { | ||
2234 | return xxx_messageInfo_ReadDataSource_Request.Size(m) | ||
2235 | } | ||
2236 | func (m *ReadDataSource_Request) XXX_DiscardUnknown() { | ||
2237 | xxx_messageInfo_ReadDataSource_Request.DiscardUnknown(m) | ||
2238 | } | ||
2239 | |||
2240 | var xxx_messageInfo_ReadDataSource_Request proto.InternalMessageInfo | ||
2241 | |||
2242 | func (m *ReadDataSource_Request) GetTypeName() string { | ||
2243 | if m != nil { | ||
2244 | return m.TypeName | ||
2245 | } | ||
2246 | return "" | ||
2247 | } | ||
2248 | |||
2249 | func (m *ReadDataSource_Request) GetConfig() *DynamicValue { | ||
2250 | if m != nil { | ||
2251 | return m.Config | ||
2252 | } | ||
2253 | return nil | ||
2254 | } | ||
2255 | |||
2256 | type ReadDataSource_Response struct { | ||
2257 | State *DynamicValue `protobuf:"bytes,1,opt,name=state,proto3" json:"state,omitempty"` | ||
2258 | Diagnostics []*Diagnostic `protobuf:"bytes,2,rep,name=diagnostics,proto3" json:"diagnostics,omitempty"` | ||
2259 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
2260 | XXX_unrecognized []byte `json:"-"` | ||
2261 | XXX_sizecache int32 `json:"-"` | ||
2262 | } | ||
2263 | |||
2264 | func (m *ReadDataSource_Response) Reset() { *m = ReadDataSource_Response{} } | ||
2265 | func (m *ReadDataSource_Response) String() string { return proto.CompactTextString(m) } | ||
2266 | func (*ReadDataSource_Response) ProtoMessage() {} | ||
2267 | func (*ReadDataSource_Response) Descriptor() ([]byte, []int) { | ||
2268 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{16, 1} | ||
2269 | } | ||
2270 | func (m *ReadDataSource_Response) XXX_Unmarshal(b []byte) error { | ||
2271 | return xxx_messageInfo_ReadDataSource_Response.Unmarshal(m, b) | ||
2272 | } | ||
2273 | func (m *ReadDataSource_Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
2274 | return xxx_messageInfo_ReadDataSource_Response.Marshal(b, m, deterministic) | ||
2275 | } | ||
2276 | func (dst *ReadDataSource_Response) XXX_Merge(src proto.Message) { | ||
2277 | xxx_messageInfo_ReadDataSource_Response.Merge(dst, src) | ||
2278 | } | ||
2279 | func (m *ReadDataSource_Response) XXX_Size() int { | ||
2280 | return xxx_messageInfo_ReadDataSource_Response.Size(m) | ||
2281 | } | ||
2282 | func (m *ReadDataSource_Response) XXX_DiscardUnknown() { | ||
2283 | xxx_messageInfo_ReadDataSource_Response.DiscardUnknown(m) | ||
2284 | } | ||
2285 | |||
2286 | var xxx_messageInfo_ReadDataSource_Response proto.InternalMessageInfo | ||
2287 | |||
2288 | func (m *ReadDataSource_Response) GetState() *DynamicValue { | ||
2289 | if m != nil { | ||
2290 | return m.State | ||
2291 | } | ||
2292 | return nil | ||
2293 | } | ||
2294 | |||
2295 | func (m *ReadDataSource_Response) GetDiagnostics() []*Diagnostic { | ||
2296 | if m != nil { | ||
2297 | return m.Diagnostics | ||
2298 | } | ||
2299 | return nil | ||
2300 | } | ||
2301 | |||
2302 | type GetProvisionerSchema struct { | ||
2303 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
2304 | XXX_unrecognized []byte `json:"-"` | ||
2305 | XXX_sizecache int32 `json:"-"` | ||
2306 | } | ||
2307 | |||
2308 | func (m *GetProvisionerSchema) Reset() { *m = GetProvisionerSchema{} } | ||
2309 | func (m *GetProvisionerSchema) String() string { return proto.CompactTextString(m) } | ||
2310 | func (*GetProvisionerSchema) ProtoMessage() {} | ||
2311 | func (*GetProvisionerSchema) Descriptor() ([]byte, []int) { | ||
2312 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{17} | ||
2313 | } | ||
2314 | func (m *GetProvisionerSchema) XXX_Unmarshal(b []byte) error { | ||
2315 | return xxx_messageInfo_GetProvisionerSchema.Unmarshal(m, b) | ||
2316 | } | ||
2317 | func (m *GetProvisionerSchema) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
2318 | return xxx_messageInfo_GetProvisionerSchema.Marshal(b, m, deterministic) | ||
2319 | } | ||
2320 | func (dst *GetProvisionerSchema) XXX_Merge(src proto.Message) { | ||
2321 | xxx_messageInfo_GetProvisionerSchema.Merge(dst, src) | ||
2322 | } | ||
2323 | func (m *GetProvisionerSchema) XXX_Size() int { | ||
2324 | return xxx_messageInfo_GetProvisionerSchema.Size(m) | ||
2325 | } | ||
2326 | func (m *GetProvisionerSchema) XXX_DiscardUnknown() { | ||
2327 | xxx_messageInfo_GetProvisionerSchema.DiscardUnknown(m) | ||
2328 | } | ||
2329 | |||
2330 | var xxx_messageInfo_GetProvisionerSchema proto.InternalMessageInfo | ||
2331 | |||
2332 | type GetProvisionerSchema_Request struct { | ||
2333 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
2334 | XXX_unrecognized []byte `json:"-"` | ||
2335 | XXX_sizecache int32 `json:"-"` | ||
2336 | } | ||
2337 | |||
2338 | func (m *GetProvisionerSchema_Request) Reset() { *m = GetProvisionerSchema_Request{} } | ||
2339 | func (m *GetProvisionerSchema_Request) String() string { return proto.CompactTextString(m) } | ||
2340 | func (*GetProvisionerSchema_Request) ProtoMessage() {} | ||
2341 | func (*GetProvisionerSchema_Request) Descriptor() ([]byte, []int) { | ||
2342 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{17, 0} | ||
2343 | } | ||
2344 | func (m *GetProvisionerSchema_Request) XXX_Unmarshal(b []byte) error { | ||
2345 | return xxx_messageInfo_GetProvisionerSchema_Request.Unmarshal(m, b) | ||
2346 | } | ||
2347 | func (m *GetProvisionerSchema_Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
2348 | return xxx_messageInfo_GetProvisionerSchema_Request.Marshal(b, m, deterministic) | ||
2349 | } | ||
2350 | func (dst *GetProvisionerSchema_Request) XXX_Merge(src proto.Message) { | ||
2351 | xxx_messageInfo_GetProvisionerSchema_Request.Merge(dst, src) | ||
2352 | } | ||
2353 | func (m *GetProvisionerSchema_Request) XXX_Size() int { | ||
2354 | return xxx_messageInfo_GetProvisionerSchema_Request.Size(m) | ||
2355 | } | ||
2356 | func (m *GetProvisionerSchema_Request) XXX_DiscardUnknown() { | ||
2357 | xxx_messageInfo_GetProvisionerSchema_Request.DiscardUnknown(m) | ||
2358 | } | ||
2359 | |||
2360 | var xxx_messageInfo_GetProvisionerSchema_Request proto.InternalMessageInfo | ||
2361 | |||
2362 | type GetProvisionerSchema_Response struct { | ||
2363 | Provisioner *Schema `protobuf:"bytes,1,opt,name=provisioner,proto3" json:"provisioner,omitempty"` | ||
2364 | Diagnostics []*Diagnostic `protobuf:"bytes,2,rep,name=diagnostics,proto3" json:"diagnostics,omitempty"` | ||
2365 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
2366 | XXX_unrecognized []byte `json:"-"` | ||
2367 | XXX_sizecache int32 `json:"-"` | ||
2368 | } | ||
2369 | |||
2370 | func (m *GetProvisionerSchema_Response) Reset() { *m = GetProvisionerSchema_Response{} } | ||
2371 | func (m *GetProvisionerSchema_Response) String() string { return proto.CompactTextString(m) } | ||
2372 | func (*GetProvisionerSchema_Response) ProtoMessage() {} | ||
2373 | func (*GetProvisionerSchema_Response) Descriptor() ([]byte, []int) { | ||
2374 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{17, 1} | ||
2375 | } | ||
2376 | func (m *GetProvisionerSchema_Response) XXX_Unmarshal(b []byte) error { | ||
2377 | return xxx_messageInfo_GetProvisionerSchema_Response.Unmarshal(m, b) | ||
2378 | } | ||
2379 | func (m *GetProvisionerSchema_Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
2380 | return xxx_messageInfo_GetProvisionerSchema_Response.Marshal(b, m, deterministic) | ||
2381 | } | ||
2382 | func (dst *GetProvisionerSchema_Response) XXX_Merge(src proto.Message) { | ||
2383 | xxx_messageInfo_GetProvisionerSchema_Response.Merge(dst, src) | ||
2384 | } | ||
2385 | func (m *GetProvisionerSchema_Response) XXX_Size() int { | ||
2386 | return xxx_messageInfo_GetProvisionerSchema_Response.Size(m) | ||
2387 | } | ||
2388 | func (m *GetProvisionerSchema_Response) XXX_DiscardUnknown() { | ||
2389 | xxx_messageInfo_GetProvisionerSchema_Response.DiscardUnknown(m) | ||
2390 | } | ||
2391 | |||
2392 | var xxx_messageInfo_GetProvisionerSchema_Response proto.InternalMessageInfo | ||
2393 | |||
2394 | func (m *GetProvisionerSchema_Response) GetProvisioner() *Schema { | ||
2395 | if m != nil { | ||
2396 | return m.Provisioner | ||
2397 | } | ||
2398 | return nil | ||
2399 | } | ||
2400 | |||
2401 | func (m *GetProvisionerSchema_Response) GetDiagnostics() []*Diagnostic { | ||
2402 | if m != nil { | ||
2403 | return m.Diagnostics | ||
2404 | } | ||
2405 | return nil | ||
2406 | } | ||
2407 | |||
2408 | type ValidateProvisionerConfig struct { | ||
2409 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
2410 | XXX_unrecognized []byte `json:"-"` | ||
2411 | XXX_sizecache int32 `json:"-"` | ||
2412 | } | ||
2413 | |||
2414 | func (m *ValidateProvisionerConfig) Reset() { *m = ValidateProvisionerConfig{} } | ||
2415 | func (m *ValidateProvisionerConfig) String() string { return proto.CompactTextString(m) } | ||
2416 | func (*ValidateProvisionerConfig) ProtoMessage() {} | ||
2417 | func (*ValidateProvisionerConfig) Descriptor() ([]byte, []int) { | ||
2418 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{18} | ||
2419 | } | ||
2420 | func (m *ValidateProvisionerConfig) XXX_Unmarshal(b []byte) error { | ||
2421 | return xxx_messageInfo_ValidateProvisionerConfig.Unmarshal(m, b) | ||
2422 | } | ||
2423 | func (m *ValidateProvisionerConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
2424 | return xxx_messageInfo_ValidateProvisionerConfig.Marshal(b, m, deterministic) | ||
2425 | } | ||
2426 | func (dst *ValidateProvisionerConfig) XXX_Merge(src proto.Message) { | ||
2427 | xxx_messageInfo_ValidateProvisionerConfig.Merge(dst, src) | ||
2428 | } | ||
2429 | func (m *ValidateProvisionerConfig) XXX_Size() int { | ||
2430 | return xxx_messageInfo_ValidateProvisionerConfig.Size(m) | ||
2431 | } | ||
2432 | func (m *ValidateProvisionerConfig) XXX_DiscardUnknown() { | ||
2433 | xxx_messageInfo_ValidateProvisionerConfig.DiscardUnknown(m) | ||
2434 | } | ||
2435 | |||
2436 | var xxx_messageInfo_ValidateProvisionerConfig proto.InternalMessageInfo | ||
2437 | |||
2438 | type ValidateProvisionerConfig_Request struct { | ||
2439 | Config *DynamicValue `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"` | ||
2440 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
2441 | XXX_unrecognized []byte `json:"-"` | ||
2442 | XXX_sizecache int32 `json:"-"` | ||
2443 | } | ||
2444 | |||
2445 | func (m *ValidateProvisionerConfig_Request) Reset() { *m = ValidateProvisionerConfig_Request{} } | ||
2446 | func (m *ValidateProvisionerConfig_Request) String() string { return proto.CompactTextString(m) } | ||
2447 | func (*ValidateProvisionerConfig_Request) ProtoMessage() {} | ||
2448 | func (*ValidateProvisionerConfig_Request) Descriptor() ([]byte, []int) { | ||
2449 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{18, 0} | ||
2450 | } | ||
2451 | func (m *ValidateProvisionerConfig_Request) XXX_Unmarshal(b []byte) error { | ||
2452 | return xxx_messageInfo_ValidateProvisionerConfig_Request.Unmarshal(m, b) | ||
2453 | } | ||
2454 | func (m *ValidateProvisionerConfig_Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
2455 | return xxx_messageInfo_ValidateProvisionerConfig_Request.Marshal(b, m, deterministic) | ||
2456 | } | ||
2457 | func (dst *ValidateProvisionerConfig_Request) XXX_Merge(src proto.Message) { | ||
2458 | xxx_messageInfo_ValidateProvisionerConfig_Request.Merge(dst, src) | ||
2459 | } | ||
2460 | func (m *ValidateProvisionerConfig_Request) XXX_Size() int { | ||
2461 | return xxx_messageInfo_ValidateProvisionerConfig_Request.Size(m) | ||
2462 | } | ||
2463 | func (m *ValidateProvisionerConfig_Request) XXX_DiscardUnknown() { | ||
2464 | xxx_messageInfo_ValidateProvisionerConfig_Request.DiscardUnknown(m) | ||
2465 | } | ||
2466 | |||
2467 | var xxx_messageInfo_ValidateProvisionerConfig_Request proto.InternalMessageInfo | ||
2468 | |||
2469 | func (m *ValidateProvisionerConfig_Request) GetConfig() *DynamicValue { | ||
2470 | if m != nil { | ||
2471 | return m.Config | ||
2472 | } | ||
2473 | return nil | ||
2474 | } | ||
2475 | |||
2476 | type ValidateProvisionerConfig_Response struct { | ||
2477 | Diagnostics []*Diagnostic `protobuf:"bytes,1,rep,name=diagnostics,proto3" json:"diagnostics,omitempty"` | ||
2478 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
2479 | XXX_unrecognized []byte `json:"-"` | ||
2480 | XXX_sizecache int32 `json:"-"` | ||
2481 | } | ||
2482 | |||
2483 | func (m *ValidateProvisionerConfig_Response) Reset() { *m = ValidateProvisionerConfig_Response{} } | ||
2484 | func (m *ValidateProvisionerConfig_Response) String() string { return proto.CompactTextString(m) } | ||
2485 | func (*ValidateProvisionerConfig_Response) ProtoMessage() {} | ||
2486 | func (*ValidateProvisionerConfig_Response) Descriptor() ([]byte, []int) { | ||
2487 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{18, 1} | ||
2488 | } | ||
2489 | func (m *ValidateProvisionerConfig_Response) XXX_Unmarshal(b []byte) error { | ||
2490 | return xxx_messageInfo_ValidateProvisionerConfig_Response.Unmarshal(m, b) | ||
2491 | } | ||
2492 | func (m *ValidateProvisionerConfig_Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
2493 | return xxx_messageInfo_ValidateProvisionerConfig_Response.Marshal(b, m, deterministic) | ||
2494 | } | ||
2495 | func (dst *ValidateProvisionerConfig_Response) XXX_Merge(src proto.Message) { | ||
2496 | xxx_messageInfo_ValidateProvisionerConfig_Response.Merge(dst, src) | ||
2497 | } | ||
2498 | func (m *ValidateProvisionerConfig_Response) XXX_Size() int { | ||
2499 | return xxx_messageInfo_ValidateProvisionerConfig_Response.Size(m) | ||
2500 | } | ||
2501 | func (m *ValidateProvisionerConfig_Response) XXX_DiscardUnknown() { | ||
2502 | xxx_messageInfo_ValidateProvisionerConfig_Response.DiscardUnknown(m) | ||
2503 | } | ||
2504 | |||
2505 | var xxx_messageInfo_ValidateProvisionerConfig_Response proto.InternalMessageInfo | ||
2506 | |||
2507 | func (m *ValidateProvisionerConfig_Response) GetDiagnostics() []*Diagnostic { | ||
2508 | if m != nil { | ||
2509 | return m.Diagnostics | ||
2510 | } | ||
2511 | return nil | ||
2512 | } | ||
2513 | |||
2514 | type ProvisionResource struct { | ||
2515 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
2516 | XXX_unrecognized []byte `json:"-"` | ||
2517 | XXX_sizecache int32 `json:"-"` | ||
2518 | } | ||
2519 | |||
2520 | func (m *ProvisionResource) Reset() { *m = ProvisionResource{} } | ||
2521 | func (m *ProvisionResource) String() string { return proto.CompactTextString(m) } | ||
2522 | func (*ProvisionResource) ProtoMessage() {} | ||
2523 | func (*ProvisionResource) Descriptor() ([]byte, []int) { | ||
2524 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{19} | ||
2525 | } | ||
2526 | func (m *ProvisionResource) XXX_Unmarshal(b []byte) error { | ||
2527 | return xxx_messageInfo_ProvisionResource.Unmarshal(m, b) | ||
2528 | } | ||
2529 | func (m *ProvisionResource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
2530 | return xxx_messageInfo_ProvisionResource.Marshal(b, m, deterministic) | ||
2531 | } | ||
2532 | func (dst *ProvisionResource) XXX_Merge(src proto.Message) { | ||
2533 | xxx_messageInfo_ProvisionResource.Merge(dst, src) | ||
2534 | } | ||
2535 | func (m *ProvisionResource) XXX_Size() int { | ||
2536 | return xxx_messageInfo_ProvisionResource.Size(m) | ||
2537 | } | ||
2538 | func (m *ProvisionResource) XXX_DiscardUnknown() { | ||
2539 | xxx_messageInfo_ProvisionResource.DiscardUnknown(m) | ||
2540 | } | ||
2541 | |||
2542 | var xxx_messageInfo_ProvisionResource proto.InternalMessageInfo | ||
2543 | |||
2544 | type ProvisionResource_Request struct { | ||
2545 | Config *DynamicValue `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"` | ||
2546 | Connection *DynamicValue `protobuf:"bytes,2,opt,name=connection,proto3" json:"connection,omitempty"` | ||
2547 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
2548 | XXX_unrecognized []byte `json:"-"` | ||
2549 | XXX_sizecache int32 `json:"-"` | ||
2550 | } | ||
2551 | |||
2552 | func (m *ProvisionResource_Request) Reset() { *m = ProvisionResource_Request{} } | ||
2553 | func (m *ProvisionResource_Request) String() string { return proto.CompactTextString(m) } | ||
2554 | func (*ProvisionResource_Request) ProtoMessage() {} | ||
2555 | func (*ProvisionResource_Request) Descriptor() ([]byte, []int) { | ||
2556 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{19, 0} | ||
2557 | } | ||
2558 | func (m *ProvisionResource_Request) XXX_Unmarshal(b []byte) error { | ||
2559 | return xxx_messageInfo_ProvisionResource_Request.Unmarshal(m, b) | ||
2560 | } | ||
2561 | func (m *ProvisionResource_Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
2562 | return xxx_messageInfo_ProvisionResource_Request.Marshal(b, m, deterministic) | ||
2563 | } | ||
2564 | func (dst *ProvisionResource_Request) XXX_Merge(src proto.Message) { | ||
2565 | xxx_messageInfo_ProvisionResource_Request.Merge(dst, src) | ||
2566 | } | ||
2567 | func (m *ProvisionResource_Request) XXX_Size() int { | ||
2568 | return xxx_messageInfo_ProvisionResource_Request.Size(m) | ||
2569 | } | ||
2570 | func (m *ProvisionResource_Request) XXX_DiscardUnknown() { | ||
2571 | xxx_messageInfo_ProvisionResource_Request.DiscardUnknown(m) | ||
2572 | } | ||
2573 | |||
2574 | var xxx_messageInfo_ProvisionResource_Request proto.InternalMessageInfo | ||
2575 | |||
2576 | func (m *ProvisionResource_Request) GetConfig() *DynamicValue { | ||
2577 | if m != nil { | ||
2578 | return m.Config | ||
2579 | } | ||
2580 | return nil | ||
2581 | } | ||
2582 | |||
2583 | func (m *ProvisionResource_Request) GetConnection() *DynamicValue { | ||
2584 | if m != nil { | ||
2585 | return m.Connection | ||
2586 | } | ||
2587 | return nil | ||
2588 | } | ||
2589 | |||
2590 | type ProvisionResource_Response struct { | ||
2591 | Output string `protobuf:"bytes,1,opt,name=output,proto3" json:"output,omitempty"` | ||
2592 | Diagnostics []*Diagnostic `protobuf:"bytes,2,rep,name=diagnostics,proto3" json:"diagnostics,omitempty"` | ||
2593 | XXX_NoUnkeyedLiteral struct{} `json:"-"` | ||
2594 | XXX_unrecognized []byte `json:"-"` | ||
2595 | XXX_sizecache int32 `json:"-"` | ||
2596 | } | ||
2597 | |||
2598 | func (m *ProvisionResource_Response) Reset() { *m = ProvisionResource_Response{} } | ||
2599 | func (m *ProvisionResource_Response) String() string { return proto.CompactTextString(m) } | ||
2600 | func (*ProvisionResource_Response) ProtoMessage() {} | ||
2601 | func (*ProvisionResource_Response) Descriptor() ([]byte, []int) { | ||
2602 | return fileDescriptor_tfplugin5_56820f4fb67360c5, []int{19, 1} | ||
2603 | } | ||
2604 | func (m *ProvisionResource_Response) XXX_Unmarshal(b []byte) error { | ||
2605 | return xxx_messageInfo_ProvisionResource_Response.Unmarshal(m, b) | ||
2606 | } | ||
2607 | func (m *ProvisionResource_Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { | ||
2608 | return xxx_messageInfo_ProvisionResource_Response.Marshal(b, m, deterministic) | ||
2609 | } | ||
2610 | func (dst *ProvisionResource_Response) XXX_Merge(src proto.Message) { | ||
2611 | xxx_messageInfo_ProvisionResource_Response.Merge(dst, src) | ||
2612 | } | ||
2613 | func (m *ProvisionResource_Response) XXX_Size() int { | ||
2614 | return xxx_messageInfo_ProvisionResource_Response.Size(m) | ||
2615 | } | ||
2616 | func (m *ProvisionResource_Response) XXX_DiscardUnknown() { | ||
2617 | xxx_messageInfo_ProvisionResource_Response.DiscardUnknown(m) | ||
2618 | } | ||
2619 | |||
2620 | var xxx_messageInfo_ProvisionResource_Response proto.InternalMessageInfo | ||
2621 | |||
2622 | func (m *ProvisionResource_Response) GetOutput() string { | ||
2623 | if m != nil { | ||
2624 | return m.Output | ||
2625 | } | ||
2626 | return "" | ||
2627 | } | ||
2628 | |||
2629 | func (m *ProvisionResource_Response) GetDiagnostics() []*Diagnostic { | ||
2630 | if m != nil { | ||
2631 | return m.Diagnostics | ||
2632 | } | ||
2633 | return nil | ||
2634 | } | ||
2635 | |||
2636 | func init() { | ||
2637 | proto.RegisterType((*DynamicValue)(nil), "tfplugin5.DynamicValue") | ||
2638 | proto.RegisterType((*Diagnostic)(nil), "tfplugin5.Diagnostic") | ||
2639 | proto.RegisterType((*AttributePath)(nil), "tfplugin5.AttributePath") | ||
2640 | proto.RegisterType((*AttributePath_Step)(nil), "tfplugin5.AttributePath.Step") | ||
2641 | proto.RegisterType((*Stop)(nil), "tfplugin5.Stop") | ||
2642 | proto.RegisterType((*Stop_Request)(nil), "tfplugin5.Stop.Request") | ||
2643 | proto.RegisterType((*Stop_Response)(nil), "tfplugin5.Stop.Response") | ||
2644 | proto.RegisterType((*RawState)(nil), "tfplugin5.RawState") | ||
2645 | proto.RegisterMapType((map[string]string)(nil), "tfplugin5.RawState.FlatmapEntry") | ||
2646 | proto.RegisterType((*Schema)(nil), "tfplugin5.Schema") | ||
2647 | proto.RegisterType((*Schema_Block)(nil), "tfplugin5.Schema.Block") | ||
2648 | proto.RegisterType((*Schema_Attribute)(nil), "tfplugin5.Schema.Attribute") | ||
2649 | proto.RegisterType((*Schema_NestedBlock)(nil), "tfplugin5.Schema.NestedBlock") | ||
2650 | proto.RegisterType((*GetProviderSchema)(nil), "tfplugin5.GetProviderSchema") | ||
2651 | proto.RegisterType((*GetProviderSchema_Request)(nil), "tfplugin5.GetProviderSchema.Request") | ||
2652 | proto.RegisterType((*GetProviderSchema_Response)(nil), "tfplugin5.GetProviderSchema.Response") | ||
2653 | proto.RegisterMapType((map[string]*Schema)(nil), "tfplugin5.GetProviderSchema.Response.DataSourceSchemasEntry") | ||
2654 | proto.RegisterMapType((map[string]*Schema)(nil), "tfplugin5.GetProviderSchema.Response.ResourceSchemasEntry") | ||
2655 | proto.RegisterType((*PrepareProviderConfig)(nil), "tfplugin5.PrepareProviderConfig") | ||
2656 | proto.RegisterType((*PrepareProviderConfig_Request)(nil), "tfplugin5.PrepareProviderConfig.Request") | ||
2657 | proto.RegisterType((*PrepareProviderConfig_Response)(nil), "tfplugin5.PrepareProviderConfig.Response") | ||
2658 | proto.RegisterType((*UpgradeResourceState)(nil), "tfplugin5.UpgradeResourceState") | ||
2659 | proto.RegisterType((*UpgradeResourceState_Request)(nil), "tfplugin5.UpgradeResourceState.Request") | ||
2660 | proto.RegisterType((*UpgradeResourceState_Response)(nil), "tfplugin5.UpgradeResourceState.Response") | ||
2661 | proto.RegisterType((*ValidateResourceTypeConfig)(nil), "tfplugin5.ValidateResourceTypeConfig") | ||
2662 | proto.RegisterType((*ValidateResourceTypeConfig_Request)(nil), "tfplugin5.ValidateResourceTypeConfig.Request") | ||
2663 | proto.RegisterType((*ValidateResourceTypeConfig_Response)(nil), "tfplugin5.ValidateResourceTypeConfig.Response") | ||
2664 | proto.RegisterType((*ValidateDataSourceConfig)(nil), "tfplugin5.ValidateDataSourceConfig") | ||
2665 | proto.RegisterType((*ValidateDataSourceConfig_Request)(nil), "tfplugin5.ValidateDataSourceConfig.Request") | ||
2666 | proto.RegisterType((*ValidateDataSourceConfig_Response)(nil), "tfplugin5.ValidateDataSourceConfig.Response") | ||
2667 | proto.RegisterType((*Configure)(nil), "tfplugin5.Configure") | ||
2668 | proto.RegisterType((*Configure_Request)(nil), "tfplugin5.Configure.Request") | ||
2669 | proto.RegisterType((*Configure_Response)(nil), "tfplugin5.Configure.Response") | ||
2670 | proto.RegisterType((*ReadResource)(nil), "tfplugin5.ReadResource") | ||
2671 | proto.RegisterType((*ReadResource_Request)(nil), "tfplugin5.ReadResource.Request") | ||
2672 | proto.RegisterType((*ReadResource_Response)(nil), "tfplugin5.ReadResource.Response") | ||
2673 | proto.RegisterType((*PlanResourceChange)(nil), "tfplugin5.PlanResourceChange") | ||
2674 | proto.RegisterType((*PlanResourceChange_Request)(nil), "tfplugin5.PlanResourceChange.Request") | ||
2675 | proto.RegisterType((*PlanResourceChange_Response)(nil), "tfplugin5.PlanResourceChange.Response") | ||
2676 | proto.RegisterType((*ApplyResourceChange)(nil), "tfplugin5.ApplyResourceChange") | ||
2677 | proto.RegisterType((*ApplyResourceChange_Request)(nil), "tfplugin5.ApplyResourceChange.Request") | ||
2678 | proto.RegisterType((*ApplyResourceChange_Response)(nil), "tfplugin5.ApplyResourceChange.Response") | ||
2679 | proto.RegisterType((*ImportResourceState)(nil), "tfplugin5.ImportResourceState") | ||
2680 | proto.RegisterType((*ImportResourceState_Request)(nil), "tfplugin5.ImportResourceState.Request") | ||
2681 | proto.RegisterType((*ImportResourceState_ImportedResource)(nil), "tfplugin5.ImportResourceState.ImportedResource") | ||
2682 | proto.RegisterType((*ImportResourceState_Response)(nil), "tfplugin5.ImportResourceState.Response") | ||
2683 | proto.RegisterType((*ReadDataSource)(nil), "tfplugin5.ReadDataSource") | ||
2684 | proto.RegisterType((*ReadDataSource_Request)(nil), "tfplugin5.ReadDataSource.Request") | ||
2685 | proto.RegisterType((*ReadDataSource_Response)(nil), "tfplugin5.ReadDataSource.Response") | ||
2686 | proto.RegisterType((*GetProvisionerSchema)(nil), "tfplugin5.GetProvisionerSchema") | ||
2687 | proto.RegisterType((*GetProvisionerSchema_Request)(nil), "tfplugin5.GetProvisionerSchema.Request") | ||
2688 | proto.RegisterType((*GetProvisionerSchema_Response)(nil), "tfplugin5.GetProvisionerSchema.Response") | ||
2689 | proto.RegisterType((*ValidateProvisionerConfig)(nil), "tfplugin5.ValidateProvisionerConfig") | ||
2690 | proto.RegisterType((*ValidateProvisionerConfig_Request)(nil), "tfplugin5.ValidateProvisionerConfig.Request") | ||
2691 | proto.RegisterType((*ValidateProvisionerConfig_Response)(nil), "tfplugin5.ValidateProvisionerConfig.Response") | ||
2692 | proto.RegisterType((*ProvisionResource)(nil), "tfplugin5.ProvisionResource") | ||
2693 | proto.RegisterType((*ProvisionResource_Request)(nil), "tfplugin5.ProvisionResource.Request") | ||
2694 | proto.RegisterType((*ProvisionResource_Response)(nil), "tfplugin5.ProvisionResource.Response") | ||
2695 | proto.RegisterEnum("tfplugin5.Diagnostic_Severity", Diagnostic_Severity_name, Diagnostic_Severity_value) | ||
2696 | proto.RegisterEnum("tfplugin5.Schema_NestedBlock_NestingMode", Schema_NestedBlock_NestingMode_name, Schema_NestedBlock_NestingMode_value) | ||
2697 | } | ||
2698 | |||
2699 | // Reference imports to suppress errors if they are not otherwise used. | ||
2700 | var _ context.Context | ||
2701 | var _ grpc.ClientConn | ||
2702 | |||
2703 | // This is a compile-time assertion to ensure that this generated file | ||
2704 | // is compatible with the grpc package it is being compiled against. | ||
2705 | const _ = grpc.SupportPackageIsVersion4 | ||
2706 | |||
2707 | // ProviderClient is the client API for Provider service. | ||
2708 | // | ||
2709 | // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. | ||
2710 | type ProviderClient interface { | ||
2711 | // ////// Information about what a provider supports/expects | ||
2712 | GetSchema(ctx context.Context, in *GetProviderSchema_Request, opts ...grpc.CallOption) (*GetProviderSchema_Response, error) | ||
2713 | PrepareProviderConfig(ctx context.Context, in *PrepareProviderConfig_Request, opts ...grpc.CallOption) (*PrepareProviderConfig_Response, error) | ||
2714 | ValidateResourceTypeConfig(ctx context.Context, in *ValidateResourceTypeConfig_Request, opts ...grpc.CallOption) (*ValidateResourceTypeConfig_Response, error) | ||
2715 | ValidateDataSourceConfig(ctx context.Context, in *ValidateDataSourceConfig_Request, opts ...grpc.CallOption) (*ValidateDataSourceConfig_Response, error) | ||
2716 | UpgradeResourceState(ctx context.Context, in *UpgradeResourceState_Request, opts ...grpc.CallOption) (*UpgradeResourceState_Response, error) | ||
2717 | // ////// One-time initialization, called before other functions below | ||
2718 | Configure(ctx context.Context, in *Configure_Request, opts ...grpc.CallOption) (*Configure_Response, error) | ||
2719 | // ////// Managed Resource Lifecycle | ||
2720 | ReadResource(ctx context.Context, in *ReadResource_Request, opts ...grpc.CallOption) (*ReadResource_Response, error) | ||
2721 | PlanResourceChange(ctx context.Context, in *PlanResourceChange_Request, opts ...grpc.CallOption) (*PlanResourceChange_Response, error) | ||
2722 | ApplyResourceChange(ctx context.Context, in *ApplyResourceChange_Request, opts ...grpc.CallOption) (*ApplyResourceChange_Response, error) | ||
2723 | ImportResourceState(ctx context.Context, in *ImportResourceState_Request, opts ...grpc.CallOption) (*ImportResourceState_Response, error) | ||
2724 | ReadDataSource(ctx context.Context, in *ReadDataSource_Request, opts ...grpc.CallOption) (*ReadDataSource_Response, error) | ||
2725 | // ////// Graceful Shutdown | ||
2726 | Stop(ctx context.Context, in *Stop_Request, opts ...grpc.CallOption) (*Stop_Response, error) | ||
2727 | } | ||
2728 | |||
2729 | type providerClient struct { | ||
2730 | cc *grpc.ClientConn | ||
2731 | } | ||
2732 | |||
2733 | func NewProviderClient(cc *grpc.ClientConn) ProviderClient { | ||
2734 | return &providerClient{cc} | ||
2735 | } | ||
2736 | |||
2737 | func (c *providerClient) GetSchema(ctx context.Context, in *GetProviderSchema_Request, opts ...grpc.CallOption) (*GetProviderSchema_Response, error) { | ||
2738 | out := new(GetProviderSchema_Response) | ||
2739 | err := c.cc.Invoke(ctx, "/tfplugin5.Provider/GetSchema", in, out, opts...) | ||
2740 | if err != nil { | ||
2741 | return nil, err | ||
2742 | } | ||
2743 | return out, nil | ||
2744 | } | ||
2745 | |||
2746 | func (c *providerClient) PrepareProviderConfig(ctx context.Context, in *PrepareProviderConfig_Request, opts ...grpc.CallOption) (*PrepareProviderConfig_Response, error) { | ||
2747 | out := new(PrepareProviderConfig_Response) | ||
2748 | err := c.cc.Invoke(ctx, "/tfplugin5.Provider/PrepareProviderConfig", in, out, opts...) | ||
2749 | if err != nil { | ||
2750 | return nil, err | ||
2751 | } | ||
2752 | return out, nil | ||
2753 | } | ||
2754 | |||
2755 | func (c *providerClient) ValidateResourceTypeConfig(ctx context.Context, in *ValidateResourceTypeConfig_Request, opts ...grpc.CallOption) (*ValidateResourceTypeConfig_Response, error) { | ||
2756 | out := new(ValidateResourceTypeConfig_Response) | ||
2757 | err := c.cc.Invoke(ctx, "/tfplugin5.Provider/ValidateResourceTypeConfig", in, out, opts...) | ||
2758 | if err != nil { | ||
2759 | return nil, err | ||
2760 | } | ||
2761 | return out, nil | ||
2762 | } | ||
2763 | |||
2764 | func (c *providerClient) ValidateDataSourceConfig(ctx context.Context, in *ValidateDataSourceConfig_Request, opts ...grpc.CallOption) (*ValidateDataSourceConfig_Response, error) { | ||
2765 | out := new(ValidateDataSourceConfig_Response) | ||
2766 | err := c.cc.Invoke(ctx, "/tfplugin5.Provider/ValidateDataSourceConfig", in, out, opts...) | ||
2767 | if err != nil { | ||
2768 | return nil, err | ||
2769 | } | ||
2770 | return out, nil | ||
2771 | } | ||
2772 | |||
2773 | func (c *providerClient) UpgradeResourceState(ctx context.Context, in *UpgradeResourceState_Request, opts ...grpc.CallOption) (*UpgradeResourceState_Response, error) { | ||
2774 | out := new(UpgradeResourceState_Response) | ||
2775 | err := c.cc.Invoke(ctx, "/tfplugin5.Provider/UpgradeResourceState", in, out, opts...) | ||
2776 | if err != nil { | ||
2777 | return nil, err | ||
2778 | } | ||
2779 | return out, nil | ||
2780 | } | ||
2781 | |||
2782 | func (c *providerClient) Configure(ctx context.Context, in *Configure_Request, opts ...grpc.CallOption) (*Configure_Response, error) { | ||
2783 | out := new(Configure_Response) | ||
2784 | err := c.cc.Invoke(ctx, "/tfplugin5.Provider/Configure", in, out, opts...) | ||
2785 | if err != nil { | ||
2786 | return nil, err | ||
2787 | } | ||
2788 | return out, nil | ||
2789 | } | ||
2790 | |||
2791 | func (c *providerClient) ReadResource(ctx context.Context, in *ReadResource_Request, opts ...grpc.CallOption) (*ReadResource_Response, error) { | ||
2792 | out := new(ReadResource_Response) | ||
2793 | err := c.cc.Invoke(ctx, "/tfplugin5.Provider/ReadResource", in, out, opts...) | ||
2794 | if err != nil { | ||
2795 | return nil, err | ||
2796 | } | ||
2797 | return out, nil | ||
2798 | } | ||
2799 | |||
2800 | func (c *providerClient) PlanResourceChange(ctx context.Context, in *PlanResourceChange_Request, opts ...grpc.CallOption) (*PlanResourceChange_Response, error) { | ||
2801 | out := new(PlanResourceChange_Response) | ||
2802 | err := c.cc.Invoke(ctx, "/tfplugin5.Provider/PlanResourceChange", in, out, opts...) | ||
2803 | if err != nil { | ||
2804 | return nil, err | ||
2805 | } | ||
2806 | return out, nil | ||
2807 | } | ||
2808 | |||
2809 | func (c *providerClient) ApplyResourceChange(ctx context.Context, in *ApplyResourceChange_Request, opts ...grpc.CallOption) (*ApplyResourceChange_Response, error) { | ||
2810 | out := new(ApplyResourceChange_Response) | ||
2811 | err := c.cc.Invoke(ctx, "/tfplugin5.Provider/ApplyResourceChange", in, out, opts...) | ||
2812 | if err != nil { | ||
2813 | return nil, err | ||
2814 | } | ||
2815 | return out, nil | ||
2816 | } | ||
2817 | |||
2818 | func (c *providerClient) ImportResourceState(ctx context.Context, in *ImportResourceState_Request, opts ...grpc.CallOption) (*ImportResourceState_Response, error) { | ||
2819 | out := new(ImportResourceState_Response) | ||
2820 | err := c.cc.Invoke(ctx, "/tfplugin5.Provider/ImportResourceState", in, out, opts...) | ||
2821 | if err != nil { | ||
2822 | return nil, err | ||
2823 | } | ||
2824 | return out, nil | ||
2825 | } | ||
2826 | |||
2827 | func (c *providerClient) ReadDataSource(ctx context.Context, in *ReadDataSource_Request, opts ...grpc.CallOption) (*ReadDataSource_Response, error) { | ||
2828 | out := new(ReadDataSource_Response) | ||
2829 | err := c.cc.Invoke(ctx, "/tfplugin5.Provider/ReadDataSource", in, out, opts...) | ||
2830 | if err != nil { | ||
2831 | return nil, err | ||
2832 | } | ||
2833 | return out, nil | ||
2834 | } | ||
2835 | |||
2836 | func (c *providerClient) Stop(ctx context.Context, in *Stop_Request, opts ...grpc.CallOption) (*Stop_Response, error) { | ||
2837 | out := new(Stop_Response) | ||
2838 | err := c.cc.Invoke(ctx, "/tfplugin5.Provider/Stop", in, out, opts...) | ||
2839 | if err != nil { | ||
2840 | return nil, err | ||
2841 | } | ||
2842 | return out, nil | ||
2843 | } | ||
2844 | |||
2845 | // ProviderServer is the server API for Provider service. | ||
2846 | type ProviderServer interface { | ||
2847 | // ////// Information about what a provider supports/expects | ||
2848 | GetSchema(context.Context, *GetProviderSchema_Request) (*GetProviderSchema_Response, error) | ||
2849 | PrepareProviderConfig(context.Context, *PrepareProviderConfig_Request) (*PrepareProviderConfig_Response, error) | ||
2850 | ValidateResourceTypeConfig(context.Context, *ValidateResourceTypeConfig_Request) (*ValidateResourceTypeConfig_Response, error) | ||
2851 | ValidateDataSourceConfig(context.Context, *ValidateDataSourceConfig_Request) (*ValidateDataSourceConfig_Response, error) | ||
2852 | UpgradeResourceState(context.Context, *UpgradeResourceState_Request) (*UpgradeResourceState_Response, error) | ||
2853 | // ////// One-time initialization, called before other functions below | ||
2854 | Configure(context.Context, *Configure_Request) (*Configure_Response, error) | ||
2855 | // ////// Managed Resource Lifecycle | ||
2856 | ReadResource(context.Context, *ReadResource_Request) (*ReadResource_Response, error) | ||
2857 | PlanResourceChange(context.Context, *PlanResourceChange_Request) (*PlanResourceChange_Response, error) | ||
2858 | ApplyResourceChange(context.Context, *ApplyResourceChange_Request) (*ApplyResourceChange_Response, error) | ||
2859 | ImportResourceState(context.Context, *ImportResourceState_Request) (*ImportResourceState_Response, error) | ||
2860 | ReadDataSource(context.Context, *ReadDataSource_Request) (*ReadDataSource_Response, error) | ||
2861 | // ////// Graceful Shutdown | ||
2862 | Stop(context.Context, *Stop_Request) (*Stop_Response, error) | ||
2863 | } | ||
2864 | |||
2865 | func RegisterProviderServer(s *grpc.Server, srv ProviderServer) { | ||
2866 | s.RegisterService(&_Provider_serviceDesc, srv) | ||
2867 | } | ||
2868 | |||
2869 | func _Provider_GetSchema_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { | ||
2870 | in := new(GetProviderSchema_Request) | ||
2871 | if err := dec(in); err != nil { | ||
2872 | return nil, err | ||
2873 | } | ||
2874 | if interceptor == nil { | ||
2875 | return srv.(ProviderServer).GetSchema(ctx, in) | ||
2876 | } | ||
2877 | info := &grpc.UnaryServerInfo{ | ||
2878 | Server: srv, | ||
2879 | FullMethod: "/tfplugin5.Provider/GetSchema", | ||
2880 | } | ||
2881 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { | ||
2882 | return srv.(ProviderServer).GetSchema(ctx, req.(*GetProviderSchema_Request)) | ||
2883 | } | ||
2884 | return interceptor(ctx, in, info, handler) | ||
2885 | } | ||
2886 | |||
2887 | func _Provider_PrepareProviderConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { | ||
2888 | in := new(PrepareProviderConfig_Request) | ||
2889 | if err := dec(in); err != nil { | ||
2890 | return nil, err | ||
2891 | } | ||
2892 | if interceptor == nil { | ||
2893 | return srv.(ProviderServer).PrepareProviderConfig(ctx, in) | ||
2894 | } | ||
2895 | info := &grpc.UnaryServerInfo{ | ||
2896 | Server: srv, | ||
2897 | FullMethod: "/tfplugin5.Provider/PrepareProviderConfig", | ||
2898 | } | ||
2899 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { | ||
2900 | return srv.(ProviderServer).PrepareProviderConfig(ctx, req.(*PrepareProviderConfig_Request)) | ||
2901 | } | ||
2902 | return interceptor(ctx, in, info, handler) | ||
2903 | } | ||
2904 | |||
2905 | func _Provider_ValidateResourceTypeConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { | ||
2906 | in := new(ValidateResourceTypeConfig_Request) | ||
2907 | if err := dec(in); err != nil { | ||
2908 | return nil, err | ||
2909 | } | ||
2910 | if interceptor == nil { | ||
2911 | return srv.(ProviderServer).ValidateResourceTypeConfig(ctx, in) | ||
2912 | } | ||
2913 | info := &grpc.UnaryServerInfo{ | ||
2914 | Server: srv, | ||
2915 | FullMethod: "/tfplugin5.Provider/ValidateResourceTypeConfig", | ||
2916 | } | ||
2917 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { | ||
2918 | return srv.(ProviderServer).ValidateResourceTypeConfig(ctx, req.(*ValidateResourceTypeConfig_Request)) | ||
2919 | } | ||
2920 | return interceptor(ctx, in, info, handler) | ||
2921 | } | ||
2922 | |||
2923 | func _Provider_ValidateDataSourceConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { | ||
2924 | in := new(ValidateDataSourceConfig_Request) | ||
2925 | if err := dec(in); err != nil { | ||
2926 | return nil, err | ||
2927 | } | ||
2928 | if interceptor == nil { | ||
2929 | return srv.(ProviderServer).ValidateDataSourceConfig(ctx, in) | ||
2930 | } | ||
2931 | info := &grpc.UnaryServerInfo{ | ||
2932 | Server: srv, | ||
2933 | FullMethod: "/tfplugin5.Provider/ValidateDataSourceConfig", | ||
2934 | } | ||
2935 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { | ||
2936 | return srv.(ProviderServer).ValidateDataSourceConfig(ctx, req.(*ValidateDataSourceConfig_Request)) | ||
2937 | } | ||
2938 | return interceptor(ctx, in, info, handler) | ||
2939 | } | ||
2940 | |||
2941 | func _Provider_UpgradeResourceState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { | ||
2942 | in := new(UpgradeResourceState_Request) | ||
2943 | if err := dec(in); err != nil { | ||
2944 | return nil, err | ||
2945 | } | ||
2946 | if interceptor == nil { | ||
2947 | return srv.(ProviderServer).UpgradeResourceState(ctx, in) | ||
2948 | } | ||
2949 | info := &grpc.UnaryServerInfo{ | ||
2950 | Server: srv, | ||
2951 | FullMethod: "/tfplugin5.Provider/UpgradeResourceState", | ||
2952 | } | ||
2953 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { | ||
2954 | return srv.(ProviderServer).UpgradeResourceState(ctx, req.(*UpgradeResourceState_Request)) | ||
2955 | } | ||
2956 | return interceptor(ctx, in, info, handler) | ||
2957 | } | ||
2958 | |||
2959 | func _Provider_Configure_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { | ||
2960 | in := new(Configure_Request) | ||
2961 | if err := dec(in); err != nil { | ||
2962 | return nil, err | ||
2963 | } | ||
2964 | if interceptor == nil { | ||
2965 | return srv.(ProviderServer).Configure(ctx, in) | ||
2966 | } | ||
2967 | info := &grpc.UnaryServerInfo{ | ||
2968 | Server: srv, | ||
2969 | FullMethod: "/tfplugin5.Provider/Configure", | ||
2970 | } | ||
2971 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { | ||
2972 | return srv.(ProviderServer).Configure(ctx, req.(*Configure_Request)) | ||
2973 | } | ||
2974 | return interceptor(ctx, in, info, handler) | ||
2975 | } | ||
2976 | |||
2977 | func _Provider_ReadResource_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { | ||
2978 | in := new(ReadResource_Request) | ||
2979 | if err := dec(in); err != nil { | ||
2980 | return nil, err | ||
2981 | } | ||
2982 | if interceptor == nil { | ||
2983 | return srv.(ProviderServer).ReadResource(ctx, in) | ||
2984 | } | ||
2985 | info := &grpc.UnaryServerInfo{ | ||
2986 | Server: srv, | ||
2987 | FullMethod: "/tfplugin5.Provider/ReadResource", | ||
2988 | } | ||
2989 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { | ||
2990 | return srv.(ProviderServer).ReadResource(ctx, req.(*ReadResource_Request)) | ||
2991 | } | ||
2992 | return interceptor(ctx, in, info, handler) | ||
2993 | } | ||
2994 | |||
2995 | func _Provider_PlanResourceChange_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { | ||
2996 | in := new(PlanResourceChange_Request) | ||
2997 | if err := dec(in); err != nil { | ||
2998 | return nil, err | ||
2999 | } | ||
3000 | if interceptor == nil { | ||
3001 | return srv.(ProviderServer).PlanResourceChange(ctx, in) | ||
3002 | } | ||
3003 | info := &grpc.UnaryServerInfo{ | ||
3004 | Server: srv, | ||
3005 | FullMethod: "/tfplugin5.Provider/PlanResourceChange", | ||
3006 | } | ||
3007 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { | ||
3008 | return srv.(ProviderServer).PlanResourceChange(ctx, req.(*PlanResourceChange_Request)) | ||
3009 | } | ||
3010 | return interceptor(ctx, in, info, handler) | ||
3011 | } | ||
3012 | |||
3013 | func _Provider_ApplyResourceChange_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { | ||
3014 | in := new(ApplyResourceChange_Request) | ||
3015 | if err := dec(in); err != nil { | ||
3016 | return nil, err | ||
3017 | } | ||
3018 | if interceptor == nil { | ||
3019 | return srv.(ProviderServer).ApplyResourceChange(ctx, in) | ||
3020 | } | ||
3021 | info := &grpc.UnaryServerInfo{ | ||
3022 | Server: srv, | ||
3023 | FullMethod: "/tfplugin5.Provider/ApplyResourceChange", | ||
3024 | } | ||
3025 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { | ||
3026 | return srv.(ProviderServer).ApplyResourceChange(ctx, req.(*ApplyResourceChange_Request)) | ||
3027 | } | ||
3028 | return interceptor(ctx, in, info, handler) | ||
3029 | } | ||
3030 | |||
3031 | func _Provider_ImportResourceState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { | ||
3032 | in := new(ImportResourceState_Request) | ||
3033 | if err := dec(in); err != nil { | ||
3034 | return nil, err | ||
3035 | } | ||
3036 | if interceptor == nil { | ||
3037 | return srv.(ProviderServer).ImportResourceState(ctx, in) | ||
3038 | } | ||
3039 | info := &grpc.UnaryServerInfo{ | ||
3040 | Server: srv, | ||
3041 | FullMethod: "/tfplugin5.Provider/ImportResourceState", | ||
3042 | } | ||
3043 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { | ||
3044 | return srv.(ProviderServer).ImportResourceState(ctx, req.(*ImportResourceState_Request)) | ||
3045 | } | ||
3046 | return interceptor(ctx, in, info, handler) | ||
3047 | } | ||
3048 | |||
3049 | func _Provider_ReadDataSource_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { | ||
3050 | in := new(ReadDataSource_Request) | ||
3051 | if err := dec(in); err != nil { | ||
3052 | return nil, err | ||
3053 | } | ||
3054 | if interceptor == nil { | ||
3055 | return srv.(ProviderServer).ReadDataSource(ctx, in) | ||
3056 | } | ||
3057 | info := &grpc.UnaryServerInfo{ | ||
3058 | Server: srv, | ||
3059 | FullMethod: "/tfplugin5.Provider/ReadDataSource", | ||
3060 | } | ||
3061 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { | ||
3062 | return srv.(ProviderServer).ReadDataSource(ctx, req.(*ReadDataSource_Request)) | ||
3063 | } | ||
3064 | return interceptor(ctx, in, info, handler) | ||
3065 | } | ||
3066 | |||
3067 | func _Provider_Stop_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { | ||
3068 | in := new(Stop_Request) | ||
3069 | if err := dec(in); err != nil { | ||
3070 | return nil, err | ||
3071 | } | ||
3072 | if interceptor == nil { | ||
3073 | return srv.(ProviderServer).Stop(ctx, in) | ||
3074 | } | ||
3075 | info := &grpc.UnaryServerInfo{ | ||
3076 | Server: srv, | ||
3077 | FullMethod: "/tfplugin5.Provider/Stop", | ||
3078 | } | ||
3079 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { | ||
3080 | return srv.(ProviderServer).Stop(ctx, req.(*Stop_Request)) | ||
3081 | } | ||
3082 | return interceptor(ctx, in, info, handler) | ||
3083 | } | ||
3084 | |||
3085 | var _Provider_serviceDesc = grpc.ServiceDesc{ | ||
3086 | ServiceName: "tfplugin5.Provider", | ||
3087 | HandlerType: (*ProviderServer)(nil), | ||
3088 | Methods: []grpc.MethodDesc{ | ||
3089 | { | ||
3090 | MethodName: "GetSchema", | ||
3091 | Handler: _Provider_GetSchema_Handler, | ||
3092 | }, | ||
3093 | { | ||
3094 | MethodName: "PrepareProviderConfig", | ||
3095 | Handler: _Provider_PrepareProviderConfig_Handler, | ||
3096 | }, | ||
3097 | { | ||
3098 | MethodName: "ValidateResourceTypeConfig", | ||
3099 | Handler: _Provider_ValidateResourceTypeConfig_Handler, | ||
3100 | }, | ||
3101 | { | ||
3102 | MethodName: "ValidateDataSourceConfig", | ||
3103 | Handler: _Provider_ValidateDataSourceConfig_Handler, | ||
3104 | }, | ||
3105 | { | ||
3106 | MethodName: "UpgradeResourceState", | ||
3107 | Handler: _Provider_UpgradeResourceState_Handler, | ||
3108 | }, | ||
3109 | { | ||
3110 | MethodName: "Configure", | ||
3111 | Handler: _Provider_Configure_Handler, | ||
3112 | }, | ||
3113 | { | ||
3114 | MethodName: "ReadResource", | ||
3115 | Handler: _Provider_ReadResource_Handler, | ||
3116 | }, | ||
3117 | { | ||
3118 | MethodName: "PlanResourceChange", | ||
3119 | Handler: _Provider_PlanResourceChange_Handler, | ||
3120 | }, | ||
3121 | { | ||
3122 | MethodName: "ApplyResourceChange", | ||
3123 | Handler: _Provider_ApplyResourceChange_Handler, | ||
3124 | }, | ||
3125 | { | ||
3126 | MethodName: "ImportResourceState", | ||
3127 | Handler: _Provider_ImportResourceState_Handler, | ||
3128 | }, | ||
3129 | { | ||
3130 | MethodName: "ReadDataSource", | ||
3131 | Handler: _Provider_ReadDataSource_Handler, | ||
3132 | }, | ||
3133 | { | ||
3134 | MethodName: "Stop", | ||
3135 | Handler: _Provider_Stop_Handler, | ||
3136 | }, | ||
3137 | }, | ||
3138 | Streams: []grpc.StreamDesc{}, | ||
3139 | Metadata: "tfplugin5.proto", | ||
3140 | } | ||
3141 | |||
3142 | // ProvisionerClient is the client API for Provisioner service. | ||
3143 | // | ||
3144 | // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. | ||
3145 | type ProvisionerClient interface { | ||
3146 | GetSchema(ctx context.Context, in *GetProvisionerSchema_Request, opts ...grpc.CallOption) (*GetProvisionerSchema_Response, error) | ||
3147 | ValidateProvisionerConfig(ctx context.Context, in *ValidateProvisionerConfig_Request, opts ...grpc.CallOption) (*ValidateProvisionerConfig_Response, error) | ||
3148 | ProvisionResource(ctx context.Context, in *ProvisionResource_Request, opts ...grpc.CallOption) (Provisioner_ProvisionResourceClient, error) | ||
3149 | Stop(ctx context.Context, in *Stop_Request, opts ...grpc.CallOption) (*Stop_Response, error) | ||
3150 | } | ||
3151 | |||
3152 | type provisionerClient struct { | ||
3153 | cc *grpc.ClientConn | ||
3154 | } | ||
3155 | |||
3156 | func NewProvisionerClient(cc *grpc.ClientConn) ProvisionerClient { | ||
3157 | return &provisionerClient{cc} | ||
3158 | } | ||
3159 | |||
3160 | func (c *provisionerClient) GetSchema(ctx context.Context, in *GetProvisionerSchema_Request, opts ...grpc.CallOption) (*GetProvisionerSchema_Response, error) { | ||
3161 | out := new(GetProvisionerSchema_Response) | ||
3162 | err := c.cc.Invoke(ctx, "/tfplugin5.Provisioner/GetSchema", in, out, opts...) | ||
3163 | if err != nil { | ||
3164 | return nil, err | ||
3165 | } | ||
3166 | return out, nil | ||
3167 | } | ||
3168 | |||
3169 | func (c *provisionerClient) ValidateProvisionerConfig(ctx context.Context, in *ValidateProvisionerConfig_Request, opts ...grpc.CallOption) (*ValidateProvisionerConfig_Response, error) { | ||
3170 | out := new(ValidateProvisionerConfig_Response) | ||
3171 | err := c.cc.Invoke(ctx, "/tfplugin5.Provisioner/ValidateProvisionerConfig", in, out, opts...) | ||
3172 | if err != nil { | ||
3173 | return nil, err | ||
3174 | } | ||
3175 | return out, nil | ||
3176 | } | ||
3177 | |||
3178 | func (c *provisionerClient) ProvisionResource(ctx context.Context, in *ProvisionResource_Request, opts ...grpc.CallOption) (Provisioner_ProvisionResourceClient, error) { | ||
3179 | stream, err := c.cc.NewStream(ctx, &_Provisioner_serviceDesc.Streams[0], "/tfplugin5.Provisioner/ProvisionResource", opts...) | ||
3180 | if err != nil { | ||
3181 | return nil, err | ||
3182 | } | ||
3183 | x := &provisionerProvisionResourceClient{stream} | ||
3184 | if err := x.ClientStream.SendMsg(in); err != nil { | ||
3185 | return nil, err | ||
3186 | } | ||
3187 | if err := x.ClientStream.CloseSend(); err != nil { | ||
3188 | return nil, err | ||
3189 | } | ||
3190 | return x, nil | ||
3191 | } | ||
3192 | |||
3193 | type Provisioner_ProvisionResourceClient interface { | ||
3194 | Recv() (*ProvisionResource_Response, error) | ||
3195 | grpc.ClientStream | ||
3196 | } | ||
3197 | |||
3198 | type provisionerProvisionResourceClient struct { | ||
3199 | grpc.ClientStream | ||
3200 | } | ||
3201 | |||
3202 | func (x *provisionerProvisionResourceClient) Recv() (*ProvisionResource_Response, error) { | ||
3203 | m := new(ProvisionResource_Response) | ||
3204 | if err := x.ClientStream.RecvMsg(m); err != nil { | ||
3205 | return nil, err | ||
3206 | } | ||
3207 | return m, nil | ||
3208 | } | ||
3209 | |||
3210 | func (c *provisionerClient) Stop(ctx context.Context, in *Stop_Request, opts ...grpc.CallOption) (*Stop_Response, error) { | ||
3211 | out := new(Stop_Response) | ||
3212 | err := c.cc.Invoke(ctx, "/tfplugin5.Provisioner/Stop", in, out, opts...) | ||
3213 | if err != nil { | ||
3214 | return nil, err | ||
3215 | } | ||
3216 | return out, nil | ||
3217 | } | ||
3218 | |||
3219 | // ProvisionerServer is the server API for Provisioner service. | ||
3220 | type ProvisionerServer interface { | ||
3221 | GetSchema(context.Context, *GetProvisionerSchema_Request) (*GetProvisionerSchema_Response, error) | ||
3222 | ValidateProvisionerConfig(context.Context, *ValidateProvisionerConfig_Request) (*ValidateProvisionerConfig_Response, error) | ||
3223 | ProvisionResource(*ProvisionResource_Request, Provisioner_ProvisionResourceServer) error | ||
3224 | Stop(context.Context, *Stop_Request) (*Stop_Response, error) | ||
3225 | } | ||
3226 | |||
3227 | func RegisterProvisionerServer(s *grpc.Server, srv ProvisionerServer) { | ||
3228 | s.RegisterService(&_Provisioner_serviceDesc, srv) | ||
3229 | } | ||
3230 | |||
3231 | func _Provisioner_GetSchema_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { | ||
3232 | in := new(GetProvisionerSchema_Request) | ||
3233 | if err := dec(in); err != nil { | ||
3234 | return nil, err | ||
3235 | } | ||
3236 | if interceptor == nil { | ||
3237 | return srv.(ProvisionerServer).GetSchema(ctx, in) | ||
3238 | } | ||
3239 | info := &grpc.UnaryServerInfo{ | ||
3240 | Server: srv, | ||
3241 | FullMethod: "/tfplugin5.Provisioner/GetSchema", | ||
3242 | } | ||
3243 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { | ||
3244 | return srv.(ProvisionerServer).GetSchema(ctx, req.(*GetProvisionerSchema_Request)) | ||
3245 | } | ||
3246 | return interceptor(ctx, in, info, handler) | ||
3247 | } | ||
3248 | |||
3249 | func _Provisioner_ValidateProvisionerConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { | ||
3250 | in := new(ValidateProvisionerConfig_Request) | ||
3251 | if err := dec(in); err != nil { | ||
3252 | return nil, err | ||
3253 | } | ||
3254 | if interceptor == nil { | ||
3255 | return srv.(ProvisionerServer).ValidateProvisionerConfig(ctx, in) | ||
3256 | } | ||
3257 | info := &grpc.UnaryServerInfo{ | ||
3258 | Server: srv, | ||
3259 | FullMethod: "/tfplugin5.Provisioner/ValidateProvisionerConfig", | ||
3260 | } | ||
3261 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { | ||
3262 | return srv.(ProvisionerServer).ValidateProvisionerConfig(ctx, req.(*ValidateProvisionerConfig_Request)) | ||
3263 | } | ||
3264 | return interceptor(ctx, in, info, handler) | ||
3265 | } | ||
3266 | |||
3267 | func _Provisioner_ProvisionResource_Handler(srv interface{}, stream grpc.ServerStream) error { | ||
3268 | m := new(ProvisionResource_Request) | ||
3269 | if err := stream.RecvMsg(m); err != nil { | ||
3270 | return err | ||
3271 | } | ||
3272 | return srv.(ProvisionerServer).ProvisionResource(m, &provisionerProvisionResourceServer{stream}) | ||
3273 | } | ||
3274 | |||
3275 | type Provisioner_ProvisionResourceServer interface { | ||
3276 | Send(*ProvisionResource_Response) error | ||
3277 | grpc.ServerStream | ||
3278 | } | ||
3279 | |||
3280 | type provisionerProvisionResourceServer struct { | ||
3281 | grpc.ServerStream | ||
3282 | } | ||
3283 | |||
3284 | func (x *provisionerProvisionResourceServer) Send(m *ProvisionResource_Response) error { | ||
3285 | return x.ServerStream.SendMsg(m) | ||
3286 | } | ||
3287 | |||
3288 | func _Provisioner_Stop_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { | ||
3289 | in := new(Stop_Request) | ||
3290 | if err := dec(in); err != nil { | ||
3291 | return nil, err | ||
3292 | } | ||
3293 | if interceptor == nil { | ||
3294 | return srv.(ProvisionerServer).Stop(ctx, in) | ||
3295 | } | ||
3296 | info := &grpc.UnaryServerInfo{ | ||
3297 | Server: srv, | ||
3298 | FullMethod: "/tfplugin5.Provisioner/Stop", | ||
3299 | } | ||
3300 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { | ||
3301 | return srv.(ProvisionerServer).Stop(ctx, req.(*Stop_Request)) | ||
3302 | } | ||
3303 | return interceptor(ctx, in, info, handler) | ||
3304 | } | ||
3305 | |||
3306 | var _Provisioner_serviceDesc = grpc.ServiceDesc{ | ||
3307 | ServiceName: "tfplugin5.Provisioner", | ||
3308 | HandlerType: (*ProvisionerServer)(nil), | ||
3309 | Methods: []grpc.MethodDesc{ | ||
3310 | { | ||
3311 | MethodName: "GetSchema", | ||
3312 | Handler: _Provisioner_GetSchema_Handler, | ||
3313 | }, | ||
3314 | { | ||
3315 | MethodName: "ValidateProvisionerConfig", | ||
3316 | Handler: _Provisioner_ValidateProvisionerConfig_Handler, | ||
3317 | }, | ||
3318 | { | ||
3319 | MethodName: "Stop", | ||
3320 | Handler: _Provisioner_Stop_Handler, | ||
3321 | }, | ||
3322 | }, | ||
3323 | Streams: []grpc.StreamDesc{ | ||
3324 | { | ||
3325 | StreamName: "ProvisionResource", | ||
3326 | Handler: _Provisioner_ProvisionResource_Handler, | ||
3327 | ServerStreams: true, | ||
3328 | }, | ||
3329 | }, | ||
3330 | Metadata: "tfplugin5.proto", | ||
3331 | } | ||
3332 | |||
3333 | func init() { proto.RegisterFile("tfplugin5.proto", fileDescriptor_tfplugin5_56820f4fb67360c5) } | ||
3334 | |||
3335 | var fileDescriptor_tfplugin5_56820f4fb67360c5 = []byte{ | ||
3336 | // 1876 bytes of a gzipped FileDescriptorProto | ||
3337 | 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x59, 0xcd, 0x6f, 0x23, 0x49, | ||
3338 | 0x15, 0x9f, 0x76, 0xdb, 0x89, 0xfd, 0x9c, 0x0f, 0xa7, 0x66, 0x76, 0x30, 0xbd, 0xbb, 0x10, 0xcc, | ||
3339 | 0x47, 0xb2, 0xda, 0x1d, 0xcf, 0x2a, 0x03, 0xbb, 0x4b, 0x18, 0xad, 0xc8, 0x66, 0x42, 0x26, 0x62, | ||
3340 | 0x26, 0x1b, 0xca, 0xf3, 0x81, 0x84, 0xb4, 0x56, 0x8d, 0xbb, 0xe2, 0x69, 0xc6, 0xee, 0xee, 0xad, | ||
3341 | 0x2e, 0x67, 0x62, 0x71, 0x44, 0x70, 0xe6, 0xc2, 0x87, 0xc4, 0xc7, 0x85, 0x03, 0xff, 0x00, 0x07, | ||
3342 | 0xe0, 0xc6, 0x89, 0x7f, 0x80, 0x1b, 0x70, 0x42, 0x70, 0x43, 0x1c, 0xe1, 0x82, 0x84, 0xea, 0xab, | ||
3343 | 0xbb, 0x6c, 0xb7, 0x93, 0x9e, 0x64, 0x57, 0x88, 0x5b, 0x57, 0xbd, 0x5f, 0xbd, 0xf7, 0xab, 0xf7, | ||
3344 | 0x5e, 0xbd, 0x57, 0x65, 0xc3, 0x2a, 0x3f, 0x8e, 0x07, 0xa3, 0x7e, 0x10, 0x7e, 0xa9, 0x1d, 0xb3, | ||
3345 | 0x88, 0x47, 0xa8, 0x96, 0x4e, 0xb4, 0x6e, 0xc3, 0xd2, 0x9d, 0x71, 0x48, 0x86, 0x41, 0xef, 0x11, | ||
3346 | 0x19, 0x8c, 0x28, 0x6a, 0xc2, 0xe2, 0x30, 0xe9, 0xc7, 0xa4, 0xf7, 0xac, 0xe9, 0xac, 0x3b, 0x9b, | ||
3347 | 0x4b, 0xd8, 0x0c, 0x11, 0x82, 0xf2, 0xb7, 0x93, 0x28, 0x6c, 0x96, 0xe4, 0xb4, 0xfc, 0x6e, 0xfd, | ||
3348 | 0xd5, 0x01, 0xb8, 0x13, 0x90, 0x7e, 0x18, 0x25, 0x3c, 0xe8, 0xa1, 0x6d, 0xa8, 0x26, 0xf4, 0x84, | ||
3349 | 0xb2, 0x80, 0x8f, 0xe5, 0xea, 0x95, 0xad, 0x4f, 0xb5, 0x33, 0xdb, 0x19, 0xb0, 0xdd, 0xd1, 0x28, | ||
3350 | 0x9c, 0xe2, 0x85, 0xe1, 0x64, 0x34, 0x1c, 0x12, 0x36, 0x96, 0x16, 0x6a, 0xd8, 0x0c, 0xd1, 0x75, | ||
3351 | 0x58, 0xf0, 0x29, 0x27, 0xc1, 0xa0, 0xe9, 0x4a, 0x81, 0x1e, 0xa1, 0xb7, 0xa0, 0x46, 0x38, 0x67, | ||
3352 | 0xc1, 0x93, 0x11, 0xa7, 0xcd, 0xf2, 0xba, 0xb3, 0x59, 0xdf, 0x6a, 0x5a, 0xe6, 0x76, 0x8c, 0xec, | ||
3353 | 0x88, 0xf0, 0xa7, 0x38, 0x83, 0xb6, 0x6e, 0x42, 0xd5, 0xd8, 0x47, 0x75, 0x58, 0x3c, 0x38, 0x7c, | ||
3354 | 0xb4, 0x73, 0xef, 0xe0, 0x4e, 0xe3, 0x0a, 0xaa, 0x41, 0x65, 0x0f, 0xe3, 0xf7, 0x71, 0xc3, 0x11, | ||
3355 | 0xf3, 0x8f, 0x77, 0xf0, 0xe1, 0xc1, 0xe1, 0x7e, 0xa3, 0xd4, 0xfa, 0xb3, 0x03, 0xcb, 0x13, 0xda, | ||
3356 | 0xd0, 0x2d, 0xa8, 0x24, 0x9c, 0xc6, 0x49, 0xd3, 0x59, 0x77, 0x37, 0xeb, 0x5b, 0xaf, 0xce, 0x33, | ||
3357 | 0xdb, 0xee, 0x70, 0x1a, 0x63, 0x85, 0xf5, 0x7e, 0xe8, 0x40, 0x59, 0x8c, 0xd1, 0x06, 0xac, 0xa4, | ||
3358 | 0x6c, 0xba, 0x21, 0x19, 0x52, 0xe9, 0xac, 0xda, 0xdd, 0x2b, 0x78, 0x39, 0x9d, 0x3f, 0x24, 0x43, | ||
3359 | 0x8a, 0xda, 0x80, 0xe8, 0x80, 0x0e, 0x69, 0xc8, 0xbb, 0xcf, 0xe8, 0xb8, 0x9b, 0x70, 0x16, 0x84, | ||
3360 | 0x7d, 0xe5, 0x9e, 0xbb, 0x57, 0x70, 0x43, 0xcb, 0xbe, 0x4e, 0xc7, 0x1d, 0x29, 0x41, 0x9b, 0xb0, | ||
3361 | 0x6a, 0xe3, 0x83, 0x90, 0x4b, 0x97, 0xb9, 0x42, 0x73, 0x06, 0x3e, 0x08, 0xf9, 0x7b, 0x20, 0x22, | ||
3362 | 0x35, 0xa0, 0x3d, 0x1e, 0xb1, 0xd6, 0x2d, 0x41, 0x2b, 0x8a, 0xbd, 0x1a, 0x2c, 0x62, 0xfa, 0xe1, | ||
3363 | 0x88, 0x26, 0xdc, 0x5b, 0x87, 0x2a, 0xa6, 0x49, 0x1c, 0x85, 0x09, 0x45, 0xd7, 0xa0, 0xb2, 0xc7, | ||
3364 | 0x58, 0xc4, 0x14, 0x49, 0xac, 0x06, 0xad, 0x1f, 0x39, 0x50, 0xc5, 0xe4, 0x79, 0x87, 0x13, 0x4e, | ||
3365 | 0xd3, 0xd4, 0x70, 0xb2, 0xd4, 0x40, 0xdb, 0xb0, 0x78, 0x3c, 0x20, 0x7c, 0x48, 0xe2, 0x66, 0x49, | ||
3366 | 0x3a, 0x69, 0xdd, 0x72, 0x92, 0x59, 0xd9, 0xfe, 0x9a, 0x82, 0xec, 0x85, 0x9c, 0x8d, 0xb1, 0x59, | ||
3367 | 0xe0, 0x6d, 0xc3, 0x92, 0x2d, 0x40, 0x0d, 0x70, 0x9f, 0xd1, 0xb1, 0x26, 0x20, 0x3e, 0x05, 0xa9, | ||
3368 | 0x13, 0x91, 0xaf, 0x3a, 0x57, 0xd4, 0x60, 0xbb, 0xf4, 0x8e, 0xd3, 0xfa, 0x7b, 0x05, 0x16, 0x3a, | ||
3369 | 0xbd, 0xa7, 0x74, 0x48, 0x44, 0x4a, 0x9d, 0x50, 0x96, 0x04, 0x9a, 0x99, 0x8b, 0xcd, 0x10, 0xdd, | ||
3370 | 0x80, 0xca, 0x93, 0x41, 0xd4, 0x7b, 0x26, 0x97, 0xd7, 0xb7, 0x3e, 0x61, 0x51, 0x53, 0x6b, 0xdb, | ||
3371 | 0xef, 0x09, 0x31, 0x56, 0x28, 0xef, 0x17, 0x0e, 0x54, 0xe4, 0xc4, 0x19, 0x2a, 0xbf, 0x02, 0x90, | ||
3372 | 0x06, 0x2f, 0xd1, 0x5b, 0x7e, 0x79, 0x56, 0x6f, 0x9a, 0x1e, 0xd8, 0x82, 0xa3, 0x77, 0xa1, 0x2e, | ||
3373 | 0x2d, 0x75, 0xf9, 0x38, 0xa6, 0x49, 0xd3, 0x9d, 0xc9, 0x2a, 0xbd, 0xfa, 0x90, 0x26, 0x9c, 0xfa, | ||
3374 | 0x8a, 0x1b, 0xc8, 0x15, 0x0f, 0xc4, 0x02, 0xef, 0x0f, 0x0e, 0xd4, 0x52, 0xcd, 0x22, 0x1c, 0x59, | ||
3375 | 0x56, 0x61, 0xf9, 0x2d, 0xe6, 0x84, 0x6e, 0x73, 0x7a, 0xc5, 0x37, 0x5a, 0x87, 0xba, 0x4f, 0x93, | ||
3376 | 0x1e, 0x0b, 0x62, 0x2e, 0x36, 0xa4, 0x4e, 0x97, 0x3d, 0x85, 0x3c, 0xa8, 0x32, 0xfa, 0xe1, 0x28, | ||
3377 | 0x60, 0xd4, 0x97, 0x27, 0xac, 0x8a, 0xd3, 0xb1, 0x90, 0x45, 0x12, 0x45, 0x06, 0xcd, 0x8a, 0x92, | ||
3378 | 0x99, 0xb1, 0x90, 0xf5, 0xa2, 0x61, 0x3c, 0xe2, 0xd4, 0x6f, 0x2e, 0x28, 0x99, 0x19, 0xa3, 0x57, | ||
3379 | 0xa0, 0x96, 0xd0, 0x30, 0x09, 0x78, 0x70, 0x42, 0x9b, 0x8b, 0x52, 0x98, 0x4d, 0x78, 0xbf, 0x2a, | ||
3380 | 0x41, 0xdd, 0xda, 0x25, 0x7a, 0x19, 0x6a, 0x82, 0xab, 0x75, 0x4c, 0x70, 0x55, 0x4c, 0xc8, 0xf3, | ||
3381 | 0xf1, 0x62, 0x61, 0x44, 0xbb, 0xb0, 0x18, 0xd2, 0x84, 0x8b, 0x33, 0xe4, 0xca, 0xea, 0xf4, 0xda, | ||
3382 | 0x99, 0x1e, 0x96, 0xdf, 0x41, 0xd8, 0xbf, 0x1f, 0xf9, 0x14, 0x9b, 0x95, 0x82, 0xd0, 0x30, 0x08, | ||
3383 | 0xbb, 0x01, 0xa7, 0xc3, 0x44, 0xfa, 0xc4, 0xc5, 0xd5, 0x61, 0x10, 0x1e, 0x88, 0xb1, 0x14, 0x92, | ||
3384 | 0x53, 0x2d, 0xac, 0x68, 0x21, 0x39, 0x95, 0xc2, 0xd6, 0x7d, 0xb5, 0x33, 0xad, 0x71, 0xb2, 0xf4, | ||
3385 | 0x00, 0x2c, 0x74, 0x0e, 0x0e, 0xf7, 0xef, 0xed, 0x35, 0x1c, 0x54, 0x85, 0xf2, 0xbd, 0x83, 0xce, | ||
3386 | 0x83, 0x46, 0x09, 0x2d, 0x82, 0xdb, 0xd9, 0x7b, 0xd0, 0x70, 0xc5, 0xc7, 0xfd, 0x9d, 0xa3, 0x46, | ||
3387 | 0x59, 0x94, 0xa8, 0x7d, 0xfc, 0xfe, 0xc3, 0xa3, 0x46, 0xa5, 0xf5, 0x93, 0x32, 0xac, 0xed, 0x53, | ||
3388 | 0x7e, 0xc4, 0xa2, 0x93, 0xc0, 0xa7, 0x4c, 0xf1, 0xb7, 0x0f, 0xf1, 0xbf, 0x5c, 0xeb, 0x14, 0xdf, | ||
3389 | 0x80, 0x6a, 0xac, 0x91, 0xd2, 0x8d, 0xf5, 0xad, 0xb5, 0x99, 0xcd, 0xe3, 0x14, 0x82, 0x28, 0x34, | ||
3390 | 0x18, 0x4d, 0xa2, 0x11, 0xeb, 0xd1, 0x6e, 0x22, 0x85, 0x26, 0xa7, 0xb7, 0xad, 0x65, 0x33, 0xe6, | ||
3391 | 0xdb, 0xc6, 0x9e, 0xf8, 0x90, 0xab, 0xd5, 0x7c, 0xa2, 0x0e, 0xf8, 0x2a, 0x9b, 0x9c, 0x45, 0x03, | ||
3392 | 0xb8, 0xea, 0x13, 0x4e, 0xba, 0x53, 0x96, 0x54, 0xfe, 0xdf, 0x2e, 0x66, 0xe9, 0x0e, 0xe1, 0xa4, | ||
3393 | 0x33, 0x6b, 0x6b, 0xcd, 0x9f, 0x9e, 0x47, 0x6f, 0x43, 0xdd, 0x4f, 0x7b, 0x90, 0x08, 0x9e, 0xb0, | ||
3394 | 0xf2, 0x52, 0x6e, 0x87, 0xc2, 0x36, 0xd2, 0x7b, 0x08, 0xd7, 0xf2, 0xf6, 0x93, 0x53, 0x97, 0x36, | ||
3395 | 0xec, 0xba, 0x94, 0xeb, 0xe3, 0xac, 0x54, 0x79, 0x8f, 0xe1, 0x7a, 0x3e, 0xf9, 0x4b, 0x2a, 0x6e, | ||
3396 | 0xfd, 0xc9, 0x81, 0x97, 0x8e, 0x18, 0x8d, 0x09, 0xa3, 0xc6, 0x6b, 0xbb, 0x51, 0x78, 0x1c, 0xf4, | ||
3397 | 0xbd, 0xed, 0x34, 0x3d, 0xd0, 0x4d, 0x58, 0xe8, 0xc9, 0x49, 0x9d, 0x0f, 0xf6, 0xe9, 0xb1, 0xaf, | ||
3398 | 0x04, 0x58, 0xc3, 0xbc, 0xef, 0x39, 0x56, 0x3e, 0x7d, 0x15, 0x56, 0x63, 0x65, 0xc1, 0xef, 0x16, | ||
3399 | 0x53, 0xb3, 0x62, 0xf0, 0x8a, 0xca, 0x74, 0x34, 0x4a, 0x45, 0xa3, 0xd1, 0xfa, 0x41, 0x09, 0xae, | ||
3400 | 0x3d, 0x8c, 0xfb, 0x8c, 0xf8, 0x34, 0x8d, 0x8a, 0x68, 0x26, 0x1e, 0xcb, 0x36, 0x77, 0x66, 0xd9, | ||
3401 | 0xb0, 0x8a, 0x78, 0x69, 0xb2, 0x88, 0xbf, 0x09, 0x35, 0x46, 0x9e, 0x77, 0x13, 0xa1, 0x4e, 0xd6, | ||
3402 | 0x88, 0xfa, 0xd6, 0xd5, 0x9c, 0xb6, 0x85, 0xab, 0x4c, 0x7f, 0x79, 0xdf, 0xb5, 0x9d, 0xf2, 0x2e, | ||
3403 | 0xac, 0x8c, 0x14, 0x31, 0x5f, 0xeb, 0x38, 0xc7, 0x27, 0xcb, 0x06, 0xae, 0xfa, 0xe8, 0x85, 0x5d, | ||
3404 | 0xf2, 0x3b, 0x07, 0xbc, 0x47, 0x64, 0x10, 0xf8, 0x82, 0x9c, 0xf6, 0x89, 0xe8, 0x0c, 0x3a, 0xea, | ||
3405 | 0x8f, 0x0b, 0x3a, 0x26, 0x4b, 0x89, 0x52, 0xb1, 0x94, 0xd8, 0xb5, 0x36, 0x3f, 0x45, 0xde, 0x29, | ||
3406 | 0x4c, 0xfe, 0x37, 0x0e, 0x34, 0x0d, 0xf9, 0xec, 0x3c, 0xfc, 0x5f, 0x50, 0xff, 0xad, 0x03, 0x35, | ||
3407 | 0x45, 0x74, 0xc4, 0xa8, 0xd7, 0xcf, 0xb8, 0xbe, 0x0e, 0x6b, 0x9c, 0x32, 0x46, 0x8e, 0x23, 0x36, | ||
3408 | 0xec, 0xda, 0x37, 0x86, 0x1a, 0x6e, 0xa4, 0x82, 0x47, 0x3a, 0xeb, 0xfe, 0x37, 0xdc, 0xff, 0xe9, | ||
3409 | 0xc0, 0x12, 0xa6, 0xc4, 0x37, 0xf9, 0xe2, 0xf9, 0x05, 0x5d, 0x7d, 0x1b, 0x96, 0x7b, 0x23, 0xc6, | ||
3410 | 0xc4, 0x2d, 0x53, 0x25, 0xf9, 0x39, 0xac, 0x97, 0x34, 0x5a, 0x1d, 0x98, 0xb1, 0xc5, 0xfd, 0x8b, | ||
3411 | 0x50, 0x0b, 0xe9, 0xf3, 0x62, 0x47, 0xa5, 0x1a, 0xd2, 0xe7, 0x97, 0x3c, 0x25, 0xbf, 0x2e, 0x03, | ||
3412 | 0x3a, 0x1a, 0x90, 0xd0, 0xec, 0x78, 0xf7, 0x29, 0x09, 0xfb, 0xd4, 0xfb, 0x8f, 0x53, 0x70, 0xe3, | ||
3413 | 0xef, 0x40, 0x3d, 0x66, 0x41, 0xc4, 0x8a, 0x6d, 0x1b, 0x24, 0x56, 0x51, 0xde, 0x03, 0x14, 0xb3, | ||
3414 | 0x28, 0x8e, 0x12, 0xea, 0x77, 0xb3, 0x1d, 0xbb, 0x67, 0x2b, 0x68, 0x98, 0x25, 0x87, 0x66, 0xe7, | ||
3415 | 0x59, 0xa2, 0x94, 0x0b, 0x25, 0x0a, 0xfa, 0x2c, 0x2c, 0x2b, 0xc6, 0x31, 0x0b, 0x4e, 0x84, 0xc9, | ||
3416 | 0x8a, 0xbc, 0xfe, 0x2d, 0xc9, 0xc9, 0x23, 0x35, 0xe7, 0xfd, 0xbc, 0x64, 0x85, 0xe4, 0x36, 0x2c, | ||
3417 | 0xc7, 0x03, 0x12, 0x86, 0x45, 0x2b, 0xd8, 0x92, 0x46, 0x2b, 0x82, 0xbb, 0xe2, 0xda, 0x20, 0xef, | ||
3418 | 0x87, 0x49, 0x97, 0xd1, 0x78, 0x40, 0x7a, 0x54, 0xc7, 0x67, 0xfe, 0xcb, 0x6c, 0xd5, 0xac, 0xc0, | ||
3419 | 0x6a, 0x01, 0xda, 0x80, 0x55, 0x43, 0xc1, 0xd0, 0x76, 0x25, 0xed, 0x15, 0x3d, 0xad, 0x89, 0x5f, | ||
3420 | 0xb8, 0x9f, 0xa3, 0x37, 0x00, 0x0d, 0x68, 0x9f, 0xf4, 0xc6, 0xf2, 0xbe, 0xdd, 0x4d, 0xc6, 0x09, | ||
3421 | 0xa7, 0x43, 0x7d, 0x89, 0x6d, 0x28, 0x89, 0xa8, 0x9e, 0x1d, 0x39, 0xdf, 0xfa, 0xa3, 0x0b, 0x57, | ||
3422 | 0x77, 0xe2, 0x78, 0x30, 0x9e, 0xca, 0x9b, 0x7f, 0x7f, 0xfc, 0x79, 0x33, 0x13, 0x0d, 0xf7, 0x45, | ||
3423 | 0xa2, 0xf1, 0xc2, 0xe9, 0x92, 0xe3, 0xf9, 0x4a, 0x9e, 0xe7, 0xbd, 0xdf, 0x3b, 0x97, 0x3e, 0xc5, | ||
3424 | 0x4d, 0x58, 0x34, 0x36, 0xd4, 0x9b, 0xc4, 0x0c, 0xa7, 0xc3, 0xea, 0x5e, 0x32, 0xac, 0xe5, 0x39, | ||
3425 | 0x61, 0xfd, 0x47, 0x09, 0xae, 0x1e, 0x0c, 0xe3, 0x88, 0xf1, 0xc9, 0x5b, 0xc4, 0x5b, 0x05, 0xa3, | ||
3426 | 0xba, 0x02, 0xa5, 0xc0, 0xd7, 0xef, 0xcf, 0x52, 0xe0, 0x7b, 0xa7, 0xd0, 0x50, 0xea, 0x68, 0x5a, | ||
3427 | 0x52, 0xcf, 0x7d, 0xbd, 0x14, 0x4a, 0x08, 0x85, 0xb2, 0x1d, 0xe6, 0x4e, 0x38, 0xcc, 0xfb, 0xa5, | ||
3428 | 0x1d, 0x8d, 0x0f, 0x00, 0x05, 0x9a, 0x46, 0xd7, 0x5c, 0xb7, 0x4d, 0x5b, 0xb8, 0x69, 0x99, 0xc8, | ||
3429 | 0xd9, 0x7a, 0x7b, 0x9a, 0x3f, 0x5e, 0x0b, 0xa6, 0x66, 0x92, 0x8b, 0x57, 0xdf, 0xbf, 0x38, 0xb0, | ||
3430 | 0x22, 0xfa, 0x4d, 0xd6, 0xe2, 0x3f, 0xbe, 0xe6, 0xce, 0x26, 0x5e, 0x3e, 0x95, 0x42, 0xa9, 0xa9, | ||
3431 | 0xdd, 0x7c, 0xe1, 0xfd, 0xfd, 0xd4, 0x81, 0x6b, 0xe6, 0x99, 0x22, 0xda, 0x7a, 0xde, 0x93, 0xec, | ||
3432 | 0xd4, 0xe2, 0x75, 0x4b, 0x54, 0x85, 0x14, 0x3b, 0xff, 0x51, 0x66, 0xa3, 0x2e, 0xce, 0xee, 0x67, | ||
3433 | 0x0e, 0x7c, 0xd2, 0x5c, 0xb2, 0x2c, 0x8a, 0x1f, 0xc1, 0xb3, 0xe0, 0x23, 0xb9, 0x8c, 0xfc, 0xcd, | ||
3434 | 0x81, 0xb5, 0x94, 0x56, 0x7a, 0x23, 0x49, 0x2e, 0x4e, 0x0b, 0xbd, 0x0d, 0xd0, 0x8b, 0xc2, 0x90, | ||
3435 | 0xf6, 0xb8, 0xb9, 0xe7, 0x9f, 0x55, 0x73, 0x33, 0xa8, 0xf7, 0x2d, 0x6b, 0x3f, 0xd7, 0x61, 0x21, | ||
3436 | 0x1a, 0xf1, 0x78, 0xc4, 0x75, 0x4a, 0xea, 0xd1, 0x85, 0xc3, 0xb0, 0xf5, 0xe3, 0x1a, 0x54, 0xcd, | ||
3437 | 0x93, 0x0c, 0x7d, 0x13, 0x6a, 0xfb, 0x94, 0xeb, 0x1f, 0xab, 0x3e, 0x77, 0xce, 0x6b, 0x57, 0x25, | ||
3438 | 0xd0, 0xe7, 0x0b, 0xbd, 0x89, 0xd1, 0x60, 0xce, 0xfb, 0x0f, 0x6d, 0x5a, 0xeb, 0x73, 0x11, 0xa9, | ||
3439 | 0xa5, 0xd7, 0x0a, 0x20, 0xb5, 0xb5, 0xef, 0x9c, 0xf5, 0xf8, 0x40, 0x37, 0x2c, 0x45, 0xf3, 0x61, | ||
3440 | 0xa9, 0xdd, 0x76, 0x51, 0xb8, 0x36, 0x3e, 0x9a, 0xff, 0x78, 0x40, 0xaf, 0xe7, 0xe8, 0x9a, 0x06, | ||
3441 | 0xa5, 0x86, 0xdf, 0x28, 0x06, 0xd6, 0x66, 0x83, 0xfc, 0x37, 0x28, 0xda, 0xb0, 0xb4, 0xe4, 0x01, | ||
3442 | 0x52, 0x73, 0x9b, 0xe7, 0x03, 0xb5, 0xa9, 0xbb, 0xd6, 0x1b, 0x03, 0xbd, 0x62, 0x2d, 0x4b, 0x67, | ||
3443 | 0x53, 0xa5, 0xaf, 0xce, 0x91, 0x6a, 0x4d, 0xdf, 0x98, 0xbc, 0xf1, 0xa3, 0x4f, 0xdb, 0x6f, 0x5b, | ||
3444 | 0x4b, 0x90, 0xea, 0x5b, 0x9f, 0x0f, 0xd0, 0x2a, 0x7b, 0x79, 0x57, 0x6a, 0x64, 0xa7, 0xe9, 0xac, | ||
3445 | 0x38, 0x55, 0xff, 0x85, 0xf3, 0x60, 0xda, 0xc8, 0x71, 0xee, 0x05, 0x0c, 0xd9, 0xcb, 0x73, 0xe4, | ||
3446 | 0xa9, 0x99, 0x8d, 0x73, 0x71, 0x99, 0x9d, 0x9c, 0xb6, 0x38, 0x61, 0x27, 0xaf, 0x6d, 0xe6, 0xd9, | ||
3447 | 0xc9, 0xc7, 0x69, 0x3b, 0x8f, 0xa7, 0x3b, 0x21, 0xfa, 0xcc, 0x94, 0xa3, 0x33, 0x51, 0xaa, 0xbd, | ||
3448 | 0x75, 0x16, 0x44, 0x2b, 0xfe, 0xb2, 0xfa, 0x29, 0x1f, 0x4d, 0xfc, 0x12, 0xca, 0xa3, 0x38, 0x55, | ||
3449 | 0xd2, 0x9c, 0x15, 0xa8, 0xa5, 0x5b, 0xdf, 0x77, 0xa1, 0x6e, 0x35, 0x06, 0xf4, 0x81, 0x5d, 0x9c, | ||
3450 | 0x36, 0x72, 0xca, 0x8e, 0xdd, 0xe3, 0x72, 0xb3, 0x7a, 0x0e, 0x50, 0x53, 0x3d, 0x3d, 0xa3, 0x1f, | ||
3451 | 0xa1, 0xbc, 0xb3, 0x38, 0x83, 0x4a, 0x8d, 0xde, 0x28, 0x88, 0xd6, 0x96, 0x9f, 0xe4, 0xb4, 0x9a, | ||
3452 | 0x89, 0xf2, 0x3b, 0x23, 0xcd, 0x2d, 0xbf, 0x79, 0x28, 0x65, 0xe1, 0x4d, 0xe7, 0x12, 0x81, 0x78, | ||
3453 | 0xb2, 0x20, 0xff, 0xa3, 0xbb, 0xf5, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc8, 0x16, 0x0b, 0x32, | ||
3454 | 0xb6, 0x1b, 0x00, 0x00, | ||
3455 | } | ||
diff --git a/vendor/github.com/hashicorp/terraform/internal/tfplugin5/tfplugin5.proto b/vendor/github.com/hashicorp/terraform/internal/tfplugin5/tfplugin5.proto new file mode 100644 index 0000000..370faf7 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/internal/tfplugin5/tfplugin5.proto | |||
@@ -0,0 +1,351 @@ | |||
1 | // Terraform Plugin RPC protocol version 5.0 | ||
2 | // | ||
3 | // This file defines version 5.0 of the RPC protocol. To implement a plugin | ||
4 | // against this protocol, copy this definition into your own codebase and | ||
5 | // use protoc to generate stubs for your target language. | ||
6 | // | ||
7 | // This file will be updated in-place in the source Terraform repository for | ||
8 | // any minor versions of protocol 5, but later minor versions will always be | ||
9 | // backwards compatible. Breaking changes, if any are required, will come | ||
10 | // in a subsequent major version with its own separate proto definition. | ||
11 | // | ||
12 | // Note that only the proto files included in a release tag of Terraform are | ||
13 | // official protocol releases. Proto files taken from other commits may include | ||
14 | // incomplete changes or features that did not make it into a final release. | ||
15 | // In all reasonable cases, plugin developers should take the proto file from | ||
16 | // the tag of the most recent release of Terraform, and not from the master | ||
17 | // branch or any other development branch. | ||
18 | // | ||
19 | syntax = "proto3"; | ||
20 | |||
21 | package tfplugin5; | ||
22 | |||
23 | // DynamicValue is an opaque encoding of terraform data, with the field name | ||
24 | // indicating the encoding scheme used. | ||
25 | message DynamicValue { | ||
26 | bytes msgpack = 1; | ||
27 | bytes json = 2; | ||
28 | } | ||
29 | |||
30 | message Diagnostic { | ||
31 | enum Severity { | ||
32 | INVALID = 0; | ||
33 | ERROR = 1; | ||
34 | WARNING = 2; | ||
35 | } | ||
36 | Severity severity = 1; | ||
37 | string summary = 2; | ||
38 | string detail = 3; | ||
39 | AttributePath attribute = 4; | ||
40 | } | ||
41 | |||
42 | message AttributePath { | ||
43 | message Step { | ||
44 | oneof selector { | ||
45 | // Set "attribute_name" to represent looking up an attribute | ||
46 | // in the current object value. | ||
47 | string attribute_name = 1; | ||
48 | // Set "element_key_*" to represent looking up an element in | ||
49 | // an indexable collection type. | ||
50 | string element_key_string = 2; | ||
51 | int64 element_key_int = 3; | ||
52 | } | ||
53 | } | ||
54 | repeated Step steps = 1; | ||
55 | } | ||
56 | |||
57 | message Stop { | ||
58 | message Request { | ||
59 | } | ||
60 | message Response { | ||
61 | string Error = 1; | ||
62 | } | ||
63 | } | ||
64 | |||
65 | // RawState holds the stored state for a resource to be upgraded by the | ||
66 | // provider. It can be in one of two formats, the current json encoded format | ||
67 | // in bytes, or the legacy flatmap format as a map of strings. | ||
68 | message RawState { | ||
69 | bytes json = 1; | ||
70 | map<string, string> flatmap = 2; | ||
71 | } | ||
72 | |||
73 | // Schema is the configuration schema for a Resource, Provider, or Provisioner. | ||
74 | message Schema { | ||
75 | message Block { | ||
76 | int64 version = 1; | ||
77 | repeated Attribute attributes = 2; | ||
78 | repeated NestedBlock block_types = 3; | ||
79 | } | ||
80 | |||
81 | message Attribute { | ||
82 | string name = 1; | ||
83 | bytes type = 2; | ||
84 | string description = 3; | ||
85 | bool required = 4; | ||
86 | bool optional = 5; | ||
87 | bool computed = 6; | ||
88 | bool sensitive = 7; | ||
89 | } | ||
90 | |||
91 | message NestedBlock { | ||
92 | enum NestingMode { | ||
93 | INVALID = 0; | ||
94 | SINGLE = 1; | ||
95 | LIST = 2; | ||
96 | SET = 3; | ||
97 | MAP = 4; | ||
98 | GROUP = 5; | ||
99 | } | ||
100 | |||
101 | string type_name = 1; | ||
102 | Block block = 2; | ||
103 | NestingMode nesting = 3; | ||
104 | int64 min_items = 4; | ||
105 | int64 max_items = 5; | ||
106 | } | ||
107 | |||
108 | // The version of the schema. | ||
109 | // Schemas are versioned, so that providers can upgrade a saved resource | ||
110 | // state when the schema is changed. | ||
111 | int64 version = 1; | ||
112 | |||
113 | // Block is the top level configuration block for this schema. | ||
114 | Block block = 2; | ||
115 | } | ||
116 | |||
117 | service Provider { | ||
118 | //////// Information about what a provider supports/expects | ||
119 | rpc GetSchema(GetProviderSchema.Request) returns (GetProviderSchema.Response); | ||
120 | rpc PrepareProviderConfig(PrepareProviderConfig.Request) returns (PrepareProviderConfig.Response); | ||
121 | rpc ValidateResourceTypeConfig(ValidateResourceTypeConfig.Request) returns (ValidateResourceTypeConfig.Response); | ||
122 | rpc ValidateDataSourceConfig(ValidateDataSourceConfig.Request) returns (ValidateDataSourceConfig.Response); | ||
123 | rpc UpgradeResourceState(UpgradeResourceState.Request) returns (UpgradeResourceState.Response); | ||
124 | |||
125 | //////// One-time initialization, called before other functions below | ||
126 | rpc Configure(Configure.Request) returns (Configure.Response); | ||
127 | |||
128 | //////// Managed Resource Lifecycle | ||
129 | rpc ReadResource(ReadResource.Request) returns (ReadResource.Response); | ||
130 | rpc PlanResourceChange(PlanResourceChange.Request) returns (PlanResourceChange.Response); | ||
131 | rpc ApplyResourceChange(ApplyResourceChange.Request) returns (ApplyResourceChange.Response); | ||
132 | rpc ImportResourceState(ImportResourceState.Request) returns (ImportResourceState.Response); | ||
133 | |||
134 | rpc ReadDataSource(ReadDataSource.Request) returns (ReadDataSource.Response); | ||
135 | |||
136 | //////// Graceful Shutdown | ||
137 | rpc Stop(Stop.Request) returns (Stop.Response); | ||
138 | } | ||
139 | |||
140 | message GetProviderSchema { | ||
141 | message Request { | ||
142 | } | ||
143 | message Response { | ||
144 | Schema provider = 1; | ||
145 | map<string, Schema> resource_schemas = 2; | ||
146 | map<string, Schema> data_source_schemas = 3; | ||
147 | repeated Diagnostic diagnostics = 4; | ||
148 | } | ||
149 | } | ||
150 | |||
151 | message PrepareProviderConfig { | ||
152 | message Request { | ||
153 | DynamicValue config = 1; | ||
154 | } | ||
155 | message Response { | ||
156 | DynamicValue prepared_config = 1; | ||
157 | repeated Diagnostic diagnostics = 2; | ||
158 | } | ||
159 | } | ||
160 | |||
161 | message UpgradeResourceState { | ||
162 | message Request { | ||
163 | string type_name = 1; | ||
164 | |||
165 | // version is the schema_version number recorded in the state file | ||
166 | int64 version = 2; | ||
167 | |||
168 | // raw_state is the raw states as stored for the resource. Core does | ||
169 | // not have access to the schema of prior_version, so it's the | ||
170 | // provider's responsibility to interpret this value using the | ||
171 | // appropriate older schema. The raw_state will be the json encoded | ||
172 | // state, or a legacy flat-mapped format. | ||
173 | RawState raw_state = 3; | ||
174 | } | ||
175 | message Response { | ||
176 | // new_state is a msgpack-encoded data structure that, when interpreted with | ||
177 | // the _current_ schema for this resource type, is functionally equivalent to | ||
178 | // that which was given in prior_state_raw. | ||
179 | DynamicValue upgraded_state = 1; | ||
180 | |||
181 | // diagnostics describes any errors encountered during migration that could not | ||
182 | // be safely resolved, and warnings about any possibly-risky assumptions made | ||
183 | // in the upgrade process. | ||
184 | repeated Diagnostic diagnostics = 2; | ||
185 | } | ||
186 | } | ||
187 | |||
188 | message ValidateResourceTypeConfig { | ||
189 | message Request { | ||
190 | string type_name = 1; | ||
191 | DynamicValue config = 2; | ||
192 | } | ||
193 | message Response { | ||
194 | repeated Diagnostic diagnostics = 1; | ||
195 | } | ||
196 | } | ||
197 | |||
198 | message ValidateDataSourceConfig { | ||
199 | message Request { | ||
200 | string type_name = 1; | ||
201 | DynamicValue config = 2; | ||
202 | } | ||
203 | message Response { | ||
204 | repeated Diagnostic diagnostics = 1; | ||
205 | } | ||
206 | } | ||
207 | |||
208 | message Configure { | ||
209 | message Request { | ||
210 | string terraform_version = 1; | ||
211 | DynamicValue config = 2; | ||
212 | } | ||
213 | message Response { | ||
214 | repeated Diagnostic diagnostics = 1; | ||
215 | } | ||
216 | } | ||
217 | |||
218 | message ReadResource { | ||
219 | message Request { | ||
220 | string type_name = 1; | ||
221 | DynamicValue current_state = 2; | ||
222 | } | ||
223 | message Response { | ||
224 | DynamicValue new_state = 1; | ||
225 | repeated Diagnostic diagnostics = 2; | ||
226 | } | ||
227 | } | ||
228 | |||
229 | message PlanResourceChange { | ||
230 | message Request { | ||
231 | string type_name = 1; | ||
232 | DynamicValue prior_state = 2; | ||
233 | DynamicValue proposed_new_state = 3; | ||
234 | DynamicValue config = 4; | ||
235 | bytes prior_private = 5; | ||
236 | } | ||
237 | |||
238 | message Response { | ||
239 | DynamicValue planned_state = 1; | ||
240 | repeated AttributePath requires_replace = 2; | ||
241 | bytes planned_private = 3; | ||
242 | repeated Diagnostic diagnostics = 4; | ||
243 | |||
244 | |||
245 | // This may be set only by the helper/schema "SDK" in the main Terraform | ||
246 | // repository, to request that Terraform Core >=0.12 permit additional | ||
247 | // inconsistencies that can result from the legacy SDK type system | ||
248 | // and its imprecise mapping to the >=0.12 type system. | ||
249 | // The change in behavior implied by this flag makes sense only for the | ||
250 | // specific details of the legacy SDK type system, and are not a general | ||
251 | // mechanism to avoid proper type handling in providers. | ||
252 | // | ||
253 | // ==== DO NOT USE THIS ==== | ||
254 | // ==== THIS MUST BE LEFT UNSET IN ALL OTHER SDKS ==== | ||
255 | // ==== DO NOT USE THIS ==== | ||
256 | bool legacy_type_system = 5; | ||
257 | } | ||
258 | } | ||
259 | |||
260 | message ApplyResourceChange { | ||
261 | message Request { | ||
262 | string type_name = 1; | ||
263 | DynamicValue prior_state = 2; | ||
264 | DynamicValue planned_state = 3; | ||
265 | DynamicValue config = 4; | ||
266 | bytes planned_private = 5; | ||
267 | } | ||
268 | message Response { | ||
269 | DynamicValue new_state = 1; | ||
270 | bytes private = 2; | ||
271 | repeated Diagnostic diagnostics = 3; | ||
272 | |||
273 | // This may be set only by the helper/schema "SDK" in the main Terraform | ||
274 | // repository, to request that Terraform Core >=0.12 permit additional | ||
275 | // inconsistencies that can result from the legacy SDK type system | ||
276 | // and its imprecise mapping to the >=0.12 type system. | ||
277 | // The change in behavior implied by this flag makes sense only for the | ||
278 | // specific details of the legacy SDK type system, and are not a general | ||
279 | // mechanism to avoid proper type handling in providers. | ||
280 | // | ||
281 | // ==== DO NOT USE THIS ==== | ||
282 | // ==== THIS MUST BE LEFT UNSET IN ALL OTHER SDKS ==== | ||
283 | // ==== DO NOT USE THIS ==== | ||
284 | bool legacy_type_system = 4; | ||
285 | } | ||
286 | } | ||
287 | |||
288 | message ImportResourceState { | ||
289 | message Request { | ||
290 | string type_name = 1; | ||
291 | string id = 2; | ||
292 | } | ||
293 | |||
294 | message ImportedResource { | ||
295 | string type_name = 1; | ||
296 | DynamicValue state = 2; | ||
297 | bytes private = 3; | ||
298 | } | ||
299 | |||
300 | message Response { | ||
301 | repeated ImportedResource imported_resources = 1; | ||
302 | repeated Diagnostic diagnostics = 2; | ||
303 | } | ||
304 | } | ||
305 | |||
306 | message ReadDataSource { | ||
307 | message Request { | ||
308 | string type_name = 1; | ||
309 | DynamicValue config = 2; | ||
310 | } | ||
311 | message Response { | ||
312 | DynamicValue state = 1; | ||
313 | repeated Diagnostic diagnostics = 2; | ||
314 | } | ||
315 | } | ||
316 | |||
317 | service Provisioner { | ||
318 | rpc GetSchema(GetProvisionerSchema.Request) returns (GetProvisionerSchema.Response); | ||
319 | rpc ValidateProvisionerConfig(ValidateProvisionerConfig.Request) returns (ValidateProvisionerConfig.Response); | ||
320 | rpc ProvisionResource(ProvisionResource.Request) returns (stream ProvisionResource.Response); | ||
321 | rpc Stop(Stop.Request) returns (Stop.Response); | ||
322 | } | ||
323 | |||
324 | message GetProvisionerSchema { | ||
325 | message Request { | ||
326 | } | ||
327 | message Response { | ||
328 | Schema provisioner = 1; | ||
329 | repeated Diagnostic diagnostics = 2; | ||
330 | } | ||
331 | } | ||
332 | |||
333 | message ValidateProvisionerConfig { | ||
334 | message Request { | ||
335 | DynamicValue config = 1; | ||
336 | } | ||
337 | message Response { | ||
338 | repeated Diagnostic diagnostics = 1; | ||
339 | } | ||
340 | } | ||
341 | |||
342 | message ProvisionResource { | ||
343 | message Request { | ||
344 | DynamicValue config = 1; | ||
345 | DynamicValue connection = 2; | ||
346 | } | ||
347 | message Response { | ||
348 | string output = 1; | ||
349 | repeated Diagnostic diagnostics = 2; | ||
350 | } | ||
351 | } | ||