diff --git a/VERSION b/VERSION index 787ffc3..8298bb0 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.42.0 +0.43.0 diff --git a/pkg/codefresh/ap_git-sources.go b/pkg/codefresh/ap_git-sources.go index 071233f..a8b8063 100644 --- a/pkg/codefresh/ap_git-sources.go +++ b/pkg/codefresh/ap_git-sources.go @@ -10,9 +10,9 @@ import ( type ( IAppProxyGitSourcesAPI interface { - Create(ctx context.Context, appName, appSpecifier, destServer, destNamespace string, isInternal bool) error + Create(ctx context.Context, opts *appProxyModel.CreateGitSourceInput) error Delete(ctx context.Context, appName string) error - Edit(ctx context.Context, appName, appSpecifier string) error + Edit(ctx context.Context, opts *appProxyModel.EditGitSourceInput) error } appProxyGitSources struct { @@ -37,27 +37,29 @@ type ( graphqlGitSourceEditResponse struct { Errors []graphqlError } - ) func newAppProxyGitSourcesAPI(c *codefresh) IAppProxyGitSourcesAPI { return &appProxyGitSources{codefresh: c} } -func (c *appProxyGitSources) Create(ctx context.Context, appName, appSpecifier, destServer, destNamespace string, isInternal bool) error { + +func (c *appProxyGitSources) Create(ctx context.Context, opts *appProxyModel.CreateGitSourceInput) error { jsonData := map[string]interface{}{ "query": ` mutation CreateGitSource($args: CreateGitSourceInput!) { createGitSource(args: $args) } - `, + `, "variables": map[string]interface{}{ "args": appProxyModel.CreateGitSourceInput{ - AppName: appName, - AppSpecifier: appSpecifier, - DestServer: destServer, - DestNamespace: destNamespace, - IsInternal: &isInternal, + AppName: opts.AppName, + AppSpecifier: opts.AppSpecifier, + DestServer: opts.DestServer, + DestNamespace: opts.DestNamespace, + IsInternal: opts.IsInternal, + Include: opts.Include, + Exclude: opts.Exclude, }, }, } @@ -82,7 +84,7 @@ func (c *appProxyGitSources) Delete(ctx context.Context, appName string) error { mutation DeleteApplication($args: DeleteApplicationInput!) { deleteApplication(args: $args) } - `, + `, "variables": map[string]interface{}{ "args": appProxyModel.DeleteApplicationInput{ AppName: appName, @@ -104,17 +106,19 @@ func (c *appProxyGitSources) Delete(ctx context.Context, appName string) error { return nil } -func (c *appProxyGitSources) Edit(ctx context.Context, appName, appSpecifier string) error { +func (c *appProxyGitSources) Edit(ctx context.Context, opts *appProxyModel.EditGitSourceInput) error { jsonData := map[string]interface{}{ "query": ` mutation EditGitSource($args: EditGitSourceInput!) { editGitSource(args: $args) } - `, + `, "variables": map[string]interface{}{ "args": appProxyModel.EditGitSourceInput{ - AppName: appName, - AppSpecifier: appSpecifier, + AppName: opts.AppName, + AppSpecifier: opts.AppSpecifier, + Include: opts.Include, + Exclude: opts.Exclude, }, }, }