Generate new version of SDK resources and Add Tests (#331)

This commit is contained in:
Todd Knight authored and GitHub committed 2020-09-08 16:27:51 -04:00
1 parent 96e4b1cdba
commit c3ecea172d
93 files changed
+3414 -2826

No files matched your search

@@ -32,7 +32,7 @@ func (c *PasswordCommand) Synopsis() string {
}
var passwordFlagsMap = map[string][]string{
"create": {"name", "description"},
"create": {"scope-id", "name", "description"},
"update": {"id", "name", "description", "version"},
}
@@ -102,6 +102,10 @@ func (c *PasswordCommand) Run(args []string) int {
c.UI.Error("ID is required but not passed in via -id")
return 1
}
if strutil.StrListContains(passwordFlagsMap[c.Func], "scope-id") && c.FlagScopeId == "" {
c.UI.Error("Scope ID must be passed in via -scope-id")
return 1
}
client, err := c.Client()
if err != nil {
@@ -174,7 +178,7 @@ func (c *PasswordCommand) Run(args []string) int {
default:
switch c.FlagVersion {
case 0:
opts = append(opts, authmethods.WithAutomaticVersioning())
opts = append(opts, authmethods.WithAutomaticVersioning(true))
default:
version = uint32(c.FlagVersion)
}
@@ -185,7 +189,7 @@ func (c *PasswordCommand) Run(args []string) int {
switch c.Func {
case "create":
method, apiErr, err = authmethodClient.Create(c.Context, "password", opts...)
method, apiErr, err = authmethodClient.Create(c.Context, "password", c.FlagScopeId, opts...)
case "update":
method, apiErr, err = authmethodClient.Update(c.Context, c.FlagId, version, opts...)
}