@@ -10,9 +10,9 @@ import (
10
10
11
11
type (
12
12
IAppProxyGitSourcesAPI interface {
13
- Create (ctx context.Context , appName , appSpecifier , destServer , destNamespace string , isInternal bool ) error
13
+ Create (ctx context.Context , opts * appProxyModel. CreateGitSourceInput ) error
14
14
Delete (ctx context.Context , appName string ) error
15
- Edit (ctx context.Context , appName , appSpecifier string ) error
15
+ Edit (ctx context.Context , opts * appProxyModel. EditGitSourceInput ) error
16
16
}
17
17
18
18
appProxyGitSources struct {
@@ -37,27 +37,29 @@ type (
37
37
graphqlGitSourceEditResponse struct {
38
38
Errors []graphqlError
39
39
}
40
-
41
40
)
42
41
43
42
func newAppProxyGitSourcesAPI (c * codefresh ) IAppProxyGitSourcesAPI {
44
43
return & appProxyGitSources {codefresh : c }
45
44
}
46
45
47
- func (c * appProxyGitSources ) Create (ctx context.Context , appName , appSpecifier , destServer , destNamespace string , isInternal bool ) error {
46
+
47
+ func (c * appProxyGitSources ) Create (ctx context.Context , opts * appProxyModel.CreateGitSourceInput ) error {
48
48
jsonData := map [string ]interface {}{
49
49
"query" : `
50
50
mutation CreateGitSource($args: CreateGitSourceInput!) {
51
51
createGitSource(args: $args)
52
52
}
53
- ` ,
53
+ ` ,
54
54
"variables" : map [string ]interface {}{
55
55
"args" : appProxyModel.CreateGitSourceInput {
56
- AppName : appName ,
57
- AppSpecifier : appSpecifier ,
58
- DestServer : destServer ,
59
- DestNamespace : destNamespace ,
60
- IsInternal : & isInternal ,
56
+ AppName : opts .AppName ,
57
+ AppSpecifier : opts .AppSpecifier ,
58
+ DestServer : opts .DestServer ,
59
+ DestNamespace : opts .DestNamespace ,
60
+ IsInternal : opts .IsInternal ,
61
+ Include : opts .Include ,
62
+ Exclude : opts .Exclude ,
61
63
},
62
64
},
63
65
}
@@ -82,7 +84,7 @@ func (c *appProxyGitSources) Delete(ctx context.Context, appName string) error {
82
84
mutation DeleteApplication($args: DeleteApplicationInput!) {
83
85
deleteApplication(args: $args)
84
86
}
85
- ` ,
87
+ ` ,
86
88
"variables" : map [string ]interface {}{
87
89
"args" : appProxyModel.DeleteApplicationInput {
88
90
AppName : appName ,
@@ -104,17 +106,19 @@ func (c *appProxyGitSources) Delete(ctx context.Context, appName string) error {
104
106
return nil
105
107
}
106
108
107
- func (c * appProxyGitSources ) Edit (ctx context.Context , appName , appSpecifier string ) error {
109
+ func (c * appProxyGitSources ) Edit (ctx context.Context , opts * appProxyModel. EditGitSourceInput ) error {
108
110
jsonData := map [string ]interface {}{
109
111
"query" : `
110
112
mutation EditGitSource($args: EditGitSourceInput!) {
111
113
editGitSource(args: $args)
112
114
}
113
- ` ,
115
+ ` ,
114
116
"variables" : map [string ]interface {}{
115
117
"args" : appProxyModel.EditGitSourceInput {
116
- AppName : appName ,
117
- AppSpecifier : appSpecifier ,
118
+ AppName : opts .AppName ,
119
+ AppSpecifier : opts .AppSpecifier ,
120
+ Include : opts .Include ,
121
+ Exclude : opts .Exclude ,
118
122
},
119
123
},
120
124
}
0 commit comments