OLD | NEW |
1 // This is a generated file (see the discoveryapis_generator project). | 1 // This is a generated file (see the discoveryapis_generator project). |
2 | 2 |
3 library googleapis.sourcerepo.v1; | 3 library googleapis.sourcerepo.v1; |
4 | 4 |
5 import 'dart:core' as core; | 5 import 'dart:core' as core; |
6 import 'dart:async' as async; | 6 import 'dart:async' as async; |
7 import 'dart:convert' as convert; | 7 import 'dart:convert' as convert; |
8 | 8 |
9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; | 9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; |
10 import 'package:http/http.dart' as http; | 10 import 'package:http/http.dart' as http; |
11 | 11 |
12 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show | 12 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' |
13 ApiRequestError, DetailedApiRequestError; | 13 show ApiRequestError, DetailedApiRequestError; |
14 | 14 |
15 const core.String USER_AGENT = 'dart-api-client sourcerepo/v1'; | 15 const core.String USER_AGENT = 'dart-api-client sourcerepo/v1'; |
16 | 16 |
17 /** Access source code repositories hosted by Google. */ | 17 /// Access source code repositories hosted by Google. |
18 class SourcerepoApi { | 18 class SourcerepoApi { |
19 /** View and manage your data across Google Cloud Platform services */ | 19 /// View and manage your data across Google Cloud Platform services |
20 static const CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platf
orm"; | 20 static const CloudPlatformScope = |
| 21 "https://www.googleapis.com/auth/cloud-platform"; |
21 | 22 |
22 /** View the contents of your source code repositories */ | 23 /// View the contents of your source code repositories |
23 static const SourceReadOnlyScope = "https://www.googleapis.com/auth/source.rea
d_only"; | 24 static const SourceReadOnlyScope = |
| 25 "https://www.googleapis.com/auth/source.read_only"; |
24 | 26 |
25 /** Manage the contents of your source code repositories */ | 27 /// Manage the contents of your source code repositories |
26 static const SourceReadWriteScope = "https://www.googleapis.com/auth/source.re
ad_write"; | 28 static const SourceReadWriteScope = |
27 | 29 "https://www.googleapis.com/auth/source.read_write"; |
28 | 30 |
29 final commons.ApiRequester _requester; | 31 final commons.ApiRequester _requester; |
30 | 32 |
31 ProjectsResourceApi get projects => new ProjectsResourceApi(_requester); | 33 ProjectsResourceApi get projects => new ProjectsResourceApi(_requester); |
32 | 34 |
33 SourcerepoApi(http.Client client, {core.String rootUrl: "https://sourcerepo.go
ogleapis.com/", core.String servicePath: ""}) : | 35 SourcerepoApi(http.Client client, |
34 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A
GENT); | 36 {core.String rootUrl: "https://sourcerepo.googleapis.com/", |
| 37 core.String servicePath: ""}) |
| 38 : _requester = |
| 39 new commons.ApiRequester(client, rootUrl, servicePath, USER_AGENT); |
35 } | 40 } |
36 | 41 |
37 | |
38 class ProjectsResourceApi { | 42 class ProjectsResourceApi { |
39 final commons.ApiRequester _requester; | 43 final commons.ApiRequester _requester; |
40 | 44 |
41 ProjectsReposResourceApi get repos => new ProjectsReposResourceApi(_requester)
; | 45 ProjectsReposResourceApi get repos => |
| 46 new ProjectsReposResourceApi(_requester); |
42 | 47 |
43 ProjectsResourceApi(commons.ApiRequester client) : | 48 ProjectsResourceApi(commons.ApiRequester client) : _requester = client; |
44 _requester = client; | |
45 } | 49 } |
46 | 50 |
47 | |
48 class ProjectsReposResourceApi { | 51 class ProjectsReposResourceApi { |
49 final commons.ApiRequester _requester; | 52 final commons.ApiRequester _requester; |
50 | 53 |
51 ProjectsReposResourceApi(commons.ApiRequester client) : | 54 ProjectsReposResourceApi(commons.ApiRequester client) : _requester = client; |
52 _requester = client; | |
53 | 55 |
54 /** | 56 /// Creates a repo in the given project with the given name. |
55 * Creates a repo in the given project with the given name. | 57 /// |
56 * | 58 /// If the named repository already exists, `CreateRepo` returns |
57 * If the named repository already exists, `CreateRepo` returns | 59 /// `ALREADY_EXISTS`. |
58 * `ALREADY_EXISTS`. | 60 /// |
59 * | 61 /// [request] - The metadata request object. |
60 * [request] - The metadata request object. | 62 /// |
61 * | 63 /// Request parameters: |
62 * Request parameters: | 64 /// |
63 * | 65 /// [parent] - The project in which to create the repo. Values are of the |
64 * [parent] - The project in which to create the repo. Values are of the form | 66 /// form |
65 * `projects/<project>`. | 67 /// `projects/<project>`. |
66 * Value must have pattern "^projects/[^/]+$". | 68 /// Value must have pattern "^projects/[^/]+$". |
67 * | 69 /// |
68 * Completes with a [Repo]. | 70 /// Completes with a [Repo]. |
69 * | 71 /// |
70 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 72 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
71 * error. | 73 /// an error. |
72 * | 74 /// |
73 * If the used [http.Client] completes with an error when making a REST call, | 75 /// If the used [http.Client] completes with an error when making a REST |
74 * this method will complete with the same error. | 76 /// call, this method will complete with the same error. |
75 */ | |
76 async.Future<Repo> create(Repo request, core.String parent) { | 77 async.Future<Repo> create(Repo request, core.String parent) { |
77 var _url = null; | 78 var _url = null; |
78 var _queryParams = new core.Map(); | 79 var _queryParams = new core.Map(); |
79 var _uploadMedia = null; | 80 var _uploadMedia = null; |
80 var _uploadOptions = null; | 81 var _uploadOptions = null; |
81 var _downloadOptions = commons.DownloadOptions.Metadata; | 82 var _downloadOptions = commons.DownloadOptions.Metadata; |
82 var _body = null; | 83 var _body = null; |
83 | 84 |
84 if (request != null) { | 85 if (request != null) { |
85 _body = convert.JSON.encode((request).toJson()); | 86 _body = convert.JSON.encode((request).toJson()); |
86 } | 87 } |
87 if (parent == null) { | 88 if (parent == null) { |
88 throw new core.ArgumentError("Parameter parent is required."); | 89 throw new core.ArgumentError("Parameter parent is required."); |
89 } | 90 } |
90 | 91 |
91 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$parent') + '/repos'; | 92 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$parent') + '/repos'; |
92 | 93 |
93 var _response = _requester.request(_url, | 94 var _response = _requester.request(_url, "POST", |
94 "POST", | 95 body: _body, |
95 body: _body, | 96 queryParams: _queryParams, |
96 queryParams: _queryParams, | 97 uploadOptions: _uploadOptions, |
97 uploadOptions: _uploadOptions, | 98 uploadMedia: _uploadMedia, |
98 uploadMedia: _uploadMedia, | 99 downloadOptions: _downloadOptions); |
99 downloadOptions: _downloadOptions); | |
100 return _response.then((data) => new Repo.fromJson(data)); | 100 return _response.then((data) => new Repo.fromJson(data)); |
101 } | 101 } |
102 | 102 |
103 /** | 103 /// Deletes a repo. |
104 * Deletes a repo. | 104 /// |
105 * | 105 /// Request parameters: |
106 * Request parameters: | 106 /// |
107 * | 107 /// [name] - The name of the repo to delete. Values are of the form |
108 * [name] - The name of the repo to delete. Values are of the form | 108 /// `projects/<project>/repos/<repo>`. |
109 * `projects/<project>/repos/<repo>`. | 109 /// Value must have pattern "^projects/[^/]+/repos/.+$". |
110 * Value must have pattern "^projects/[^/]+/repos/.+$". | 110 /// |
111 * | 111 /// Completes with a [Empty]. |
112 * Completes with a [Empty]. | 112 /// |
113 * | 113 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
114 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 114 /// an error. |
115 * error. | 115 /// |
116 * | 116 /// If the used [http.Client] completes with an error when making a REST |
117 * If the used [http.Client] completes with an error when making a REST call, | 117 /// call, this method will complete with the same error. |
118 * this method will complete with the same error. | |
119 */ | |
120 async.Future<Empty> delete(core.String name) { | 118 async.Future<Empty> delete(core.String name) { |
121 var _url = null; | 119 var _url = null; |
122 var _queryParams = new core.Map(); | 120 var _queryParams = new core.Map(); |
123 var _uploadMedia = null; | 121 var _uploadMedia = null; |
124 var _uploadOptions = null; | 122 var _uploadOptions = null; |
125 var _downloadOptions = commons.DownloadOptions.Metadata; | 123 var _downloadOptions = commons.DownloadOptions.Metadata; |
126 var _body = null; | 124 var _body = null; |
127 | 125 |
128 if (name == null) { | 126 if (name == null) { |
129 throw new core.ArgumentError("Parameter name is required."); | 127 throw new core.ArgumentError("Parameter name is required."); |
130 } | 128 } |
131 | 129 |
132 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name'); | 130 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name'); |
133 | 131 |
134 var _response = _requester.request(_url, | 132 var _response = _requester.request(_url, "DELETE", |
135 "DELETE", | 133 body: _body, |
136 body: _body, | 134 queryParams: _queryParams, |
137 queryParams: _queryParams, | 135 uploadOptions: _uploadOptions, |
138 uploadOptions: _uploadOptions, | 136 uploadMedia: _uploadMedia, |
139 uploadMedia: _uploadMedia, | 137 downloadOptions: _downloadOptions); |
140 downloadOptions: _downloadOptions); | |
141 return _response.then((data) => new Empty.fromJson(data)); | 138 return _response.then((data) => new Empty.fromJson(data)); |
142 } | 139 } |
143 | 140 |
144 /** | 141 /// Returns information about a repo. |
145 * Returns information about a repo. | 142 /// |
146 * | 143 /// Request parameters: |
147 * Request parameters: | 144 /// |
148 * | 145 /// [name] - The name of the requested repository. Values are of the form |
149 * [name] - The name of the requested repository. Values are of the form | 146 /// `projects/<project>/repos/<repo>`. |
150 * `projects/<project>/repos/<repo>`. | 147 /// Value must have pattern "^projects/[^/]+/repos/.+$". |
151 * Value must have pattern "^projects/[^/]+/repos/.+$". | 148 /// |
152 * | 149 /// Completes with a [Repo]. |
153 * Completes with a [Repo]. | 150 /// |
154 * | 151 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
155 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 152 /// an error. |
156 * error. | 153 /// |
157 * | 154 /// If the used [http.Client] completes with an error when making a REST |
158 * If the used [http.Client] completes with an error when making a REST call, | 155 /// call, this method will complete with the same error. |
159 * this method will complete with the same error. | |
160 */ | |
161 async.Future<Repo> get(core.String name) { | 156 async.Future<Repo> get(core.String name) { |
162 var _url = null; | 157 var _url = null; |
163 var _queryParams = new core.Map(); | 158 var _queryParams = new core.Map(); |
164 var _uploadMedia = null; | 159 var _uploadMedia = null; |
165 var _uploadOptions = null; | 160 var _uploadOptions = null; |
166 var _downloadOptions = commons.DownloadOptions.Metadata; | 161 var _downloadOptions = commons.DownloadOptions.Metadata; |
167 var _body = null; | 162 var _body = null; |
168 | 163 |
169 if (name == null) { | 164 if (name == null) { |
170 throw new core.ArgumentError("Parameter name is required."); | 165 throw new core.ArgumentError("Parameter name is required."); |
171 } | 166 } |
172 | 167 |
173 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name'); | 168 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name'); |
174 | 169 |
175 var _response = _requester.request(_url, | 170 var _response = _requester.request(_url, "GET", |
176 "GET", | 171 body: _body, |
177 body: _body, | 172 queryParams: _queryParams, |
178 queryParams: _queryParams, | 173 uploadOptions: _uploadOptions, |
179 uploadOptions: _uploadOptions, | 174 uploadMedia: _uploadMedia, |
180 uploadMedia: _uploadMedia, | 175 downloadOptions: _downloadOptions); |
181 downloadOptions: _downloadOptions); | |
182 return _response.then((data) => new Repo.fromJson(data)); | 176 return _response.then((data) => new Repo.fromJson(data)); |
183 } | 177 } |
184 | 178 |
185 /** | 179 /// Gets the access control policy for a resource. |
186 * Gets the access control policy for a resource. | 180 /// Returns an empty policy if the resource exists and does not have a policy |
187 * Returns an empty policy if the resource exists and does not have a policy | 181 /// set. |
188 * set. | 182 /// |
189 * | 183 /// Request parameters: |
190 * Request parameters: | 184 /// |
191 * | 185 /// [resource] - REQUIRED: The resource for which the policy is being |
192 * [resource] - REQUIRED: The resource for which the policy is being | 186 /// requested. |
193 * requested. | 187 /// See the operation documentation for the appropriate value for this field. |
194 * See the operation documentation for the appropriate value for this field. | 188 /// Value must have pattern "^projects/[^/]+/repos/.+$". |
195 * Value must have pattern "^projects/[^/]+/repos/.+$". | 189 /// |
196 * | 190 /// Completes with a [Policy]. |
197 * Completes with a [Policy]. | 191 /// |
198 * | 192 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
199 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 193 /// an error. |
200 * error. | 194 /// |
201 * | 195 /// If the used [http.Client] completes with an error when making a REST |
202 * If the used [http.Client] completes with an error when making a REST call, | 196 /// call, this method will complete with the same error. |
203 * this method will complete with the same error. | |
204 */ | |
205 async.Future<Policy> getIamPolicy(core.String resource) { | 197 async.Future<Policy> getIamPolicy(core.String resource) { |
206 var _url = null; | 198 var _url = null; |
207 var _queryParams = new core.Map(); | 199 var _queryParams = new core.Map(); |
208 var _uploadMedia = null; | 200 var _uploadMedia = null; |
209 var _uploadOptions = null; | 201 var _uploadOptions = null; |
210 var _downloadOptions = commons.DownloadOptions.Metadata; | 202 var _downloadOptions = commons.DownloadOptions.Metadata; |
211 var _body = null; | 203 var _body = null; |
212 | 204 |
213 if (resource == null) { | 205 if (resource == null) { |
214 throw new core.ArgumentError("Parameter resource is required."); | 206 throw new core.ArgumentError("Parameter resource is required."); |
215 } | 207 } |
216 | 208 |
217 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':getIam
Policy'; | 209 _url = 'v1/' + |
| 210 commons.Escaper.ecapeVariableReserved('$resource') + |
| 211 ':getIamPolicy'; |
218 | 212 |
219 var _response = _requester.request(_url, | 213 var _response = _requester.request(_url, "GET", |
220 "GET", | 214 body: _body, |
221 body: _body, | 215 queryParams: _queryParams, |
222 queryParams: _queryParams, | 216 uploadOptions: _uploadOptions, |
223 uploadOptions: _uploadOptions, | 217 uploadMedia: _uploadMedia, |
224 uploadMedia: _uploadMedia, | 218 downloadOptions: _downloadOptions); |
225 downloadOptions: _downloadOptions); | |
226 return _response.then((data) => new Policy.fromJson(data)); | 219 return _response.then((data) => new Policy.fromJson(data)); |
227 } | 220 } |
228 | 221 |
229 /** | 222 /// Returns all repos belonging to a project. The sizes of the repos are |
230 * Returns all repos belonging to a project. The sizes of the repos are | 223 /// not set by ListRepos. To get the size of a repo, use GetRepo. |
231 * not set by ListRepos. To get the size of a repo, use GetRepo. | 224 /// |
232 * | 225 /// Request parameters: |
233 * Request parameters: | 226 /// |
234 * | 227 /// [name] - The project ID whose repos should be listed. Values are of the |
235 * [name] - The project ID whose repos should be listed. Values are of the | 228 /// form |
236 * form | 229 /// `projects/<project>`. |
237 * `projects/<project>`. | 230 /// Value must have pattern "^projects/[^/]+$". |
238 * Value must have pattern "^projects/[^/]+$". | 231 /// |
239 * | 232 /// [pageToken] - Resume listing repositories where a prior ListReposResponse |
240 * [pageToken] - Resume listing repositories where a prior ListReposResponse | 233 /// left off. This is an opaque token that must be obtained from |
241 * left off. This is an opaque token that must be obtained from | 234 /// a recent, prior ListReposResponse's next_page_token field. |
242 * a recent, prior ListReposResponse's next_page_token field. | 235 /// |
243 * | 236 /// [pageSize] - Maximum number of repositories to return; between 1 and 500. |
244 * [pageSize] - Maximum number of repositories to return; between 1 and 500. | 237 /// If not set or zero, defaults to 100 at the server. |
245 * If not set or zero, defaults to 100 at the server. | 238 /// |
246 * | 239 /// Completes with a [ListReposResponse]. |
247 * Completes with a [ListReposResponse]. | 240 /// |
248 * | 241 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
249 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 242 /// an error. |
250 * error. | 243 /// |
251 * | 244 /// If the used [http.Client] completes with an error when making a REST |
252 * If the used [http.Client] completes with an error when making a REST call, | 245 /// call, this method will complete with the same error. |
253 * this method will complete with the same error. | 246 async.Future<ListReposResponse> list(core.String name, |
254 */ | 247 {core.String pageToken, core.int pageSize}) { |
255 async.Future<ListReposResponse> list(core.String name, {core.String pageToken,
core.int pageSize}) { | |
256 var _url = null; | 248 var _url = null; |
257 var _queryParams = new core.Map(); | 249 var _queryParams = new core.Map(); |
258 var _uploadMedia = null; | 250 var _uploadMedia = null; |
259 var _uploadOptions = null; | 251 var _uploadOptions = null; |
260 var _downloadOptions = commons.DownloadOptions.Metadata; | 252 var _downloadOptions = commons.DownloadOptions.Metadata; |
261 var _body = null; | 253 var _body = null; |
262 | 254 |
263 if (name == null) { | 255 if (name == null) { |
264 throw new core.ArgumentError("Parameter name is required."); | 256 throw new core.ArgumentError("Parameter name is required."); |
265 } | 257 } |
266 if (pageToken != null) { | 258 if (pageToken != null) { |
267 _queryParams["pageToken"] = [pageToken]; | 259 _queryParams["pageToken"] = [pageToken]; |
268 } | 260 } |
269 if (pageSize != null) { | 261 if (pageSize != null) { |
270 _queryParams["pageSize"] = ["${pageSize}"]; | 262 _queryParams["pageSize"] = ["${pageSize}"]; |
271 } | 263 } |
272 | 264 |
273 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name') + '/repos'; | 265 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name') + '/repos'; |
274 | 266 |
275 var _response = _requester.request(_url, | 267 var _response = _requester.request(_url, "GET", |
276 "GET", | 268 body: _body, |
277 body: _body, | 269 queryParams: _queryParams, |
278 queryParams: _queryParams, | 270 uploadOptions: _uploadOptions, |
279 uploadOptions: _uploadOptions, | 271 uploadMedia: _uploadMedia, |
280 uploadMedia: _uploadMedia, | 272 downloadOptions: _downloadOptions); |
281 downloadOptions: _downloadOptions); | |
282 return _response.then((data) => new ListReposResponse.fromJson(data)); | 273 return _response.then((data) => new ListReposResponse.fromJson(data)); |
283 } | 274 } |
284 | 275 |
285 /** | 276 /// Sets the access control policy on the specified resource. Replaces any |
286 * Sets the access control policy on the specified resource. Replaces any | 277 /// existing policy. |
287 * existing policy. | 278 /// |
288 * | 279 /// [request] - The metadata request object. |
289 * [request] - The metadata request object. | 280 /// |
290 * | 281 /// Request parameters: |
291 * Request parameters: | 282 /// |
292 * | 283 /// [resource] - REQUIRED: The resource for which the policy is being |
293 * [resource] - REQUIRED: The resource for which the policy is being | 284 /// specified. |
294 * specified. | 285 /// See the operation documentation for the appropriate value for this field. |
295 * See the operation documentation for the appropriate value for this field. | 286 /// Value must have pattern "^projects/[^/]+/repos/.+$". |
296 * Value must have pattern "^projects/[^/]+/repos/.+$". | 287 /// |
297 * | 288 /// Completes with a [Policy]. |
298 * Completes with a [Policy]. | 289 /// |
299 * | 290 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
300 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 291 /// an error. |
301 * error. | 292 /// |
302 * | 293 /// If the used [http.Client] completes with an error when making a REST |
303 * If the used [http.Client] completes with an error when making a REST call, | 294 /// call, this method will complete with the same error. |
304 * this method will complete with the same error. | 295 async.Future<Policy> setIamPolicy( |
305 */ | 296 SetIamPolicyRequest request, core.String resource) { |
306 async.Future<Policy> setIamPolicy(SetIamPolicyRequest request, core.String res
ource) { | |
307 var _url = null; | 297 var _url = null; |
308 var _queryParams = new core.Map(); | 298 var _queryParams = new core.Map(); |
309 var _uploadMedia = null; | 299 var _uploadMedia = null; |
310 var _uploadOptions = null; | 300 var _uploadOptions = null; |
311 var _downloadOptions = commons.DownloadOptions.Metadata; | 301 var _downloadOptions = commons.DownloadOptions.Metadata; |
312 var _body = null; | 302 var _body = null; |
313 | 303 |
314 if (request != null) { | 304 if (request != null) { |
315 _body = convert.JSON.encode((request).toJson()); | 305 _body = convert.JSON.encode((request).toJson()); |
316 } | 306 } |
317 if (resource == null) { | 307 if (resource == null) { |
318 throw new core.ArgumentError("Parameter resource is required."); | 308 throw new core.ArgumentError("Parameter resource is required."); |
319 } | 309 } |
320 | 310 |
321 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':setIam
Policy'; | 311 _url = 'v1/' + |
| 312 commons.Escaper.ecapeVariableReserved('$resource') + |
| 313 ':setIamPolicy'; |
322 | 314 |
323 var _response = _requester.request(_url, | 315 var _response = _requester.request(_url, "POST", |
324 "POST", | 316 body: _body, |
325 body: _body, | 317 queryParams: _queryParams, |
326 queryParams: _queryParams, | 318 uploadOptions: _uploadOptions, |
327 uploadOptions: _uploadOptions, | 319 uploadMedia: _uploadMedia, |
328 uploadMedia: _uploadMedia, | 320 downloadOptions: _downloadOptions); |
329 downloadOptions: _downloadOptions); | |
330 return _response.then((data) => new Policy.fromJson(data)); | 321 return _response.then((data) => new Policy.fromJson(data)); |
331 } | 322 } |
332 | 323 |
333 /** | 324 /// Returns permissions that a caller has on the specified resource. |
334 * Returns permissions that a caller has on the specified resource. | 325 /// If the resource does not exist, this will return an empty set of |
335 * If the resource does not exist, this will return an empty set of | 326 /// permissions, not a NOT_FOUND error. |
336 * permissions, not a NOT_FOUND error. | 327 /// |
337 * | 328 /// [request] - The metadata request object. |
338 * [request] - The metadata request object. | 329 /// |
339 * | 330 /// Request parameters: |
340 * Request parameters: | 331 /// |
341 * | 332 /// [resource] - REQUIRED: The resource for which the policy detail is being |
342 * [resource] - REQUIRED: The resource for which the policy detail is being | 333 /// requested. |
343 * requested. | 334 /// See the operation documentation for the appropriate value for this field. |
344 * See the operation documentation for the appropriate value for this field. | 335 /// Value must have pattern "^projects/[^/]+/repos/.+$". |
345 * Value must have pattern "^projects/[^/]+/repos/.+$". | 336 /// |
346 * | 337 /// Completes with a [TestIamPermissionsResponse]. |
347 * Completes with a [TestIamPermissionsResponse]. | 338 /// |
348 * | 339 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
349 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 340 /// an error. |
350 * error. | 341 /// |
351 * | 342 /// If the used [http.Client] completes with an error when making a REST |
352 * If the used [http.Client] completes with an error when making a REST call, | 343 /// call, this method will complete with the same error. |
353 * this method will complete with the same error. | 344 async.Future<TestIamPermissionsResponse> testIamPermissions( |
354 */ | 345 TestIamPermissionsRequest request, core.String resource) { |
355 async.Future<TestIamPermissionsResponse> testIamPermissions(TestIamPermissions
Request request, core.String resource) { | |
356 var _url = null; | 346 var _url = null; |
357 var _queryParams = new core.Map(); | 347 var _queryParams = new core.Map(); |
358 var _uploadMedia = null; | 348 var _uploadMedia = null; |
359 var _uploadOptions = null; | 349 var _uploadOptions = null; |
360 var _downloadOptions = commons.DownloadOptions.Metadata; | 350 var _downloadOptions = commons.DownloadOptions.Metadata; |
361 var _body = null; | 351 var _body = null; |
362 | 352 |
363 if (request != null) { | 353 if (request != null) { |
364 _body = convert.JSON.encode((request).toJson()); | 354 _body = convert.JSON.encode((request).toJson()); |
365 } | 355 } |
366 if (resource == null) { | 356 if (resource == null) { |
367 throw new core.ArgumentError("Parameter resource is required."); | 357 throw new core.ArgumentError("Parameter resource is required."); |
368 } | 358 } |
369 | 359 |
370 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':testIa
mPermissions'; | 360 _url = 'v1/' + |
| 361 commons.Escaper.ecapeVariableReserved('$resource') + |
| 362 ':testIamPermissions'; |
371 | 363 |
372 var _response = _requester.request(_url, | 364 var _response = _requester.request(_url, "POST", |
373 "POST", | 365 body: _body, |
374 body: _body, | 366 queryParams: _queryParams, |
375 queryParams: _queryParams, | 367 uploadOptions: _uploadOptions, |
376 uploadOptions: _uploadOptions, | 368 uploadMedia: _uploadMedia, |
377 uploadMedia: _uploadMedia, | 369 downloadOptions: _downloadOptions); |
378 downloadOptions: _downloadOptions); | 370 return _response |
379 return _response.then((data) => new TestIamPermissionsResponse.fromJson(data
)); | 371 .then((data) => new TestIamPermissionsResponse.fromJson(data)); |
380 } | 372 } |
381 | |
382 } | 373 } |
383 | 374 |
384 | 375 /// Specifies the audit configuration for a service. |
385 | 376 /// The configuration determines which permission types are logged, and what |
386 /** | 377 /// identities, if any, are exempted from logging. |
387 * Specifies the audit configuration for a service. | 378 /// An AuditConfig must have one or more AuditLogConfigs. |
388 * The configuration determines which permission types are logged, and what | 379 /// |
389 * identities, if any, are exempted from logging. | 380 /// If there are AuditConfigs for both `allServices` and a specific service, |
390 * An AuditConfig must have one or more AuditLogConfigs. | 381 /// the union of the two AuditConfigs is used for that service: the log_types |
391 * | 382 /// specified in each AuditConfig are enabled, and the exempted_members in each |
392 * If there are AuditConfigs for both `allServices` and a specific service, | 383 /// AuditConfig are exempted. |
393 * the union of the two AuditConfigs is used for that service: the log_types | 384 /// |
394 * specified in each AuditConfig are enabled, and the exempted_members in each | 385 /// Example Policy with multiple AuditConfigs: |
395 * AuditConfig are exempted. | 386 /// |
396 * | 387 /// { |
397 * Example Policy with multiple AuditConfigs: | 388 /// "audit_configs": [ |
398 * | 389 /// { |
399 * { | 390 /// "service": "allServices" |
400 * "audit_configs": [ | 391 /// "audit_log_configs": [ |
401 * { | 392 /// { |
402 * "service": "allServices" | 393 /// "log_type": "DATA_READ", |
403 * "audit_log_configs": [ | 394 /// "exempted_members": [ |
404 * { | 395 /// "user:foo@gmail.com" |
405 * "log_type": "DATA_READ", | 396 /// ] |
406 * "exempted_members": [ | 397 /// }, |
407 * "user:foo@gmail.com" | 398 /// { |
408 * ] | 399 /// "log_type": "DATA_WRITE", |
409 * }, | 400 /// }, |
410 * { | 401 /// { |
411 * "log_type": "DATA_WRITE", | 402 /// "log_type": "ADMIN_READ", |
412 * }, | 403 /// } |
413 * { | 404 /// ] |
414 * "log_type": "ADMIN_READ", | 405 /// }, |
415 * } | 406 /// { |
416 * ] | 407 /// "service": "fooservice.googleapis.com" |
417 * }, | 408 /// "audit_log_configs": [ |
418 * { | 409 /// { |
419 * "service": "fooservice.googleapis.com" | 410 /// "log_type": "DATA_READ", |
420 * "audit_log_configs": [ | 411 /// }, |
421 * { | 412 /// { |
422 * "log_type": "DATA_READ", | 413 /// "log_type": "DATA_WRITE", |
423 * }, | 414 /// "exempted_members": [ |
424 * { | 415 /// "user:bar@gmail.com" |
425 * "log_type": "DATA_WRITE", | 416 /// ] |
426 * "exempted_members": [ | 417 /// } |
427 * "user:bar@gmail.com" | 418 /// ] |
428 * ] | 419 /// } |
429 * } | 420 /// ] |
430 * ] | 421 /// } |
431 * } | 422 /// |
432 * ] | 423 /// For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ |
433 * } | 424 /// logging. It also exempts foo@gmail.com from DATA_READ logging, and |
434 * | 425 /// bar@gmail.com from DATA_WRITE logging. |
435 * For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ | |
436 * logging. It also exempts foo@gmail.com from DATA_READ logging, and | |
437 * bar@gmail.com from DATA_WRITE logging. | |
438 */ | |
439 class AuditConfig { | 426 class AuditConfig { |
440 /** | 427 /// The configuration for logging of each type of permission. |
441 * The configuration for logging of each type of permission. | 428 /// Next ID: 4 |
442 * Next ID: 4 | |
443 */ | |
444 core.List<AuditLogConfig> auditLogConfigs; | 429 core.List<AuditLogConfig> auditLogConfigs; |
445 core.List<core.String> exemptedMembers; | 430 core.List<core.String> exemptedMembers; |
446 /** | 431 |
447 * Specifies a service that will be enabled for audit logging. | 432 /// Specifies a service that will be enabled for audit logging. |
448 * For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. | 433 /// For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. |
449 * `allServices` is a special value that covers all services. | 434 /// `allServices` is a special value that covers all services. |
450 */ | |
451 core.String service; | 435 core.String service; |
452 | 436 |
453 AuditConfig(); | 437 AuditConfig(); |
454 | 438 |
455 AuditConfig.fromJson(core.Map _json) { | 439 AuditConfig.fromJson(core.Map _json) { |
456 if (_json.containsKey("auditLogConfigs")) { | 440 if (_json.containsKey("auditLogConfigs")) { |
457 auditLogConfigs = _json["auditLogConfigs"].map((value) => new AuditLogConf
ig.fromJson(value)).toList(); | 441 auditLogConfigs = _json["auditLogConfigs"] |
| 442 .map((value) => new AuditLogConfig.fromJson(value)) |
| 443 .toList(); |
458 } | 444 } |
459 if (_json.containsKey("exemptedMembers")) { | 445 if (_json.containsKey("exemptedMembers")) { |
460 exemptedMembers = _json["exemptedMembers"]; | 446 exemptedMembers = _json["exemptedMembers"]; |
461 } | 447 } |
462 if (_json.containsKey("service")) { | 448 if (_json.containsKey("service")) { |
463 service = _json["service"]; | 449 service = _json["service"]; |
464 } | 450 } |
465 } | 451 } |
466 | 452 |
467 core.Map<core.String, core.Object> toJson() { | 453 core.Map<core.String, core.Object> toJson() { |
468 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 454 final core.Map<core.String, core.Object> _json = |
| 455 new core.Map<core.String, core.Object>(); |
469 if (auditLogConfigs != null) { | 456 if (auditLogConfigs != null) { |
470 _json["auditLogConfigs"] = auditLogConfigs.map((value) => (value).toJson()
).toList(); | 457 _json["auditLogConfigs"] = |
| 458 auditLogConfigs.map((value) => (value).toJson()).toList(); |
471 } | 459 } |
472 if (exemptedMembers != null) { | 460 if (exemptedMembers != null) { |
473 _json["exemptedMembers"] = exemptedMembers; | 461 _json["exemptedMembers"] = exemptedMembers; |
474 } | 462 } |
475 if (service != null) { | 463 if (service != null) { |
476 _json["service"] = service; | 464 _json["service"] = service; |
477 } | 465 } |
478 return _json; | 466 return _json; |
479 } | 467 } |
480 } | 468 } |
481 | 469 |
482 /** | 470 /// Provides the configuration for logging a type of permissions. |
483 * Provides the configuration for logging a type of permissions. | 471 /// Example: |
484 * Example: | 472 /// |
485 * | 473 /// { |
486 * { | 474 /// "audit_log_configs": [ |
487 * "audit_log_configs": [ | 475 /// { |
488 * { | 476 /// "log_type": "DATA_READ", |
489 * "log_type": "DATA_READ", | 477 /// "exempted_members": [ |
490 * "exempted_members": [ | 478 /// "user:foo@gmail.com" |
491 * "user:foo@gmail.com" | 479 /// ] |
492 * ] | 480 /// }, |
493 * }, | 481 /// { |
494 * { | 482 /// "log_type": "DATA_WRITE", |
495 * "log_type": "DATA_WRITE", | 483 /// } |
496 * } | 484 /// ] |
497 * ] | 485 /// } |
498 * } | 486 /// |
499 * | 487 /// This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting |
500 * This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting | 488 /// foo@gmail.com from DATA_READ logging. |
501 * foo@gmail.com from DATA_READ logging. | |
502 */ | |
503 class AuditLogConfig { | 489 class AuditLogConfig { |
504 /** | 490 /// Specifies the identities that do not cause logging for this type of |
505 * Specifies the identities that do not cause logging for this type of | 491 /// permission. |
506 * permission. | 492 /// Follows the same format of Binding.members. |
507 * Follows the same format of Binding.members. | |
508 */ | |
509 core.List<core.String> exemptedMembers; | 493 core.List<core.String> exemptedMembers; |
510 /** | 494 |
511 * The log type that this config enables. | 495 /// The log type that this config enables. |
512 * Possible string values are: | 496 /// Possible string values are: |
513 * - "LOG_TYPE_UNSPECIFIED" : Default case. Should never be this. | 497 /// - "LOG_TYPE_UNSPECIFIED" : Default case. Should never be this. |
514 * - "ADMIN_READ" : Admin reads. Example: CloudIAM getIamPolicy | 498 /// - "ADMIN_READ" : Admin reads. Example: CloudIAM getIamPolicy |
515 * - "DATA_WRITE" : Data writes. Example: CloudSQL Users create | 499 /// - "DATA_WRITE" : Data writes. Example: CloudSQL Users create |
516 * - "DATA_READ" : Data reads. Example: CloudSQL Users list | 500 /// - "DATA_READ" : Data reads. Example: CloudSQL Users list |
517 */ | |
518 core.String logType; | 501 core.String logType; |
519 | 502 |
520 AuditLogConfig(); | 503 AuditLogConfig(); |
521 | 504 |
522 AuditLogConfig.fromJson(core.Map _json) { | 505 AuditLogConfig.fromJson(core.Map _json) { |
523 if (_json.containsKey("exemptedMembers")) { | 506 if (_json.containsKey("exemptedMembers")) { |
524 exemptedMembers = _json["exemptedMembers"]; | 507 exemptedMembers = _json["exemptedMembers"]; |
525 } | 508 } |
526 if (_json.containsKey("logType")) { | 509 if (_json.containsKey("logType")) { |
527 logType = _json["logType"]; | 510 logType = _json["logType"]; |
528 } | 511 } |
529 } | 512 } |
530 | 513 |
531 core.Map<core.String, core.Object> toJson() { | 514 core.Map<core.String, core.Object> toJson() { |
532 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 515 final core.Map<core.String, core.Object> _json = |
| 516 new core.Map<core.String, core.Object>(); |
533 if (exemptedMembers != null) { | 517 if (exemptedMembers != null) { |
534 _json["exemptedMembers"] = exemptedMembers; | 518 _json["exemptedMembers"] = exemptedMembers; |
535 } | 519 } |
536 if (logType != null) { | 520 if (logType != null) { |
537 _json["logType"] = logType; | 521 _json["logType"] = logType; |
538 } | 522 } |
539 return _json; | 523 return _json; |
540 } | 524 } |
541 } | 525 } |
542 | 526 |
543 /** Associates `members` with a `role`. */ | 527 /// Associates `members` with a `role`. |
544 class Binding { | 528 class Binding { |
545 /** | 529 /// Specifies the identities requesting access for a Cloud Platform resource. |
546 * Specifies the identities requesting access for a Cloud Platform resource. | 530 /// `members` can have the following values: |
547 * `members` can have the following values: | 531 /// |
548 * | 532 /// * `allUsers`: A special identifier that represents anyone who is |
549 * * `allUsers`: A special identifier that represents anyone who is | 533 /// on the internet; with or without a Google account. |
550 * on the internet; with or without a Google account. | 534 /// |
551 * | 535 /// * `allAuthenticatedUsers`: A special identifier that represents anyone |
552 * * `allAuthenticatedUsers`: A special identifier that represents anyone | 536 /// who is authenticated with a Google account or a service account. |
553 * who is authenticated with a Google account or a service account. | 537 /// |
554 * | 538 /// * `user:{emailid}`: An email address that represents a specific Google |
555 * * `user:{emailid}`: An email address that represents a specific Google | 539 /// account. For example, `alice@gmail.com` or `joe@example.com`. |
556 * account. For example, `alice@gmail.com` or `joe@example.com`. | 540 /// |
557 * | 541 /// |
558 * | 542 /// * `serviceAccount:{emailid}`: An email address that represents a service |
559 * * `serviceAccount:{emailid}`: An email address that represents a service | 543 /// account. For example, `my-other-app@appspot.gserviceaccount.com`. |
560 * account. For example, `my-other-app@appspot.gserviceaccount.com`. | 544 /// |
561 * | 545 /// * `group:{emailid}`: An email address that represents a Google group. |
562 * * `group:{emailid}`: An email address that represents a Google group. | 546 /// For example, `admins@example.com`. |
563 * For example, `admins@example.com`. | 547 /// |
564 * | 548 /// |
565 * | 549 /// * `domain:{domain}`: A Google Apps domain name that represents all the |
566 * * `domain:{domain}`: A Google Apps domain name that represents all the | 550 /// users of that domain. For example, `google.com` or `example.com`. |
567 * users of that domain. For example, `google.com` or `example.com`. | |
568 */ | |
569 core.List<core.String> members; | 551 core.List<core.String> members; |
570 /** | 552 |
571 * Role that is assigned to `members`. | 553 /// Role that is assigned to `members`. |
572 * For example, `roles/viewer`, `roles/editor`, or `roles/owner`. | 554 /// For example, `roles/viewer`, `roles/editor`, or `roles/owner`. |
573 * Required | 555 /// Required |
574 */ | |
575 core.String role; | 556 core.String role; |
576 | 557 |
577 Binding(); | 558 Binding(); |
578 | 559 |
579 Binding.fromJson(core.Map _json) { | 560 Binding.fromJson(core.Map _json) { |
580 if (_json.containsKey("members")) { | 561 if (_json.containsKey("members")) { |
581 members = _json["members"]; | 562 members = _json["members"]; |
582 } | 563 } |
583 if (_json.containsKey("role")) { | 564 if (_json.containsKey("role")) { |
584 role = _json["role"]; | 565 role = _json["role"]; |
585 } | 566 } |
586 } | 567 } |
587 | 568 |
588 core.Map<core.String, core.Object> toJson() { | 569 core.Map<core.String, core.Object> toJson() { |
589 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 570 final core.Map<core.String, core.Object> _json = |
| 571 new core.Map<core.String, core.Object>(); |
590 if (members != null) { | 572 if (members != null) { |
591 _json["members"] = members; | 573 _json["members"] = members; |
592 } | 574 } |
593 if (role != null) { | 575 if (role != null) { |
594 _json["role"] = role; | 576 _json["role"] = role; |
595 } | 577 } |
596 return _json; | 578 return _json; |
597 } | 579 } |
598 } | 580 } |
599 | 581 |
600 /** Write a Cloud Audit log */ | 582 /// Write a Cloud Audit log |
601 class CloudAuditOptions { | 583 class CloudAuditOptions { |
602 /** | 584 /// The log_name to populate in the Cloud Audit Record. |
603 * The log_name to populate in the Cloud Audit Record. | 585 /// Possible string values are: |
604 * Possible string values are: | 586 /// - "UNSPECIFIED_LOG_NAME" : Default. Should not be used. |
605 * - "UNSPECIFIED_LOG_NAME" : Default. Should not be used. | 587 /// - "ADMIN_ACTIVITY" : Corresponds to "cloudaudit.googleapis.com/activity" |
606 * - "ADMIN_ACTIVITY" : Corresponds to "cloudaudit.googleapis.com/activity" | 588 /// - "DATA_ACCESS" : Corresponds to "cloudaudit.googleapis.com/data_access" |
607 * - "DATA_ACCESS" : Corresponds to "cloudaudit.googleapis.com/data_access" | |
608 */ | |
609 core.String logName; | 589 core.String logName; |
610 | 590 |
611 CloudAuditOptions(); | 591 CloudAuditOptions(); |
612 | 592 |
613 CloudAuditOptions.fromJson(core.Map _json) { | 593 CloudAuditOptions.fromJson(core.Map _json) { |
614 if (_json.containsKey("logName")) { | 594 if (_json.containsKey("logName")) { |
615 logName = _json["logName"]; | 595 logName = _json["logName"]; |
616 } | 596 } |
617 } | 597 } |
618 | 598 |
619 core.Map<core.String, core.Object> toJson() { | 599 core.Map<core.String, core.Object> toJson() { |
620 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 600 final core.Map<core.String, core.Object> _json = |
| 601 new core.Map<core.String, core.Object>(); |
621 if (logName != null) { | 602 if (logName != null) { |
622 _json["logName"] = logName; | 603 _json["logName"] = logName; |
623 } | 604 } |
624 return _json; | 605 return _json; |
625 } | 606 } |
626 } | 607 } |
627 | 608 |
628 /** A condition to be met. */ | 609 /// A condition to be met. |
629 class Condition { | 610 class Condition { |
630 /** | 611 /// Trusted attributes supplied by the IAM system. |
631 * Trusted attributes supplied by the IAM system. | 612 /// Possible string values are: |
632 * Possible string values are: | 613 /// - "NO_ATTR" : Default non-attribute. |
633 * - "NO_ATTR" : Default non-attribute. | 614 /// - "AUTHORITY" : Either principal or (if present) authority selector. |
634 * - "AUTHORITY" : Either principal or (if present) authority selector. | 615 /// - "ATTRIBUTION" : The principal (even if an authority selector is |
635 * - "ATTRIBUTION" : The principal (even if an authority selector is present), | 616 /// present), which |
636 * which | 617 /// must only be used for attribution, not authorization. |
637 * must only be used for attribution, not authorization. | 618 /// - "APPROVER" : An approver (distinct from the requester) that has |
638 * - "APPROVER" : An approver (distinct from the requester) that has | 619 /// authorized this |
639 * authorized this | 620 /// request. |
640 * request. | 621 /// When used with IN, the condition indicates that one of the approvers |
641 * When used with IN, the condition indicates that one of the approvers | 622 /// associated with the request matches the specified principal, or is a |
642 * associated with the request matches the specified principal, or is a | 623 /// member of the specified group. Approvers can only grant additional |
643 * member of the specified group. Approvers can only grant additional | 624 /// access, and are thus only used in a strictly positive context |
644 * access, and are thus only used in a strictly positive context | 625 /// (e.g. ALLOW/IN or DENY/NOT_IN). |
645 * (e.g. ALLOW/IN or DENY/NOT_IN). | 626 /// See: go/rpc-security-policy-dynamicauth. |
646 * See: go/rpc-security-policy-dynamicauth. | 627 /// - "JUSTIFICATION_TYPE" : What types of justifications have been supplied |
647 * - "JUSTIFICATION_TYPE" : What types of justifications have been supplied | 628 /// with this request. |
648 * with this request. | 629 /// String values should match enum names from tech.iam.JustificationType, |
649 * String values should match enum names from tech.iam.JustificationType, | 630 /// e.g. "MANUAL_STRING". It is not permitted to grant access based on |
650 * e.g. "MANUAL_STRING". It is not permitted to grant access based on | 631 /// the *absence* of a justification, so justification conditions can only |
651 * the *absence* of a justification, so justification conditions can only | 632 /// be used in a "positive" context (e.g., ALLOW/IN or DENY/NOT_IN). |
652 * be used in a "positive" context (e.g., ALLOW/IN or DENY/NOT_IN). | 633 /// |
653 * | 634 /// Multiple justifications, e.g., a Buganizer ID and a manually-entered |
654 * Multiple justifications, e.g., a Buganizer ID and a manually-entered | 635 /// reason, are normal and supported. |
655 * reason, are normal and supported. | |
656 */ | |
657 core.String iam; | 636 core.String iam; |
658 /** | 637 |
659 * An operator to apply the subject with. | 638 /// An operator to apply the subject with. |
660 * Possible string values are: | 639 /// Possible string values are: |
661 * - "NO_OP" : Default no-op. | 640 /// - "NO_OP" : Default no-op. |
662 * - "EQUALS" : DEPRECATED. Use IN instead. | 641 /// - "EQUALS" : DEPRECATED. Use IN instead. |
663 * - "NOT_EQUALS" : DEPRECATED. Use NOT_IN instead. | 642 /// - "NOT_EQUALS" : DEPRECATED. Use NOT_IN instead. |
664 * - "IN" : The condition is true if the subject (or any element of it if it | 643 /// - "IN" : The condition is true if the subject (or any element of it if it |
665 * is | 644 /// is |
666 * a set) matches any of the supplied values. | 645 /// a set) matches any of the supplied values. |
667 * - "NOT_IN" : The condition is true if the subject (or every element of it | 646 /// - "NOT_IN" : The condition is true if the subject (or every element of it |
668 * if it is | 647 /// if it is |
669 * a set) matches none of the supplied values. | 648 /// a set) matches none of the supplied values. |
670 * - "DISCHARGED" : Subject is discharged | 649 /// - "DISCHARGED" : Subject is discharged |
671 */ | |
672 core.String op; | 650 core.String op; |
673 /** Trusted attributes discharged by the service. */ | 651 |
| 652 /// Trusted attributes discharged by the service. |
674 core.String svc; | 653 core.String svc; |
675 /** | 654 |
676 * Trusted attributes supplied by any service that owns resources and uses | 655 /// Trusted attributes supplied by any service that owns resources and uses |
677 * the IAM system for access control. | 656 /// the IAM system for access control. |
678 * Possible string values are: | 657 /// Possible string values are: |
679 * - "NO_ATTR" : Default non-attribute type | 658 /// - "NO_ATTR" : Default non-attribute type |
680 * - "REGION" : Region of the resource | 659 /// - "REGION" : Region of the resource |
681 * - "SERVICE" : Service name | 660 /// - "SERVICE" : Service name |
682 * - "NAME" : Resource name | 661 /// - "NAME" : Resource name |
683 * - "IP" : IP address of the caller | 662 /// - "IP" : IP address of the caller |
684 */ | |
685 core.String sys; | 663 core.String sys; |
686 /** DEPRECATED. Use 'values' instead. */ | 664 |
| 665 /// DEPRECATED. Use 'values' instead. |
687 core.String value; | 666 core.String value; |
688 /** The objects of the condition. This is mutually exclusive with 'value'. */ | 667 |
| 668 /// The objects of the condition. This is mutually exclusive with 'value'. |
689 core.List<core.String> values; | 669 core.List<core.String> values; |
690 | 670 |
691 Condition(); | 671 Condition(); |
692 | 672 |
693 Condition.fromJson(core.Map _json) { | 673 Condition.fromJson(core.Map _json) { |
694 if (_json.containsKey("iam")) { | 674 if (_json.containsKey("iam")) { |
695 iam = _json["iam"]; | 675 iam = _json["iam"]; |
696 } | 676 } |
697 if (_json.containsKey("op")) { | 677 if (_json.containsKey("op")) { |
698 op = _json["op"]; | 678 op = _json["op"]; |
699 } | 679 } |
700 if (_json.containsKey("svc")) { | 680 if (_json.containsKey("svc")) { |
701 svc = _json["svc"]; | 681 svc = _json["svc"]; |
702 } | 682 } |
703 if (_json.containsKey("sys")) { | 683 if (_json.containsKey("sys")) { |
704 sys = _json["sys"]; | 684 sys = _json["sys"]; |
705 } | 685 } |
706 if (_json.containsKey("value")) { | 686 if (_json.containsKey("value")) { |
707 value = _json["value"]; | 687 value = _json["value"]; |
708 } | 688 } |
709 if (_json.containsKey("values")) { | 689 if (_json.containsKey("values")) { |
710 values = _json["values"]; | 690 values = _json["values"]; |
711 } | 691 } |
712 } | 692 } |
713 | 693 |
714 core.Map<core.String, core.Object> toJson() { | 694 core.Map<core.String, core.Object> toJson() { |
715 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 695 final core.Map<core.String, core.Object> _json = |
| 696 new core.Map<core.String, core.Object>(); |
716 if (iam != null) { | 697 if (iam != null) { |
717 _json["iam"] = iam; | 698 _json["iam"] = iam; |
718 } | 699 } |
719 if (op != null) { | 700 if (op != null) { |
720 _json["op"] = op; | 701 _json["op"] = op; |
721 } | 702 } |
722 if (svc != null) { | 703 if (svc != null) { |
723 _json["svc"] = svc; | 704 _json["svc"] = svc; |
724 } | 705 } |
725 if (sys != null) { | 706 if (sys != null) { |
726 _json["sys"] = sys; | 707 _json["sys"] = sys; |
727 } | 708 } |
728 if (value != null) { | 709 if (value != null) { |
729 _json["value"] = value; | 710 _json["value"] = value; |
730 } | 711 } |
731 if (values != null) { | 712 if (values != null) { |
732 _json["values"] = values; | 713 _json["values"] = values; |
733 } | 714 } |
734 return _json; | 715 return _json; |
735 } | 716 } |
736 } | 717 } |
737 | 718 |
738 /** Options for counters */ | 719 /// Options for counters |
739 class CounterOptions { | 720 class CounterOptions { |
740 /** The field value to attribute. */ | 721 /// The field value to attribute. |
741 core.String field; | 722 core.String field; |
742 /** The metric to update. */ | 723 |
| 724 /// The metric to update. |
743 core.String metric; | 725 core.String metric; |
744 | 726 |
745 CounterOptions(); | 727 CounterOptions(); |
746 | 728 |
747 CounterOptions.fromJson(core.Map _json) { | 729 CounterOptions.fromJson(core.Map _json) { |
748 if (_json.containsKey("field")) { | 730 if (_json.containsKey("field")) { |
749 field = _json["field"]; | 731 field = _json["field"]; |
750 } | 732 } |
751 if (_json.containsKey("metric")) { | 733 if (_json.containsKey("metric")) { |
752 metric = _json["metric"]; | 734 metric = _json["metric"]; |
753 } | 735 } |
754 } | 736 } |
755 | 737 |
756 core.Map<core.String, core.Object> toJson() { | 738 core.Map<core.String, core.Object> toJson() { |
757 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 739 final core.Map<core.String, core.Object> _json = |
| 740 new core.Map<core.String, core.Object>(); |
758 if (field != null) { | 741 if (field != null) { |
759 _json["field"] = field; | 742 _json["field"] = field; |
760 } | 743 } |
761 if (metric != null) { | 744 if (metric != null) { |
762 _json["metric"] = metric; | 745 _json["metric"] = metric; |
763 } | 746 } |
764 return _json; | 747 return _json; |
765 } | 748 } |
766 } | 749 } |
767 | 750 |
768 /** Write a Data Access (Gin) log */ | 751 /// Write a Data Access (Gin) log |
769 class DataAccessOptions { | 752 class DataAccessOptions { |
770 | |
771 DataAccessOptions(); | 753 DataAccessOptions(); |
772 | 754 |
773 DataAccessOptions.fromJson(core.Map _json) { | 755 DataAccessOptions.fromJson(core.Map _json) {} |
774 } | |
775 | 756 |
776 core.Map<core.String, core.Object> toJson() { | 757 core.Map<core.String, core.Object> toJson() { |
777 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 758 final core.Map<core.String, core.Object> _json = |
| 759 new core.Map<core.String, core.Object>(); |
778 return _json; | 760 return _json; |
779 } | 761 } |
780 } | 762 } |
781 | 763 |
782 /** | 764 /// A generic empty message that you can re-use to avoid defining duplicated |
783 * A generic empty message that you can re-use to avoid defining duplicated | 765 /// empty messages in your APIs. A typical example is to use it as the request |
784 * empty messages in your APIs. A typical example is to use it as the request | 766 /// or the response type of an API method. For instance: |
785 * or the response type of an API method. For instance: | 767 /// |
786 * | 768 /// service Foo { |
787 * service Foo { | 769 /// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); |
788 * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); | 770 /// } |
789 * } | 771 /// |
790 * | 772 /// The JSON representation for `Empty` is empty JSON object `{}`. |
791 * The JSON representation for `Empty` is empty JSON object `{}`. | |
792 */ | |
793 class Empty { | 773 class Empty { |
794 | |
795 Empty(); | 774 Empty(); |
796 | 775 |
797 Empty.fromJson(core.Map _json) { | 776 Empty.fromJson(core.Map _json) {} |
798 } | |
799 | 777 |
800 core.Map<core.String, core.Object> toJson() { | 778 core.Map<core.String, core.Object> toJson() { |
801 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 779 final core.Map<core.String, core.Object> _json = |
| 780 new core.Map<core.String, core.Object>(); |
802 return _json; | 781 return _json; |
803 } | 782 } |
804 } | 783 } |
805 | 784 |
806 /** | 785 /// Response for ListRepos. The size is not set in the returned repositories. |
807 * Response for ListRepos. The size is not set in the returned repositories. | |
808 */ | |
809 class ListReposResponse { | 786 class ListReposResponse { |
810 /** | 787 /// If non-empty, additional repositories exist within the project. These |
811 * If non-empty, additional repositories exist within the project. These | 788 /// can be retrieved by including this value in the next ListReposRequest's |
812 * can be retrieved by including this value in the next ListReposRequest's | 789 /// page_token field. |
813 * page_token field. | |
814 */ | |
815 core.String nextPageToken; | 790 core.String nextPageToken; |
816 /** The listed repos. */ | 791 |
| 792 /// The listed repos. |
817 core.List<Repo> repos; | 793 core.List<Repo> repos; |
818 | 794 |
819 ListReposResponse(); | 795 ListReposResponse(); |
820 | 796 |
821 ListReposResponse.fromJson(core.Map _json) { | 797 ListReposResponse.fromJson(core.Map _json) { |
822 if (_json.containsKey("nextPageToken")) { | 798 if (_json.containsKey("nextPageToken")) { |
823 nextPageToken = _json["nextPageToken"]; | 799 nextPageToken = _json["nextPageToken"]; |
824 } | 800 } |
825 if (_json.containsKey("repos")) { | 801 if (_json.containsKey("repos")) { |
826 repos = _json["repos"].map((value) => new Repo.fromJson(value)).toList(); | 802 repos = _json["repos"].map((value) => new Repo.fromJson(value)).toList(); |
827 } | 803 } |
828 } | 804 } |
829 | 805 |
830 core.Map<core.String, core.Object> toJson() { | 806 core.Map<core.String, core.Object> toJson() { |
831 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 807 final core.Map<core.String, core.Object> _json = |
| 808 new core.Map<core.String, core.Object>(); |
832 if (nextPageToken != null) { | 809 if (nextPageToken != null) { |
833 _json["nextPageToken"] = nextPageToken; | 810 _json["nextPageToken"] = nextPageToken; |
834 } | 811 } |
835 if (repos != null) { | 812 if (repos != null) { |
836 _json["repos"] = repos.map((value) => (value).toJson()).toList(); | 813 _json["repos"] = repos.map((value) => (value).toJson()).toList(); |
837 } | 814 } |
838 return _json; | 815 return _json; |
839 } | 816 } |
840 } | 817 } |
841 | 818 |
842 /** Specifies what kind of log the caller must write */ | 819 /// Specifies what kind of log the caller must write |
843 class LogConfig { | 820 class LogConfig { |
844 /** Cloud audit options. */ | 821 /// Cloud audit options. |
845 CloudAuditOptions cloudAudit; | 822 CloudAuditOptions cloudAudit; |
846 /** Counter options. */ | 823 |
| 824 /// Counter options. |
847 CounterOptions counter; | 825 CounterOptions counter; |
848 /** Data access options. */ | 826 |
| 827 /// Data access options. |
849 DataAccessOptions dataAccess; | 828 DataAccessOptions dataAccess; |
850 | 829 |
851 LogConfig(); | 830 LogConfig(); |
852 | 831 |
853 LogConfig.fromJson(core.Map _json) { | 832 LogConfig.fromJson(core.Map _json) { |
854 if (_json.containsKey("cloudAudit")) { | 833 if (_json.containsKey("cloudAudit")) { |
855 cloudAudit = new CloudAuditOptions.fromJson(_json["cloudAudit"]); | 834 cloudAudit = new CloudAuditOptions.fromJson(_json["cloudAudit"]); |
856 } | 835 } |
857 if (_json.containsKey("counter")) { | 836 if (_json.containsKey("counter")) { |
858 counter = new CounterOptions.fromJson(_json["counter"]); | 837 counter = new CounterOptions.fromJson(_json["counter"]); |
859 } | 838 } |
860 if (_json.containsKey("dataAccess")) { | 839 if (_json.containsKey("dataAccess")) { |
861 dataAccess = new DataAccessOptions.fromJson(_json["dataAccess"]); | 840 dataAccess = new DataAccessOptions.fromJson(_json["dataAccess"]); |
862 } | 841 } |
863 } | 842 } |
864 | 843 |
865 core.Map<core.String, core.Object> toJson() { | 844 core.Map<core.String, core.Object> toJson() { |
866 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 845 final core.Map<core.String, core.Object> _json = |
| 846 new core.Map<core.String, core.Object>(); |
867 if (cloudAudit != null) { | 847 if (cloudAudit != null) { |
868 _json["cloudAudit"] = (cloudAudit).toJson(); | 848 _json["cloudAudit"] = (cloudAudit).toJson(); |
869 } | 849 } |
870 if (counter != null) { | 850 if (counter != null) { |
871 _json["counter"] = (counter).toJson(); | 851 _json["counter"] = (counter).toJson(); |
872 } | 852 } |
873 if (dataAccess != null) { | 853 if (dataAccess != null) { |
874 _json["dataAccess"] = (dataAccess).toJson(); | 854 _json["dataAccess"] = (dataAccess).toJson(); |
875 } | 855 } |
876 return _json; | 856 return _json; |
877 } | 857 } |
878 } | 858 } |
879 | 859 |
880 /** | 860 /// Configuration to automatically mirror a repository from another |
881 * Configuration to automatically mirror a repository from another | 861 /// hosting service, for example GitHub or BitBucket. |
882 * hosting service, for example GitHub or BitBucket. | |
883 */ | |
884 class MirrorConfig { | 862 class MirrorConfig { |
885 /** | 863 /// ID of the SSH deploy key at the other hosting service. |
886 * ID of the SSH deploy key at the other hosting service. | 864 /// Removing this key from the other service would deauthorize |
887 * Removing this key from the other service would deauthorize | 865 /// Google Cloud Source Repositories from mirroring. |
888 * Google Cloud Source Repositories from mirroring. | |
889 */ | |
890 core.String deployKeyId; | 866 core.String deployKeyId; |
891 /** URL of the main repository at the other hosting service. */ | 867 |
| 868 /// URL of the main repository at the other hosting service. |
892 core.String url; | 869 core.String url; |
893 /** | 870 |
894 * ID of the webhook listening to updates to trigger mirroring. | 871 /// ID of the webhook listening to updates to trigger mirroring. |
895 * Removing this webook from the other hosting service will stop | 872 /// Removing this webook from the other hosting service will stop |
896 * Google Cloud Source Repositories from receiving notifications, | 873 /// Google Cloud Source Repositories from receiving notifications, |
897 * and thereby disabling mirroring. | 874 /// and thereby disabling mirroring. |
898 */ | |
899 core.String webhookId; | 875 core.String webhookId; |
900 | 876 |
901 MirrorConfig(); | 877 MirrorConfig(); |
902 | 878 |
903 MirrorConfig.fromJson(core.Map _json) { | 879 MirrorConfig.fromJson(core.Map _json) { |
904 if (_json.containsKey("deployKeyId")) { | 880 if (_json.containsKey("deployKeyId")) { |
905 deployKeyId = _json["deployKeyId"]; | 881 deployKeyId = _json["deployKeyId"]; |
906 } | 882 } |
907 if (_json.containsKey("url")) { | 883 if (_json.containsKey("url")) { |
908 url = _json["url"]; | 884 url = _json["url"]; |
909 } | 885 } |
910 if (_json.containsKey("webhookId")) { | 886 if (_json.containsKey("webhookId")) { |
911 webhookId = _json["webhookId"]; | 887 webhookId = _json["webhookId"]; |
912 } | 888 } |
913 } | 889 } |
914 | 890 |
915 core.Map<core.String, core.Object> toJson() { | 891 core.Map<core.String, core.Object> toJson() { |
916 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 892 final core.Map<core.String, core.Object> _json = |
| 893 new core.Map<core.String, core.Object>(); |
917 if (deployKeyId != null) { | 894 if (deployKeyId != null) { |
918 _json["deployKeyId"] = deployKeyId; | 895 _json["deployKeyId"] = deployKeyId; |
919 } | 896 } |
920 if (url != null) { | 897 if (url != null) { |
921 _json["url"] = url; | 898 _json["url"] = url; |
922 } | 899 } |
923 if (webhookId != null) { | 900 if (webhookId != null) { |
924 _json["webhookId"] = webhookId; | 901 _json["webhookId"] = webhookId; |
925 } | 902 } |
926 return _json; | 903 return _json; |
927 } | 904 } |
928 } | 905 } |
929 | 906 |
930 /** | 907 /// Defines an Identity and Access Management (IAM) policy. It is used to |
931 * Defines an Identity and Access Management (IAM) policy. It is used to | 908 /// specify access control policies for Cloud Platform resources. |
932 * specify access control policies for Cloud Platform resources. | 909 /// |
933 * | 910 /// |
934 * | 911 /// A `Policy` consists of a list of `bindings`. A `Binding` binds a list of |
935 * A `Policy` consists of a list of `bindings`. A `Binding` binds a list of | 912 /// `members` to a `role`, where the members can be user accounts, Google |
936 * `members` to a `role`, where the members can be user accounts, Google groups, | 913 /// groups, |
937 * Google domains, and service accounts. A `role` is a named list of permissions | 914 /// Google domains, and service accounts. A `role` is a named list of |
938 * defined by IAM. | 915 /// permissions |
939 * | 916 /// defined by IAM. |
940 * **Example** | 917 /// |
941 * | 918 /// **Example** |
942 * { | 919 /// |
943 * "bindings": [ | 920 /// { |
944 * { | 921 /// "bindings": [ |
945 * "role": "roles/owner", | 922 /// { |
946 * "members": [ | 923 /// "role": "roles/owner", |
947 * "user:mike@example.com", | 924 /// "members": [ |
948 * "group:admins@example.com", | 925 /// "user:mike@example.com", |
949 * "domain:google.com", | 926 /// "group:admins@example.com", |
950 * "serviceAccount:my-other-app@appspot.gserviceaccount.com", | 927 /// "domain:google.com", |
951 * ] | 928 /// "serviceAccount:my-other-app@appspot.gserviceaccount.com", |
952 * }, | 929 /// ] |
953 * { | 930 /// }, |
954 * "role": "roles/viewer", | 931 /// { |
955 * "members": ["user:sean@example.com"] | 932 /// "role": "roles/viewer", |
956 * } | 933 /// "members": ["user:sean@example.com"] |
957 * ] | 934 /// } |
958 * } | 935 /// ] |
959 * | 936 /// } |
960 * For a description of IAM and its features, see the | 937 /// |
961 * [IAM developer's guide](https://cloud.google.com/iam). | 938 /// For a description of IAM and its features, see the |
962 */ | 939 /// [IAM developer's guide](https://cloud.google.com/iam). |
963 class Policy { | 940 class Policy { |
964 /** Specifies cloud audit logging configuration for this policy. */ | 941 /// Specifies cloud audit logging configuration for this policy. |
965 core.List<AuditConfig> auditConfigs; | 942 core.List<AuditConfig> auditConfigs; |
966 /** | 943 |
967 * Associates a list of `members` to a `role`. | 944 /// Associates a list of `members` to a `role`. |
968 * Multiple `bindings` must not be specified for the same `role`. | 945 /// Multiple `bindings` must not be specified for the same `role`. |
969 * `bindings` with no members will result in an error. | 946 /// `bindings` with no members will result in an error. |
970 */ | |
971 core.List<Binding> bindings; | 947 core.List<Binding> bindings; |
972 /** | 948 |
973 * `etag` is used for optimistic concurrency control as a way to help | 949 /// `etag` is used for optimistic concurrency control as a way to help |
974 * prevent simultaneous updates of a policy from overwriting each other. | 950 /// prevent simultaneous updates of a policy from overwriting each other. |
975 * It is strongly suggested that systems make use of the `etag` in the | 951 /// It is strongly suggested that systems make use of the `etag` in the |
976 * read-modify-write cycle to perform policy updates in order to avoid race | 952 /// read-modify-write cycle to perform policy updates in order to avoid race |
977 * conditions: An `etag` is returned in the response to `getIamPolicy`, and | 953 /// conditions: An `etag` is returned in the response to `getIamPolicy`, and |
978 * systems are expected to put that etag in the request to `setIamPolicy` to | 954 /// systems are expected to put that etag in the request to `setIamPolicy` to |
979 * ensure that their change will be applied to the same version of the policy. | 955 /// ensure that their change will be applied to the same version of the |
980 * | 956 /// policy. |
981 * If no `etag` is provided in the call to `setIamPolicy`, then the existing | 957 /// |
982 * policy is overwritten blindly. | 958 /// If no `etag` is provided in the call to `setIamPolicy`, then the existing |
983 */ | 959 /// policy is overwritten blindly. |
984 core.String etag; | 960 core.String etag; |
985 core.List<core.int> get etagAsBytes { | 961 core.List<core.int> get etagAsBytes { |
986 return convert.BASE64.decode(etag); | 962 return convert.BASE64.decode(etag); |
987 } | 963 } |
988 | 964 |
989 void set etagAsBytes(core.List<core.int> _bytes) { | 965 void set etagAsBytes(core.List<core.int> _bytes) { |
990 etag = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-
"); | 966 etag = |
| 967 convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-"); |
991 } | 968 } |
| 969 |
992 core.bool iamOwned; | 970 core.bool iamOwned; |
993 /** | 971 |
994 * If more than one rule is specified, the rules are applied in the following | 972 /// If more than one rule is specified, the rules are applied in the |
995 * manner: | 973 /// following |
996 * - All matching LOG rules are always applied. | 974 /// manner: |
997 * - If any DENY/DENY_WITH_LOG rule matches, permission is denied. | 975 /// - All matching LOG rules are always applied. |
998 * Logging will be applied if one or more matching rule requires logging. | 976 /// - If any DENY/DENY_WITH_LOG rule matches, permission is denied. |
999 * - Otherwise, if any ALLOW/ALLOW_WITH_LOG rule matches, permission is | 977 /// Logging will be applied if one or more matching rule requires logging. |
1000 * granted. | 978 /// - Otherwise, if any ALLOW/ALLOW_WITH_LOG rule matches, permission is |
1001 * Logging will be applied if one or more matching rule requires logging. | 979 /// granted. |
1002 * - Otherwise, if no rule applies, permission is denied. | 980 /// Logging will be applied if one or more matching rule requires logging. |
1003 */ | 981 /// - Otherwise, if no rule applies, permission is denied. |
1004 core.List<Rule> rules; | 982 core.List<Rule> rules; |
1005 /** Version of the `Policy`. The default version is 0. */ | 983 |
| 984 /// Version of the `Policy`. The default version is 0. |
1006 core.int version; | 985 core.int version; |
1007 | 986 |
1008 Policy(); | 987 Policy(); |
1009 | 988 |
1010 Policy.fromJson(core.Map _json) { | 989 Policy.fromJson(core.Map _json) { |
1011 if (_json.containsKey("auditConfigs")) { | 990 if (_json.containsKey("auditConfigs")) { |
1012 auditConfigs = _json["auditConfigs"].map((value) => new AuditConfig.fromJs
on(value)).toList(); | 991 auditConfigs = _json["auditConfigs"] |
| 992 .map((value) => new AuditConfig.fromJson(value)) |
| 993 .toList(); |
1013 } | 994 } |
1014 if (_json.containsKey("bindings")) { | 995 if (_json.containsKey("bindings")) { |
1015 bindings = _json["bindings"].map((value) => new Binding.fromJson(value)).t
oList(); | 996 bindings = _json["bindings"] |
| 997 .map((value) => new Binding.fromJson(value)) |
| 998 .toList(); |
1016 } | 999 } |
1017 if (_json.containsKey("etag")) { | 1000 if (_json.containsKey("etag")) { |
1018 etag = _json["etag"]; | 1001 etag = _json["etag"]; |
1019 } | 1002 } |
1020 if (_json.containsKey("iamOwned")) { | 1003 if (_json.containsKey("iamOwned")) { |
1021 iamOwned = _json["iamOwned"]; | 1004 iamOwned = _json["iamOwned"]; |
1022 } | 1005 } |
1023 if (_json.containsKey("rules")) { | 1006 if (_json.containsKey("rules")) { |
1024 rules = _json["rules"].map((value) => new Rule.fromJson(value)).toList(); | 1007 rules = _json["rules"].map((value) => new Rule.fromJson(value)).toList(); |
1025 } | 1008 } |
1026 if (_json.containsKey("version")) { | 1009 if (_json.containsKey("version")) { |
1027 version = _json["version"]; | 1010 version = _json["version"]; |
1028 } | 1011 } |
1029 } | 1012 } |
1030 | 1013 |
1031 core.Map<core.String, core.Object> toJson() { | 1014 core.Map<core.String, core.Object> toJson() { |
1032 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1015 final core.Map<core.String, core.Object> _json = |
| 1016 new core.Map<core.String, core.Object>(); |
1033 if (auditConfigs != null) { | 1017 if (auditConfigs != null) { |
1034 _json["auditConfigs"] = auditConfigs.map((value) => (value).toJson()).toLi
st(); | 1018 _json["auditConfigs"] = |
| 1019 auditConfigs.map((value) => (value).toJson()).toList(); |
1035 } | 1020 } |
1036 if (bindings != null) { | 1021 if (bindings != null) { |
1037 _json["bindings"] = bindings.map((value) => (value).toJson()).toList(); | 1022 _json["bindings"] = bindings.map((value) => (value).toJson()).toList(); |
1038 } | 1023 } |
1039 if (etag != null) { | 1024 if (etag != null) { |
1040 _json["etag"] = etag; | 1025 _json["etag"] = etag; |
1041 } | 1026 } |
1042 if (iamOwned != null) { | 1027 if (iamOwned != null) { |
1043 _json["iamOwned"] = iamOwned; | 1028 _json["iamOwned"] = iamOwned; |
1044 } | 1029 } |
1045 if (rules != null) { | 1030 if (rules != null) { |
1046 _json["rules"] = rules.map((value) => (value).toJson()).toList(); | 1031 _json["rules"] = rules.map((value) => (value).toJson()).toList(); |
1047 } | 1032 } |
1048 if (version != null) { | 1033 if (version != null) { |
1049 _json["version"] = version; | 1034 _json["version"] = version; |
1050 } | 1035 } |
1051 return _json; | 1036 return _json; |
1052 } | 1037 } |
1053 } | 1038 } |
1054 | 1039 |
1055 /** | 1040 /// A repository (or repo) is a Git repository storing versioned source |
1056 * A repository (or repo) is a Git repository storing versioned source content. | 1041 /// content. |
1057 */ | |
1058 class Repo { | 1042 class Repo { |
1059 /** How this repository mirrors a repository managed by another service. */ | 1043 /// How this repository mirrors a repository managed by another service. |
1060 MirrorConfig mirrorConfig; | 1044 MirrorConfig mirrorConfig; |
1061 /** | 1045 |
1062 * Resource name of the repository, of the form | 1046 /// Resource name of the repository, of the form |
1063 * `projects/<project>/repos/<repo>`. The repo name may contain slashes. | 1047 /// `projects/<project>/repos/<repo>`. The repo name may contain slashes. |
1064 * eg, `projects/myproject/repos/name/with/slash` | 1048 /// eg, `projects/myproject/repos/name/with/slash` |
1065 */ | |
1066 core.String name; | 1049 core.String name; |
1067 /** | 1050 |
1068 * The disk usage of the repo, in bytes. | 1051 /// The disk usage of the repo, in bytes. |
1069 * Only returned by GetRepo. | 1052 /// Only returned by GetRepo. |
1070 */ | |
1071 core.String size; | 1053 core.String size; |
1072 /** URL to clone the repository from Google Cloud Source Repositories. */ | 1054 |
| 1055 /// URL to clone the repository from Google Cloud Source Repositories. |
1073 core.String url; | 1056 core.String url; |
1074 | 1057 |
1075 Repo(); | 1058 Repo(); |
1076 | 1059 |
1077 Repo.fromJson(core.Map _json) { | 1060 Repo.fromJson(core.Map _json) { |
1078 if (_json.containsKey("mirrorConfig")) { | 1061 if (_json.containsKey("mirrorConfig")) { |
1079 mirrorConfig = new MirrorConfig.fromJson(_json["mirrorConfig"]); | 1062 mirrorConfig = new MirrorConfig.fromJson(_json["mirrorConfig"]); |
1080 } | 1063 } |
1081 if (_json.containsKey("name")) { | 1064 if (_json.containsKey("name")) { |
1082 name = _json["name"]; | 1065 name = _json["name"]; |
1083 } | 1066 } |
1084 if (_json.containsKey("size")) { | 1067 if (_json.containsKey("size")) { |
1085 size = _json["size"]; | 1068 size = _json["size"]; |
1086 } | 1069 } |
1087 if (_json.containsKey("url")) { | 1070 if (_json.containsKey("url")) { |
1088 url = _json["url"]; | 1071 url = _json["url"]; |
1089 } | 1072 } |
1090 } | 1073 } |
1091 | 1074 |
1092 core.Map<core.String, core.Object> toJson() { | 1075 core.Map<core.String, core.Object> toJson() { |
1093 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1076 final core.Map<core.String, core.Object> _json = |
| 1077 new core.Map<core.String, core.Object>(); |
1094 if (mirrorConfig != null) { | 1078 if (mirrorConfig != null) { |
1095 _json["mirrorConfig"] = (mirrorConfig).toJson(); | 1079 _json["mirrorConfig"] = (mirrorConfig).toJson(); |
1096 } | 1080 } |
1097 if (name != null) { | 1081 if (name != null) { |
1098 _json["name"] = name; | 1082 _json["name"] = name; |
1099 } | 1083 } |
1100 if (size != null) { | 1084 if (size != null) { |
1101 _json["size"] = size; | 1085 _json["size"] = size; |
1102 } | 1086 } |
1103 if (url != null) { | 1087 if (url != null) { |
1104 _json["url"] = url; | 1088 _json["url"] = url; |
1105 } | 1089 } |
1106 return _json; | 1090 return _json; |
1107 } | 1091 } |
1108 } | 1092 } |
1109 | 1093 |
1110 /** A rule to be applied in a Policy. */ | 1094 /// A rule to be applied in a Policy. |
1111 class Rule { | 1095 class Rule { |
1112 /** | 1096 /// Required |
1113 * Required | 1097 /// Possible string values are: |
1114 * Possible string values are: | 1098 /// - "NO_ACTION" : Default no action. |
1115 * - "NO_ACTION" : Default no action. | 1099 /// - "ALLOW" : Matching 'Entries' grant access. |
1116 * - "ALLOW" : Matching 'Entries' grant access. | 1100 /// - "ALLOW_WITH_LOG" : Matching 'Entries' grant access and the caller |
1117 * - "ALLOW_WITH_LOG" : Matching 'Entries' grant access and the caller | 1101 /// promises to log |
1118 * promises to log | 1102 /// the request per the returned log_configs. |
1119 * the request per the returned log_configs. | 1103 /// - "DENY" : Matching 'Entries' deny access. |
1120 * - "DENY" : Matching 'Entries' deny access. | 1104 /// - "DENY_WITH_LOG" : Matching 'Entries' deny access and the caller |
1121 * - "DENY_WITH_LOG" : Matching 'Entries' deny access and the caller promises | 1105 /// promises to log |
1122 * to log | 1106 /// the request per the returned log_configs. |
1123 * the request per the returned log_configs. | 1107 /// - "LOG" : Matching 'Entries' tell IAM.Check callers to generate logs. |
1124 * - "LOG" : Matching 'Entries' tell IAM.Check callers to generate logs. | |
1125 */ | |
1126 core.String action; | 1108 core.String action; |
1127 /** Additional restrictions that must be met */ | 1109 |
| 1110 /// Additional restrictions that must be met |
1128 core.List<Condition> conditions; | 1111 core.List<Condition> conditions; |
1129 /** Human-readable description of the rule. */ | 1112 |
| 1113 /// Human-readable description of the rule. |
1130 core.String description; | 1114 core.String description; |
1131 /** | 1115 |
1132 * If one or more 'in' clauses are specified, the rule matches if | 1116 /// If one or more 'in' clauses are specified, the rule matches if |
1133 * the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries. | 1117 /// the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries. |
1134 */ | |
1135 core.List<core.String> in_; | 1118 core.List<core.String> in_; |
1136 /** | 1119 |
1137 * The config returned to callers of tech.iam.IAM.CheckPolicy for any entries | 1120 /// The config returned to callers of tech.iam.IAM.CheckPolicy for any |
1138 * that match the LOG action. | 1121 /// entries |
1139 */ | 1122 /// that match the LOG action. |
1140 core.List<LogConfig> logConfig; | 1123 core.List<LogConfig> logConfig; |
1141 /** | 1124 |
1142 * If one or more 'not_in' clauses are specified, the rule matches | 1125 /// If one or more 'not_in' clauses are specified, the rule matches |
1143 * if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries. | 1126 /// if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries. |
1144 * The format for in and not_in entries is the same as for members in a | 1127 /// The format for in and not_in entries is the same as for members in a |
1145 * Binding (see google/iam/v1/policy.proto). | 1128 /// Binding (see google/iam/v1/policy.proto). |
1146 */ | |
1147 core.List<core.String> notIn; | 1129 core.List<core.String> notIn; |
1148 /** | 1130 |
1149 * A permission is a string of form '<service>.<resource type>.<verb>' | 1131 /// A permission is a string of form '<service>.<resource type>.<verb>' |
1150 * (e.g., 'storage.buckets.list'). A value of '*' matches all permissions, | 1132 /// (e.g., 'storage.buckets.list'). A value of '*' matches all permissions, |
1151 * and a verb part of '*' (e.g., 'storage.buckets.*') matches all verbs. | 1133 /// and a verb part of '*' (e.g., 'storage.buckets.*') matches all verbs. |
1152 */ | |
1153 core.List<core.String> permissions; | 1134 core.List<core.String> permissions; |
1154 | 1135 |
1155 Rule(); | 1136 Rule(); |
1156 | 1137 |
1157 Rule.fromJson(core.Map _json) { | 1138 Rule.fromJson(core.Map _json) { |
1158 if (_json.containsKey("action")) { | 1139 if (_json.containsKey("action")) { |
1159 action = _json["action"]; | 1140 action = _json["action"]; |
1160 } | 1141 } |
1161 if (_json.containsKey("conditions")) { | 1142 if (_json.containsKey("conditions")) { |
1162 conditions = _json["conditions"].map((value) => new Condition.fromJson(val
ue)).toList(); | 1143 conditions = _json["conditions"] |
| 1144 .map((value) => new Condition.fromJson(value)) |
| 1145 .toList(); |
1163 } | 1146 } |
1164 if (_json.containsKey("description")) { | 1147 if (_json.containsKey("description")) { |
1165 description = _json["description"]; | 1148 description = _json["description"]; |
1166 } | 1149 } |
1167 if (_json.containsKey("in")) { | 1150 if (_json.containsKey("in")) { |
1168 in_ = _json["in"]; | 1151 in_ = _json["in"]; |
1169 } | 1152 } |
1170 if (_json.containsKey("logConfig")) { | 1153 if (_json.containsKey("logConfig")) { |
1171 logConfig = _json["logConfig"].map((value) => new LogConfig.fromJson(value
)).toList(); | 1154 logConfig = _json["logConfig"] |
| 1155 .map((value) => new LogConfig.fromJson(value)) |
| 1156 .toList(); |
1172 } | 1157 } |
1173 if (_json.containsKey("notIn")) { | 1158 if (_json.containsKey("notIn")) { |
1174 notIn = _json["notIn"]; | 1159 notIn = _json["notIn"]; |
1175 } | 1160 } |
1176 if (_json.containsKey("permissions")) { | 1161 if (_json.containsKey("permissions")) { |
1177 permissions = _json["permissions"]; | 1162 permissions = _json["permissions"]; |
1178 } | 1163 } |
1179 } | 1164 } |
1180 | 1165 |
1181 core.Map<core.String, core.Object> toJson() { | 1166 core.Map<core.String, core.Object> toJson() { |
1182 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1167 final core.Map<core.String, core.Object> _json = |
| 1168 new core.Map<core.String, core.Object>(); |
1183 if (action != null) { | 1169 if (action != null) { |
1184 _json["action"] = action; | 1170 _json["action"] = action; |
1185 } | 1171 } |
1186 if (conditions != null) { | 1172 if (conditions != null) { |
1187 _json["conditions"] = conditions.map((value) => (value).toJson()).toList()
; | 1173 _json["conditions"] = |
| 1174 conditions.map((value) => (value).toJson()).toList(); |
1188 } | 1175 } |
1189 if (description != null) { | 1176 if (description != null) { |
1190 _json["description"] = description; | 1177 _json["description"] = description; |
1191 } | 1178 } |
1192 if (in_ != null) { | 1179 if (in_ != null) { |
1193 _json["in"] = in_; | 1180 _json["in"] = in_; |
1194 } | 1181 } |
1195 if (logConfig != null) { | 1182 if (logConfig != null) { |
1196 _json["logConfig"] = logConfig.map((value) => (value).toJson()).toList(); | 1183 _json["logConfig"] = logConfig.map((value) => (value).toJson()).toList(); |
1197 } | 1184 } |
1198 if (notIn != null) { | 1185 if (notIn != null) { |
1199 _json["notIn"] = notIn; | 1186 _json["notIn"] = notIn; |
1200 } | 1187 } |
1201 if (permissions != null) { | 1188 if (permissions != null) { |
1202 _json["permissions"] = permissions; | 1189 _json["permissions"] = permissions; |
1203 } | 1190 } |
1204 return _json; | 1191 return _json; |
1205 } | 1192 } |
1206 } | 1193 } |
1207 | 1194 |
1208 /** Request message for `SetIamPolicy` method. */ | 1195 /// Request message for `SetIamPolicy` method. |
1209 class SetIamPolicyRequest { | 1196 class SetIamPolicyRequest { |
1210 /** | 1197 /// REQUIRED: The complete policy to be applied to the `resource`. The size |
1211 * REQUIRED: The complete policy to be applied to the `resource`. The size of | 1198 /// of |
1212 * the policy is limited to a few 10s of KB. An empty policy is a | 1199 /// the policy is limited to a few 10s of KB. An empty policy is a |
1213 * valid policy but certain Cloud Platform services (such as Projects) | 1200 /// valid policy but certain Cloud Platform services (such as Projects) |
1214 * might reject them. | 1201 /// might reject them. |
1215 */ | |
1216 Policy policy; | 1202 Policy policy; |
1217 /** | 1203 |
1218 * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only | 1204 /// OPTIONAL: A FieldMask specifying which fields of the policy to modify. |
1219 * the fields in the mask will be modified. If no mask is provided, the | 1205 /// Only |
1220 * following default mask is used: | 1206 /// the fields in the mask will be modified. If no mask is provided, the |
1221 * paths: "bindings, etag" | 1207 /// following default mask is used: |
1222 * This field is only used by Cloud IAM. | 1208 /// paths: "bindings, etag" |
1223 */ | 1209 /// This field is only used by Cloud IAM. |
1224 core.String updateMask; | 1210 core.String updateMask; |
1225 | 1211 |
1226 SetIamPolicyRequest(); | 1212 SetIamPolicyRequest(); |
1227 | 1213 |
1228 SetIamPolicyRequest.fromJson(core.Map _json) { | 1214 SetIamPolicyRequest.fromJson(core.Map _json) { |
1229 if (_json.containsKey("policy")) { | 1215 if (_json.containsKey("policy")) { |
1230 policy = new Policy.fromJson(_json["policy"]); | 1216 policy = new Policy.fromJson(_json["policy"]); |
1231 } | 1217 } |
1232 if (_json.containsKey("updateMask")) { | 1218 if (_json.containsKey("updateMask")) { |
1233 updateMask = _json["updateMask"]; | 1219 updateMask = _json["updateMask"]; |
1234 } | 1220 } |
1235 } | 1221 } |
1236 | 1222 |
1237 core.Map<core.String, core.Object> toJson() { | 1223 core.Map<core.String, core.Object> toJson() { |
1238 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1224 final core.Map<core.String, core.Object> _json = |
| 1225 new core.Map<core.String, core.Object>(); |
1239 if (policy != null) { | 1226 if (policy != null) { |
1240 _json["policy"] = (policy).toJson(); | 1227 _json["policy"] = (policy).toJson(); |
1241 } | 1228 } |
1242 if (updateMask != null) { | 1229 if (updateMask != null) { |
1243 _json["updateMask"] = updateMask; | 1230 _json["updateMask"] = updateMask; |
1244 } | 1231 } |
1245 return _json; | 1232 return _json; |
1246 } | 1233 } |
1247 } | 1234 } |
1248 | 1235 |
1249 /** Request message for `TestIamPermissions` method. */ | 1236 /// Request message for `TestIamPermissions` method. |
1250 class TestIamPermissionsRequest { | 1237 class TestIamPermissionsRequest { |
1251 /** | 1238 /// The set of permissions to check for the `resource`. Permissions with |
1252 * The set of permissions to check for the `resource`. Permissions with | 1239 /// wildcards (such as '*' or 'storage.*') are not allowed. For more |
1253 * wildcards (such as '*' or 'storage.*') are not allowed. For more | 1240 /// information see |
1254 * information see | 1241 /// [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). |
1255 * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). | |
1256 */ | |
1257 core.List<core.String> permissions; | 1242 core.List<core.String> permissions; |
1258 | 1243 |
1259 TestIamPermissionsRequest(); | 1244 TestIamPermissionsRequest(); |
1260 | 1245 |
1261 TestIamPermissionsRequest.fromJson(core.Map _json) { | 1246 TestIamPermissionsRequest.fromJson(core.Map _json) { |
1262 if (_json.containsKey("permissions")) { | 1247 if (_json.containsKey("permissions")) { |
1263 permissions = _json["permissions"]; | 1248 permissions = _json["permissions"]; |
1264 } | 1249 } |
1265 } | 1250 } |
1266 | 1251 |
1267 core.Map<core.String, core.Object> toJson() { | 1252 core.Map<core.String, core.Object> toJson() { |
1268 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1253 final core.Map<core.String, core.Object> _json = |
| 1254 new core.Map<core.String, core.Object>(); |
1269 if (permissions != null) { | 1255 if (permissions != null) { |
1270 _json["permissions"] = permissions; | 1256 _json["permissions"] = permissions; |
1271 } | 1257 } |
1272 return _json; | 1258 return _json; |
1273 } | 1259 } |
1274 } | 1260 } |
1275 | 1261 |
1276 /** Response message for `TestIamPermissions` method. */ | 1262 /// Response message for `TestIamPermissions` method. |
1277 class TestIamPermissionsResponse { | 1263 class TestIamPermissionsResponse { |
1278 /** | 1264 /// A subset of `TestPermissionsRequest.permissions` that the caller is |
1279 * A subset of `TestPermissionsRequest.permissions` that the caller is | 1265 /// allowed. |
1280 * allowed. | |
1281 */ | |
1282 core.List<core.String> permissions; | 1266 core.List<core.String> permissions; |
1283 | 1267 |
1284 TestIamPermissionsResponse(); | 1268 TestIamPermissionsResponse(); |
1285 | 1269 |
1286 TestIamPermissionsResponse.fromJson(core.Map _json) { | 1270 TestIamPermissionsResponse.fromJson(core.Map _json) { |
1287 if (_json.containsKey("permissions")) { | 1271 if (_json.containsKey("permissions")) { |
1288 permissions = _json["permissions"]; | 1272 permissions = _json["permissions"]; |
1289 } | 1273 } |
1290 } | 1274 } |
1291 | 1275 |
1292 core.Map<core.String, core.Object> toJson() { | 1276 core.Map<core.String, core.Object> toJson() { |
1293 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1277 final core.Map<core.String, core.Object> _json = |
| 1278 new core.Map<core.String, core.Object>(); |
1294 if (permissions != null) { | 1279 if (permissions != null) { |
1295 _json["permissions"] = permissions; | 1280 _json["permissions"] = permissions; |
1296 } | 1281 } |
1297 return _json; | 1282 return _json; |
1298 } | 1283 } |
1299 } | 1284 } |
OLD | NEW |