diff --git a/pkg/sdk/secrets_validations_gen.go b/pkg/sdk/secrets_validations_gen.go index b5f7e14800..f747d54ad7 100644 --- a/pkg/sdk/secrets_validations_gen.go +++ b/pkg/sdk/secrets_validations_gen.go @@ -76,8 +76,8 @@ func (opts *AlterSecretOptions) validate() error { errs = append(errs, errExactlyOneOf("AlterSecretOptions", "Set", "Unset")) } if valueSet(opts.Set) { - if everyValueSet(opts.Set.SetForOAuthClientCredentialsFlow, opts.Set.SetForOAuthAuthorizationFlow, opts.Set.SetForBasicAuthentication, opts.Set.SetForGenericString) { - errs = append(errs, errOneOf("AlterSecretOptions.Set", "SetForOAuthClientCredentialsFlow", "SetForOAuthAuthorizationFlow", "SetForBasicAuthentication", "SetForGenericString")) + if moreThanOneValueSet(opts.Set.SetForOAuthClientCredentialsFlow, opts.Set.SetForOAuthAuthorizationFlow, opts.Set.SetForBasicAuthentication, opts.Set.SetForGenericString) { + errs = append(errs, errMoreThanOneOf("AlterSecretOptions.Set", "SetForOAuthClientCredentialsFlow", "SetForOAuthAuthorizationFlow", "SetForBasicAuthentication", "SetForGenericString")) } } return JoinErrors(errs...) diff --git a/pkg/sdk/testint/secrets_gen_integration_test.go b/pkg/sdk/testint/secrets_gen_integration_test.go index 76df4308ef..5503f362ee 100644 --- a/pkg/sdk/testint/secrets_gen_integration_test.go +++ b/pkg/sdk/testint/secrets_gen_integration_test.go @@ -18,6 +18,8 @@ func TestInt_Secrets(t *testing.T) { ctx := testContext(t) integrationId := testClientHelper().Ids.RandomAccountObjectIdentifier() + + // "YYYY-MM-DD" or "YYYY-MM-DD HH-MI-SS" format has to be used, otherwise Snowflake returns error: "Invalid date/time format" refreshTokenExpiryTime := time.Now().Add(24 * time.Hour).Format(time.DateOnly) _, apiIntegrationCleanup := testClientHelper().SecurityIntegration.CreateApiAuthenticationClientCredentialsWithRequest(t, @@ -212,11 +214,11 @@ func TestInt_Secrets(t *testing.T) { require.NoError(t, err) t.Cleanup(testClientHelper().Secret.DropFunc(t, id)) - _, err = client.Secrets.ShowByID(ctx, id) + secret, err := client.Secrets.ShowByID(ctx, id) require.NoError(t, err) assertions.AssertThat(t, - objectassert.Secret(t, id). + objectassert.SecretFromObject(t, secret). HasName(id.Name()). HasComment(comment). HasSecretType("PASSWORD"). @@ -535,9 +537,6 @@ func TestInt_Secrets(t *testing.T) { }) t.Run("Show: SecretWithOAuthAuthorization with Like", func(t *testing.T) { - // secret2, id1 := createSecretWithOAuthAuthorizationCodeFlow(t, integrationId, "foo_1", refreshTokenExpiryTime, nil) - // secret2, _ := createSecretWithOAuthAuthorizationCodeFlow(t, integrationId, "foo_2", refreshTokenExpiryTime, nil) - id1 := testClientHelper().Ids.RandomSchemaObjectIdentifier() id2 := testClientHelper().Ids.RandomSchemaObjectIdentifier()