-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodel.go
174 lines (151 loc) · 5.41 KB
/
model.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
package cloudbeaver
// CreateTeam -
type CreateTeam struct {
Query string `json:"query"`
OperationName string `json:"operationName"`
Variables CreateVariables `json:"variables"`
}
// CreateVariables -
type CreateVariables struct {
Description string `json:"description"`
TeamId string `json:"teamId"`
TeamName string `json:"teamName"`
IncludeMetaParameters bool `json:"includeMetaParameters"`
CustomIncludeBase bool `json:"customIncludeBase"`
}
// CreateResponse -
type CreateResponse struct {
Data struct {
Team Team `json:"team"`
} `json:"data"`
}
// NewCreateTeam -
func NewCreateTeam(teamId, teamName, desc *string) *CreateTeam {
return &CreateTeam{
OperationName: "createTeam",
Query: "\n query createTeam($teamId: ID!, $teamName: String, $description: String, $includeMetaParameters: Boolean!) {\n team: createTeam(\n teamId: $teamId\n teamName: $teamName\n description: $description\n ) {\n ...AdminTeamInfo\n }\n}\n \n fragment AdminTeamInfo on AdminTeamInfo {\n teamId\n teamName\n description\n teamPermissions\n metaParameters @include(if: $includeMetaParameters)\n}\n ",
Variables: CreateVariables{
Description: *desc,
TeamId: *teamId,
TeamName: *teamName,
IncludeMetaParameters: false,
CustomIncludeBase: true,
},
}
}
// DeleteTeam -
type DeleteTeam struct {
OperationName string `json:"operationName"`
Query string `json:"query"`
Variables DeleteVariables `json:"variables"`
}
// DeleteVariables -
type DeleteVariables struct {
TeamId string `json:"teamId"`
Force bool `json:"force"`
}
// DeleteResponse -
type DeleteResponse struct {
Data struct {
DeleteTeam bool `json:"deleteTeam"`
} `json:"data"`
}
// NewDeleteTeam -
func NewDeleteTeam(teamId *string) *DeleteTeam {
return &DeleteTeam{
OperationName: "deleteTeam",
Query: "\n query deleteTeam($teamId: ID!, $force: Boolean) {\n deleteTeam(teamId: $teamId, force: $force)\n}\n ",
Variables: DeleteVariables{
TeamId: *teamId,
Force: true,
},
}
}
// GetAllTeam -
type GetAllTeam struct {
OperationName string `json:"operationName"`
Query string `json:"query"`
Variables GetAllVariables `json:"variables"`
}
// GetAllVariables -
type GetAllVariables struct {
IncludeMetaParameters bool `json:"includeMetaParameters"`
CustomIncludeBase bool `json:"customIncludeBase"`
}
type GetAllResponse struct {
Data struct {
Teams []Team `json:"teams"`
} `json:"data"`
}
// NewGetAllTeams -
func NewGetAllTeams() *GetAllTeam {
return &GetAllTeam{
OperationName: "getTeamsList",
Query: "\n query getTeamsList($teamId: ID, $includeMetaParameters: Boolean!) {\n teams: listTeams(teamId: $teamId) {\n ...AdminTeamInfo\n }\n}\n \n fragment AdminTeamInfo on AdminTeamInfo {\n teamId\n teamName\n description\n teamPermissions\n metaParameters @include(if: $includeMetaParameters)\n}\n ",
Variables: GetAllVariables{
IncludeMetaParameters: false,
CustomIncludeBase: true,
},
}
}
// GetTeam -
type GetTeam struct {
OperationName string `json:"operationName"`
Query string `json:"query"`
Variables GetVariables `json:"variables"`
}
// GetVariables -
type GetVariables struct {
TeamId string `json:"teamId"`
IncludeMetaParameters bool `json:"includeMetaParameters"`
CustomIncludeBase bool `json:"customIncludeBase"`
}
type GetResponse struct {
Data struct {
Teams []Team `json:"teams"`
} `json:"data"`
}
// NewGetTeams -
func NewGetTeams(teamId *string) *GetTeam {
return &GetTeam{
OperationName: "getTeamsList",
Query: "\n query getTeamsList($teamId: ID, $includeMetaParameters: Boolean!) {\n teams: listTeams(teamId: $teamId) {\n ...AdminTeamInfo\n }\n}\n \n fragment AdminTeamInfo on AdminTeamInfo {\n teamId\n teamName\n description\n teamPermissions\n metaParameters @include(if: $includeMetaParameters)\n}\n ",
Variables: GetVariables{
TeamId: *teamId,
IncludeMetaParameters: false,
CustomIncludeBase: true,
},
}
}
// UpdateTeam -
type UpdateTeam struct {
OperationName string `json:"operationName"`
Query string `json:"query"`
Variables UpdateVariables `json:"variables"`
}
// UpdateVariables -
type UpdateVariables struct {
TeamId string `json:"teamId"`
TeamName string `json:"teamName"`
Description string `json:"description"`
IncludeMetaParameters bool `json:"includeMetaParameters"`
CustomIncludeBase bool `json:"customIncludeBase"`
}
type UpdateResponse struct {
Data struct {
Team Team `json:"team"`
}
}
func NewUpdateTeam(teamId, teamName, desc *string) *UpdateTeam {
return &UpdateTeam{
OperationName: "updateTeam",
Query: "\n query updateTeam($teamId: ID!, $teamName: String, $description: String, $includeMetaParameters: Boolean!) {\n team: updateTeam(\n teamId: $teamId\n teamName: $teamName\n description: $description\n ) {\n ...AdminTeamInfo\n }\n}\n \n fragment AdminTeamInfo on AdminTeamInfo {\n teamId\n teamName\n description\n teamPermissions\n metaParameters @include(if: $includeMetaParameters)\n}\n ",
Variables: UpdateVariables{
TeamId: *teamId,
TeamName: *teamName,
Description: *desc,
CustomIncludeBase: true,
IncludeMetaParameters: false,
},
}
}