google-apis-backupdr_v1 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,570 @@
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 BackupdrV1
23
+ # Backup and DR Service API
24
+ #
25
+ #
26
+ #
27
+ # @example
28
+ # require 'google/apis/backupdr_v1'
29
+ #
30
+ # Backupdr = Google::Apis::BackupdrV1 # Alias the module
31
+ # service = Backupdr::BackupdrService.new
32
+ #
33
+ # @see https://cloud.google.com/
34
+ class BackupdrService < 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://backupdr.googleapis.com/', '',
47
+ client_name: 'google-apis-backupdr_v1',
48
+ client_version: Google::Apis::BackupdrV1::GEM_VERSION)
49
+ @batch_path = 'batch'
50
+ end
51
+
52
+ # Gets information about a location.
53
+ # @param [String] name
54
+ # Resource name for the location.
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::BackupdrV1::Location] parsed result object
65
+ # @yieldparam err [StandardError] error object if request failed
66
+ #
67
+ # @return [Google::Apis::BackupdrV1::Location]
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_location(name, fields: nil, quota_user: nil, options: nil, &block)
73
+ command = make_simple_command(:get, 'v1/{+name}', options)
74
+ command.response_representation = Google::Apis::BackupdrV1::Location::Representation
75
+ command.response_class = Google::Apis::BackupdrV1::Location
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
+ # Lists information about the supported locations for this service.
83
+ # @param [String] name
84
+ # The resource that owns the locations collection, if applicable.
85
+ # @param [String] filter
86
+ # A filter to narrow down results to a preferred subset. The filtering language
87
+ # accepts strings like `"displayName=tokyo"`, and is documented in more detail
88
+ # in [AIP-160](https://google.aip.dev/160).
89
+ # @param [Fixnum] page_size
90
+ # The maximum number of results to return. If not set, the service selects a
91
+ # default.
92
+ # @param [String] page_token
93
+ # A page token received from the `next_page_token` field in the response. Send
94
+ # that page token to receive the subsequent page.
95
+ # @param [String] fields
96
+ # Selector specifying which fields to include in a partial response.
97
+ # @param [String] quota_user
98
+ # Available to use for quota purposes for server-side applications. Can be any
99
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
100
+ # @param [Google::Apis::RequestOptions] options
101
+ # Request-specific options
102
+ #
103
+ # @yield [result, err] Result & error if block supplied
104
+ # @yieldparam result [Google::Apis::BackupdrV1::ListLocationsResponse] parsed result object
105
+ # @yieldparam err [StandardError] error object if request failed
106
+ #
107
+ # @return [Google::Apis::BackupdrV1::ListLocationsResponse]
108
+ #
109
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
110
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
111
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
112
+ def list_project_locations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
113
+ command = make_simple_command(:get, 'v1/{+name}/locations', options)
114
+ command.response_representation = Google::Apis::BackupdrV1::ListLocationsResponse::Representation
115
+ command.response_class = Google::Apis::BackupdrV1::ListLocationsResponse
116
+ command.params['name'] = name unless name.nil?
117
+ command.query['filter'] = filter unless filter.nil?
118
+ command.query['pageSize'] = page_size unless page_size.nil?
119
+ command.query['pageToken'] = page_token unless page_token.nil?
120
+ command.query['fields'] = fields unless fields.nil?
121
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
122
+ execute_or_queue_command(command, &block)
123
+ end
124
+
125
+ # Creates a new ManagementServer in a given project and location.
126
+ # @param [String] parent
127
+ # Required. The management server project and location in the format `projects/`
128
+ # project_id`/locations/`location``. In Cloud Backup and DR locations map to GCP
129
+ # regions, for example **us-central1**.
130
+ # @param [Google::Apis::BackupdrV1::ManagementServer] management_server_object
131
+ # @param [String] management_server_id
132
+ # Required. The name of the management server to create. The name must be unique
133
+ # for the specified project and location.
134
+ # @param [String] request_id
135
+ # Optional. An optional request ID to identify requests. Specify a unique
136
+ # request ID so that if you must retry your request, the server will know to
137
+ # ignore the request if it has already been completed. The server will guarantee
138
+ # that for at least 60 minutes since the first request. For example, consider a
139
+ # situation where you make an initial request and the request times out. If you
140
+ # make the request again with the same request ID, the server can check if
141
+ # original operation with the same request ID was received, and if so, will
142
+ # ignore the second request. This prevents clients from accidentally creating
143
+ # duplicate commitments. The request ID must be a valid UUID with the exception
144
+ # that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
145
+ # @param [String] fields
146
+ # Selector specifying which fields to include in a partial response.
147
+ # @param [String] quota_user
148
+ # Available to use for quota purposes for server-side applications. Can be any
149
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
150
+ # @param [Google::Apis::RequestOptions] options
151
+ # Request-specific options
152
+ #
153
+ # @yield [result, err] Result & error if block supplied
154
+ # @yieldparam result [Google::Apis::BackupdrV1::Operation] parsed result object
155
+ # @yieldparam err [StandardError] error object if request failed
156
+ #
157
+ # @return [Google::Apis::BackupdrV1::Operation]
158
+ #
159
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
160
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
161
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
162
+ def create_project_location_management_server(parent, management_server_object = nil, management_server_id: nil, request_id: nil, fields: nil, quota_user: nil, options: nil, &block)
163
+ command = make_simple_command(:post, 'v1/{+parent}/managementServers', options)
164
+ command.request_representation = Google::Apis::BackupdrV1::ManagementServer::Representation
165
+ command.request_object = management_server_object
166
+ command.response_representation = Google::Apis::BackupdrV1::Operation::Representation
167
+ command.response_class = Google::Apis::BackupdrV1::Operation
168
+ command.params['parent'] = parent unless parent.nil?
169
+ command.query['managementServerId'] = management_server_id unless management_server_id.nil?
170
+ command.query['requestId'] = request_id unless request_id.nil?
171
+ command.query['fields'] = fields unless fields.nil?
172
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
173
+ execute_or_queue_command(command, &block)
174
+ end
175
+
176
+ # Deletes a single ManagementServer.
177
+ # @param [String] name
178
+ # Required. Name of the resource
179
+ # @param [String] request_id
180
+ # Optional. An optional request ID to identify requests. Specify a unique
181
+ # request ID so that if you must retry your request, the server will know to
182
+ # ignore the request if it has already been completed. The server will guarantee
183
+ # that for at least 60 minutes after the first request. For example, consider a
184
+ # situation where you make an initial request and the request times out. If you
185
+ # make the request again with the same request ID, the server can check if
186
+ # original operation with the same request ID was received, and if so, will
187
+ # ignore the second request. This prevents clients from accidentally creating
188
+ # duplicate commitments. The request ID must be a valid UUID with the exception
189
+ # that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
190
+ # @param [String] fields
191
+ # Selector specifying which fields to include in a partial response.
192
+ # @param [String] quota_user
193
+ # Available to use for quota purposes for server-side applications. Can be any
194
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
195
+ # @param [Google::Apis::RequestOptions] options
196
+ # Request-specific options
197
+ #
198
+ # @yield [result, err] Result & error if block supplied
199
+ # @yieldparam result [Google::Apis::BackupdrV1::Operation] parsed result object
200
+ # @yieldparam err [StandardError] error object if request failed
201
+ #
202
+ # @return [Google::Apis::BackupdrV1::Operation]
203
+ #
204
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
205
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
206
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
207
+ def delete_project_location_management_server(name, request_id: nil, fields: nil, quota_user: nil, options: nil, &block)
208
+ command = make_simple_command(:delete, 'v1/{+name}', options)
209
+ command.response_representation = Google::Apis::BackupdrV1::Operation::Representation
210
+ command.response_class = Google::Apis::BackupdrV1::Operation
211
+ command.params['name'] = name unless name.nil?
212
+ command.query['requestId'] = request_id unless request_id.nil?
213
+ command.query['fields'] = fields unless fields.nil?
214
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
215
+ execute_or_queue_command(command, &block)
216
+ end
217
+
218
+ # Gets details of a single ManagementServer.
219
+ # @param [String] name
220
+ # Required. Name of the management server resource name, in the format `projects/
221
+ # `project_id`/locations/`location`/managementServers/`resource_name``
222
+ # @param [String] fields
223
+ # Selector specifying which fields to include in a partial response.
224
+ # @param [String] quota_user
225
+ # Available to use for quota purposes for server-side applications. Can be any
226
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
227
+ # @param [Google::Apis::RequestOptions] options
228
+ # Request-specific options
229
+ #
230
+ # @yield [result, err] Result & error if block supplied
231
+ # @yieldparam result [Google::Apis::BackupdrV1::ManagementServer] parsed result object
232
+ # @yieldparam err [StandardError] error object if request failed
233
+ #
234
+ # @return [Google::Apis::BackupdrV1::ManagementServer]
235
+ #
236
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
237
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
238
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
239
+ def get_project_location_management_server(name, fields: nil, quota_user: nil, options: nil, &block)
240
+ command = make_simple_command(:get, 'v1/{+name}', options)
241
+ command.response_representation = Google::Apis::BackupdrV1::ManagementServer::Representation
242
+ command.response_class = Google::Apis::BackupdrV1::ManagementServer
243
+ command.params['name'] = name unless name.nil?
244
+ command.query['fields'] = fields unless fields.nil?
245
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
246
+ execute_or_queue_command(command, &block)
247
+ end
248
+
249
+ # Gets the access control policy for a resource. Returns an empty policy if the
250
+ # resource exists and does not have a policy set.
251
+ # @param [String] resource
252
+ # REQUIRED: The resource for which the policy is being requested. See [Resource
253
+ # names](https://cloud.google.com/apis/design/resource_names) for the
254
+ # appropriate value for this field.
255
+ # @param [Fixnum] options_requested_policy_version
256
+ # Optional. The maximum policy version that will be used to format the policy.
257
+ # Valid values are 0, 1, and 3. Requests specifying an invalid value will be
258
+ # rejected. Requests for policies with any conditional role bindings must
259
+ # specify version 3. Policies with no conditional role bindings may specify any
260
+ # valid value or leave the field unset. The policy in the response might use the
261
+ # policy version that you specified, or it might use a lower policy version. For
262
+ # example, if you specify version 3, but the policy has no conditional role
263
+ # bindings, the response uses version 1. To learn which resources support
264
+ # conditions in their IAM policies, see the [IAM documentation](https://cloud.
265
+ # google.com/iam/help/conditions/resource-policies).
266
+ # @param [String] fields
267
+ # Selector specifying which fields to include in a partial response.
268
+ # @param [String] quota_user
269
+ # Available to use for quota purposes for server-side applications. Can be any
270
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
271
+ # @param [Google::Apis::RequestOptions] options
272
+ # Request-specific options
273
+ #
274
+ # @yield [result, err] Result & error if block supplied
275
+ # @yieldparam result [Google::Apis::BackupdrV1::Policy] parsed result object
276
+ # @yieldparam err [StandardError] error object if request failed
277
+ #
278
+ # @return [Google::Apis::BackupdrV1::Policy]
279
+ #
280
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
281
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
282
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
283
+ def get_project_location_management_server_iam_policy(resource, options_requested_policy_version: nil, fields: nil, quota_user: nil, options: nil, &block)
284
+ command = make_simple_command(:get, 'v1/{+resource}:getIamPolicy', options)
285
+ command.response_representation = Google::Apis::BackupdrV1::Policy::Representation
286
+ command.response_class = Google::Apis::BackupdrV1::Policy
287
+ command.params['resource'] = resource unless resource.nil?
288
+ command.query['options.requestedPolicyVersion'] = options_requested_policy_version unless options_requested_policy_version.nil?
289
+ command.query['fields'] = fields unless fields.nil?
290
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
291
+ execute_or_queue_command(command, &block)
292
+ end
293
+
294
+ # Lists ManagementServers in a given project and location.
295
+ # @param [String] parent
296
+ # Required. The project and location for which to retrieve management servers
297
+ # information, in the format `projects/`project_id`/locations/`location``. In
298
+ # Cloud BackupDR, locations map to GCP regions, for example **us-central1**. To
299
+ # retrieve management servers for all locations, use "-" for the ``location``
300
+ # value.
301
+ # @param [String] filter
302
+ # Optional. Filtering results.
303
+ # @param [String] order_by
304
+ # Optional. Hint for how to order the results.
305
+ # @param [Fixnum] page_size
306
+ # Optional. Requested page size. Server may return fewer items than requested.
307
+ # If unspecified, server will pick an appropriate default.
308
+ # @param [String] page_token
309
+ # Optional. A token identifying a page of results the server should return.
310
+ # @param [String] fields
311
+ # Selector specifying which fields to include in a partial response.
312
+ # @param [String] quota_user
313
+ # Available to use for quota purposes for server-side applications. Can be any
314
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
315
+ # @param [Google::Apis::RequestOptions] options
316
+ # Request-specific options
317
+ #
318
+ # @yield [result, err] Result & error if block supplied
319
+ # @yieldparam result [Google::Apis::BackupdrV1::ListManagementServersResponse] parsed result object
320
+ # @yieldparam err [StandardError] error object if request failed
321
+ #
322
+ # @return [Google::Apis::BackupdrV1::ListManagementServersResponse]
323
+ #
324
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
325
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
326
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
327
+ def list_project_location_management_servers(parent, filter: nil, order_by: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
328
+ command = make_simple_command(:get, 'v1/{+parent}/managementServers', options)
329
+ command.response_representation = Google::Apis::BackupdrV1::ListManagementServersResponse::Representation
330
+ command.response_class = Google::Apis::BackupdrV1::ListManagementServersResponse
331
+ command.params['parent'] = parent unless parent.nil?
332
+ command.query['filter'] = filter unless filter.nil?
333
+ command.query['orderBy'] = order_by unless order_by.nil?
334
+ command.query['pageSize'] = page_size unless page_size.nil?
335
+ command.query['pageToken'] = page_token unless page_token.nil?
336
+ command.query['fields'] = fields unless fields.nil?
337
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
338
+ execute_or_queue_command(command, &block)
339
+ end
340
+
341
+ # Sets the access control policy on the specified resource. Replaces any
342
+ # existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `
343
+ # PERMISSION_DENIED` errors.
344
+ # @param [String] resource
345
+ # REQUIRED: The resource for which the policy is being specified. See [Resource
346
+ # names](https://cloud.google.com/apis/design/resource_names) for the
347
+ # appropriate value for this field.
348
+ # @param [Google::Apis::BackupdrV1::SetIamPolicyRequest] set_iam_policy_request_object
349
+ # @param [String] fields
350
+ # Selector specifying which fields to include in a partial response.
351
+ # @param [String] quota_user
352
+ # Available to use for quota purposes for server-side applications. Can be any
353
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
354
+ # @param [Google::Apis::RequestOptions] options
355
+ # Request-specific options
356
+ #
357
+ # @yield [result, err] Result & error if block supplied
358
+ # @yieldparam result [Google::Apis::BackupdrV1::Policy] parsed result object
359
+ # @yieldparam err [StandardError] error object if request failed
360
+ #
361
+ # @return [Google::Apis::BackupdrV1::Policy]
362
+ #
363
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
364
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
365
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
366
+ def set_management_server_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
367
+ command = make_simple_command(:post, 'v1/{+resource}:setIamPolicy', options)
368
+ command.request_representation = Google::Apis::BackupdrV1::SetIamPolicyRequest::Representation
369
+ command.request_object = set_iam_policy_request_object
370
+ command.response_representation = Google::Apis::BackupdrV1::Policy::Representation
371
+ command.response_class = Google::Apis::BackupdrV1::Policy
372
+ command.params['resource'] = resource unless resource.nil?
373
+ command.query['fields'] = fields unless fields.nil?
374
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
375
+ execute_or_queue_command(command, &block)
376
+ end
377
+
378
+ # Returns permissions that a caller has on the specified resource. If the
379
+ # resource does not exist, this will return an empty set of permissions, not a `
380
+ # NOT_FOUND` error. Note: This operation is designed to be used for building
381
+ # permission-aware UIs and command-line tools, not for authorization checking.
382
+ # This operation may "fail open" without warning.
383
+ # @param [String] resource
384
+ # REQUIRED: The resource for which the policy detail is being requested. See [
385
+ # Resource names](https://cloud.google.com/apis/design/resource_names) for the
386
+ # appropriate value for this field.
387
+ # @param [Google::Apis::BackupdrV1::TestIamPermissionsRequest] test_iam_permissions_request_object
388
+ # @param [String] fields
389
+ # Selector specifying which fields to include in a partial response.
390
+ # @param [String] quota_user
391
+ # Available to use for quota purposes for server-side applications. Can be any
392
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
393
+ # @param [Google::Apis::RequestOptions] options
394
+ # Request-specific options
395
+ #
396
+ # @yield [result, err] Result & error if block supplied
397
+ # @yieldparam result [Google::Apis::BackupdrV1::TestIamPermissionsResponse] parsed result object
398
+ # @yieldparam err [StandardError] error object if request failed
399
+ #
400
+ # @return [Google::Apis::BackupdrV1::TestIamPermissionsResponse]
401
+ #
402
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
403
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
404
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
405
+ def test_management_server_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
406
+ command = make_simple_command(:post, 'v1/{+resource}:testIamPermissions', options)
407
+ command.request_representation = Google::Apis::BackupdrV1::TestIamPermissionsRequest::Representation
408
+ command.request_object = test_iam_permissions_request_object
409
+ command.response_representation = Google::Apis::BackupdrV1::TestIamPermissionsResponse::Representation
410
+ command.response_class = Google::Apis::BackupdrV1::TestIamPermissionsResponse
411
+ command.params['resource'] = resource unless resource.nil?
412
+ command.query['fields'] = fields unless fields.nil?
413
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
414
+ execute_or_queue_command(command, &block)
415
+ end
416
+
417
+ # Starts asynchronous cancellation on a long-running operation. The server makes
418
+ # a best effort to cancel the operation, but success is not guaranteed. If the
419
+ # server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
420
+ # Clients can use Operations.GetOperation or other methods to check whether the
421
+ # cancellation succeeded or whether the operation completed despite cancellation.
422
+ # On successful cancellation, the operation is not deleted; instead, it becomes
423
+ # an operation with an Operation.error value with a google.rpc.Status.code of 1,
424
+ # corresponding to `Code.CANCELLED`.
425
+ # @param [String] name
426
+ # The name of the operation resource to be cancelled.
427
+ # @param [Google::Apis::BackupdrV1::CancelOperationRequest] cancel_operation_request_object
428
+ # @param [String] fields
429
+ # Selector specifying which fields to include in a partial response.
430
+ # @param [String] quota_user
431
+ # Available to use for quota purposes for server-side applications. Can be any
432
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
433
+ # @param [Google::Apis::RequestOptions] options
434
+ # Request-specific options
435
+ #
436
+ # @yield [result, err] Result & error if block supplied
437
+ # @yieldparam result [Google::Apis::BackupdrV1::Empty] parsed result object
438
+ # @yieldparam err [StandardError] error object if request failed
439
+ #
440
+ # @return [Google::Apis::BackupdrV1::Empty]
441
+ #
442
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
443
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
444
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
445
+ def cancel_operation(name, cancel_operation_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
446
+ command = make_simple_command(:post, 'v1/{+name}:cancel', options)
447
+ command.request_representation = Google::Apis::BackupdrV1::CancelOperationRequest::Representation
448
+ command.request_object = cancel_operation_request_object
449
+ command.response_representation = Google::Apis::BackupdrV1::Empty::Representation
450
+ command.response_class = Google::Apis::BackupdrV1::Empty
451
+ command.params['name'] = name unless name.nil?
452
+ command.query['fields'] = fields unless fields.nil?
453
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
454
+ execute_or_queue_command(command, &block)
455
+ end
456
+
457
+ # Deletes a long-running operation. This method indicates that the client is no
458
+ # longer interested in the operation result. It does not cancel the operation.
459
+ # If the server doesn't support this method, it returns `google.rpc.Code.
460
+ # UNIMPLEMENTED`.
461
+ # @param [String] name
462
+ # The name of the operation resource to be deleted.
463
+ # @param [String] fields
464
+ # Selector specifying which fields to include in a partial response.
465
+ # @param [String] quota_user
466
+ # Available to use for quota purposes for server-side applications. Can be any
467
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
468
+ # @param [Google::Apis::RequestOptions] options
469
+ # Request-specific options
470
+ #
471
+ # @yield [result, err] Result & error if block supplied
472
+ # @yieldparam result [Google::Apis::BackupdrV1::Empty] parsed result object
473
+ # @yieldparam err [StandardError] error object if request failed
474
+ #
475
+ # @return [Google::Apis::BackupdrV1::Empty]
476
+ #
477
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
478
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
479
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
480
+ def delete_project_location_operation(name, fields: nil, quota_user: nil, options: nil, &block)
481
+ command = make_simple_command(:delete, 'v1/{+name}', options)
482
+ command.response_representation = Google::Apis::BackupdrV1::Empty::Representation
483
+ command.response_class = Google::Apis::BackupdrV1::Empty
484
+ command.params['name'] = name unless name.nil?
485
+ command.query['fields'] = fields unless fields.nil?
486
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
487
+ execute_or_queue_command(command, &block)
488
+ end
489
+
490
+ # Gets the latest state of a long-running operation. Clients can use this method
491
+ # to poll the operation result at intervals as recommended by the API service.
492
+ # @param [String] name
493
+ # The name of the operation resource.
494
+ # @param [String] fields
495
+ # Selector specifying which fields to include in a partial response.
496
+ # @param [String] quota_user
497
+ # Available to use for quota purposes for server-side applications. Can be any
498
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
499
+ # @param [Google::Apis::RequestOptions] options
500
+ # Request-specific options
501
+ #
502
+ # @yield [result, err] Result & error if block supplied
503
+ # @yieldparam result [Google::Apis::BackupdrV1::Operation] parsed result object
504
+ # @yieldparam err [StandardError] error object if request failed
505
+ #
506
+ # @return [Google::Apis::BackupdrV1::Operation]
507
+ #
508
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
509
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
510
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
511
+ def get_project_location_operation(name, fields: nil, quota_user: nil, options: nil, &block)
512
+ command = make_simple_command(:get, 'v1/{+name}', options)
513
+ command.response_representation = Google::Apis::BackupdrV1::Operation::Representation
514
+ command.response_class = Google::Apis::BackupdrV1::Operation
515
+ command.params['name'] = name unless name.nil?
516
+ command.query['fields'] = fields unless fields.nil?
517
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
518
+ execute_or_queue_command(command, &block)
519
+ end
520
+
521
+ # Lists operations that match the specified filter in the request. If the server
522
+ # doesn't support this method, it returns `UNIMPLEMENTED`.
523
+ # @param [String] name
524
+ # The name of the operation's parent resource.
525
+ # @param [String] filter
526
+ # The standard list filter.
527
+ # @param [Fixnum] page_size
528
+ # The standard list page size.
529
+ # @param [String] page_token
530
+ # The standard list page token.
531
+ # @param [String] fields
532
+ # Selector specifying which fields to include in a partial response.
533
+ # @param [String] quota_user
534
+ # Available to use for quota purposes for server-side applications. Can be any
535
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
536
+ # @param [Google::Apis::RequestOptions] options
537
+ # Request-specific options
538
+ #
539
+ # @yield [result, err] Result & error if block supplied
540
+ # @yieldparam result [Google::Apis::BackupdrV1::ListOperationsResponse] parsed result object
541
+ # @yieldparam err [StandardError] error object if request failed
542
+ #
543
+ # @return [Google::Apis::BackupdrV1::ListOperationsResponse]
544
+ #
545
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
546
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
547
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
548
+ def list_project_location_operations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
549
+ command = make_simple_command(:get, 'v1/{+name}/operations', options)
550
+ command.response_representation = Google::Apis::BackupdrV1::ListOperationsResponse::Representation
551
+ command.response_class = Google::Apis::BackupdrV1::ListOperationsResponse
552
+ command.params['name'] = name unless name.nil?
553
+ command.query['filter'] = filter unless filter.nil?
554
+ command.query['pageSize'] = page_size unless page_size.nil?
555
+ command.query['pageToken'] = page_token unless page_token.nil?
556
+ command.query['fields'] = fields unless fields.nil?
557
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
558
+ execute_or_queue_command(command, &block)
559
+ end
560
+
561
+ protected
562
+
563
+ def apply_command_defaults(command)
564
+ command.query['key'] = key unless key.nil?
565
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
566
+ end
567
+ end
568
+ end
569
+ end
570
+ end
@@ -0,0 +1,36 @@
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/backupdr_v1/service.rb'
16
+ require 'google/apis/backupdr_v1/classes.rb'
17
+ require 'google/apis/backupdr_v1/representations.rb'
18
+ require 'google/apis/backupdr_v1/gem_version.rb'
19
+
20
+ module Google
21
+ module Apis
22
+ # Backup and DR Service API
23
+ #
24
+ #
25
+ #
26
+ # @see https://cloud.google.com/
27
+ module BackupdrV1
28
+ # Version of the Backup and DR Service API this client connects to.
29
+ # This is NOT the gem version.
30
+ VERSION = 'V1'
31
+
32
+ # See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
33
+ AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,15 @@
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/backupdr_v1"