Skip to content

Commit

Permalink
generator rerun
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-fbudzynski committed Dec 10, 2024
1 parent b058577 commit 235da09
Show file tree
Hide file tree
Showing 36 changed files with 106 additions and 102 deletions.
4 changes: 2 additions & 2 deletions pkg/sdk/api_integrations_dto_builders_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions pkg/sdk/api_integrations_impl_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ func (v *apiIntegrations) Show(ctx context.Context, request *ShowApiIntegrationR
}

func (v *apiIntegrations) ShowByID(ctx context.Context, id AccountObjectIdentifier) (*ApiIntegration, error) {
apiIntegrations, err := v.Show(ctx, NewShowApiIntegrationRequest().WithLike(&Like{
Pattern: String(id.Name()),
}))
request := NewShowApiIntegrationRequest().
WithLike(Like{Pattern: String(id.Name())})
apiIntegrations, err := v.Show(ctx, request)
if err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/sdk/application_packages_dto_builders_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion pkg/sdk/application_packages_impl_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ func (v *applicationPackages) Show(ctx context.Context, request *ShowApplication
}

func (v *applicationPackages) ShowByID(ctx context.Context, id AccountObjectIdentifier) (*ApplicationPackage, error) {
request := NewShowApplicationPackageRequest().WithLike(&Like{String(id.Name())})
request := NewShowApplicationPackageRequest().
WithLike(Like{Pattern: String(id.Name())})
applicationPackages, err := v.Show(ctx, request)
if err != nil {
return nil, err
Expand Down
4 changes: 2 additions & 2 deletions pkg/sdk/applications_dto_builders_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion pkg/sdk/applications_impl_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ func (v *applications) Show(ctx context.Context, request *ShowApplicationRequest
}

func (v *applications) ShowByID(ctx context.Context, id AccountObjectIdentifier) (*Application, error) {
request := NewShowApplicationRequest().WithLike(&Like{String(id.Name())})
request := NewShowApplicationRequest().
WithLike(Like{Pattern: String(id.Name())})
applications, err := v.Show(ctx, request)
if err != nil {
return nil, err
Expand Down
9 changes: 4 additions & 5 deletions pkg/sdk/authentication_policies_impl_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,10 @@ func (v *authenticationPolicies) Show(ctx context.Context, request *ShowAuthenti
}

func (v *authenticationPolicies) ShowByID(ctx context.Context, id SchemaObjectIdentifier) (*AuthenticationPolicy, error) {
authenticationPolicies, err := v.Show(ctx, NewShowAuthenticationPolicyRequest().WithIn(In{
Schema: id.SchemaId(),
}).WithLike(Like{
Pattern: String(id.Name()),
}))
request := NewShowAuthenticationPolicyRequest().
WithLike(Like{Pattern: String(id.Name())}).
WithIn(In{Schema: id.SchemaId()})
authenticationPolicies, err := v.Show(ctx, request)
if err != nil {
return nil, err
}
Expand Down
8 changes: 4 additions & 4 deletions pkg/sdk/event_tables_dto_builders_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion pkg/sdk/event_tables_impl_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ func (v *eventTables) Show(ctx context.Context, request *ShowEventTableRequest)
}

func (v *eventTables) ShowByID(ctx context.Context, id SchemaObjectIdentifier) (*EventTable, error) {
request := NewShowEventTableRequest().WithIn(&In{Schema: id.SchemaId()}).WithLike(&Like{String(id.Name())})
request := NewShowEventTableRequest().
WithIn(In{Schema: id.SchemaId()}).
WithLike(Like{Pattern: String(id.Name())})
eventTables, err := v.Show(ctx, request)
if err != nil {
return nil, err
Expand Down
5 changes: 4 additions & 1 deletion pkg/sdk/external_functions_impl_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ func (v *externalFunctions) Show(ctx context.Context, request *ShowExternalFunct
}

func (v *externalFunctions) ShowByID(ctx context.Context, id SchemaObjectIdentifierWithArguments) (*ExternalFunction, error) {
externalFunctions, err := v.Show(ctx, NewShowExternalFunctionRequest().WithIn(In{Schema: id.SchemaId()}).WithLike(Like{String(id.Name())}))
request := NewShowExternalFunctionRequest().
WithIn(In{Schema: id.SchemaId()}).
WithLike(Like{Pattern: String(id.Name())})
externalFunctions, err := v.Show(ctx, request)
if err != nil {
return nil, err
}
Expand Down
5 changes: 4 additions & 1 deletion pkg/sdk/functions_impl_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ func (v *functions) Show(ctx context.Context, request *ShowFunctionRequest) ([]F
}

func (v *functions) ShowByID(ctx context.Context, id SchemaObjectIdentifierWithArguments) (*Function, error) {
functions, err := v.Show(ctx, NewShowFunctionRequest().WithIn(ExtendedIn{In: In{Schema: id.SchemaId()}}).WithLike(Like{String(id.Name())}))
request := NewShowFunctionRequest().
WithIn(ExtendedIn{In: In{Schema: id.SchemaId()}}).
WithLike(Like{Pattern: String(id.Name())})
functions, err := v.Show(ctx, request)
if err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/sdk/managed_accounts_dto_builders_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion pkg/sdk/managed_accounts_impl_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ func (v *managedAccounts) Show(ctx context.Context, request *ShowManagedAccountR
}

func (v *managedAccounts) ShowByID(ctx context.Context, id AccountObjectIdentifier) (*ManagedAccount, error) {
managedAccounts, err := v.Show(ctx, NewShowManagedAccountRequest().WithLike(&Like{String(id.Name())}))
request := NewShowManagedAccountRequest().
WithLike(Like{Pattern: String(id.Name())})
managedAccounts, err := v.Show(ctx, request)
if err != nil {
return nil, err
}
Expand Down
8 changes: 4 additions & 4 deletions pkg/sdk/materialized_views_dto_builders_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion pkg/sdk/materialized_views_impl_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ func (v *materializedViews) Show(ctx context.Context, request *ShowMaterializedV
}

func (v *materializedViews) ShowByID(ctx context.Context, id SchemaObjectIdentifier) (*MaterializedView, error) {
request := NewShowMaterializedViewRequest().WithIn(&In{Schema: id.SchemaId()}).WithLike(&Like{String(id.Name())})
request := NewShowMaterializedViewRequest().
WithIn(In{Schema: id.SchemaId()}).
WithLike(Like{Pattern: String(id.Name())})
materializedViews, err := v.Show(ctx, request)
if err != nil {
return nil, err
Expand Down
4 changes: 3 additions & 1 deletion pkg/sdk/network_policies_impl_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ func (v *networkPolicies) Show(ctx context.Context, request *ShowNetworkPolicyRe
}

func (v *networkPolicies) ShowByID(ctx context.Context, id AccountObjectIdentifier) (*NetworkPolicy, error) {
networkPolicies, err := v.Show(ctx, NewShowNetworkPolicyRequest().WithLike(Like{Pattern: String(id.Name())}))
request := NewShowNetworkPolicyRequest().
WithLike(Like{Pattern: String(id.Name())})
networkPolicies, err := v.Show(ctx, request)
if err != nil {
return nil, err
}
Expand Down
8 changes: 4 additions & 4 deletions pkg/sdk/network_rule_dto_builders_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 4 additions & 5 deletions pkg/sdk/network_rule_impl_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,10 @@ func (v *networkRules) Show(ctx context.Context, request *ShowNetworkRuleRequest
}

func (v *networkRules) ShowByID(ctx context.Context, id SchemaObjectIdentifier) (*NetworkRule, error) {
networkRules, err := v.Show(ctx, NewShowNetworkRuleRequest().WithIn(&In{
Schema: id.SchemaId(),
}).WithLike(&Like{
Pattern: String(id.Name()),
}))
request := NewShowNetworkRuleRequest().
WithIn(In{Schema: id.SchemaId()}).
WithLike(Like{Pattern: String(id.Name())})
networkRules, err := v.Show(ctx, request)
if err != nil {
return nil, err
}
Expand Down
6 changes: 2 additions & 4 deletions pkg/sdk/notification_integrations_dto_builders_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions pkg/sdk/notification_integrations_impl_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ func (v *notificationIntegrations) Show(ctx context.Context, request *ShowNotifi
}

func (v *notificationIntegrations) ShowByID(ctx context.Context, id AccountObjectIdentifier) (*NotificationIntegration, error) {
notificationIntegrations, err := v.Show(ctx, NewShowNotificationIntegrationRequest().WithLike(&Like{
Pattern: String(id.Name()),
}))
request := NewShowNotificationIntegrationRequest().
WithLike(Like{Pattern: String(id.Name())})
notificationIntegrations, err := v.Show(ctx, request)
if err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/sdk/poc/generator/operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ func (i *Interface) ShowOperation(doc string, dbRepresentation *dbStruct, resour
return i
}

// ShowByIdOperationNoFiltering adds a ShowByID operation to the interface without any filtering. Should be used for objects that do not implement any filtering options.
func (i *Interface) ShowByIdOperationNoFiltering() *Interface {
// ShowByIdOperationWithNoFiltering adds a ShowByID operation to the interface without any filtering. Should be used for objects that do not implement any filtering options.
func (i *Interface) ShowByIdOperationWithNoFiltering() *Interface {
op := newNoSqlOperation(string(OperationKindShowByID))
i.Operations = append(i.Operations, op)
return i
Expand Down
5 changes: 0 additions & 5 deletions pkg/sdk/poc/generator/template_executors.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,6 @@ func GenerateValidations(writer io.Writer, def *Interface) {
printTo(writer, ValidationsTemplate, def)
}

func GenerateIntegrationTests(writer io.Writer, def *Interface) {
generatePackageDirective(writer)
printTo(writer, IntegrationTestsTemplate, def)
}

func generatePackageDirective(writer io.Writer) {
printTo(writer, PackageTemplate, os.Getenv("GOPACKAGE"))
}
Expand Down
1 change: 0 additions & 1 deletion pkg/sdk/poc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ func runAllTemplatesToStdOut(definition *generator.Interface) {
generator.GenerateImplementation(writer, definition)
generator.GenerateUnitTests(writer, definition)
generator.GenerateValidations(writer, definition)
generator.GenerateIntegrationTests(writer, definition)
}

func runAllTemplatesAndSave(definition *generator.Interface, file string) {
Expand Down
5 changes: 4 additions & 1 deletion pkg/sdk/procedures_impl_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ func (v *procedures) Show(ctx context.Context, request *ShowProcedureRequest) ([
}

func (v *procedures) ShowByID(ctx context.Context, id SchemaObjectIdentifierWithArguments) (*Procedure, error) {
procedures, err := v.Show(ctx, NewShowProcedureRequest().WithIn(In{Schema: id.SchemaId()}).WithLike(Like{String(id.Name())}))
request := NewShowProcedureRequest().
WithIn(In{Schema: id.SchemaId()}).
WithLike(Like{Pattern: String(id.Name())})
procedures, err := v.Show(ctx, request)
if err != nil {
return nil, err
}
Expand Down
8 changes: 4 additions & 4 deletions pkg/sdk/row_access_policies_dto_builders_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion pkg/sdk/row_access_policies_impl_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ func (v *rowAccessPolicies) Show(ctx context.Context, request *ShowRowAccessPoli
}

func (v *rowAccessPolicies) ShowByID(ctx context.Context, id SchemaObjectIdentifier) (*RowAccessPolicy, error) {
request := NewShowRowAccessPolicyRequest().WithIn(&ExtendedIn{In: In{Schema: id.SchemaId()}}).WithLike(&Like{String(id.Name())})
request := NewShowRowAccessPolicyRequest().
WithIn(ExtendedIn{In: In{Schema: id.SchemaId()}}).
WithLike(Like{Pattern: String(id.Name())})
rowAccessPolicies, err := v.Show(ctx, request)
if err != nil {
return nil, err
Expand Down
6 changes: 3 additions & 3 deletions pkg/sdk/security_integrations_impl_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ func (v *securityIntegrations) Show(ctx context.Context, request *ShowSecurityIn
}

func (v *securityIntegrations) ShowByID(ctx context.Context, id AccountObjectIdentifier) (*SecurityIntegration, error) {
securityIntegrations, err := v.Show(ctx, NewShowSecurityIntegrationRequest().WithLike(Like{
Pattern: String(id.Name()),
}))
request := NewShowSecurityIntegrationRequest().
WithLike(Like{Pattern: String(id.Name())})
securityIntegrations, err := v.Show(ctx, request)
if err != nil {
return nil, err
}
Expand Down
10 changes: 4 additions & 6 deletions pkg/sdk/sequences_dto_builders_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion pkg/sdk/sequences_impl_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ func (v *sequences) Show(ctx context.Context, request *ShowSequenceRequest) ([]S
}

func (v *sequences) ShowByID(ctx context.Context, id SchemaObjectIdentifier) (*Sequence, error) {
request := NewShowSequenceRequest().WithIn(&In{Schema: id.SchemaId()}).WithLike(&Like{String(id.Name())})
request := NewShowSequenceRequest().
WithIn(In{Schema: id.SchemaId()}).
WithLike(Like{Pattern: String(id.Name())})
sequences, err := v.Show(ctx, request)
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion pkg/sdk/session_policies_def.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ var SessionPoliciesDef = g.NewInterface(
Show().
SQL("SESSION POLICIES"),
).
ShowByIdOperationNoFiltering().
ShowByIdOperationWithNoFiltering().
DescribeOperation(
g.DescriptionMappingKindSingleValue,
"https://docs.snowflake.com/en/sql-reference/sql/desc-session-policy",
Expand Down
Loading

0 comments on commit 235da09

Please sign in to comment.