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

+2 -5
View File
@@ -5,7 +5,6 @@ import (
"context"
"errors"
"fmt"
"net/url"
"time"
"github.com/kr/pretty"
@@ -114,15 +113,13 @@ func (c *UsersClient) Update(ctx context.Context, userId string, version uint32,
version = existingTarget.Version
}
opts.valueMap["version"] = version
req, err := c.client.NewRequest(ctx, "PATCH", fmt.Sprintf("users/%s", userId), 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)