google-apis-sourcerepo_v1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,28 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ module Google
16
+ module Apis
17
+ module SourcerepoV1
18
+ # Version of the google-apis-sourcerepo_v1 gem
19
+ GEM_VERSION = "0.1.0"
20
+
21
+ # Version of the code generator used to generate this client
22
+ GENERATOR_VERSION = "0.1.1"
23
+
24
+ # Revision of the discovery document this client was generated from
25
+ REVISION = "20200914"
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,329 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'date'
16
+ require 'google/apis/core/base_service'
17
+ require 'google/apis/core/json_representation'
18
+ require 'google/apis/core/hashable'
19
+ require 'google/apis/errors'
20
+
21
+ module Google
22
+ module Apis
23
+ module SourcerepoV1
24
+
25
+ class AuditConfig
26
+ class Representation < Google::Apis::Core::JsonRepresentation; end
27
+
28
+ include Google::Apis::Core::JsonObjectSupport
29
+ end
30
+
31
+ class AuditLogConfig
32
+ class Representation < Google::Apis::Core::JsonRepresentation; end
33
+
34
+ include Google::Apis::Core::JsonObjectSupport
35
+ end
36
+
37
+ class Binding
38
+ class Representation < Google::Apis::Core::JsonRepresentation; end
39
+
40
+ include Google::Apis::Core::JsonObjectSupport
41
+ end
42
+
43
+ class Empty
44
+ class Representation < Google::Apis::Core::JsonRepresentation; end
45
+
46
+ include Google::Apis::Core::JsonObjectSupport
47
+ end
48
+
49
+ class Expr
50
+ class Representation < Google::Apis::Core::JsonRepresentation; end
51
+
52
+ include Google::Apis::Core::JsonObjectSupport
53
+ end
54
+
55
+ class ListReposResponse
56
+ class Representation < Google::Apis::Core::JsonRepresentation; end
57
+
58
+ include Google::Apis::Core::JsonObjectSupport
59
+ end
60
+
61
+ class MirrorConfig
62
+ class Representation < Google::Apis::Core::JsonRepresentation; end
63
+
64
+ include Google::Apis::Core::JsonObjectSupport
65
+ end
66
+
67
+ class Operation
68
+ class Representation < Google::Apis::Core::JsonRepresentation; end
69
+
70
+ include Google::Apis::Core::JsonObjectSupport
71
+ end
72
+
73
+ class Policy
74
+ class Representation < Google::Apis::Core::JsonRepresentation; end
75
+
76
+ include Google::Apis::Core::JsonObjectSupport
77
+ end
78
+
79
+ class ProjectConfig
80
+ class Representation < Google::Apis::Core::JsonRepresentation; end
81
+
82
+ include Google::Apis::Core::JsonObjectSupport
83
+ end
84
+
85
+ class PubsubConfig
86
+ class Representation < Google::Apis::Core::JsonRepresentation; end
87
+
88
+ include Google::Apis::Core::JsonObjectSupport
89
+ end
90
+
91
+ class Repo
92
+ class Representation < Google::Apis::Core::JsonRepresentation; end
93
+
94
+ include Google::Apis::Core::JsonObjectSupport
95
+ end
96
+
97
+ class SetIamPolicyRequest
98
+ class Representation < Google::Apis::Core::JsonRepresentation; end
99
+
100
+ include Google::Apis::Core::JsonObjectSupport
101
+ end
102
+
103
+ class Status
104
+ class Representation < Google::Apis::Core::JsonRepresentation; end
105
+
106
+ include Google::Apis::Core::JsonObjectSupport
107
+ end
108
+
109
+ class SyncRepoMetadata
110
+ class Representation < Google::Apis::Core::JsonRepresentation; end
111
+
112
+ include Google::Apis::Core::JsonObjectSupport
113
+ end
114
+
115
+ class SyncRepoRequest
116
+ class Representation < Google::Apis::Core::JsonRepresentation; end
117
+
118
+ include Google::Apis::Core::JsonObjectSupport
119
+ end
120
+
121
+ class TestIamPermissionsRequest
122
+ class Representation < Google::Apis::Core::JsonRepresentation; end
123
+
124
+ include Google::Apis::Core::JsonObjectSupport
125
+ end
126
+
127
+ class TestIamPermissionsResponse
128
+ class Representation < Google::Apis::Core::JsonRepresentation; end
129
+
130
+ include Google::Apis::Core::JsonObjectSupport
131
+ end
132
+
133
+ class UpdateProjectConfigRequest
134
+ class Representation < Google::Apis::Core::JsonRepresentation; end
135
+
136
+ include Google::Apis::Core::JsonObjectSupport
137
+ end
138
+
139
+ class UpdateRepoRequest
140
+ class Representation < Google::Apis::Core::JsonRepresentation; end
141
+
142
+ include Google::Apis::Core::JsonObjectSupport
143
+ end
144
+
145
+ class AuditConfig
146
+ # @private
147
+ class Representation < Google::Apis::Core::JsonRepresentation
148
+ collection :audit_log_configs, as: 'auditLogConfigs', class: Google::Apis::SourcerepoV1::AuditLogConfig, decorator: Google::Apis::SourcerepoV1::AuditLogConfig::Representation
149
+
150
+ property :service, as: 'service'
151
+ end
152
+ end
153
+
154
+ class AuditLogConfig
155
+ # @private
156
+ class Representation < Google::Apis::Core::JsonRepresentation
157
+ collection :exempted_members, as: 'exemptedMembers'
158
+ property :log_type, as: 'logType'
159
+ end
160
+ end
161
+
162
+ class Binding
163
+ # @private
164
+ class Representation < Google::Apis::Core::JsonRepresentation
165
+ property :condition, as: 'condition', class: Google::Apis::SourcerepoV1::Expr, decorator: Google::Apis::SourcerepoV1::Expr::Representation
166
+
167
+ collection :members, as: 'members'
168
+ property :role, as: 'role'
169
+ end
170
+ end
171
+
172
+ class Empty
173
+ # @private
174
+ class Representation < Google::Apis::Core::JsonRepresentation
175
+ end
176
+ end
177
+
178
+ class Expr
179
+ # @private
180
+ class Representation < Google::Apis::Core::JsonRepresentation
181
+ property :description, as: 'description'
182
+ property :expression, as: 'expression'
183
+ property :location, as: 'location'
184
+ property :title, as: 'title'
185
+ end
186
+ end
187
+
188
+ class ListReposResponse
189
+ # @private
190
+ class Representation < Google::Apis::Core::JsonRepresentation
191
+ property :next_page_token, as: 'nextPageToken'
192
+ collection :repos, as: 'repos', class: Google::Apis::SourcerepoV1::Repo, decorator: Google::Apis::SourcerepoV1::Repo::Representation
193
+
194
+ end
195
+ end
196
+
197
+ class MirrorConfig
198
+ # @private
199
+ class Representation < Google::Apis::Core::JsonRepresentation
200
+ property :deploy_key_id, as: 'deployKeyId'
201
+ property :url, as: 'url'
202
+ property :webhook_id, as: 'webhookId'
203
+ end
204
+ end
205
+
206
+ class Operation
207
+ # @private
208
+ class Representation < Google::Apis::Core::JsonRepresentation
209
+ property :done, as: 'done'
210
+ property :error, as: 'error', class: Google::Apis::SourcerepoV1::Status, decorator: Google::Apis::SourcerepoV1::Status::Representation
211
+
212
+ hash :metadata, as: 'metadata'
213
+ property :name, as: 'name'
214
+ hash :response, as: 'response'
215
+ end
216
+ end
217
+
218
+ class Policy
219
+ # @private
220
+ class Representation < Google::Apis::Core::JsonRepresentation
221
+ collection :audit_configs, as: 'auditConfigs', class: Google::Apis::SourcerepoV1::AuditConfig, decorator: Google::Apis::SourcerepoV1::AuditConfig::Representation
222
+
223
+ collection :bindings, as: 'bindings', class: Google::Apis::SourcerepoV1::Binding, decorator: Google::Apis::SourcerepoV1::Binding::Representation
224
+
225
+ property :etag, :base64 => true, as: 'etag'
226
+ property :version, as: 'version'
227
+ end
228
+ end
229
+
230
+ class ProjectConfig
231
+ # @private
232
+ class Representation < Google::Apis::Core::JsonRepresentation
233
+ property :enable_private_key_check, as: 'enablePrivateKeyCheck'
234
+ property :name, as: 'name'
235
+ hash :pubsub_configs, as: 'pubsubConfigs', class: Google::Apis::SourcerepoV1::PubsubConfig, decorator: Google::Apis::SourcerepoV1::PubsubConfig::Representation
236
+
237
+ end
238
+ end
239
+
240
+ class PubsubConfig
241
+ # @private
242
+ class Representation < Google::Apis::Core::JsonRepresentation
243
+ property :message_format, as: 'messageFormat'
244
+ property :service_account_email, as: 'serviceAccountEmail'
245
+ property :topic, as: 'topic'
246
+ end
247
+ end
248
+
249
+ class Repo
250
+ # @private
251
+ class Representation < Google::Apis::Core::JsonRepresentation
252
+ property :mirror_config, as: 'mirrorConfig', class: Google::Apis::SourcerepoV1::MirrorConfig, decorator: Google::Apis::SourcerepoV1::MirrorConfig::Representation
253
+
254
+ property :name, as: 'name'
255
+ hash :pubsub_configs, as: 'pubsubConfigs', class: Google::Apis::SourcerepoV1::PubsubConfig, decorator: Google::Apis::SourcerepoV1::PubsubConfig::Representation
256
+
257
+ property :size, :numeric_string => true, as: 'size'
258
+ property :url, as: 'url'
259
+ end
260
+ end
261
+
262
+ class SetIamPolicyRequest
263
+ # @private
264
+ class Representation < Google::Apis::Core::JsonRepresentation
265
+ property :policy, as: 'policy', class: Google::Apis::SourcerepoV1::Policy, decorator: Google::Apis::SourcerepoV1::Policy::Representation
266
+
267
+ property :update_mask, as: 'updateMask'
268
+ end
269
+ end
270
+
271
+ class Status
272
+ # @private
273
+ class Representation < Google::Apis::Core::JsonRepresentation
274
+ property :code, as: 'code'
275
+ collection :details, as: 'details'
276
+ property :message, as: 'message'
277
+ end
278
+ end
279
+
280
+ class SyncRepoMetadata
281
+ # @private
282
+ class Representation < Google::Apis::Core::JsonRepresentation
283
+ property :name, as: 'name'
284
+ property :start_time, as: 'startTime'
285
+ property :status_message, as: 'statusMessage'
286
+ property :update_time, as: 'updateTime'
287
+ end
288
+ end
289
+
290
+ class SyncRepoRequest
291
+ # @private
292
+ class Representation < Google::Apis::Core::JsonRepresentation
293
+ end
294
+ end
295
+
296
+ class TestIamPermissionsRequest
297
+ # @private
298
+ class Representation < Google::Apis::Core::JsonRepresentation
299
+ collection :permissions, as: 'permissions'
300
+ end
301
+ end
302
+
303
+ class TestIamPermissionsResponse
304
+ # @private
305
+ class Representation < Google::Apis::Core::JsonRepresentation
306
+ collection :permissions, as: 'permissions'
307
+ end
308
+ end
309
+
310
+ class UpdateProjectConfigRequest
311
+ # @private
312
+ class Representation < Google::Apis::Core::JsonRepresentation
313
+ property :project_config, as: 'projectConfig', class: Google::Apis::SourcerepoV1::ProjectConfig, decorator: Google::Apis::SourcerepoV1::ProjectConfig::Representation
314
+
315
+ property :update_mask, as: 'updateMask'
316
+ end
317
+ end
318
+
319
+ class UpdateRepoRequest
320
+ # @private
321
+ class Representation < Google::Apis::Core::JsonRepresentation
322
+ property :repo, as: 'repo', class: Google::Apis::SourcerepoV1::Repo, decorator: Google::Apis::SourcerepoV1::Repo::Representation
323
+
324
+ property :update_mask, as: 'updateMask'
325
+ end
326
+ end
327
+ end
328
+ end
329
+ end
@@ -0,0 +1,440 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/core/base_service'
16
+ require 'google/apis/core/json_representation'
17
+ require 'google/apis/core/hashable'
18
+ require 'google/apis/errors'
19
+
20
+ module Google
21
+ module Apis
22
+ module SourcerepoV1
23
+ # Cloud Source Repositories API
24
+ #
25
+ # Accesses source code repositories hosted by Google.
26
+ #
27
+ # @example
28
+ # require 'google/apis/sourcerepo_v1'
29
+ #
30
+ # Sourcerepo = Google::Apis::SourcerepoV1 # Alias the module
31
+ # service = Sourcerepo::CloudSourceRepositoriesService.new
32
+ #
33
+ # @see https://cloud.google.com/source-repositories/docs/apis
34
+ class CloudSourceRepositoriesService < Google::Apis::Core::BaseService
35
+ # @return [String]
36
+ # API key. Your API key identifies your project and provides you with API access,
37
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
38
+ attr_accessor :key
39
+
40
+ # @return [String]
41
+ # Available to use for quota purposes for server-side applications. Can be any
42
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
43
+ attr_accessor :quota_user
44
+
45
+ def initialize
46
+ super('https://sourcerepo.googleapis.com/', '',
47
+ client_name: 'google-apis-sourcerepo_v1',
48
+ client_version: Google::Apis::SourcerepoV1::GEM_VERSION)
49
+ @batch_path = 'batch'
50
+ end
51
+
52
+ # Returns the Cloud Source Repositories configuration of the project.
53
+ # @param [String] name
54
+ # The name of the requested project. Values are of the form `projects/`.
55
+ # @param [String] fields
56
+ # Selector specifying which fields to include in a partial response.
57
+ # @param [String] quota_user
58
+ # Available to use for quota purposes for server-side applications. Can be any
59
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
60
+ # @param [Google::Apis::RequestOptions] options
61
+ # Request-specific options
62
+ #
63
+ # @yield [result, err] Result & error if block supplied
64
+ # @yieldparam result [Google::Apis::SourcerepoV1::ProjectConfig] parsed result object
65
+ # @yieldparam err [StandardError] error object if request failed
66
+ #
67
+ # @return [Google::Apis::SourcerepoV1::ProjectConfig]
68
+ #
69
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
70
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
71
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
72
+ def get_project_config(name, fields: nil, quota_user: nil, options: nil, &block)
73
+ command = make_simple_command(:get, 'v1/{+name}/config', options)
74
+ command.response_representation = Google::Apis::SourcerepoV1::ProjectConfig::Representation
75
+ command.response_class = Google::Apis::SourcerepoV1::ProjectConfig
76
+ command.params['name'] = name unless name.nil?
77
+ command.query['fields'] = fields unless fields.nil?
78
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
79
+ execute_or_queue_command(command, &block)
80
+ end
81
+
82
+ # Updates the Cloud Source Repositories configuration of the project.
83
+ # @param [String] name
84
+ # The name of the requested project. Values are of the form `projects/`.
85
+ # @param [Google::Apis::SourcerepoV1::UpdateProjectConfigRequest] update_project_config_request_object
86
+ # @param [String] fields
87
+ # Selector specifying which fields to include in a partial response.
88
+ # @param [String] quota_user
89
+ # Available to use for quota purposes for server-side applications. Can be any
90
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
91
+ # @param [Google::Apis::RequestOptions] options
92
+ # Request-specific options
93
+ #
94
+ # @yield [result, err] Result & error if block supplied
95
+ # @yieldparam result [Google::Apis::SourcerepoV1::ProjectConfig] parsed result object
96
+ # @yieldparam err [StandardError] error object if request failed
97
+ #
98
+ # @return [Google::Apis::SourcerepoV1::ProjectConfig]
99
+ #
100
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
101
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
102
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
103
+ def update_project_config(name, update_project_config_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
104
+ command = make_simple_command(:patch, 'v1/{+name}/config', options)
105
+ command.request_representation = Google::Apis::SourcerepoV1::UpdateProjectConfigRequest::Representation
106
+ command.request_object = update_project_config_request_object
107
+ command.response_representation = Google::Apis::SourcerepoV1::ProjectConfig::Representation
108
+ command.response_class = Google::Apis::SourcerepoV1::ProjectConfig
109
+ command.params['name'] = name unless name.nil?
110
+ command.query['fields'] = fields unless fields.nil?
111
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
112
+ execute_or_queue_command(command, &block)
113
+ end
114
+
115
+ # Creates a repo in the given project with the given name. If the named
116
+ # repository already exists, `CreateRepo` returns `ALREADY_EXISTS`.
117
+ # @param [String] parent
118
+ # The project in which to create the repo. Values are of the form `projects/`.
119
+ # @param [Google::Apis::SourcerepoV1::Repo] repo_object
120
+ # @param [String] fields
121
+ # Selector specifying which fields to include in a partial response.
122
+ # @param [String] quota_user
123
+ # Available to use for quota purposes for server-side applications. Can be any
124
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
125
+ # @param [Google::Apis::RequestOptions] options
126
+ # Request-specific options
127
+ #
128
+ # @yield [result, err] Result & error if block supplied
129
+ # @yieldparam result [Google::Apis::SourcerepoV1::Repo] parsed result object
130
+ # @yieldparam err [StandardError] error object if request failed
131
+ #
132
+ # @return [Google::Apis::SourcerepoV1::Repo]
133
+ #
134
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
135
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
136
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
137
+ def create_project_repo(parent, repo_object = nil, fields: nil, quota_user: nil, options: nil, &block)
138
+ command = make_simple_command(:post, 'v1/{+parent}/repos', options)
139
+ command.request_representation = Google::Apis::SourcerepoV1::Repo::Representation
140
+ command.request_object = repo_object
141
+ command.response_representation = Google::Apis::SourcerepoV1::Repo::Representation
142
+ command.response_class = Google::Apis::SourcerepoV1::Repo
143
+ command.params['parent'] = parent unless parent.nil?
144
+ command.query['fields'] = fields unless fields.nil?
145
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
146
+ execute_or_queue_command(command, &block)
147
+ end
148
+
149
+ # Deletes a repo.
150
+ # @param [String] name
151
+ # The name of the repo to delete. Values are of the form `projects//repos/`.
152
+ # @param [String] fields
153
+ # Selector specifying which fields to include in a partial response.
154
+ # @param [String] quota_user
155
+ # Available to use for quota purposes for server-side applications. Can be any
156
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
157
+ # @param [Google::Apis::RequestOptions] options
158
+ # Request-specific options
159
+ #
160
+ # @yield [result, err] Result & error if block supplied
161
+ # @yieldparam result [Google::Apis::SourcerepoV1::Empty] parsed result object
162
+ # @yieldparam err [StandardError] error object if request failed
163
+ #
164
+ # @return [Google::Apis::SourcerepoV1::Empty]
165
+ #
166
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
167
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
168
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
169
+ def delete_project_repo(name, fields: nil, quota_user: nil, options: nil, &block)
170
+ command = make_simple_command(:delete, 'v1/{+name}', options)
171
+ command.response_representation = Google::Apis::SourcerepoV1::Empty::Representation
172
+ command.response_class = Google::Apis::SourcerepoV1::Empty
173
+ command.params['name'] = name unless name.nil?
174
+ command.query['fields'] = fields unless fields.nil?
175
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
176
+ execute_or_queue_command(command, &block)
177
+ end
178
+
179
+ # Returns information about a repo.
180
+ # @param [String] name
181
+ # The name of the requested repository. Values are of the form `projects//repos/`
182
+ # .
183
+ # @param [String] fields
184
+ # Selector specifying which fields to include in a partial response.
185
+ # @param [String] quota_user
186
+ # Available to use for quota purposes for server-side applications. Can be any
187
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
188
+ # @param [Google::Apis::RequestOptions] options
189
+ # Request-specific options
190
+ #
191
+ # @yield [result, err] Result & error if block supplied
192
+ # @yieldparam result [Google::Apis::SourcerepoV1::Repo] parsed result object
193
+ # @yieldparam err [StandardError] error object if request failed
194
+ #
195
+ # @return [Google::Apis::SourcerepoV1::Repo]
196
+ #
197
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
198
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
199
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
200
+ def get_project_repo(name, fields: nil, quota_user: nil, options: nil, &block)
201
+ command = make_simple_command(:get, 'v1/{+name}', options)
202
+ command.response_representation = Google::Apis::SourcerepoV1::Repo::Representation
203
+ command.response_class = Google::Apis::SourcerepoV1::Repo
204
+ command.params['name'] = name unless name.nil?
205
+ command.query['fields'] = fields unless fields.nil?
206
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
207
+ execute_or_queue_command(command, &block)
208
+ end
209
+
210
+ # Gets the access control policy for a resource. Returns an empty policy if the
211
+ # resource exists and does not have a policy set.
212
+ # @param [String] resource
213
+ # REQUIRED: The resource for which the policy is being requested. See the
214
+ # operation documentation for the appropriate value for this field.
215
+ # @param [Fixnum] options_requested_policy_version
216
+ # Optional. The policy format version to be returned. Valid values are 0, 1, and
217
+ # 3. Requests specifying an invalid value will be rejected. Requests for
218
+ # policies with any conditional bindings must specify version 3. Policies
219
+ # without any conditional bindings may specify any valid value or leave the
220
+ # field unset. To learn which resources support conditions in their IAM policies,
221
+ # see the [IAM documentation](https://cloud.google.com/iam/help/conditions/
222
+ # resource-policies).
223
+ # @param [String] fields
224
+ # Selector specifying which fields to include in a partial response.
225
+ # @param [String] quota_user
226
+ # Available to use for quota purposes for server-side applications. Can be any
227
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
228
+ # @param [Google::Apis::RequestOptions] options
229
+ # Request-specific options
230
+ #
231
+ # @yield [result, err] Result & error if block supplied
232
+ # @yieldparam result [Google::Apis::SourcerepoV1::Policy] parsed result object
233
+ # @yieldparam err [StandardError] error object if request failed
234
+ #
235
+ # @return [Google::Apis::SourcerepoV1::Policy]
236
+ #
237
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
238
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
239
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
240
+ def get_project_repo_iam_policy(resource, options_requested_policy_version: nil, fields: nil, quota_user: nil, options: nil, &block)
241
+ command = make_simple_command(:get, 'v1/{+resource}:getIamPolicy', options)
242
+ command.response_representation = Google::Apis::SourcerepoV1::Policy::Representation
243
+ command.response_class = Google::Apis::SourcerepoV1::Policy
244
+ command.params['resource'] = resource unless resource.nil?
245
+ command.query['options.requestedPolicyVersion'] = options_requested_policy_version unless options_requested_policy_version.nil?
246
+ command.query['fields'] = fields unless fields.nil?
247
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
248
+ execute_or_queue_command(command, &block)
249
+ end
250
+
251
+ # Returns all repos belonging to a project. The sizes of the repos are not set
252
+ # by ListRepos. To get the size of a repo, use GetRepo.
253
+ # @param [String] name
254
+ # The project ID whose repos should be listed. Values are of the form `projects/`
255
+ # .
256
+ # @param [Fixnum] page_size
257
+ # Maximum number of repositories to return; between 1 and 500. If not set or
258
+ # zero, defaults to 100 at the server.
259
+ # @param [String] page_token
260
+ # Resume listing repositories where a prior ListReposResponse left off. This is
261
+ # an opaque token that must be obtained from a recent, prior ListReposResponse's
262
+ # next_page_token field.
263
+ # @param [String] fields
264
+ # Selector specifying which fields to include in a partial response.
265
+ # @param [String] quota_user
266
+ # Available to use for quota purposes for server-side applications. Can be any
267
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
268
+ # @param [Google::Apis::RequestOptions] options
269
+ # Request-specific options
270
+ #
271
+ # @yield [result, err] Result & error if block supplied
272
+ # @yieldparam result [Google::Apis::SourcerepoV1::ListReposResponse] parsed result object
273
+ # @yieldparam err [StandardError] error object if request failed
274
+ #
275
+ # @return [Google::Apis::SourcerepoV1::ListReposResponse]
276
+ #
277
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
278
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
279
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
280
+ def list_project_repos(name, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
281
+ command = make_simple_command(:get, 'v1/{+name}/repos', options)
282
+ command.response_representation = Google::Apis::SourcerepoV1::ListReposResponse::Representation
283
+ command.response_class = Google::Apis::SourcerepoV1::ListReposResponse
284
+ command.params['name'] = name unless name.nil?
285
+ command.query['pageSize'] = page_size unless page_size.nil?
286
+ command.query['pageToken'] = page_token unless page_token.nil?
287
+ command.query['fields'] = fields unless fields.nil?
288
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
289
+ execute_or_queue_command(command, &block)
290
+ end
291
+
292
+ # Updates information about a repo.
293
+ # @param [String] name
294
+ # The name of the requested repository. Values are of the form `projects//repos/`
295
+ # .
296
+ # @param [Google::Apis::SourcerepoV1::UpdateRepoRequest] update_repo_request_object
297
+ # @param [String] fields
298
+ # Selector specifying which fields to include in a partial response.
299
+ # @param [String] quota_user
300
+ # Available to use for quota purposes for server-side applications. Can be any
301
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
302
+ # @param [Google::Apis::RequestOptions] options
303
+ # Request-specific options
304
+ #
305
+ # @yield [result, err] Result & error if block supplied
306
+ # @yieldparam result [Google::Apis::SourcerepoV1::Repo] parsed result object
307
+ # @yieldparam err [StandardError] error object if request failed
308
+ #
309
+ # @return [Google::Apis::SourcerepoV1::Repo]
310
+ #
311
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
312
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
313
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
314
+ def patch_project_repo(name, update_repo_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
315
+ command = make_simple_command(:patch, 'v1/{+name}', options)
316
+ command.request_representation = Google::Apis::SourcerepoV1::UpdateRepoRequest::Representation
317
+ command.request_object = update_repo_request_object
318
+ command.response_representation = Google::Apis::SourcerepoV1::Repo::Representation
319
+ command.response_class = Google::Apis::SourcerepoV1::Repo
320
+ command.params['name'] = name unless name.nil?
321
+ command.query['fields'] = fields unless fields.nil?
322
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
323
+ execute_or_queue_command(command, &block)
324
+ end
325
+
326
+ # Sets the access control policy on the specified resource. Replaces any
327
+ # existing policy.
328
+ # @param [String] resource
329
+ # REQUIRED: The resource for which the policy is being specified. See the
330
+ # operation documentation for the appropriate value for this field.
331
+ # @param [Google::Apis::SourcerepoV1::SetIamPolicyRequest] set_iam_policy_request_object
332
+ # @param [String] fields
333
+ # Selector specifying which fields to include in a partial response.
334
+ # @param [String] quota_user
335
+ # Available to use for quota purposes for server-side applications. Can be any
336
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
337
+ # @param [Google::Apis::RequestOptions] options
338
+ # Request-specific options
339
+ #
340
+ # @yield [result, err] Result & error if block supplied
341
+ # @yieldparam result [Google::Apis::SourcerepoV1::Policy] parsed result object
342
+ # @yieldparam err [StandardError] error object if request failed
343
+ #
344
+ # @return [Google::Apis::SourcerepoV1::Policy]
345
+ #
346
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
347
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
348
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
349
+ def set_repo_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
350
+ command = make_simple_command(:post, 'v1/{+resource}:setIamPolicy', options)
351
+ command.request_representation = Google::Apis::SourcerepoV1::SetIamPolicyRequest::Representation
352
+ command.request_object = set_iam_policy_request_object
353
+ command.response_representation = Google::Apis::SourcerepoV1::Policy::Representation
354
+ command.response_class = Google::Apis::SourcerepoV1::Policy
355
+ command.params['resource'] = resource unless resource.nil?
356
+ command.query['fields'] = fields unless fields.nil?
357
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
358
+ execute_or_queue_command(command, &block)
359
+ end
360
+
361
+ # Synchronize a connected repo. The response contains SyncRepoMetadata in the
362
+ # metadata field.
363
+ # @param [String] name
364
+ # The name of the repo to synchronize. Values are of the form `projects//repos/`.
365
+ # @param [Google::Apis::SourcerepoV1::SyncRepoRequest] sync_repo_request_object
366
+ # @param [String] fields
367
+ # Selector specifying which fields to include in a partial response.
368
+ # @param [String] quota_user
369
+ # Available to use for quota purposes for server-side applications. Can be any
370
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
371
+ # @param [Google::Apis::RequestOptions] options
372
+ # Request-specific options
373
+ #
374
+ # @yield [result, err] Result & error if block supplied
375
+ # @yieldparam result [Google::Apis::SourcerepoV1::Operation] parsed result object
376
+ # @yieldparam err [StandardError] error object if request failed
377
+ #
378
+ # @return [Google::Apis::SourcerepoV1::Operation]
379
+ #
380
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
381
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
382
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
383
+ def sync_repo(name, sync_repo_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
384
+ command = make_simple_command(:post, 'v1/{+name}:sync', options)
385
+ command.request_representation = Google::Apis::SourcerepoV1::SyncRepoRequest::Representation
386
+ command.request_object = sync_repo_request_object
387
+ command.response_representation = Google::Apis::SourcerepoV1::Operation::Representation
388
+ command.response_class = Google::Apis::SourcerepoV1::Operation
389
+ command.params['name'] = name unless name.nil?
390
+ command.query['fields'] = fields unless fields.nil?
391
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
392
+ execute_or_queue_command(command, &block)
393
+ end
394
+
395
+ # Returns permissions that a caller has on the specified resource. If the
396
+ # resource does not exist, this will return an empty set of permissions, not a
397
+ # NOT_FOUND error.
398
+ # @param [String] resource
399
+ # REQUIRED: The resource for which the policy detail is being requested. See the
400
+ # operation documentation for the appropriate value for this field.
401
+ # @param [Google::Apis::SourcerepoV1::TestIamPermissionsRequest] test_iam_permissions_request_object
402
+ # @param [String] fields
403
+ # Selector specifying which fields to include in a partial response.
404
+ # @param [String] quota_user
405
+ # Available to use for quota purposes for server-side applications. Can be any
406
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
407
+ # @param [Google::Apis::RequestOptions] options
408
+ # Request-specific options
409
+ #
410
+ # @yield [result, err] Result & error if block supplied
411
+ # @yieldparam result [Google::Apis::SourcerepoV1::TestIamPermissionsResponse] parsed result object
412
+ # @yieldparam err [StandardError] error object if request failed
413
+ #
414
+ # @return [Google::Apis::SourcerepoV1::TestIamPermissionsResponse]
415
+ #
416
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
417
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
418
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
419
+ def test_repo_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
420
+ command = make_simple_command(:post, 'v1/{+resource}:testIamPermissions', options)
421
+ command.request_representation = Google::Apis::SourcerepoV1::TestIamPermissionsRequest::Representation
422
+ command.request_object = test_iam_permissions_request_object
423
+ command.response_representation = Google::Apis::SourcerepoV1::TestIamPermissionsResponse::Representation
424
+ command.response_class = Google::Apis::SourcerepoV1::TestIamPermissionsResponse
425
+ command.params['resource'] = resource unless resource.nil?
426
+ command.query['fields'] = fields unless fields.nil?
427
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
428
+ execute_or_queue_command(command, &block)
429
+ end
430
+
431
+ protected
432
+
433
+ def apply_command_defaults(command)
434
+ command.query['key'] = key unless key.nil?
435
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
436
+ end
437
+ end
438
+ end
439
+ end
440
+ end