Version can be passed through request body (#281)

* Scopes inline version into update request body.

* Users inline version into update request body.

* Group inline version into update and add|set|remove member request body.

* Role inline version into update and add|set|remove grant|principal request body.

* Auth method inline version into update request body.

* Auth Account inline version into update request body.

* host catalog version is inlined for update.

* Gen after merge.

* Submitting template changes for version handling.
This commit is contained in:
Todd Knight authored and GitHub committed 2020-08-18 17:38:38 -07:00
1 parent e20c150617
commit d86e58476f
62 files changed
+1629 -2137

No files matched your search

+3 -8
View File
@@ -363,15 +363,13 @@ func (c *{{ .ClientName }}Client) Update(ctx context.Context, {{ range .Resource
}
{{ end }}
opts.valueMap["version"] = version
req, err := c.client.NewRequest(ctx, "PATCH", {{ .ResourcePath }}, opts.valueMap, apiOpts...)
if err != nil {
return nil, nil, fmt.Errorf("error creating Update request: %w", err)
}
q := url.Values{}
q.Add("version", fmt.Sprintf("%d", version))
req.URL.RawQuery = q.Encode()
resp, err := c.client.Do(req)
if err != nil {
return nil, nil, fmt.Errorf("error performing client request during Update call: %w", err)
@@ -429,6 +427,7 @@ func (c *{{ $input.ClientName }}Client) {{ $fullName }}(ctx context.Context, {{
version = existingTarget.Version
}
{{ end }}
opts.valueMap["version"] = version
if len({{ $value }}) > 0 {
opts.valueMap["{{ snakeCase $value }}"] = {{ $value }}
@@ -443,10 +442,6 @@ func (c *{{ $input.ClientName }}Client) {{ $fullName }}(ctx context.Context, {{
return nil, nil, fmt.Errorf("error creating {{ $fullName }} request: %w", err)
}
q := url.Values{}
q.Add("version", fmt.Sprintf("%d", version))
req.URL.RawQuery = q.Encode()
resp, err := c.client.Do(req)
if err != nil {
return nil, nil, fmt.Errorf("error performing client request during {{ $fullName }} call: %w", err)