From 3337ded7202a2b4a4938e24014633431d1942160 Mon Sep 17 00:00:00 2001 From: Lukasz Zajaczkowski Date: Mon, 19 Aug 2024 10:00:21 +0200 Subject: [PATCH] migrate commnad --- cmd/command/plural/plural.go | 2 +- cmd/command/pr/pr.go | 82 +++++++- go.mod | 2 +- go.sum | 4 +- pkg/console/console.go | 1 + pkg/console/pr.go | 15 ++ pkg/test/mocks/Client.go | 2 +- pkg/test/mocks/ConsoleClient.go | 339 +++++++++++++++++--------------- pkg/test/mocks/Kube.go | 2 +- 9 files changed, 286 insertions(+), 163 deletions(-) create mode 100644 pkg/console/pr.go diff --git a/cmd/command/plural/plural.go b/cmd/command/plural/plural.go index 32bf9479..5ef5f1c0 100644 --- a/cmd/command/plural/plural.go +++ b/cmd/command/plural/plural.go @@ -253,7 +253,7 @@ func CreateNewApp(plural *Plural) *cli.App { output.Command(), ops.Command(plural.Plural), profile.Command(), - pr.Command(), + pr.Command(plural.Plural), proxy.Command(plural.Plural), push.Command(plural.Plural), repo.Command(plural.Plural), diff --git a/cmd/command/pr/pr.go b/cmd/command/pr/pr.go index 98dc2ee2..23244348 100644 --- a/cmd/command/pr/pr.go +++ b/cmd/command/pr/pr.go @@ -1,21 +1,57 @@ package pr import ( + "io" + "os" + + "github.com/pluralsh/plural-cli/pkg/client" + "github.com/pluralsh/plural-cli/pkg/common" "github.com/pluralsh/plural-cli/pkg/pr" + "github.com/pluralsh/plural-cli/pkg/utils" + "github.com/samber/lo" "github.com/urfave/cli" ) -func Command() cli.Command { +func init() { + consoleToken = "" + consoleURL = "" +} + +var consoleToken string +var consoleURL string + +type Plural struct { + client.Plural +} + +func Command(clients client.Plural) cli.Command { + p := Plural{ + Plural: clients, + } return cli.Command{ Name: "pull-requests", Aliases: []string{"pr"}, Usage: "Generate and manage pull requests", - Subcommands: prCommands(), + Subcommands: p.prCommands(), Category: "CD", + Flags: []cli.Flag{ + cli.StringFlag{ + Name: "token", + Usage: "console token", + EnvVar: "PLURAL_CONSOLE_TOKEN", + Destination: &consoleToken, + }, + cli.StringFlag{ + Name: "url", + Usage: "console url address", + EnvVar: "PLURAL_CONSOLE_URL", + Destination: &consoleURL, + }, + }, } } -func prCommands() []cli.Command { +func (p *Plural) prCommands() []cli.Command { return []cli.Command{ { Name: "template", @@ -34,6 +70,16 @@ func prCommands() []cli.Command { }, }, }, + { + Name: "create", + Action: common.LatestVersion(common.RequireArgs(p.handleCreatePrAutomation, []string{"ID"})), + Usage: "create PR automation", + ArgsUsage: "ID", + Flags: []cli.Flag{ + cli.StringFlag{Name: "context", Usage: "JSON blob string"}, + cli.StringFlag{Name: "branch", Usage: "branch name"}, + }, + }, } } @@ -49,3 +95,33 @@ func handlePrTemplate(c *cli.Context) error { return pr.Apply(template) } + +func (p *Plural) handleCreatePrAutomation(c *cli.Context) error { + if err := p.InitConsoleClient(consoleToken, consoleURL); err != nil { + return err + } + var branch, context *string + + id := c.Args().Get(0) + if c := c.String("context"); c != "" { + if c == "-" { + bytes, err := io.ReadAll(os.Stdin) + if err != nil { + return err + } + context = lo.ToPtr(string(bytes)) + } + } + + if b := c.String("branch"); b != "" { + branch = &b + } + + pr, err := p.ConsoleClient.CreatePullRequest(id, branch, context) + if err != nil { + return err + } + + utils.Success("PR %s created successfully\n", pr.ID) + return nil +} diff --git a/go.mod b/go.mod index ebb1ad40..1581ad8d 100644 --- a/go.mod +++ b/go.mod @@ -56,7 +56,7 @@ require ( github.com/packethost/packngo v0.29.0 github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 github.com/pluralsh/cluster-api-migration v0.2.16 - github.com/pluralsh/console/go/client v1.4.0 + github.com/pluralsh/console/go/client v1.5.0 github.com/pluralsh/gqlclient v1.12.1 github.com/pluralsh/plural-operator v0.5.5 github.com/pluralsh/polly v0.1.8 diff --git a/go.sum b/go.sum index 6df5f01c..09a73883 100644 --- a/go.sum +++ b/go.sum @@ -1884,8 +1884,8 @@ github.com/pkg/sftp v1.13.6 h1:JFZT4XbOU7l77xGSpOdW+pwIMqP044IyjXX6FGyEKFo= github.com/pkg/sftp v1.13.6/go.mod h1:tz1ryNURKu77RL+GuCzmoJYxQczL3wLNNpPWagdg4Qk= github.com/pluralsh/cluster-api-migration v0.2.16 h1:MQGrLQAhGSSpyjEDamhnJZaQ8MkxlHzR8PZxIVavLIM= github.com/pluralsh/cluster-api-migration v0.2.16/go.mod h1:24PjMsYv3vSlUiYw7BeUQ0GAtK0Jk2B1iwh35WGQLx8= -github.com/pluralsh/console/go/client v1.4.0 h1:Mr/gyU20jrLZZ9diEznv3aU/CJ5wk13qLes/4O9unwM= -github.com/pluralsh/console/go/client v1.4.0/go.mod h1:lpoWASYsM9keNePS3dpFiEisUHEfObIVlSL3tzpKn8k= +github.com/pluralsh/console/go/client v1.5.0 h1:O5pHJUXqBJWUt66MiCRlyatarNFQGy1Fy6QaC5P0avY= +github.com/pluralsh/console/go/client v1.5.0/go.mod h1:lpoWASYsM9keNePS3dpFiEisUHEfObIVlSL3tzpKn8k= github.com/pluralsh/controller-reconcile-helper v0.0.4 h1:1o+7qYSyoeqKFjx+WgQTxDz4Q2VMpzprJIIKShxqG0E= github.com/pluralsh/controller-reconcile-helper v0.0.4/go.mod h1:AfY0gtteD6veBjmB6jiRx/aR4yevEf6K0M13/pGan/s= github.com/pluralsh/gqlclient v1.12.1 h1:JDOkP9jjqkPdTYdpH5hooG4F8T6FDH90XfipeXJmJFY= diff --git a/pkg/console/console.go b/pkg/console/console.go index 0ba04325..af397da3 100644 --- a/pkg/console/console.go +++ b/pkg/console/console.go @@ -54,6 +54,7 @@ type ConsoleClient interface { UpdateDeploymentSettings(attr consoleclient.DeploymentSettingsAttributes) (*consoleclient.UpdateDeploymentSettings, error) GetGlobalSettings() (*consoleclient.DeploymentSettingsFragment, error) ListStackRuns(stackID string) (*consoleclient.ListStackRuns, error) + CreatePullRequest(id string, branch, context *string) (*consoleclient.PullRequestFragment, error) } type authedTransport struct { diff --git a/pkg/console/pr.go b/pkg/console/pr.go new file mode 100644 index 00000000..4015114d --- /dev/null +++ b/pkg/console/pr.go @@ -0,0 +1,15 @@ +package console + +import ( + consoleclient "github.com/pluralsh/console/go/client" + "github.com/pluralsh/plural-cli/pkg/api" +) + +func (c *consoleClient) CreatePullRequest(id string, branch, context *string) (*consoleclient.PullRequestFragment, error) { + result, err := c.client.CreatePullRequest(c.ctx, id, nil, branch, context) + if err != nil { + return nil, api.GetErrorResponse(err, "CreatePullRequest") + } + + return result.CreatePullRequest, nil +} diff --git a/pkg/test/mocks/Client.go b/pkg/test/mocks/Client.go index 0f0a355a..841d0bcd 100644 --- a/pkg/test/mocks/Client.go +++ b/pkg/test/mocks/Client.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.43.2. DO NOT EDIT. +// Code generated by mockery v2.44.2. DO NOT EDIT. package mocks diff --git a/pkg/test/mocks/ConsoleClient.go b/pkg/test/mocks/ConsoleClient.go index 00657aba..d32d0a80 100644 --- a/pkg/test/mocks/ConsoleClient.go +++ b/pkg/test/mocks/ConsoleClient.go @@ -1,9 +1,10 @@ -// Code generated by mockery v2.43.2. DO NOT EDIT. +// Code generated by mockery v2.44.2. DO NOT EDIT. package mocks import ( - gqlclient "github.com/pluralsh/console/go/client" + client "github.com/pluralsh/console/go/client" + mock "github.com/stretchr/testify/mock" ) @@ -41,27 +42,27 @@ func (_m *ConsoleClient) AgentUrl(id string) (string, error) { } // CloneService provides a mock function with given fields: clusterId, serviceId, serviceName, clusterName, attributes -func (_m *ConsoleClient) CloneService(clusterId string, serviceId *string, serviceName *string, clusterName *string, attributes gqlclient.ServiceCloneAttributes) (*gqlclient.ServiceDeploymentFragment, error) { +func (_m *ConsoleClient) CloneService(clusterId string, serviceId *string, serviceName *string, clusterName *string, attributes client.ServiceCloneAttributes) (*client.ServiceDeploymentFragment, error) { ret := _m.Called(clusterId, serviceId, serviceName, clusterName, attributes) if len(ret) == 0 { panic("no return value specified for CloneService") } - var r0 *gqlclient.ServiceDeploymentFragment + var r0 *client.ServiceDeploymentFragment var r1 error - if rf, ok := ret.Get(0).(func(string, *string, *string, *string, gqlclient.ServiceCloneAttributes) (*gqlclient.ServiceDeploymentFragment, error)); ok { + if rf, ok := ret.Get(0).(func(string, *string, *string, *string, client.ServiceCloneAttributes) (*client.ServiceDeploymentFragment, error)); ok { return rf(clusterId, serviceId, serviceName, clusterName, attributes) } - if rf, ok := ret.Get(0).(func(string, *string, *string, *string, gqlclient.ServiceCloneAttributes) *gqlclient.ServiceDeploymentFragment); ok { + if rf, ok := ret.Get(0).(func(string, *string, *string, *string, client.ServiceCloneAttributes) *client.ServiceDeploymentFragment); ok { r0 = rf(clusterId, serviceId, serviceName, clusterName, attributes) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*gqlclient.ServiceDeploymentFragment) + r0 = ret.Get(0).(*client.ServiceDeploymentFragment) } } - if rf, ok := ret.Get(1).(func(string, *string, *string, *string, gqlclient.ServiceCloneAttributes) error); ok { + if rf, ok := ret.Get(1).(func(string, *string, *string, *string, client.ServiceCloneAttributes) error); ok { r1 = rf(clusterId, serviceId, serviceName, clusterName, attributes) } else { r1 = ret.Error(1) @@ -71,27 +72,27 @@ func (_m *ConsoleClient) CloneService(clusterId string, serviceId *string, servi } // CreateCluster provides a mock function with given fields: attributes -func (_m *ConsoleClient) CreateCluster(attributes gqlclient.ClusterAttributes) (*gqlclient.CreateCluster, error) { +func (_m *ConsoleClient) CreateCluster(attributes client.ClusterAttributes) (*client.CreateCluster, error) { ret := _m.Called(attributes) if len(ret) == 0 { panic("no return value specified for CreateCluster") } - var r0 *gqlclient.CreateCluster + var r0 *client.CreateCluster var r1 error - if rf, ok := ret.Get(0).(func(gqlclient.ClusterAttributes) (*gqlclient.CreateCluster, error)); ok { + if rf, ok := ret.Get(0).(func(client.ClusterAttributes) (*client.CreateCluster, error)); ok { return rf(attributes) } - if rf, ok := ret.Get(0).(func(gqlclient.ClusterAttributes) *gqlclient.CreateCluster); ok { + if rf, ok := ret.Get(0).(func(client.ClusterAttributes) *client.CreateCluster); ok { r0 = rf(attributes) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*gqlclient.CreateCluster) + r0 = ret.Get(0).(*client.CreateCluster) } } - if rf, ok := ret.Get(1).(func(gqlclient.ClusterAttributes) error); ok { + if rf, ok := ret.Get(1).(func(client.ClusterAttributes) error); ok { r1 = rf(attributes) } else { r1 = ret.Error(1) @@ -101,27 +102,27 @@ func (_m *ConsoleClient) CreateCluster(attributes gqlclient.ClusterAttributes) ( } // CreateClusterService provides a mock function with given fields: clusterId, clusterName, attr -func (_m *ConsoleClient) CreateClusterService(clusterId *string, clusterName *string, attr gqlclient.ServiceDeploymentAttributes) (*gqlclient.ServiceDeploymentExtended, error) { +func (_m *ConsoleClient) CreateClusterService(clusterId *string, clusterName *string, attr client.ServiceDeploymentAttributes) (*client.ServiceDeploymentExtended, error) { ret := _m.Called(clusterId, clusterName, attr) if len(ret) == 0 { panic("no return value specified for CreateClusterService") } - var r0 *gqlclient.ServiceDeploymentExtended + var r0 *client.ServiceDeploymentExtended var r1 error - if rf, ok := ret.Get(0).(func(*string, *string, gqlclient.ServiceDeploymentAttributes) (*gqlclient.ServiceDeploymentExtended, error)); ok { + if rf, ok := ret.Get(0).(func(*string, *string, client.ServiceDeploymentAttributes) (*client.ServiceDeploymentExtended, error)); ok { return rf(clusterId, clusterName, attr) } - if rf, ok := ret.Get(0).(func(*string, *string, gqlclient.ServiceDeploymentAttributes) *gqlclient.ServiceDeploymentExtended); ok { + if rf, ok := ret.Get(0).(func(*string, *string, client.ServiceDeploymentAttributes) *client.ServiceDeploymentExtended); ok { r0 = rf(clusterId, clusterName, attr) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*gqlclient.ServiceDeploymentExtended) + r0 = ret.Get(0).(*client.ServiceDeploymentExtended) } } - if rf, ok := ret.Get(1).(func(*string, *string, gqlclient.ServiceDeploymentAttributes) error); ok { + if rf, ok := ret.Get(1).(func(*string, *string, client.ServiceDeploymentAttributes) error); ok { r1 = rf(clusterId, clusterName, attr) } else { r1 = ret.Error(1) @@ -131,27 +132,27 @@ func (_m *ConsoleClient) CreateClusterService(clusterId *string, clusterName *st } // CreateNotificationSinks provides a mock function with given fields: attr -func (_m *ConsoleClient) CreateNotificationSinks(attr gqlclient.NotificationSinkAttributes) (*gqlclient.NotificationSinkFragment, error) { +func (_m *ConsoleClient) CreateNotificationSinks(attr client.NotificationSinkAttributes) (*client.NotificationSinkFragment, error) { ret := _m.Called(attr) if len(ret) == 0 { panic("no return value specified for CreateNotificationSinks") } - var r0 *gqlclient.NotificationSinkFragment + var r0 *client.NotificationSinkFragment var r1 error - if rf, ok := ret.Get(0).(func(gqlclient.NotificationSinkAttributes) (*gqlclient.NotificationSinkFragment, error)); ok { + if rf, ok := ret.Get(0).(func(client.NotificationSinkAttributes) (*client.NotificationSinkFragment, error)); ok { return rf(attr) } - if rf, ok := ret.Get(0).(func(gqlclient.NotificationSinkAttributes) *gqlclient.NotificationSinkFragment); ok { + if rf, ok := ret.Get(0).(func(client.NotificationSinkAttributes) *client.NotificationSinkFragment); ok { r0 = rf(attr) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*gqlclient.NotificationSinkFragment) + r0 = ret.Get(0).(*client.NotificationSinkFragment) } } - if rf, ok := ret.Get(1).(func(gqlclient.NotificationSinkAttributes) error); ok { + if rf, ok := ret.Get(1).(func(client.NotificationSinkAttributes) error); ok { r1 = rf(attr) } else { r1 = ret.Error(1) @@ -161,27 +162,27 @@ func (_m *ConsoleClient) CreateNotificationSinks(attr gqlclient.NotificationSink } // CreateProvider provides a mock function with given fields: attr -func (_m *ConsoleClient) CreateProvider(attr gqlclient.ClusterProviderAttributes) (*gqlclient.CreateClusterProvider, error) { +func (_m *ConsoleClient) CreateProvider(attr client.ClusterProviderAttributes) (*client.CreateClusterProvider, error) { ret := _m.Called(attr) if len(ret) == 0 { panic("no return value specified for CreateProvider") } - var r0 *gqlclient.CreateClusterProvider + var r0 *client.CreateClusterProvider var r1 error - if rf, ok := ret.Get(0).(func(gqlclient.ClusterProviderAttributes) (*gqlclient.CreateClusterProvider, error)); ok { + if rf, ok := ret.Get(0).(func(client.ClusterProviderAttributes) (*client.CreateClusterProvider, error)); ok { return rf(attr) } - if rf, ok := ret.Get(0).(func(gqlclient.ClusterProviderAttributes) *gqlclient.CreateClusterProvider); ok { + if rf, ok := ret.Get(0).(func(client.ClusterProviderAttributes) *client.CreateClusterProvider); ok { r0 = rf(attr) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*gqlclient.CreateClusterProvider) + r0 = ret.Get(0).(*client.CreateClusterProvider) } } - if rf, ok := ret.Get(1).(func(gqlclient.ClusterProviderAttributes) error); ok { + if rf, ok := ret.Get(1).(func(client.ClusterProviderAttributes) error); ok { r1 = rf(attr) } else { r1 = ret.Error(1) @@ -191,27 +192,27 @@ func (_m *ConsoleClient) CreateProvider(attr gqlclient.ClusterProviderAttributes } // CreateProviderCredentials provides a mock function with given fields: name, attr -func (_m *ConsoleClient) CreateProviderCredentials(name string, attr gqlclient.ProviderCredentialAttributes) (*gqlclient.CreateProviderCredential, error) { +func (_m *ConsoleClient) CreateProviderCredentials(name string, attr client.ProviderCredentialAttributes) (*client.CreateProviderCredential, error) { ret := _m.Called(name, attr) if len(ret) == 0 { panic("no return value specified for CreateProviderCredentials") } - var r0 *gqlclient.CreateProviderCredential + var r0 *client.CreateProviderCredential var r1 error - if rf, ok := ret.Get(0).(func(string, gqlclient.ProviderCredentialAttributes) (*gqlclient.CreateProviderCredential, error)); ok { + if rf, ok := ret.Get(0).(func(string, client.ProviderCredentialAttributes) (*client.CreateProviderCredential, error)); ok { return rf(name, attr) } - if rf, ok := ret.Get(0).(func(string, gqlclient.ProviderCredentialAttributes) *gqlclient.CreateProviderCredential); ok { + if rf, ok := ret.Get(0).(func(string, client.ProviderCredentialAttributes) *client.CreateProviderCredential); ok { r0 = rf(name, attr) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*gqlclient.CreateProviderCredential) + r0 = ret.Get(0).(*client.CreateProviderCredential) } } - if rf, ok := ret.Get(1).(func(string, gqlclient.ProviderCredentialAttributes) error); ok { + if rf, ok := ret.Get(1).(func(string, client.ProviderCredentialAttributes) error); ok { r1 = rf(name, attr) } else { r1 = ret.Error(1) @@ -220,24 +221,54 @@ func (_m *ConsoleClient) CreateProviderCredentials(name string, attr gqlclient.P return r0, r1 } +// CreatePullRequest provides a mock function with given fields: id, branch, context +func (_m *ConsoleClient) CreatePullRequest(id string, branch *string, context *string) (*client.PullRequestFragment, error) { + ret := _m.Called(id, branch, context) + + if len(ret) == 0 { + panic("no return value specified for CreatePullRequest") + } + + var r0 *client.PullRequestFragment + var r1 error + if rf, ok := ret.Get(0).(func(string, *string, *string) (*client.PullRequestFragment, error)); ok { + return rf(id, branch, context) + } + if rf, ok := ret.Get(0).(func(string, *string, *string) *client.PullRequestFragment); ok { + r0 = rf(id, branch, context) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*client.PullRequestFragment) + } + } + + if rf, ok := ret.Get(1).(func(string, *string, *string) error); ok { + r1 = rf(id, branch, context) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + // CreateRepository provides a mock function with given fields: url, privateKey, passphrase, username, password -func (_m *ConsoleClient) CreateRepository(url string, privateKey *string, passphrase *string, username *string, password *string) (*gqlclient.CreateGitRepository, error) { +func (_m *ConsoleClient) CreateRepository(url string, privateKey *string, passphrase *string, username *string, password *string) (*client.CreateGitRepository, error) { ret := _m.Called(url, privateKey, passphrase, username, password) if len(ret) == 0 { panic("no return value specified for CreateRepository") } - var r0 *gqlclient.CreateGitRepository + var r0 *client.CreateGitRepository var r1 error - if rf, ok := ret.Get(0).(func(string, *string, *string, *string, *string) (*gqlclient.CreateGitRepository, error)); ok { + if rf, ok := ret.Get(0).(func(string, *string, *string, *string, *string) (*client.CreateGitRepository, error)); ok { return rf(url, privateKey, passphrase, username, password) } - if rf, ok := ret.Get(0).(func(string, *string, *string, *string, *string) *gqlclient.CreateGitRepository); ok { + if rf, ok := ret.Get(0).(func(string, *string, *string, *string, *string) *client.CreateGitRepository); ok { r0 = rf(url, privateKey, passphrase, username, password) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*gqlclient.CreateGitRepository) + r0 = ret.Get(0).(*client.CreateGitRepository) } } @@ -269,23 +300,23 @@ func (_m *ConsoleClient) DeleteCluster(id string) error { } // DeleteClusterService provides a mock function with given fields: serviceId -func (_m *ConsoleClient) DeleteClusterService(serviceId string) (*gqlclient.DeleteServiceDeployment, error) { +func (_m *ConsoleClient) DeleteClusterService(serviceId string) (*client.DeleteServiceDeployment, error) { ret := _m.Called(serviceId) if len(ret) == 0 { panic("no return value specified for DeleteClusterService") } - var r0 *gqlclient.DeleteServiceDeployment + var r0 *client.DeleteServiceDeployment var r1 error - if rf, ok := ret.Get(0).(func(string) (*gqlclient.DeleteServiceDeployment, error)); ok { + if rf, ok := ret.Get(0).(func(string) (*client.DeleteServiceDeployment, error)); ok { return rf(serviceId) } - if rf, ok := ret.Get(0).(func(string) *gqlclient.DeleteServiceDeployment); ok { + if rf, ok := ret.Get(0).(func(string) *client.DeleteServiceDeployment); ok { r0 = rf(serviceId) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*gqlclient.DeleteServiceDeployment) + r0 = ret.Get(0).(*client.DeleteServiceDeployment) } } @@ -299,23 +330,23 @@ func (_m *ConsoleClient) DeleteClusterService(serviceId string) (*gqlclient.Dele } // DeleteProviderCredentials provides a mock function with given fields: id -func (_m *ConsoleClient) DeleteProviderCredentials(id string) (*gqlclient.DeleteProviderCredential, error) { +func (_m *ConsoleClient) DeleteProviderCredentials(id string) (*client.DeleteProviderCredential, error) { ret := _m.Called(id) if len(ret) == 0 { panic("no return value specified for DeleteProviderCredentials") } - var r0 *gqlclient.DeleteProviderCredential + var r0 *client.DeleteProviderCredential var r1 error - if rf, ok := ret.Get(0).(func(string) (*gqlclient.DeleteProviderCredential, error)); ok { + if rf, ok := ret.Get(0).(func(string) (*client.DeleteProviderCredential, error)); ok { return rf(id) } - if rf, ok := ret.Get(0).(func(string) *gqlclient.DeleteProviderCredential); ok { + if rf, ok := ret.Get(0).(func(string) *client.DeleteProviderCredential); ok { r0 = rf(id) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*gqlclient.DeleteProviderCredential) + r0 = ret.Get(0).(*client.DeleteProviderCredential) } } @@ -365,23 +396,23 @@ func (_m *ConsoleClient) ExtUrl() string { } // GetCluster provides a mock function with given fields: clusterId, clusterName -func (_m *ConsoleClient) GetCluster(clusterId *string, clusterName *string) (*gqlclient.ClusterFragment, error) { +func (_m *ConsoleClient) GetCluster(clusterId *string, clusterName *string) (*client.ClusterFragment, error) { ret := _m.Called(clusterId, clusterName) if len(ret) == 0 { panic("no return value specified for GetCluster") } - var r0 *gqlclient.ClusterFragment + var r0 *client.ClusterFragment var r1 error - if rf, ok := ret.Get(0).(func(*string, *string) (*gqlclient.ClusterFragment, error)); ok { + if rf, ok := ret.Get(0).(func(*string, *string) (*client.ClusterFragment, error)); ok { return rf(clusterId, clusterName) } - if rf, ok := ret.Get(0).(func(*string, *string) *gqlclient.ClusterFragment); ok { + if rf, ok := ret.Get(0).(func(*string, *string) *client.ClusterFragment); ok { r0 = rf(clusterId, clusterName) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*gqlclient.ClusterFragment) + r0 = ret.Get(0).(*client.ClusterFragment) } } @@ -395,23 +426,23 @@ func (_m *ConsoleClient) GetCluster(clusterId *string, clusterName *string) (*gq } // GetClusterService provides a mock function with given fields: serviceId, serviceName, clusterName -func (_m *ConsoleClient) GetClusterService(serviceId *string, serviceName *string, clusterName *string) (*gqlclient.ServiceDeploymentExtended, error) { +func (_m *ConsoleClient) GetClusterService(serviceId *string, serviceName *string, clusterName *string) (*client.ServiceDeploymentExtended, error) { ret := _m.Called(serviceId, serviceName, clusterName) if len(ret) == 0 { panic("no return value specified for GetClusterService") } - var r0 *gqlclient.ServiceDeploymentExtended + var r0 *client.ServiceDeploymentExtended var r1 error - if rf, ok := ret.Get(0).(func(*string, *string, *string) (*gqlclient.ServiceDeploymentExtended, error)); ok { + if rf, ok := ret.Get(0).(func(*string, *string, *string) (*client.ServiceDeploymentExtended, error)); ok { return rf(serviceId, serviceName, clusterName) } - if rf, ok := ret.Get(0).(func(*string, *string, *string) *gqlclient.ServiceDeploymentExtended); ok { + if rf, ok := ret.Get(0).(func(*string, *string, *string) *client.ServiceDeploymentExtended); ok { r0 = rf(serviceId, serviceName, clusterName) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*gqlclient.ServiceDeploymentExtended) + r0 = ret.Get(0).(*client.ServiceDeploymentExtended) } } @@ -453,23 +484,23 @@ func (_m *ConsoleClient) GetDeployToken(clusterId *string, clusterName *string) } // GetGlobalSettings provides a mock function with given fields: -func (_m *ConsoleClient) GetGlobalSettings() (*gqlclient.DeploymentSettingsFragment, error) { +func (_m *ConsoleClient) GetGlobalSettings() (*client.DeploymentSettingsFragment, error) { ret := _m.Called() if len(ret) == 0 { panic("no return value specified for GetGlobalSettings") } - var r0 *gqlclient.DeploymentSettingsFragment + var r0 *client.DeploymentSettingsFragment var r1 error - if rf, ok := ret.Get(0).(func() (*gqlclient.DeploymentSettingsFragment, error)); ok { + if rf, ok := ret.Get(0).(func() (*client.DeploymentSettingsFragment, error)); ok { return rf() } - if rf, ok := ret.Get(0).(func() *gqlclient.DeploymentSettingsFragment); ok { + if rf, ok := ret.Get(0).(func() *client.DeploymentSettingsFragment); ok { r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*gqlclient.DeploymentSettingsFragment) + r0 = ret.Get(0).(*client.DeploymentSettingsFragment) } } @@ -483,23 +514,23 @@ func (_m *ConsoleClient) GetGlobalSettings() (*gqlclient.DeploymentSettingsFragm } // GetProject provides a mock function with given fields: name -func (_m *ConsoleClient) GetProject(name string) (*gqlclient.ProjectFragment, error) { +func (_m *ConsoleClient) GetProject(name string) (*client.ProjectFragment, error) { ret := _m.Called(name) if len(ret) == 0 { panic("no return value specified for GetProject") } - var r0 *gqlclient.ProjectFragment + var r0 *client.ProjectFragment var r1 error - if rf, ok := ret.Get(0).(func(string) (*gqlclient.ProjectFragment, error)); ok { + if rf, ok := ret.Get(0).(func(string) (*client.ProjectFragment, error)); ok { return rf(name) } - if rf, ok := ret.Get(0).(func(string) *gqlclient.ProjectFragment); ok { + if rf, ok := ret.Get(0).(func(string) *client.ProjectFragment); ok { r0 = rf(name) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*gqlclient.ProjectFragment) + r0 = ret.Get(0).(*client.ProjectFragment) } } @@ -513,23 +544,23 @@ func (_m *ConsoleClient) GetProject(name string) (*gqlclient.ProjectFragment, er } // GetServiceContext provides a mock function with given fields: name -func (_m *ConsoleClient) GetServiceContext(name string) (*gqlclient.ServiceContextFragment, error) { +func (_m *ConsoleClient) GetServiceContext(name string) (*client.ServiceContextFragment, error) { ret := _m.Called(name) if len(ret) == 0 { panic("no return value specified for GetServiceContext") } - var r0 *gqlclient.ServiceContextFragment + var r0 *client.ServiceContextFragment var r1 error - if rf, ok := ret.Get(0).(func(string) (*gqlclient.ServiceContextFragment, error)); ok { + if rf, ok := ret.Get(0).(func(string) (*client.ServiceContextFragment, error)); ok { return rf(name) } - if rf, ok := ret.Get(0).(func(string) *gqlclient.ServiceContextFragment); ok { + if rf, ok := ret.Get(0).(func(string) *client.ServiceContextFragment); ok { r0 = rf(name) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*gqlclient.ServiceContextFragment) + r0 = ret.Get(0).(*client.ServiceContextFragment) } } @@ -543,23 +574,23 @@ func (_m *ConsoleClient) GetServiceContext(name string) (*gqlclient.ServiceConte } // KickClusterService provides a mock function with given fields: serviceId, serviceName, clusterName -func (_m *ConsoleClient) KickClusterService(serviceId *string, serviceName *string, clusterName *string) (*gqlclient.ServiceDeploymentExtended, error) { +func (_m *ConsoleClient) KickClusterService(serviceId *string, serviceName *string, clusterName *string) (*client.ServiceDeploymentExtended, error) { ret := _m.Called(serviceId, serviceName, clusterName) if len(ret) == 0 { panic("no return value specified for KickClusterService") } - var r0 *gqlclient.ServiceDeploymentExtended + var r0 *client.ServiceDeploymentExtended var r1 error - if rf, ok := ret.Get(0).(func(*string, *string, *string) (*gqlclient.ServiceDeploymentExtended, error)); ok { + if rf, ok := ret.Get(0).(func(*string, *string, *string) (*client.ServiceDeploymentExtended, error)); ok { return rf(serviceId, serviceName, clusterName) } - if rf, ok := ret.Get(0).(func(*string, *string, *string) *gqlclient.ServiceDeploymentExtended); ok { + if rf, ok := ret.Get(0).(func(*string, *string, *string) *client.ServiceDeploymentExtended); ok { r0 = rf(serviceId, serviceName, clusterName) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*gqlclient.ServiceDeploymentExtended) + r0 = ret.Get(0).(*client.ServiceDeploymentExtended) } } @@ -573,23 +604,23 @@ func (_m *ConsoleClient) KickClusterService(serviceId *string, serviceName *stri } // ListClusterServices provides a mock function with given fields: clusterId, handle -func (_m *ConsoleClient) ListClusterServices(clusterId *string, handle *string) ([]*gqlclient.ServiceDeploymentEdgeFragment, error) { +func (_m *ConsoleClient) ListClusterServices(clusterId *string, handle *string) ([]*client.ServiceDeploymentEdgeFragment, error) { ret := _m.Called(clusterId, handle) if len(ret) == 0 { panic("no return value specified for ListClusterServices") } - var r0 []*gqlclient.ServiceDeploymentEdgeFragment + var r0 []*client.ServiceDeploymentEdgeFragment var r1 error - if rf, ok := ret.Get(0).(func(*string, *string) ([]*gqlclient.ServiceDeploymentEdgeFragment, error)); ok { + if rf, ok := ret.Get(0).(func(*string, *string) ([]*client.ServiceDeploymentEdgeFragment, error)); ok { return rf(clusterId, handle) } - if rf, ok := ret.Get(0).(func(*string, *string) []*gqlclient.ServiceDeploymentEdgeFragment); ok { + if rf, ok := ret.Get(0).(func(*string, *string) []*client.ServiceDeploymentEdgeFragment); ok { r0 = rf(clusterId, handle) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).([]*gqlclient.ServiceDeploymentEdgeFragment) + r0 = ret.Get(0).([]*client.ServiceDeploymentEdgeFragment) } } @@ -603,23 +634,23 @@ func (_m *ConsoleClient) ListClusterServices(clusterId *string, handle *string) } // ListClusters provides a mock function with given fields: -func (_m *ConsoleClient) ListClusters() (*gqlclient.ListClusters, error) { +func (_m *ConsoleClient) ListClusters() (*client.ListClusters, error) { ret := _m.Called() if len(ret) == 0 { panic("no return value specified for ListClusters") } - var r0 *gqlclient.ListClusters + var r0 *client.ListClusters var r1 error - if rf, ok := ret.Get(0).(func() (*gqlclient.ListClusters, error)); ok { + if rf, ok := ret.Get(0).(func() (*client.ListClusters, error)); ok { return rf() } - if rf, ok := ret.Get(0).(func() *gqlclient.ListClusters); ok { + if rf, ok := ret.Get(0).(func() *client.ListClusters); ok { r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*gqlclient.ListClusters) + r0 = ret.Get(0).(*client.ListClusters) } } @@ -633,23 +664,23 @@ func (_m *ConsoleClient) ListClusters() (*gqlclient.ListClusters, error) { } // ListNotificationSinks provides a mock function with given fields: after, first -func (_m *ConsoleClient) ListNotificationSinks(after *string, first *int64) (*gqlclient.ListNotificationSinks_NotificationSinks, error) { +func (_m *ConsoleClient) ListNotificationSinks(after *string, first *int64) (*client.ListNotificationSinks_NotificationSinks, error) { ret := _m.Called(after, first) if len(ret) == 0 { panic("no return value specified for ListNotificationSinks") } - var r0 *gqlclient.ListNotificationSinks_NotificationSinks + var r0 *client.ListNotificationSinks_NotificationSinks var r1 error - if rf, ok := ret.Get(0).(func(*string, *int64) (*gqlclient.ListNotificationSinks_NotificationSinks, error)); ok { + if rf, ok := ret.Get(0).(func(*string, *int64) (*client.ListNotificationSinks_NotificationSinks, error)); ok { return rf(after, first) } - if rf, ok := ret.Get(0).(func(*string, *int64) *gqlclient.ListNotificationSinks_NotificationSinks); ok { + if rf, ok := ret.Get(0).(func(*string, *int64) *client.ListNotificationSinks_NotificationSinks); ok { r0 = rf(after, first) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*gqlclient.ListNotificationSinks_NotificationSinks) + r0 = ret.Get(0).(*client.ListNotificationSinks_NotificationSinks) } } @@ -663,23 +694,23 @@ func (_m *ConsoleClient) ListNotificationSinks(after *string, first *int64) (*gq } // ListProviders provides a mock function with given fields: -func (_m *ConsoleClient) ListProviders() (*gqlclient.ListProviders, error) { +func (_m *ConsoleClient) ListProviders() (*client.ListProviders, error) { ret := _m.Called() if len(ret) == 0 { panic("no return value specified for ListProviders") } - var r0 *gqlclient.ListProviders + var r0 *client.ListProviders var r1 error - if rf, ok := ret.Get(0).(func() (*gqlclient.ListProviders, error)); ok { + if rf, ok := ret.Get(0).(func() (*client.ListProviders, error)); ok { return rf() } - if rf, ok := ret.Get(0).(func() *gqlclient.ListProviders); ok { + if rf, ok := ret.Get(0).(func() *client.ListProviders); ok { r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*gqlclient.ListProviders) + r0 = ret.Get(0).(*client.ListProviders) } } @@ -693,23 +724,23 @@ func (_m *ConsoleClient) ListProviders() (*gqlclient.ListProviders, error) { } // ListRepositories provides a mock function with given fields: -func (_m *ConsoleClient) ListRepositories() (*gqlclient.ListGitRepositories, error) { +func (_m *ConsoleClient) ListRepositories() (*client.ListGitRepositories, error) { ret := _m.Called() if len(ret) == 0 { panic("no return value specified for ListRepositories") } - var r0 *gqlclient.ListGitRepositories + var r0 *client.ListGitRepositories var r1 error - if rf, ok := ret.Get(0).(func() (*gqlclient.ListGitRepositories, error)); ok { + if rf, ok := ret.Get(0).(func() (*client.ListGitRepositories, error)); ok { return rf() } - if rf, ok := ret.Get(0).(func() *gqlclient.ListGitRepositories); ok { + if rf, ok := ret.Get(0).(func() *client.ListGitRepositories); ok { r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*gqlclient.ListGitRepositories) + r0 = ret.Get(0).(*client.ListGitRepositories) } } @@ -723,23 +754,23 @@ func (_m *ConsoleClient) ListRepositories() (*gqlclient.ListGitRepositories, err } // ListStackRuns provides a mock function with given fields: stackID -func (_m *ConsoleClient) ListStackRuns(stackID string) (*gqlclient.ListStackRuns, error) { +func (_m *ConsoleClient) ListStackRuns(stackID string) (*client.ListStackRuns, error) { ret := _m.Called(stackID) if len(ret) == 0 { panic("no return value specified for ListStackRuns") } - var r0 *gqlclient.ListStackRuns + var r0 *client.ListStackRuns var r1 error - if rf, ok := ret.Get(0).(func(string) (*gqlclient.ListStackRuns, error)); ok { + if rf, ok := ret.Get(0).(func(string) (*client.ListStackRuns, error)); ok { return rf(stackID) } - if rf, ok := ret.Get(0).(func(string) *gqlclient.ListStackRuns); ok { + if rf, ok := ret.Get(0).(func(string) *client.ListStackRuns); ok { r0 = rf(stackID) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*gqlclient.ListStackRuns) + r0 = ret.Get(0).(*client.ListStackRuns) } } @@ -753,23 +784,23 @@ func (_m *ConsoleClient) ListStackRuns(stackID string) (*gqlclient.ListStackRuns } // MyCluster provides a mock function with given fields: -func (_m *ConsoleClient) MyCluster() (*gqlclient.MyCluster, error) { +func (_m *ConsoleClient) MyCluster() (*client.MyCluster, error) { ret := _m.Called() if len(ret) == 0 { panic("no return value specified for MyCluster") } - var r0 *gqlclient.MyCluster + var r0 *client.MyCluster var r1 error - if rf, ok := ret.Get(0).(func() (*gqlclient.MyCluster, error)); ok { + if rf, ok := ret.Get(0).(func() (*client.MyCluster, error)); ok { return rf() } - if rf, ok := ret.Get(0).(func() *gqlclient.MyCluster); ok { + if rf, ok := ret.Get(0).(func() *client.MyCluster); ok { r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*gqlclient.MyCluster) + r0 = ret.Get(0).(*client.MyCluster) } } @@ -783,27 +814,27 @@ func (_m *ConsoleClient) MyCluster() (*gqlclient.MyCluster, error) { } // SavePipeline provides a mock function with given fields: name, attrs -func (_m *ConsoleClient) SavePipeline(name string, attrs gqlclient.PipelineAttributes) (*gqlclient.PipelineFragment, error) { +func (_m *ConsoleClient) SavePipeline(name string, attrs client.PipelineAttributes) (*client.PipelineFragment, error) { ret := _m.Called(name, attrs) if len(ret) == 0 { panic("no return value specified for SavePipeline") } - var r0 *gqlclient.PipelineFragment + var r0 *client.PipelineFragment var r1 error - if rf, ok := ret.Get(0).(func(string, gqlclient.PipelineAttributes) (*gqlclient.PipelineFragment, error)); ok { + if rf, ok := ret.Get(0).(func(string, client.PipelineAttributes) (*client.PipelineFragment, error)); ok { return rf(name, attrs) } - if rf, ok := ret.Get(0).(func(string, gqlclient.PipelineAttributes) *gqlclient.PipelineFragment); ok { + if rf, ok := ret.Get(0).(func(string, client.PipelineAttributes) *client.PipelineFragment); ok { r0 = rf(name, attrs) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*gqlclient.PipelineFragment) + r0 = ret.Get(0).(*client.PipelineFragment) } } - if rf, ok := ret.Get(1).(func(string, gqlclient.PipelineAttributes) error); ok { + if rf, ok := ret.Get(1).(func(string, client.PipelineAttributes) error); ok { r1 = rf(name, attrs) } else { r1 = ret.Error(1) @@ -813,27 +844,27 @@ func (_m *ConsoleClient) SavePipeline(name string, attrs gqlclient.PipelineAttri } // SaveServiceContext provides a mock function with given fields: name, attributes -func (_m *ConsoleClient) SaveServiceContext(name string, attributes gqlclient.ServiceContextAttributes) (*gqlclient.ServiceContextFragment, error) { +func (_m *ConsoleClient) SaveServiceContext(name string, attributes client.ServiceContextAttributes) (*client.ServiceContextFragment, error) { ret := _m.Called(name, attributes) if len(ret) == 0 { panic("no return value specified for SaveServiceContext") } - var r0 *gqlclient.ServiceContextFragment + var r0 *client.ServiceContextFragment var r1 error - if rf, ok := ret.Get(0).(func(string, gqlclient.ServiceContextAttributes) (*gqlclient.ServiceContextFragment, error)); ok { + if rf, ok := ret.Get(0).(func(string, client.ServiceContextAttributes) (*client.ServiceContextFragment, error)); ok { return rf(name, attributes) } - if rf, ok := ret.Get(0).(func(string, gqlclient.ServiceContextAttributes) *gqlclient.ServiceContextFragment); ok { + if rf, ok := ret.Get(0).(func(string, client.ServiceContextAttributes) *client.ServiceContextFragment); ok { r0 = rf(name, attributes) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*gqlclient.ServiceContextFragment) + r0 = ret.Get(0).(*client.ServiceContextFragment) } } - if rf, ok := ret.Get(1).(func(string, gqlclient.ServiceContextAttributes) error); ok { + if rf, ok := ret.Get(1).(func(string, client.ServiceContextAttributes) error); ok { r1 = rf(name, attributes) } else { r1 = ret.Error(1) @@ -861,27 +892,27 @@ func (_m *ConsoleClient) Token() string { } // UpdateCluster provides a mock function with given fields: id, attr -func (_m *ConsoleClient) UpdateCluster(id string, attr gqlclient.ClusterUpdateAttributes) (*gqlclient.UpdateCluster, error) { +func (_m *ConsoleClient) UpdateCluster(id string, attr client.ClusterUpdateAttributes) (*client.UpdateCluster, error) { ret := _m.Called(id, attr) if len(ret) == 0 { panic("no return value specified for UpdateCluster") } - var r0 *gqlclient.UpdateCluster + var r0 *client.UpdateCluster var r1 error - if rf, ok := ret.Get(0).(func(string, gqlclient.ClusterUpdateAttributes) (*gqlclient.UpdateCluster, error)); ok { + if rf, ok := ret.Get(0).(func(string, client.ClusterUpdateAttributes) (*client.UpdateCluster, error)); ok { return rf(id, attr) } - if rf, ok := ret.Get(0).(func(string, gqlclient.ClusterUpdateAttributes) *gqlclient.UpdateCluster); ok { + if rf, ok := ret.Get(0).(func(string, client.ClusterUpdateAttributes) *client.UpdateCluster); ok { r0 = rf(id, attr) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*gqlclient.UpdateCluster) + r0 = ret.Get(0).(*client.UpdateCluster) } } - if rf, ok := ret.Get(1).(func(string, gqlclient.ClusterUpdateAttributes) error); ok { + if rf, ok := ret.Get(1).(func(string, client.ClusterUpdateAttributes) error); ok { r1 = rf(id, attr) } else { r1 = ret.Error(1) @@ -891,27 +922,27 @@ func (_m *ConsoleClient) UpdateCluster(id string, attr gqlclient.ClusterUpdateAt } // UpdateClusterService provides a mock function with given fields: serviceId, serviceName, clusterName, attributes -func (_m *ConsoleClient) UpdateClusterService(serviceId *string, serviceName *string, clusterName *string, attributes gqlclient.ServiceUpdateAttributes) (*gqlclient.ServiceDeploymentExtended, error) { +func (_m *ConsoleClient) UpdateClusterService(serviceId *string, serviceName *string, clusterName *string, attributes client.ServiceUpdateAttributes) (*client.ServiceDeploymentExtended, error) { ret := _m.Called(serviceId, serviceName, clusterName, attributes) if len(ret) == 0 { panic("no return value specified for UpdateClusterService") } - var r0 *gqlclient.ServiceDeploymentExtended + var r0 *client.ServiceDeploymentExtended var r1 error - if rf, ok := ret.Get(0).(func(*string, *string, *string, gqlclient.ServiceUpdateAttributes) (*gqlclient.ServiceDeploymentExtended, error)); ok { + if rf, ok := ret.Get(0).(func(*string, *string, *string, client.ServiceUpdateAttributes) (*client.ServiceDeploymentExtended, error)); ok { return rf(serviceId, serviceName, clusterName, attributes) } - if rf, ok := ret.Get(0).(func(*string, *string, *string, gqlclient.ServiceUpdateAttributes) *gqlclient.ServiceDeploymentExtended); ok { + if rf, ok := ret.Get(0).(func(*string, *string, *string, client.ServiceUpdateAttributes) *client.ServiceDeploymentExtended); ok { r0 = rf(serviceId, serviceName, clusterName, attributes) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*gqlclient.ServiceDeploymentExtended) + r0 = ret.Get(0).(*client.ServiceDeploymentExtended) } } - if rf, ok := ret.Get(1).(func(*string, *string, *string, gqlclient.ServiceUpdateAttributes) error); ok { + if rf, ok := ret.Get(1).(func(*string, *string, *string, client.ServiceUpdateAttributes) error); ok { r1 = rf(serviceId, serviceName, clusterName, attributes) } else { r1 = ret.Error(1) @@ -921,27 +952,27 @@ func (_m *ConsoleClient) UpdateClusterService(serviceId *string, serviceName *st } // UpdateDeploymentSettings provides a mock function with given fields: attr -func (_m *ConsoleClient) UpdateDeploymentSettings(attr gqlclient.DeploymentSettingsAttributes) (*gqlclient.UpdateDeploymentSettings, error) { +func (_m *ConsoleClient) UpdateDeploymentSettings(attr client.DeploymentSettingsAttributes) (*client.UpdateDeploymentSettings, error) { ret := _m.Called(attr) if len(ret) == 0 { panic("no return value specified for UpdateDeploymentSettings") } - var r0 *gqlclient.UpdateDeploymentSettings + var r0 *client.UpdateDeploymentSettings var r1 error - if rf, ok := ret.Get(0).(func(gqlclient.DeploymentSettingsAttributes) (*gqlclient.UpdateDeploymentSettings, error)); ok { + if rf, ok := ret.Get(0).(func(client.DeploymentSettingsAttributes) (*client.UpdateDeploymentSettings, error)); ok { return rf(attr) } - if rf, ok := ret.Get(0).(func(gqlclient.DeploymentSettingsAttributes) *gqlclient.UpdateDeploymentSettings); ok { + if rf, ok := ret.Get(0).(func(client.DeploymentSettingsAttributes) *client.UpdateDeploymentSettings); ok { r0 = rf(attr) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*gqlclient.UpdateDeploymentSettings) + r0 = ret.Get(0).(*client.UpdateDeploymentSettings) } } - if rf, ok := ret.Get(1).(func(gqlclient.DeploymentSettingsAttributes) error); ok { + if rf, ok := ret.Get(1).(func(client.DeploymentSettingsAttributes) error); ok { r1 = rf(attr) } else { r1 = ret.Error(1) @@ -951,27 +982,27 @@ func (_m *ConsoleClient) UpdateDeploymentSettings(attr gqlclient.DeploymentSetti } // UpdateRepository provides a mock function with given fields: id, attrs -func (_m *ConsoleClient) UpdateRepository(id string, attrs gqlclient.GitAttributes) (*gqlclient.UpdateGitRepository, error) { +func (_m *ConsoleClient) UpdateRepository(id string, attrs client.GitAttributes) (*client.UpdateGitRepository, error) { ret := _m.Called(id, attrs) if len(ret) == 0 { panic("no return value specified for UpdateRepository") } - var r0 *gqlclient.UpdateGitRepository + var r0 *client.UpdateGitRepository var r1 error - if rf, ok := ret.Get(0).(func(string, gqlclient.GitAttributes) (*gqlclient.UpdateGitRepository, error)); ok { + if rf, ok := ret.Get(0).(func(string, client.GitAttributes) (*client.UpdateGitRepository, error)); ok { return rf(id, attrs) } - if rf, ok := ret.Get(0).(func(string, gqlclient.GitAttributes) *gqlclient.UpdateGitRepository); ok { + if rf, ok := ret.Get(0).(func(string, client.GitAttributes) *client.UpdateGitRepository); ok { r0 = rf(id, attrs) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*gqlclient.UpdateGitRepository) + r0 = ret.Get(0).(*client.UpdateGitRepository) } } - if rf, ok := ret.Get(1).(func(string, gqlclient.GitAttributes) error); ok { + if rf, ok := ret.Get(1).(func(string, client.GitAttributes) error); ok { r1 = rf(id, attrs) } else { r1 = ret.Error(1) diff --git a/pkg/test/mocks/Kube.go b/pkg/test/mocks/Kube.go index 14a0c1c0..461e3dde 100644 --- a/pkg/test/mocks/Kube.go +++ b/pkg/test/mocks/Kube.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.43.2. DO NOT EDIT. +// Code generated by mockery v2.44.2. DO NOT EDIT. package mocks