google-apis-cloudbuild_v1alpha2 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,302 @@
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 CloudbuildV1alpha2
23
+ # Cloud Build API
24
+ #
25
+ # Creates and manages builds on Google Cloud Platform.
26
+ #
27
+ # @example
28
+ # require 'google/apis/cloudbuild_v1alpha2'
29
+ #
30
+ # Cloudbuild = Google::Apis::CloudbuildV1alpha2 # Alias the module
31
+ # service = Cloudbuild::CloudBuildService.new
32
+ #
33
+ # @see https://cloud.google.com/cloud-build/docs/
34
+ class CloudBuildService < 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://cloudbuild.googleapis.com/', '',
47
+ client_name: 'google-apis-cloudbuild_v1alpha2',
48
+ client_version: Google::Apis::CloudbuildV1alpha2::GEM_VERSION)
49
+ @batch_path = 'batch'
50
+ end
51
+
52
+ # Starts asynchronous cancellation on a long-running operation. The server makes
53
+ # a best effort to cancel the operation, but success is not guaranteed. If the
54
+ # server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
55
+ # Clients can use Operations.GetOperation or other methods to check whether the
56
+ # cancellation succeeded or whether the operation completed despite cancellation.
57
+ # On successful cancellation, the operation is not deleted; instead, it becomes
58
+ # an operation with an Operation.error value with a google.rpc.Status.code of 1,
59
+ # corresponding to `Code.CANCELLED`.
60
+ # @param [String] name
61
+ # The name of the operation resource to be cancelled.
62
+ # @param [Google::Apis::CloudbuildV1alpha2::CancelOperationRequest] cancel_operation_request_object
63
+ # @param [String] fields
64
+ # Selector specifying which fields to include in a partial response.
65
+ # @param [String] quota_user
66
+ # Available to use for quota purposes for server-side applications. Can be any
67
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
68
+ # @param [Google::Apis::RequestOptions] options
69
+ # Request-specific options
70
+ #
71
+ # @yield [result, err] Result & error if block supplied
72
+ # @yieldparam result [Google::Apis::CloudbuildV1alpha2::Empty] parsed result object
73
+ # @yieldparam err [StandardError] error object if request failed
74
+ #
75
+ # @return [Google::Apis::CloudbuildV1alpha2::Empty]
76
+ #
77
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
78
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
79
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
80
+ def cancel_operation(name, cancel_operation_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
81
+ command = make_simple_command(:post, 'v1alpha2/{+name}:cancel', options)
82
+ command.request_representation = Google::Apis::CloudbuildV1alpha2::CancelOperationRequest::Representation
83
+ command.request_object = cancel_operation_request_object
84
+ command.response_representation = Google::Apis::CloudbuildV1alpha2::Empty::Representation
85
+ command.response_class = Google::Apis::CloudbuildV1alpha2::Empty
86
+ command.params['name'] = name unless name.nil?
87
+ command.query['fields'] = fields unless fields.nil?
88
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
89
+ execute_or_queue_command(command, &block)
90
+ end
91
+
92
+ # Gets the latest state of a long-running operation. Clients can use this method
93
+ # to poll the operation result at intervals as recommended by the API service.
94
+ # @param [String] name
95
+ # The name of the operation resource.
96
+ # @param [String] fields
97
+ # Selector specifying which fields to include in a partial response.
98
+ # @param [String] quota_user
99
+ # Available to use for quota purposes for server-side applications. Can be any
100
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
101
+ # @param [Google::Apis::RequestOptions] options
102
+ # Request-specific options
103
+ #
104
+ # @yield [result, err] Result & error if block supplied
105
+ # @yieldparam result [Google::Apis::CloudbuildV1alpha2::Operation] parsed result object
106
+ # @yieldparam err [StandardError] error object if request failed
107
+ #
108
+ # @return [Google::Apis::CloudbuildV1alpha2::Operation]
109
+ #
110
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
111
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
112
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
113
+ def get_project_location_operation(name, fields: nil, quota_user: nil, options: nil, &block)
114
+ command = make_simple_command(:get, 'v1alpha2/{+name}', options)
115
+ command.response_representation = Google::Apis::CloudbuildV1alpha2::Operation::Representation
116
+ command.response_class = Google::Apis::CloudbuildV1alpha2::Operation
117
+ command.params['name'] = name unless name.nil?
118
+ command.query['fields'] = fields unless fields.nil?
119
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
120
+ execute_or_queue_command(command, &block)
121
+ end
122
+
123
+ # Creates a `WorkerPool` to run the builds, and returns the new worker pool.
124
+ # @param [String] parent
125
+ # Required. The parent resource where this book will be created. Format:
126
+ # projects/`project`
127
+ # @param [Google::Apis::CloudbuildV1alpha2::WorkerPool] worker_pool_object
128
+ # @param [String] worker_pool_id
129
+ # Required. Immutable. The ID to use for the `WorkerPool`, which will become the
130
+ # final component of the resource name. This value should be 1-63 characters,
131
+ # and valid characters are /a-z-/.
132
+ # @param [String] fields
133
+ # Selector specifying which fields to include in a partial response.
134
+ # @param [String] quota_user
135
+ # Available to use for quota purposes for server-side applications. Can be any
136
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
137
+ # @param [Google::Apis::RequestOptions] options
138
+ # Request-specific options
139
+ #
140
+ # @yield [result, err] Result & error if block supplied
141
+ # @yieldparam result [Google::Apis::CloudbuildV1alpha2::WorkerPool] parsed result object
142
+ # @yieldparam err [StandardError] error object if request failed
143
+ #
144
+ # @return [Google::Apis::CloudbuildV1alpha2::WorkerPool]
145
+ #
146
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
147
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
148
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
149
+ def create_project_worker_pool(parent, worker_pool_object = nil, worker_pool_id: nil, fields: nil, quota_user: nil, options: nil, &block)
150
+ command = make_simple_command(:post, 'v1alpha2/{+parent}/workerPools', options)
151
+ command.request_representation = Google::Apis::CloudbuildV1alpha2::WorkerPool::Representation
152
+ command.request_object = worker_pool_object
153
+ command.response_representation = Google::Apis::CloudbuildV1alpha2::WorkerPool::Representation
154
+ command.response_class = Google::Apis::CloudbuildV1alpha2::WorkerPool
155
+ command.params['parent'] = parent unless parent.nil?
156
+ command.query['workerPoolId'] = worker_pool_id unless worker_pool_id.nil?
157
+ command.query['fields'] = fields unless fields.nil?
158
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
159
+ execute_or_queue_command(command, &block)
160
+ end
161
+
162
+ # Deletes a `WorkerPool`.
163
+ # @param [String] name
164
+ # Required. The name of the `WorkerPool` to delete. Format: projects/`project`/
165
+ # workerPools/`workerPool`
166
+ # @param [String] fields
167
+ # Selector specifying which fields to include in a partial response.
168
+ # @param [String] quota_user
169
+ # Available to use for quota purposes for server-side applications. Can be any
170
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
171
+ # @param [Google::Apis::RequestOptions] options
172
+ # Request-specific options
173
+ #
174
+ # @yield [result, err] Result & error if block supplied
175
+ # @yieldparam result [Google::Apis::CloudbuildV1alpha2::Empty] parsed result object
176
+ # @yieldparam err [StandardError] error object if request failed
177
+ #
178
+ # @return [Google::Apis::CloudbuildV1alpha2::Empty]
179
+ #
180
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
181
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
182
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
183
+ def delete_project_worker_pool(name, fields: nil, quota_user: nil, options: nil, &block)
184
+ command = make_simple_command(:delete, 'v1alpha2/{+name}', options)
185
+ command.response_representation = Google::Apis::CloudbuildV1alpha2::Empty::Representation
186
+ command.response_class = Google::Apis::CloudbuildV1alpha2::Empty
187
+ command.params['name'] = name unless name.nil?
188
+ command.query['fields'] = fields unless fields.nil?
189
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
190
+ execute_or_queue_command(command, &block)
191
+ end
192
+
193
+ # Returns details of a `WorkerPool`.
194
+ # @param [String] name
195
+ # Required. The name of the `WorkerPool` to retrieve. Format: projects/`project`/
196
+ # workerPools/`workerPool`
197
+ # @param [String] fields
198
+ # Selector specifying which fields to include in a partial response.
199
+ # @param [String] quota_user
200
+ # Available to use for quota purposes for server-side applications. Can be any
201
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
202
+ # @param [Google::Apis::RequestOptions] options
203
+ # Request-specific options
204
+ #
205
+ # @yield [result, err] Result & error if block supplied
206
+ # @yieldparam result [Google::Apis::CloudbuildV1alpha2::WorkerPool] parsed result object
207
+ # @yieldparam err [StandardError] error object if request failed
208
+ #
209
+ # @return [Google::Apis::CloudbuildV1alpha2::WorkerPool]
210
+ #
211
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
212
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
213
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
214
+ def get_project_worker_pool(name, fields: nil, quota_user: nil, options: nil, &block)
215
+ command = make_simple_command(:get, 'v1alpha2/{+name}', options)
216
+ command.response_representation = Google::Apis::CloudbuildV1alpha2::WorkerPool::Representation
217
+ command.response_class = Google::Apis::CloudbuildV1alpha2::WorkerPool
218
+ command.params['name'] = name unless name.nil?
219
+ command.query['fields'] = fields unless fields.nil?
220
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
221
+ execute_or_queue_command(command, &block)
222
+ end
223
+
224
+ # Lists `WorkerPool`s by project.
225
+ # @param [String] parent
226
+ # Required. The parent, which owns this collection of `WorkerPools`. Format:
227
+ # projects/`project`
228
+ # @param [String] fields
229
+ # Selector specifying which fields to include in a partial response.
230
+ # @param [String] quota_user
231
+ # Available to use for quota purposes for server-side applications. Can be any
232
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
233
+ # @param [Google::Apis::RequestOptions] options
234
+ # Request-specific options
235
+ #
236
+ # @yield [result, err] Result & error if block supplied
237
+ # @yieldparam result [Google::Apis::CloudbuildV1alpha2::ListWorkerPoolsResponse] parsed result object
238
+ # @yieldparam err [StandardError] error object if request failed
239
+ #
240
+ # @return [Google::Apis::CloudbuildV1alpha2::ListWorkerPoolsResponse]
241
+ #
242
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
243
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
244
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
245
+ def list_project_worker_pools(parent, fields: nil, quota_user: nil, options: nil, &block)
246
+ command = make_simple_command(:get, 'v1alpha2/{+parent}/workerPools', options)
247
+ command.response_representation = Google::Apis::CloudbuildV1alpha2::ListWorkerPoolsResponse::Representation
248
+ command.response_class = Google::Apis::CloudbuildV1alpha2::ListWorkerPoolsResponse
249
+ command.params['parent'] = parent unless parent.nil?
250
+ command.query['fields'] = fields unless fields.nil?
251
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
252
+ execute_or_queue_command(command, &block)
253
+ end
254
+
255
+ # Updates a `WorkerPool`.
256
+ # @param [String] name
257
+ # Output only. The resource name of the `WorkerPool`. Format of the name is `
258
+ # projects/`project_id`/workerPools/`worker_pool_id``, where the value of `
259
+ # worker_pool_id` is provided in the CreateWorkerPool request.
260
+ # @param [Google::Apis::CloudbuildV1alpha2::WorkerPool] worker_pool_object
261
+ # @param [String] update_mask
262
+ # A mask specifying which fields in `WorkerPool` should be updated.
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::CloudbuildV1alpha2::WorkerPool] parsed result object
273
+ # @yieldparam err [StandardError] error object if request failed
274
+ #
275
+ # @return [Google::Apis::CloudbuildV1alpha2::WorkerPool]
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 patch_project_worker_pool(name, worker_pool_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
281
+ command = make_simple_command(:patch, 'v1alpha2/{+name}', options)
282
+ command.request_representation = Google::Apis::CloudbuildV1alpha2::WorkerPool::Representation
283
+ command.request_object = worker_pool_object
284
+ command.response_representation = Google::Apis::CloudbuildV1alpha2::WorkerPool::Representation
285
+ command.response_class = Google::Apis::CloudbuildV1alpha2::WorkerPool
286
+ command.params['name'] = name unless name.nil?
287
+ command.query['updateMask'] = update_mask unless update_mask.nil?
288
+ command.query['fields'] = fields unless fields.nil?
289
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
290
+ execute_or_queue_command(command, &block)
291
+ end
292
+
293
+ protected
294
+
295
+ def apply_command_defaults(command)
296
+ command.query['key'] = key unless key.nil?
297
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
298
+ end
299
+ end
300
+ end
301
+ end
302
+ end
metadata ADDED
@@ -0,0 +1,76 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: google-apis-cloudbuild_v1alpha2
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Google LLC
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2021-01-08 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: google-apis-core
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.1'
27
+ description: This is the simple REST client for Cloud Build API V1alpha2. Simple REST
28
+ clients are Ruby client libraries that provide access to Google services via their
29
+ HTTP REST API endpoints. These libraries are generated and updated automatically
30
+ based on the discovery documents published by the service, and they handle most
31
+ concerns such as authentication, pagination, retry, timeouts, and logging. You can
32
+ use this client to access the Cloud Build API, but note that some services may provide
33
+ a separate modern client that is easier to use.
34
+ email: googleapis-packages@google.com
35
+ executables: []
36
+ extensions: []
37
+ extra_rdoc_files: []
38
+ files:
39
+ - ".yardopts"
40
+ - CHANGELOG.md
41
+ - LICENSE.md
42
+ - OVERVIEW.md
43
+ - lib/google-apis-cloudbuild_v1alpha2.rb
44
+ - lib/google/apis/cloudbuild_v1alpha2.rb
45
+ - lib/google/apis/cloudbuild_v1alpha2/classes.rb
46
+ - lib/google/apis/cloudbuild_v1alpha2/gem_version.rb
47
+ - lib/google/apis/cloudbuild_v1alpha2/representations.rb
48
+ - lib/google/apis/cloudbuild_v1alpha2/service.rb
49
+ homepage: https://github.com/google/google-api-ruby-client
50
+ licenses:
51
+ - Apache-2.0
52
+ metadata:
53
+ bug_tracker_uri: https://github.com/googleapis/google-api-ruby-client/issues
54
+ changelog_uri: https://github.com/googleapis/google-api-ruby-client/tree/master/generated/google-apis-cloudbuild_v1alpha2/CHANGELOG.md
55
+ documentation_uri: https://googleapis.dev/ruby/google-apis-cloudbuild_v1alpha2/v0.1.0
56
+ source_code_uri: https://github.com/googleapis/google-api-ruby-client/tree/master/generated/google-apis-cloudbuild_v1alpha2
57
+ post_install_message:
58
+ rdoc_options: []
59
+ require_paths:
60
+ - lib
61
+ required_ruby_version: !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ version: '2.4'
66
+ required_rubygems_version: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
71
+ requirements: []
72
+ rubygems_version: 3.1.4
73
+ signing_key:
74
+ specification_version: 4
75
+ summary: Simple REST client for Cloud Build API V1alpha2
76
+ test_files: []