google-apis-gkehub_v1alpha 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,706 @@
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 GkehubV1alpha
23
+ # GKE Hub
24
+ #
25
+ #
26
+ #
27
+ # @example
28
+ # require 'google/apis/gkehub_v1alpha'
29
+ #
30
+ # Gkehub = Google::Apis::GkehubV1alpha # Alias the module
31
+ # service = Gkehub::GKEHubService.new
32
+ #
33
+ # @see https://cloud.google.com/anthos/multicluster-management/connect/registering-a-cluster
34
+ class GKEHubService < 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://gkehub.googleapis.com/', '',
47
+ client_name: 'google-apis-gkehub_v1alpha',
48
+ client_version: Google::Apis::GkehubV1alpha::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::GkehubV1alpha::Location] parsed result object
65
+ # @yieldparam err [StandardError] error object if request failed
66
+ #
67
+ # @return [Google::Apis::GkehubV1alpha::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, 'v1alpha/{+name}', options)
74
+ command.response_representation = Google::Apis::GkehubV1alpha::Location::Representation
75
+ command.response_class = Google::Apis::GkehubV1alpha::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 in [
88
+ # 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 will select 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::GkehubV1alpha::ListLocationsResponse] parsed result object
105
+ # @yieldparam err [StandardError] error object if request failed
106
+ #
107
+ # @return [Google::Apis::GkehubV1alpha::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, 'v1alpha/{+name}/locations', options)
114
+ command.response_representation = Google::Apis::GkehubV1alpha::ListLocationsResponse::Representation
115
+ command.response_class = Google::Apis::GkehubV1alpha::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
+ # Gets the access control policy for a resource. Returns an empty policy if the
126
+ # resource exists and does not have a policy set.
127
+ # @param [String] resource
128
+ # REQUIRED: The resource for which the policy is being requested. See the
129
+ # operation documentation for the appropriate value for this field.
130
+ # @param [Fixnum] options_requested_policy_version
131
+ # Optional. The policy format version to be returned. Valid values are 0, 1, and
132
+ # 3. Requests specifying an invalid value will be rejected. Requests for
133
+ # policies with any conditional bindings must specify version 3. Policies
134
+ # without any conditional bindings may specify any valid value or leave the
135
+ # field unset. To learn which resources support conditions in their IAM policies,
136
+ # see the [IAM documentation](https://cloud.google.com/iam/help/conditions/
137
+ # resource-policies).
138
+ # @param [String] fields
139
+ # Selector specifying which fields to include in a partial response.
140
+ # @param [String] quota_user
141
+ # Available to use for quota purposes for server-side applications. Can be any
142
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
143
+ # @param [Google::Apis::RequestOptions] options
144
+ # Request-specific options
145
+ #
146
+ # @yield [result, err] Result & error if block supplied
147
+ # @yieldparam result [Google::Apis::GkehubV1alpha::Policy] parsed result object
148
+ # @yieldparam err [StandardError] error object if request failed
149
+ #
150
+ # @return [Google::Apis::GkehubV1alpha::Policy]
151
+ #
152
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
153
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
154
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
155
+ def get_project_location_feature_iam_policy(resource, options_requested_policy_version: nil, fields: nil, quota_user: nil, options: nil, &block)
156
+ command = make_simple_command(:get, 'v1alpha/{+resource}:getIamPolicy', options)
157
+ command.response_representation = Google::Apis::GkehubV1alpha::Policy::Representation
158
+ command.response_class = Google::Apis::GkehubV1alpha::Policy
159
+ command.params['resource'] = resource unless resource.nil?
160
+ command.query['options.requestedPolicyVersion'] = options_requested_policy_version unless options_requested_policy_version.nil?
161
+ command.query['fields'] = fields unless fields.nil?
162
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
163
+ execute_or_queue_command(command, &block)
164
+ end
165
+
166
+ # Sets the access control policy on the specified resource. Replaces any
167
+ # existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `
168
+ # PERMISSION_DENIED` errors.
169
+ # @param [String] resource
170
+ # REQUIRED: The resource for which the policy is being specified. See the
171
+ # operation documentation for the appropriate value for this field.
172
+ # @param [Google::Apis::GkehubV1alpha::SetIamPolicyRequest] set_iam_policy_request_object
173
+ # @param [String] fields
174
+ # Selector specifying which fields to include in a partial response.
175
+ # @param [String] quota_user
176
+ # Available to use for quota purposes for server-side applications. Can be any
177
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
178
+ # @param [Google::Apis::RequestOptions] options
179
+ # Request-specific options
180
+ #
181
+ # @yield [result, err] Result & error if block supplied
182
+ # @yieldparam result [Google::Apis::GkehubV1alpha::Policy] parsed result object
183
+ # @yieldparam err [StandardError] error object if request failed
184
+ #
185
+ # @return [Google::Apis::GkehubV1alpha::Policy]
186
+ #
187
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
188
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
189
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
190
+ def set_feature_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
191
+ command = make_simple_command(:post, 'v1alpha/{+resource}:setIamPolicy', options)
192
+ command.request_representation = Google::Apis::GkehubV1alpha::SetIamPolicyRequest::Representation
193
+ command.request_object = set_iam_policy_request_object
194
+ command.response_representation = Google::Apis::GkehubV1alpha::Policy::Representation
195
+ command.response_class = Google::Apis::GkehubV1alpha::Policy
196
+ command.params['resource'] = resource unless resource.nil?
197
+ command.query['fields'] = fields unless fields.nil?
198
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
199
+ execute_or_queue_command(command, &block)
200
+ end
201
+
202
+ # Returns permissions that a caller has on the specified resource. If the
203
+ # resource does not exist, this will return an empty set of permissions, not a `
204
+ # NOT_FOUND` error. Note: This operation is designed to be used for building
205
+ # permission-aware UIs and command-line tools, not for authorization checking.
206
+ # This operation may "fail open" without warning.
207
+ # @param [String] resource
208
+ # REQUIRED: The resource for which the policy detail is being requested. See the
209
+ # operation documentation for the appropriate value for this field.
210
+ # @param [Google::Apis::GkehubV1alpha::TestIamPermissionsRequest] test_iam_permissions_request_object
211
+ # @param [String] fields
212
+ # Selector specifying which fields to include in a partial response.
213
+ # @param [String] quota_user
214
+ # Available to use for quota purposes for server-side applications. Can be any
215
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
216
+ # @param [Google::Apis::RequestOptions] options
217
+ # Request-specific options
218
+ #
219
+ # @yield [result, err] Result & error if block supplied
220
+ # @yieldparam result [Google::Apis::GkehubV1alpha::TestIamPermissionsResponse] parsed result object
221
+ # @yieldparam err [StandardError] error object if request failed
222
+ #
223
+ # @return [Google::Apis::GkehubV1alpha::TestIamPermissionsResponse]
224
+ #
225
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
226
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
227
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
228
+ def test_feature_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
229
+ command = make_simple_command(:post, 'v1alpha/{+resource}:testIamPermissions', options)
230
+ command.request_representation = Google::Apis::GkehubV1alpha::TestIamPermissionsRequest::Representation
231
+ command.request_object = test_iam_permissions_request_object
232
+ command.response_representation = Google::Apis::GkehubV1alpha::TestIamPermissionsResponse::Representation
233
+ command.response_class = Google::Apis::GkehubV1alpha::TestIamPermissionsResponse
234
+ command.params['resource'] = resource unless resource.nil?
235
+ command.query['fields'] = fields unless fields.nil?
236
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
237
+ execute_or_queue_command(command, &block)
238
+ end
239
+
240
+ # Adds a new Feature.
241
+ # @param [String] parent
242
+ # The parent (project and location) where the Feature will be created. Specified
243
+ # in the format `projects/*/locations/global`.
244
+ # @param [Google::Apis::GkehubV1alpha::Feature] feature_object
245
+ # @param [String] feature_id
246
+ # The ID of the feature to create.
247
+ # @param [String] fields
248
+ # Selector specifying which fields to include in a partial response.
249
+ # @param [String] quota_user
250
+ # Available to use for quota purposes for server-side applications. Can be any
251
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
252
+ # @param [Google::Apis::RequestOptions] options
253
+ # Request-specific options
254
+ #
255
+ # @yield [result, err] Result & error if block supplied
256
+ # @yieldparam result [Google::Apis::GkehubV1alpha::Operation] parsed result object
257
+ # @yieldparam err [StandardError] error object if request failed
258
+ #
259
+ # @return [Google::Apis::GkehubV1alpha::Operation]
260
+ #
261
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
262
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
263
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
264
+ def create_project_location_global_feature(parent, feature_object = nil, feature_id: nil, fields: nil, quota_user: nil, options: nil, &block)
265
+ command = make_simple_command(:post, 'v1alpha/{+parent}/features', options)
266
+ command.request_representation = Google::Apis::GkehubV1alpha::Feature::Representation
267
+ command.request_object = feature_object
268
+ command.response_representation = Google::Apis::GkehubV1alpha::Operation::Representation
269
+ command.response_class = Google::Apis::GkehubV1alpha::Operation
270
+ command.params['parent'] = parent unless parent.nil?
271
+ command.query['featureId'] = feature_id unless feature_id.nil?
272
+ command.query['fields'] = fields unless fields.nil?
273
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
274
+ execute_or_queue_command(command, &block)
275
+ end
276
+
277
+ # Removes a Feature.
278
+ # @param [String] name
279
+ # The Feature resource name in the format `projects/*/locations/global/features/*
280
+ # `.
281
+ # @param [Boolean] force
282
+ # If set to true, the delete will ignore any outstanding resources for this
283
+ # Feature (that is, `FeatureState.has_resources` is set to true). These
284
+ # resources will NOT be cleaned up or modified in any way.
285
+ # @param [String] fields
286
+ # Selector specifying which fields to include in a partial response.
287
+ # @param [String] quota_user
288
+ # Available to use for quota purposes for server-side applications. Can be any
289
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
290
+ # @param [Google::Apis::RequestOptions] options
291
+ # Request-specific options
292
+ #
293
+ # @yield [result, err] Result & error if block supplied
294
+ # @yieldparam result [Google::Apis::GkehubV1alpha::Operation] parsed result object
295
+ # @yieldparam err [StandardError] error object if request failed
296
+ #
297
+ # @return [Google::Apis::GkehubV1alpha::Operation]
298
+ #
299
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
300
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
301
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
302
+ def delete_project_location_global_feature(name, force: nil, fields: nil, quota_user: nil, options: nil, &block)
303
+ command = make_simple_command(:delete, 'v1alpha/{+name}', options)
304
+ command.response_representation = Google::Apis::GkehubV1alpha::Operation::Representation
305
+ command.response_class = Google::Apis::GkehubV1alpha::Operation
306
+ command.params['name'] = name unless name.nil?
307
+ command.query['force'] = force unless force.nil?
308
+ command.query['fields'] = fields unless fields.nil?
309
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
310
+ execute_or_queue_command(command, &block)
311
+ end
312
+
313
+ # Gets details of a single Feature.
314
+ # @param [String] name
315
+ # The Feature resource name in the format `projects/*/locations/global/features/*
316
+ # `
317
+ # @param [String] fields
318
+ # Selector specifying which fields to include in a partial response.
319
+ # @param [String] quota_user
320
+ # Available to use for quota purposes for server-side applications. Can be any
321
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
322
+ # @param [Google::Apis::RequestOptions] options
323
+ # Request-specific options
324
+ #
325
+ # @yield [result, err] Result & error if block supplied
326
+ # @yieldparam result [Google::Apis::GkehubV1alpha::Feature] parsed result object
327
+ # @yieldparam err [StandardError] error object if request failed
328
+ #
329
+ # @return [Google::Apis::GkehubV1alpha::Feature]
330
+ #
331
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
332
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
333
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
334
+ def get_project_location_global_feature(name, fields: nil, quota_user: nil, options: nil, &block)
335
+ command = make_simple_command(:get, 'v1alpha/{+name}', options)
336
+ command.response_representation = Google::Apis::GkehubV1alpha::Feature::Representation
337
+ command.response_class = Google::Apis::GkehubV1alpha::Feature
338
+ command.params['name'] = name unless name.nil?
339
+ command.query['fields'] = fields unless fields.nil?
340
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
341
+ execute_or_queue_command(command, &block)
342
+ end
343
+
344
+ # Lists Features in a given project and location.
345
+ # @param [String] parent
346
+ # The parent (project and location) where the Features will be listed. Specified
347
+ # in the format `projects/*/locations/global`.
348
+ # @param [String] filter
349
+ # Lists Features that match the filter expression, following the syntax outlined
350
+ # in https://google.aip.dev/160. Examples: - Feature with the name "servicemesh"
351
+ # in project "foo-proj": name = "projects/foo-proj/locations/global/features/
352
+ # servicemesh" - Features that have a label called `foo`: labels.foo:* -
353
+ # Features that have a label called `foo` whose value is `bar`: labels.foo = bar
354
+ # @param [String] order_by
355
+ # One or more fields to compare and use to sort the output. See https://google.
356
+ # aip.dev/132#ordering.
357
+ # @param [Fixnum] page_size
358
+ # When requesting a 'page' of resources, `page_size` specifies number of
359
+ # resources to return. If unspecified or set to 0, all resources will be
360
+ # returned.
361
+ # @param [String] page_token
362
+ # Token returned by previous call to `ListFeatures` which specifies the position
363
+ # in the list from where to continue listing the resources.
364
+ # @param [String] fields
365
+ # Selector specifying which fields to include in a partial response.
366
+ # @param [String] quota_user
367
+ # Available to use for quota purposes for server-side applications. Can be any
368
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
369
+ # @param [Google::Apis::RequestOptions] options
370
+ # Request-specific options
371
+ #
372
+ # @yield [result, err] Result & error if block supplied
373
+ # @yieldparam result [Google::Apis::GkehubV1alpha::ListFeaturesResponse] parsed result object
374
+ # @yieldparam err [StandardError] error object if request failed
375
+ #
376
+ # @return [Google::Apis::GkehubV1alpha::ListFeaturesResponse]
377
+ #
378
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
379
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
380
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
381
+ def list_project_location_global_features(parent, filter: nil, order_by: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
382
+ command = make_simple_command(:get, 'v1alpha/{+parent}/features', options)
383
+ command.response_representation = Google::Apis::GkehubV1alpha::ListFeaturesResponse::Representation
384
+ command.response_class = Google::Apis::GkehubV1alpha::ListFeaturesResponse
385
+ command.params['parent'] = parent unless parent.nil?
386
+ command.query['filter'] = filter unless filter.nil?
387
+ command.query['orderBy'] = order_by unless order_by.nil?
388
+ command.query['pageSize'] = page_size unless page_size.nil?
389
+ command.query['pageToken'] = page_token unless page_token.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
+ # Updates an existing Feature.
396
+ # @param [String] name
397
+ # The Feature resource name in the format `projects/*/locations/global/features/*
398
+ # `.
399
+ # @param [Google::Apis::GkehubV1alpha::Feature] feature_object
400
+ # @param [String] update_mask
401
+ # Mask of fields to update.
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::GkehubV1alpha::Operation] parsed result object
412
+ # @yieldparam err [StandardError] error object if request failed
413
+ #
414
+ # @return [Google::Apis::GkehubV1alpha::Operation]
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 patch_project_location_global_feature(name, feature_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
420
+ command = make_simple_command(:patch, 'v1alpha/{+name}', options)
421
+ command.request_representation = Google::Apis::GkehubV1alpha::Feature::Representation
422
+ command.request_object = feature_object
423
+ command.response_representation = Google::Apis::GkehubV1alpha::Operation::Representation
424
+ command.response_class = Google::Apis::GkehubV1alpha::Operation
425
+ command.params['name'] = name unless name.nil?
426
+ command.query['updateMask'] = update_mask unless update_mask.nil?
427
+ command.query['fields'] = fields unless fields.nil?
428
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
429
+ execute_or_queue_command(command, &block)
430
+ end
431
+
432
+ # Gets the access control policy for a resource. Returns an empty policy if the
433
+ # resource exists and does not have a policy set.
434
+ # @param [String] resource
435
+ # REQUIRED: The resource for which the policy is being requested. See the
436
+ # operation documentation for the appropriate value for this field.
437
+ # @param [Fixnum] options_requested_policy_version
438
+ # Optional. The policy format version to be returned. Valid values are 0, 1, and
439
+ # 3. Requests specifying an invalid value will be rejected. Requests for
440
+ # policies with any conditional bindings must specify version 3. Policies
441
+ # without any conditional bindings may specify any valid value or leave the
442
+ # field unset. To learn which resources support conditions in their IAM policies,
443
+ # see the [IAM documentation](https://cloud.google.com/iam/help/conditions/
444
+ # resource-policies).
445
+ # @param [String] fields
446
+ # Selector specifying which fields to include in a partial response.
447
+ # @param [String] quota_user
448
+ # Available to use for quota purposes for server-side applications. Can be any
449
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
450
+ # @param [Google::Apis::RequestOptions] options
451
+ # Request-specific options
452
+ #
453
+ # @yield [result, err] Result & error if block supplied
454
+ # @yieldparam result [Google::Apis::GkehubV1alpha::Policy] parsed result object
455
+ # @yieldparam err [StandardError] error object if request failed
456
+ #
457
+ # @return [Google::Apis::GkehubV1alpha::Policy]
458
+ #
459
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
460
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
461
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
462
+ def get_project_location_membership_iam_policy(resource, options_requested_policy_version: nil, fields: nil, quota_user: nil, options: nil, &block)
463
+ command = make_simple_command(:get, 'v1alpha/{+resource}:getIamPolicy', options)
464
+ command.response_representation = Google::Apis::GkehubV1alpha::Policy::Representation
465
+ command.response_class = Google::Apis::GkehubV1alpha::Policy
466
+ command.params['resource'] = resource unless resource.nil?
467
+ command.query['options.requestedPolicyVersion'] = options_requested_policy_version unless options_requested_policy_version.nil?
468
+ command.query['fields'] = fields unless fields.nil?
469
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
470
+ execute_or_queue_command(command, &block)
471
+ end
472
+
473
+ # Sets the access control policy on the specified resource. Replaces any
474
+ # existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `
475
+ # PERMISSION_DENIED` errors.
476
+ # @param [String] resource
477
+ # REQUIRED: The resource for which the policy is being specified. See the
478
+ # operation documentation for the appropriate value for this field.
479
+ # @param [Google::Apis::GkehubV1alpha::SetIamPolicyRequest] set_iam_policy_request_object
480
+ # @param [String] fields
481
+ # Selector specifying which fields to include in a partial response.
482
+ # @param [String] quota_user
483
+ # Available to use for quota purposes for server-side applications. Can be any
484
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
485
+ # @param [Google::Apis::RequestOptions] options
486
+ # Request-specific options
487
+ #
488
+ # @yield [result, err] Result & error if block supplied
489
+ # @yieldparam result [Google::Apis::GkehubV1alpha::Policy] parsed result object
490
+ # @yieldparam err [StandardError] error object if request failed
491
+ #
492
+ # @return [Google::Apis::GkehubV1alpha::Policy]
493
+ #
494
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
495
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
496
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
497
+ def set_membership_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
498
+ command = make_simple_command(:post, 'v1alpha/{+resource}:setIamPolicy', options)
499
+ command.request_representation = Google::Apis::GkehubV1alpha::SetIamPolicyRequest::Representation
500
+ command.request_object = set_iam_policy_request_object
501
+ command.response_representation = Google::Apis::GkehubV1alpha::Policy::Representation
502
+ command.response_class = Google::Apis::GkehubV1alpha::Policy
503
+ command.params['resource'] = resource unless resource.nil?
504
+ command.query['fields'] = fields unless fields.nil?
505
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
506
+ execute_or_queue_command(command, &block)
507
+ end
508
+
509
+ # Returns permissions that a caller has on the specified resource. If the
510
+ # resource does not exist, this will return an empty set of permissions, not a `
511
+ # NOT_FOUND` error. Note: This operation is designed to be used for building
512
+ # permission-aware UIs and command-line tools, not for authorization checking.
513
+ # This operation may "fail open" without warning.
514
+ # @param [String] resource
515
+ # REQUIRED: The resource for which the policy detail is being requested. See the
516
+ # operation documentation for the appropriate value for this field.
517
+ # @param [Google::Apis::GkehubV1alpha::TestIamPermissionsRequest] test_iam_permissions_request_object
518
+ # @param [String] fields
519
+ # Selector specifying which fields to include in a partial response.
520
+ # @param [String] quota_user
521
+ # Available to use for quota purposes for server-side applications. Can be any
522
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
523
+ # @param [Google::Apis::RequestOptions] options
524
+ # Request-specific options
525
+ #
526
+ # @yield [result, err] Result & error if block supplied
527
+ # @yieldparam result [Google::Apis::GkehubV1alpha::TestIamPermissionsResponse] parsed result object
528
+ # @yieldparam err [StandardError] error object if request failed
529
+ #
530
+ # @return [Google::Apis::GkehubV1alpha::TestIamPermissionsResponse]
531
+ #
532
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
533
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
534
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
535
+ def test_membership_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
536
+ command = make_simple_command(:post, 'v1alpha/{+resource}:testIamPermissions', options)
537
+ command.request_representation = Google::Apis::GkehubV1alpha::TestIamPermissionsRequest::Representation
538
+ command.request_object = test_iam_permissions_request_object
539
+ command.response_representation = Google::Apis::GkehubV1alpha::TestIamPermissionsResponse::Representation
540
+ command.response_class = Google::Apis::GkehubV1alpha::TestIamPermissionsResponse
541
+ command.params['resource'] = resource unless resource.nil?
542
+ command.query['fields'] = fields unless fields.nil?
543
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
544
+ execute_or_queue_command(command, &block)
545
+ end
546
+
547
+ # Starts asynchronous cancellation on a long-running operation. The server makes
548
+ # a best effort to cancel the operation, but success is not guaranteed. If the
549
+ # server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
550
+ # Clients can use Operations.GetOperation or other methods to check whether the
551
+ # cancellation succeeded or whether the operation completed despite cancellation.
552
+ # On successful cancellation, the operation is not deleted; instead, it becomes
553
+ # an operation with an Operation.error value with a google.rpc.Status.code of 1,
554
+ # corresponding to `Code.CANCELLED`.
555
+ # @param [String] name
556
+ # The name of the operation resource to be cancelled.
557
+ # @param [Google::Apis::GkehubV1alpha::CancelOperationRequest] cancel_operation_request_object
558
+ # @param [String] fields
559
+ # Selector specifying which fields to include in a partial response.
560
+ # @param [String] quota_user
561
+ # Available to use for quota purposes for server-side applications. Can be any
562
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
563
+ # @param [Google::Apis::RequestOptions] options
564
+ # Request-specific options
565
+ #
566
+ # @yield [result, err] Result & error if block supplied
567
+ # @yieldparam result [Google::Apis::GkehubV1alpha::Empty] parsed result object
568
+ # @yieldparam err [StandardError] error object if request failed
569
+ #
570
+ # @return [Google::Apis::GkehubV1alpha::Empty]
571
+ #
572
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
573
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
574
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
575
+ def cancel_operation(name, cancel_operation_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
576
+ command = make_simple_command(:post, 'v1alpha/{+name}:cancel', options)
577
+ command.request_representation = Google::Apis::GkehubV1alpha::CancelOperationRequest::Representation
578
+ command.request_object = cancel_operation_request_object
579
+ command.response_representation = Google::Apis::GkehubV1alpha::Empty::Representation
580
+ command.response_class = Google::Apis::GkehubV1alpha::Empty
581
+ command.params['name'] = name unless name.nil?
582
+ command.query['fields'] = fields unless fields.nil?
583
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
584
+ execute_or_queue_command(command, &block)
585
+ end
586
+
587
+ # Deletes a long-running operation. This method indicates that the client is no
588
+ # longer interested in the operation result. It does not cancel the operation.
589
+ # If the server doesn't support this method, it returns `google.rpc.Code.
590
+ # UNIMPLEMENTED`.
591
+ # @param [String] name
592
+ # The name of the operation resource to be deleted.
593
+ # @param [String] fields
594
+ # Selector specifying which fields to include in a partial response.
595
+ # @param [String] quota_user
596
+ # Available to use for quota purposes for server-side applications. Can be any
597
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
598
+ # @param [Google::Apis::RequestOptions] options
599
+ # Request-specific options
600
+ #
601
+ # @yield [result, err] Result & error if block supplied
602
+ # @yieldparam result [Google::Apis::GkehubV1alpha::Empty] parsed result object
603
+ # @yieldparam err [StandardError] error object if request failed
604
+ #
605
+ # @return [Google::Apis::GkehubV1alpha::Empty]
606
+ #
607
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
608
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
609
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
610
+ def delete_project_location_operation(name, fields: nil, quota_user: nil, options: nil, &block)
611
+ command = make_simple_command(:delete, 'v1alpha/{+name}', options)
612
+ command.response_representation = Google::Apis::GkehubV1alpha::Empty::Representation
613
+ command.response_class = Google::Apis::GkehubV1alpha::Empty
614
+ command.params['name'] = name unless name.nil?
615
+ command.query['fields'] = fields unless fields.nil?
616
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
617
+ execute_or_queue_command(command, &block)
618
+ end
619
+
620
+ # Gets the latest state of a long-running operation. Clients can use this method
621
+ # to poll the operation result at intervals as recommended by the API service.
622
+ # @param [String] name
623
+ # The name of the operation resource.
624
+ # @param [String] fields
625
+ # Selector specifying which fields to include in a partial response.
626
+ # @param [String] quota_user
627
+ # Available to use for quota purposes for server-side applications. Can be any
628
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
629
+ # @param [Google::Apis::RequestOptions] options
630
+ # Request-specific options
631
+ #
632
+ # @yield [result, err] Result & error if block supplied
633
+ # @yieldparam result [Google::Apis::GkehubV1alpha::Operation] parsed result object
634
+ # @yieldparam err [StandardError] error object if request failed
635
+ #
636
+ # @return [Google::Apis::GkehubV1alpha::Operation]
637
+ #
638
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
639
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
640
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
641
+ def get_project_location_operation(name, fields: nil, quota_user: nil, options: nil, &block)
642
+ command = make_simple_command(:get, 'v1alpha/{+name}', options)
643
+ command.response_representation = Google::Apis::GkehubV1alpha::Operation::Representation
644
+ command.response_class = Google::Apis::GkehubV1alpha::Operation
645
+ command.params['name'] = name unless name.nil?
646
+ command.query['fields'] = fields unless fields.nil?
647
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
648
+ execute_or_queue_command(command, &block)
649
+ end
650
+
651
+ # Lists operations that match the specified filter in the request. If the server
652
+ # doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name`
653
+ # binding allows API services to override the binding to use different resource
654
+ # name schemes, such as `users/*/operations`. To override the binding, API
655
+ # services can add a binding such as `"/v1/`name=users/*`/operations"` to their
656
+ # service configuration. For backwards compatibility, the default name includes
657
+ # the operations collection id, however overriding users must ensure the name
658
+ # binding is the parent resource, without the operations collection id.
659
+ # @param [String] name
660
+ # The name of the operation's parent resource.
661
+ # @param [String] filter
662
+ # The standard list filter.
663
+ # @param [Fixnum] page_size
664
+ # The standard list page size.
665
+ # @param [String] page_token
666
+ # The standard list page token.
667
+ # @param [String] fields
668
+ # Selector specifying which fields to include in a partial response.
669
+ # @param [String] quota_user
670
+ # Available to use for quota purposes for server-side applications. Can be any
671
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
672
+ # @param [Google::Apis::RequestOptions] options
673
+ # Request-specific options
674
+ #
675
+ # @yield [result, err] Result & error if block supplied
676
+ # @yieldparam result [Google::Apis::GkehubV1alpha::ListOperationsResponse] parsed result object
677
+ # @yieldparam err [StandardError] error object if request failed
678
+ #
679
+ # @return [Google::Apis::GkehubV1alpha::ListOperationsResponse]
680
+ #
681
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
682
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
683
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
684
+ def list_project_location_operations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
685
+ command = make_simple_command(:get, 'v1alpha/{+name}/operations', options)
686
+ command.response_representation = Google::Apis::GkehubV1alpha::ListOperationsResponse::Representation
687
+ command.response_class = Google::Apis::GkehubV1alpha::ListOperationsResponse
688
+ command.params['name'] = name unless name.nil?
689
+ command.query['filter'] = filter unless filter.nil?
690
+ command.query['pageSize'] = page_size unless page_size.nil?
691
+ command.query['pageToken'] = page_token unless page_token.nil?
692
+ command.query['fields'] = fields unless fields.nil?
693
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
694
+ execute_or_queue_command(command, &block)
695
+ end
696
+
697
+ protected
698
+
699
+ def apply_command_defaults(command)
700
+ command.query['key'] = key unless key.nil?
701
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
702
+ end
703
+ end
704
+ end
705
+ end
706
+ end