google-apis-cloudbuild_v1beta1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,306 @@
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 CloudbuildV1beta1
23
+ # Cloud Build API
24
+ #
25
+ # Creates and manages builds on Google Cloud Platform.
26
+ #
27
+ # @example
28
+ # require 'google/apis/cloudbuild_v1beta1'
29
+ #
30
+ # Cloudbuild = Google::Apis::CloudbuildV1beta1 # 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_v1beta1',
48
+ client_version: Google::Apis::CloudbuildV1beta1::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::CloudbuildV1beta1::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::CloudbuildV1beta1::Empty] parsed result object
73
+ # @yieldparam err [StandardError] error object if request failed
74
+ #
75
+ # @return [Google::Apis::CloudbuildV1beta1::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, 'v1beta1/{+name}:cancel', options)
82
+ command.request_representation = Google::Apis::CloudbuildV1beta1::CancelOperationRequest::Representation
83
+ command.request_object = cancel_operation_request_object
84
+ command.response_representation = Google::Apis::CloudbuildV1beta1::Empty::Representation
85
+ command.response_class = Google::Apis::CloudbuildV1beta1::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::CloudbuildV1beta1::Operation] parsed result object
106
+ # @yieldparam err [StandardError] error object if request failed
107
+ #
108
+ # @return [Google::Apis::CloudbuildV1beta1::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, 'v1beta1/{+name}', options)
115
+ command.response_representation = Google::Apis::CloudbuildV1beta1::Operation::Representation
116
+ command.response_class = Google::Apis::CloudbuildV1beta1::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
+ # NOTE: As of now, this method returns an `Operation` that is always complete.
125
+ # @param [String] parent
126
+ # Required. The parent resource where this worker pool will be created. Format: `
127
+ # projects/`project`/locations/`location``.
128
+ # @param [Google::Apis::CloudbuildV1beta1::WorkerPool] worker_pool_object
129
+ # @param [String] worker_pool_id
130
+ # Required. Immutable. The ID to use for the `WorkerPool`, which will become the
131
+ # final component of the resource name. This value should be 1-63 characters,
132
+ # and valid characters are /a-z-/.
133
+ # @param [String] fields
134
+ # Selector specifying which fields to include in a partial response.
135
+ # @param [String] quota_user
136
+ # Available to use for quota purposes for server-side applications. Can be any
137
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
138
+ # @param [Google::Apis::RequestOptions] options
139
+ # Request-specific options
140
+ #
141
+ # @yield [result, err] Result & error if block supplied
142
+ # @yieldparam result [Google::Apis::CloudbuildV1beta1::Operation] parsed result object
143
+ # @yieldparam err [StandardError] error object if request failed
144
+ #
145
+ # @return [Google::Apis::CloudbuildV1beta1::Operation]
146
+ #
147
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
148
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
149
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
150
+ def create_project_location_worker_pool(parent, worker_pool_object = nil, worker_pool_id: nil, fields: nil, quota_user: nil, options: nil, &block)
151
+ command = make_simple_command(:post, 'v1beta1/{+parent}/workerPools', options)
152
+ command.request_representation = Google::Apis::CloudbuildV1beta1::WorkerPool::Representation
153
+ command.request_object = worker_pool_object
154
+ command.response_representation = Google::Apis::CloudbuildV1beta1::Operation::Representation
155
+ command.response_class = Google::Apis::CloudbuildV1beta1::Operation
156
+ command.params['parent'] = parent unless parent.nil?
157
+ command.query['workerPoolId'] = worker_pool_id unless worker_pool_id.nil?
158
+ command.query['fields'] = fields unless fields.nil?
159
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
160
+ execute_or_queue_command(command, &block)
161
+ end
162
+
163
+ # Deletes a `WorkerPool`. NOTE: As of now, this method returns an `Operation`
164
+ # that is always complete.
165
+ # @param [String] name
166
+ # Required. The name of the `WorkerPool` to delete. Format: `projects/`project`/
167
+ # locations/`workerPool`/workerPools/`workerPool``.
168
+ # @param [String] fields
169
+ # Selector specifying which fields to include in a partial response.
170
+ # @param [String] quota_user
171
+ # Available to use for quota purposes for server-side applications. Can be any
172
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
173
+ # @param [Google::Apis::RequestOptions] options
174
+ # Request-specific options
175
+ #
176
+ # @yield [result, err] Result & error if block supplied
177
+ # @yieldparam result [Google::Apis::CloudbuildV1beta1::Operation] parsed result object
178
+ # @yieldparam err [StandardError] error object if request failed
179
+ #
180
+ # @return [Google::Apis::CloudbuildV1beta1::Operation]
181
+ #
182
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
183
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
184
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
185
+ def delete_project_location_worker_pool(name, fields: nil, quota_user: nil, options: nil, &block)
186
+ command = make_simple_command(:delete, 'v1beta1/{+name}', options)
187
+ command.response_representation = Google::Apis::CloudbuildV1beta1::Operation::Representation
188
+ command.response_class = Google::Apis::CloudbuildV1beta1::Operation
189
+ command.params['name'] = name unless name.nil?
190
+ command.query['fields'] = fields unless fields.nil?
191
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
192
+ execute_or_queue_command(command, &block)
193
+ end
194
+
195
+ # Returns details of a `WorkerPool`.
196
+ # @param [String] name
197
+ # Required. The name of the `WorkerPool` to retrieve. Format: `projects/`project`
198
+ # /locations/`location`/workerPools/`workerPool``.
199
+ # @param [String] fields
200
+ # Selector specifying which fields to include in a partial response.
201
+ # @param [String] quota_user
202
+ # Available to use for quota purposes for server-side applications. Can be any
203
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
204
+ # @param [Google::Apis::RequestOptions] options
205
+ # Request-specific options
206
+ #
207
+ # @yield [result, err] Result & error if block supplied
208
+ # @yieldparam result [Google::Apis::CloudbuildV1beta1::WorkerPool] parsed result object
209
+ # @yieldparam err [StandardError] error object if request failed
210
+ #
211
+ # @return [Google::Apis::CloudbuildV1beta1::WorkerPool]
212
+ #
213
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
214
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
215
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
216
+ def get_project_location_worker_pool(name, fields: nil, quota_user: nil, options: nil, &block)
217
+ command = make_simple_command(:get, 'v1beta1/{+name}', options)
218
+ command.response_representation = Google::Apis::CloudbuildV1beta1::WorkerPool::Representation
219
+ command.response_class = Google::Apis::CloudbuildV1beta1::WorkerPool
220
+ command.params['name'] = name unless name.nil?
221
+ command.query['fields'] = fields unless fields.nil?
222
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
223
+ execute_or_queue_command(command, &block)
224
+ end
225
+
226
+ # Lists `WorkerPool`s in the given project.
227
+ # @param [String] parent
228
+ # Required. The parent of the collection of `WorkerPools`. Format: `projects/`
229
+ # project`/locations/location`.
230
+ # @param [String] fields
231
+ # Selector specifying which fields to include in a partial response.
232
+ # @param [String] quota_user
233
+ # Available to use for quota purposes for server-side applications. Can be any
234
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
235
+ # @param [Google::Apis::RequestOptions] options
236
+ # Request-specific options
237
+ #
238
+ # @yield [result, err] Result & error if block supplied
239
+ # @yieldparam result [Google::Apis::CloudbuildV1beta1::ListWorkerPoolsResponse] parsed result object
240
+ # @yieldparam err [StandardError] error object if request failed
241
+ #
242
+ # @return [Google::Apis::CloudbuildV1beta1::ListWorkerPoolsResponse]
243
+ #
244
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
245
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
246
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
247
+ def list_project_location_worker_pools(parent, fields: nil, quota_user: nil, options: nil, &block)
248
+ command = make_simple_command(:get, 'v1beta1/{+parent}/workerPools', options)
249
+ command.response_representation = Google::Apis::CloudbuildV1beta1::ListWorkerPoolsResponse::Representation
250
+ command.response_class = Google::Apis::CloudbuildV1beta1::ListWorkerPoolsResponse
251
+ command.params['parent'] = parent unless parent.nil?
252
+ command.query['fields'] = fields unless fields.nil?
253
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
254
+ execute_or_queue_command(command, &block)
255
+ end
256
+
257
+ # Updates a `WorkerPool`. NOTE: As of now, this method returns an `Operation`
258
+ # that is always complete.
259
+ # @param [String] name
260
+ # Output only. The resource name of the `WorkerPool`, with format `projects/`
261
+ # project`/locations/`location`/workerPools/`worker_pool``. The value of ``
262
+ # worker_pool`` is provided by `worker_pool_id` in `CreateWorkerPool` request
263
+ # and the value of ``location`` is determined by the endpoint accessed.
264
+ # @param [Google::Apis::CloudbuildV1beta1::WorkerPool] worker_pool_object
265
+ # @param [String] update_mask
266
+ # A mask specifying which fields in `WorkerPool` to update.
267
+ # @param [String] fields
268
+ # Selector specifying which fields to include in a partial response.
269
+ # @param [String] quota_user
270
+ # Available to use for quota purposes for server-side applications. Can be any
271
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
272
+ # @param [Google::Apis::RequestOptions] options
273
+ # Request-specific options
274
+ #
275
+ # @yield [result, err] Result & error if block supplied
276
+ # @yieldparam result [Google::Apis::CloudbuildV1beta1::Operation] parsed result object
277
+ # @yieldparam err [StandardError] error object if request failed
278
+ #
279
+ # @return [Google::Apis::CloudbuildV1beta1::Operation]
280
+ #
281
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
282
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
283
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
284
+ def patch_project_location_worker_pool(name, worker_pool_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
285
+ command = make_simple_command(:patch, 'v1beta1/{+name}', options)
286
+ command.request_representation = Google::Apis::CloudbuildV1beta1::WorkerPool::Representation
287
+ command.request_object = worker_pool_object
288
+ command.response_representation = Google::Apis::CloudbuildV1beta1::Operation::Representation
289
+ command.response_class = Google::Apis::CloudbuildV1beta1::Operation
290
+ command.params['name'] = name unless name.nil?
291
+ command.query['updateMask'] = update_mask unless update_mask.nil?
292
+ command.query['fields'] = fields unless fields.nil?
293
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
294
+ execute_or_queue_command(command, &block)
295
+ end
296
+
297
+ protected
298
+
299
+ def apply_command_defaults(command)
300
+ command.query['key'] = key unless key.nil?
301
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
302
+ end
303
+ end
304
+ end
305
+ end
306
+ end
metadata ADDED
@@ -0,0 +1,76 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: google-apis-cloudbuild_v1beta1
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-03-15 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 V1beta1. 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_v1beta1.rb
44
+ - lib/google/apis/cloudbuild_v1beta1.rb
45
+ - lib/google/apis/cloudbuild_v1beta1/classes.rb
46
+ - lib/google/apis/cloudbuild_v1beta1/gem_version.rb
47
+ - lib/google/apis/cloudbuild_v1beta1/representations.rb
48
+ - lib/google/apis/cloudbuild_v1beta1/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_v1beta1/CHANGELOG.md
55
+ documentation_uri: https://googleapis.dev/ruby/google-apis-cloudbuild_v1beta1/v0.1.0
56
+ source_code_uri: https://github.com/googleapis/google-api-ruby-client/tree/master/generated/google-apis-cloudbuild_v1beta1
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.5'
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.2.13
73
+ signing_key:
74
+ specification_version: 4
75
+ summary: Simple REST client for Cloud Build API V1beta1
76
+ test_files: []