diff --git a/pkg/datasources/secrets.go b/pkg/datasources/secrets.go index 8983f3d68d..c40ec7aa6e 100644 --- a/pkg/datasources/secrets.go +++ b/pkg/datasources/secrets.go @@ -109,7 +109,7 @@ func ReadSecrets(ctx context.Context, d *schema.ResourceData, meta any) diag.Dia req := sdk.NewShowSecretRequest() handleLike(d, &req.Like) - err := handleExtendedIn(d, &req.ExtendedIn) + err := handleExtendedIn(d, &req.In) if err != nil { return diag.FromErr(err) } diff --git a/pkg/sdk/poc/generator/show_by_id_filtering.go b/pkg/sdk/poc/generator/show_by_id_filtering.go index 8afb913f5d..341713659c 100644 --- a/pkg/sdk/poc/generator/show_by_id_filtering.go +++ b/pkg/sdk/poc/generator/show_by_id_filtering.go @@ -13,7 +13,7 @@ const ( // Enables filtering with: In // Based on the identifier Kind ShowByIDInFiltering - // Enables filtering with: ExtendedIn + // Enables filtering with: In // Based on the identifier Kind ShowByIDExtendedInFiltering // Enables filtering with: Limit @@ -62,7 +62,7 @@ func newShowByIDInFiltering(identifierKind string) ShowByIDFiltering { } func newShowByIDExtendedInFiltering(identifierKind string) ShowByIDFiltering { - return newShowByIDFiltering("In", "ExtendedIn", "In: In{%[1]v: id.%[1]vId()}", &identifierKind) + return newShowByIDFiltering("In", "In", "In: In{%[1]v: id.%[1]vId()}", &identifierKind) } func newShowByIDLimitFiltering(string) ShowByIDFiltering { diff --git a/pkg/sdk/secrets_dto_builders_gen.go b/pkg/sdk/secrets_dto_builders_gen.go index 4577ac7edc..08982900a0 100644 --- a/pkg/sdk/secrets_dto_builders_gen.go +++ b/pkg/sdk/secrets_dto_builders_gen.go @@ -261,8 +261,8 @@ func (s *ShowSecretRequest) WithLike(Like Like) *ShowSecretRequest { return s } -func (s *ShowSecretRequest) WithExtendedIn(ExtendedIn ExtendedIn) *ShowSecretRequest { - s.ExtendedIn = &ExtendedIn +func (s *ShowSecretRequest) WithIn(In ExtendedIn) *ShowSecretRequest { + s.In = &In return s } diff --git a/pkg/sdk/secrets_dto_gen.go b/pkg/sdk/secrets_dto_gen.go index 690ce414d2..dd7ccb7d6a 100644 --- a/pkg/sdk/secrets_dto_gen.go +++ b/pkg/sdk/secrets_dto_gen.go @@ -100,8 +100,8 @@ type DropSecretRequest struct { } type ShowSecretRequest struct { - Like *Like - ExtendedIn *ExtendedIn + Like *Like + In *ExtendedIn } type DescribeSecretRequest struct { diff --git a/pkg/sdk/secrets_gen.go b/pkg/sdk/secrets_gen.go index bc3800cdcd..fdc6d1859d 100644 --- a/pkg/sdk/secrets_gen.go +++ b/pkg/sdk/secrets_gen.go @@ -123,10 +123,10 @@ type DropSecretOptions struct { // ShowSecretOptions is based on https://docs.snowflake.com/en/sql-reference/sql/show-secrets. type ShowSecretOptions struct { - show bool `ddl:"static" sql:"SHOW"` - secrets bool `ddl:"static" sql:"SECRETS"` - Like *Like `ddl:"keyword" sql:"LIKE"` - ExtendedIn *ExtendedIn `ddl:"keyword" sql:"IN"` + show bool `ddl:"static" sql:"SHOW"` + secrets bool `ddl:"static" sql:"SECRETS"` + Like *Like `ddl:"keyword" sql:"LIKE"` + In *ExtendedIn `ddl:"keyword" sql:"IN"` } type secretDBRow struct { CreatedOn time.Time `db:"created_on"` diff --git a/pkg/sdk/secrets_gen_test.go b/pkg/sdk/secrets_gen_test.go index 808aabad6b..37cc96726a 100644 --- a/pkg/sdk/secrets_gen_test.go +++ b/pkg/sdk/secrets_gen_test.go @@ -341,7 +341,7 @@ func TestSecrets_Show(t *testing.T) { t.Run("show with in", func(t *testing.T) { opts := defaultOpts() - opts.ExtendedIn = &ExtendedIn{ + opts.In = &ExtendedIn{ In: In{ Account: Bool(true), }, diff --git a/pkg/sdk/secrets_impl_gen.go b/pkg/sdk/secrets_impl_gen.go index c180b0acb9..9f2e331944 100644 --- a/pkg/sdk/secrets_impl_gen.go +++ b/pkg/sdk/secrets_impl_gen.go @@ -66,7 +66,7 @@ func (v *secrets) Describe(ctx context.Context, id SchemaObjectIdentifier) (*Sec func (v *secrets) ShowByID(ctx context.Context, id SchemaObjectIdentifier) (*Secret, error) { request := NewShowSecretRequest(). WithLike(Like{Pattern: String(id.Name())}). - WithExtendedIn(ExtendedIn{In: In{Schema: id.SchemaId()}}) + WithIn(ExtendedIn{In: In{Schema: id.SchemaId()}}) secrets, err := v.Show(ctx, request) if err != nil { return nil, err @@ -193,8 +193,8 @@ func (r *DropSecretRequest) toOpts() *DropSecretOptions { func (r *ShowSecretRequest) toOpts() *ShowSecretOptions { opts := &ShowSecretOptions{ - Like: r.Like, - ExtendedIn: r.ExtendedIn, + Like: r.Like, + In: r.In, } return opts } diff --git a/pkg/sdk/streamlits_impl_gen.go b/pkg/sdk/streamlits_impl_gen.go index c76c30e310..ac20497773 100644 --- a/pkg/sdk/streamlits_impl_gen.go +++ b/pkg/sdk/streamlits_impl_gen.go @@ -90,14 +90,12 @@ func (r *AlterStreamlitRequest) toOpts() *AlterStreamlitOptions { } if r.Set != nil { - opts.Set = &StreamlitSet{ RootLocation: r.Set.RootLocation, MainFile: r.Set.MainFile, QueryWarehouse: r.Set.QueryWarehouse, - - Comment: r.Set.Comment, - Title: r.Set.Title, + Comment: r.Set.Comment, + Title: r.Set.Title, } if r.Set.ExternalAccessIntegrations != nil { @@ -105,7 +103,6 @@ func (r *AlterStreamlitRequest) toOpts() *AlterStreamlitOptions { ExternalAccessIntegrations: r.Set.ExternalAccessIntegrations.ExternalAccessIntegrations, } } - } if r.Unset != nil { diff --git a/pkg/sdk/testint/secrets_gen_integration_test.go b/pkg/sdk/testint/secrets_gen_integration_test.go index a35a6448c5..26a12edad0 100644 --- a/pkg/sdk/testint/secrets_gen_integration_test.go +++ b/pkg/sdk/testint/secrets_gen_integration_test.go @@ -594,15 +594,15 @@ func TestInt_Secrets(t *testing.T) { secret, secretCleanup := testClientHelper().Secret.CreateWithOAuthClientCredentialsFlow(t, id, integrationId, []sdk.ApiIntegrationScope{{Scope: "foo"}}) t.Cleanup(secretCleanup) - returnedSecrets, err := client.Secrets.Show(ctx, sdk.NewShowSecretRequest().WithExtendedIn(sdk.ExtendedIn{In: sdk.In{Account: sdk.Pointer(true)}})) + returnedSecrets, err := client.Secrets.Show(ctx, sdk.NewShowSecretRequest().WithIn(sdk.ExtendedIn{In: sdk.In{Account: sdk.Pointer(true)}})) require.NoError(t, err) require.Contains(t, returnedSecrets, *secret) - returnedSecrets, err = client.Secrets.Show(ctx, sdk.NewShowSecretRequest().WithExtendedIn(sdk.ExtendedIn{In: sdk.In{Database: id.DatabaseId()}})) + returnedSecrets, err = client.Secrets.Show(ctx, sdk.NewShowSecretRequest().WithIn(sdk.ExtendedIn{In: sdk.In{Database: id.DatabaseId()}})) require.NoError(t, err) require.Contains(t, returnedSecrets, *secret) - returnedSecrets, err = client.Secrets.Show(ctx, sdk.NewShowSecretRequest().WithExtendedIn(sdk.ExtendedIn{In: sdk.In{Schema: id.SchemaId()}})) + returnedSecrets, err = client.Secrets.Show(ctx, sdk.NewShowSecretRequest().WithIn(sdk.ExtendedIn{In: sdk.In{Schema: id.SchemaId()}})) require.NoError(t, err) require.Contains(t, returnedSecrets, *secret) }) @@ -612,15 +612,15 @@ func TestInt_Secrets(t *testing.T) { secret, secretCleanup := testClientHelper().Secret.CreateWithOAuthAuthorizationCodeFlow(t, id, integrationId, "foo", refreshTokenExpiryTime) t.Cleanup(secretCleanup) - returnedSecrets, err := client.Secrets.Show(ctx, sdk.NewShowSecretRequest().WithExtendedIn(sdk.ExtendedIn{In: sdk.In{Account: sdk.Pointer(true)}})) + returnedSecrets, err := client.Secrets.Show(ctx, sdk.NewShowSecretRequest().WithIn(sdk.ExtendedIn{In: sdk.In{Account: sdk.Pointer(true)}})) require.NoError(t, err) require.Contains(t, returnedSecrets, *secret) - returnedSecrets, err = client.Secrets.Show(ctx, sdk.NewShowSecretRequest().WithExtendedIn(sdk.ExtendedIn{In: sdk.In{Database: id.DatabaseId()}})) + returnedSecrets, err = client.Secrets.Show(ctx, sdk.NewShowSecretRequest().WithIn(sdk.ExtendedIn{In: sdk.In{Database: id.DatabaseId()}})) require.NoError(t, err) require.Contains(t, returnedSecrets, *secret) - returnedSecrets, err = client.Secrets.Show(ctx, sdk.NewShowSecretRequest().WithExtendedIn(sdk.ExtendedIn{In: sdk.In{Schema: id.SchemaId()}})) + returnedSecrets, err = client.Secrets.Show(ctx, sdk.NewShowSecretRequest().WithIn(sdk.ExtendedIn{In: sdk.In{Schema: id.SchemaId()}})) require.NoError(t, err) require.Contains(t, returnedSecrets, *secret) }) @@ -640,21 +640,21 @@ func TestInt_Secrets(t *testing.T) { secretGenericString, secretCleanupWithGenericString := testClientHelper().Secret.CreateWithGenericString(t, testClientHelper().Ids.RandomSchemaObjectIdentifier(), "foo") t.Cleanup(secretCleanupWithGenericString) - returnedSecrets, err := client.Secrets.Show(ctx, sdk.NewShowSecretRequest().WithExtendedIn(sdk.ExtendedIn{In: sdk.In{Account: sdk.Pointer(true)}})) + returnedSecrets, err := client.Secrets.Show(ctx, sdk.NewShowSecretRequest().WithIn(sdk.ExtendedIn{In: sdk.In{Account: sdk.Pointer(true)}})) require.NoError(t, err) require.Contains(t, returnedSecrets, *secretOAuthClientCredentials) require.Contains(t, returnedSecrets, *secretOAuthAuthorizationCode) require.Contains(t, returnedSecrets, *secretBasicAuthentication) require.Contains(t, returnedSecrets, *secretGenericString) - returnedSecrets, err = client.Secrets.Show(ctx, sdk.NewShowSecretRequest().WithExtendedIn(sdk.ExtendedIn{In: sdk.In{Database: id.DatabaseId()}})) + returnedSecrets, err = client.Secrets.Show(ctx, sdk.NewShowSecretRequest().WithIn(sdk.ExtendedIn{In: sdk.In{Database: id.DatabaseId()}})) require.NoError(t, err) require.Contains(t, returnedSecrets, *secretOAuthClientCredentials) require.Contains(t, returnedSecrets, *secretOAuthAuthorizationCode) require.Contains(t, returnedSecrets, *secretBasicAuthentication) require.Contains(t, returnedSecrets, *secretGenericString) - returnedSecrets, err = client.Secrets.Show(ctx, sdk.NewShowSecretRequest().WithExtendedIn(sdk.ExtendedIn{In: sdk.In{Schema: id.SchemaId()}})) + returnedSecrets, err = client.Secrets.Show(ctx, sdk.NewShowSecretRequest().WithIn(sdk.ExtendedIn{In: sdk.In{Schema: id.SchemaId()}})) require.NoError(t, err) require.Contains(t, returnedSecrets, *secretOAuthClientCredentials) require.Contains(t, returnedSecrets, *secretOAuthAuthorizationCode) @@ -667,15 +667,15 @@ func TestInt_Secrets(t *testing.T) { secret, secretCleanup := testClientHelper().Secret.CreateWithGenericString(t, id, "foo") t.Cleanup(secretCleanup) - returnedSecrets, err := client.Secrets.Show(ctx, sdk.NewShowSecretRequest().WithExtendedIn(sdk.ExtendedIn{In: sdk.In{Account: sdk.Pointer(true)}})) + returnedSecrets, err := client.Secrets.Show(ctx, sdk.NewShowSecretRequest().WithIn(sdk.ExtendedIn{In: sdk.In{Account: sdk.Pointer(true)}})) require.NoError(t, err) require.Contains(t, returnedSecrets, *secret) - returnedSecrets, err = client.Secrets.Show(ctx, sdk.NewShowSecretRequest().WithExtendedIn(sdk.ExtendedIn{In: sdk.In{Database: id.DatabaseId()}})) + returnedSecrets, err = client.Secrets.Show(ctx, sdk.NewShowSecretRequest().WithIn(sdk.ExtendedIn{In: sdk.In{Database: id.DatabaseId()}})) require.NoError(t, err) require.Contains(t, returnedSecrets, *secret) - returnedSecrets, err = client.Secrets.Show(ctx, sdk.NewShowSecretRequest().WithExtendedIn(sdk.ExtendedIn{In: sdk.In{Schema: id.SchemaId()}})) + returnedSecrets, err = client.Secrets.Show(ctx, sdk.NewShowSecretRequest().WithIn(sdk.ExtendedIn{In: sdk.In{Schema: id.SchemaId()}})) require.NoError(t, err) require.Contains(t, returnedSecrets, *secret) })