google-apis-orgpolicy_v2 0.17.0 → 0.18.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4429ae2695f4e9ad2bb55e71bff8484ce2b97f3245b77ba2d5e7801920b26885
4
- data.tar.gz: d336389bf6937d78bc7ee944aff278cadf48878e1e5888e66f4d475614c3f9ab
3
+ metadata.gz: b94f38802e1ad63bc677588d7f390ebe7ccc4c2648f1fe29ef5fef2e4e65fa0f
4
+ data.tar.gz: bf2be5316c13c76150af577c58685c221961c977418afd7f684df3beae9b63c4
5
5
  SHA512:
6
- metadata.gz: 1eacda37040c6daaf8e7d2ab73dbadfc21f0e17d8b8080d8f7b2b803ceb11a058de5ba16fa1bf802a73d183836538cc9f1d6a066dbda501afc981f8424f3403b
7
- data.tar.gz: 85c80552b85ed141de1d9f7bdcd2109d17555f6d7a8397bd9e130765175a27e3701253cc42d17c1ad1fc4303f33dfdc14b25f4406ae8c5e086ffdda7db6dce1a
6
+ metadata.gz: e1b0f58f4500e5bd321f0d8a4e4460f923363cec259861f8f8574af8441fec05e55a364a91f3dd0e2e7db9be0ea696f46ff342365899e229d3fb293fb24b133a
7
+ data.tar.gz: d3c7d0e9fc45caf446962db67ed3c0271e0dba10ecfe96129459ec724709042aa4e1b6cc6188d1ae1cfab322d510554aaa666d1866ca0734dc925c81e89d0863
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Release history for google-apis-orgpolicy_v2
2
2
 
3
+ ### v0.18.0 (2022-08-17)
4
+
5
+ * Regenerated from discovery document revision 20220812
6
+ * Regenerated using generator version 0.9.0
7
+
3
8
  ### v0.17.0 (2022-06-30)
4
9
 
5
10
  * Regenerated using generator version 0.8.0
@@ -165,6 +165,69 @@ module Google
165
165
  end
166
166
  end
167
167
 
168
+ # A custom constraint defined by customers which can *only* be applied to the
169
+ # given resource types and organization. By creating a custom constraint,
170
+ # customers can applied policies of this custom constraint. *Creating a custom
171
+ # constraint itself does NOT apply any policy enforcement*.
172
+ class GoogleCloudOrgpolicyV2CustomConstraint
173
+ include Google::Apis::Core::Hashable
174
+
175
+ # Allow or deny type.
176
+ # Corresponds to the JSON property `actionType`
177
+ # @return [String]
178
+ attr_accessor :action_type
179
+
180
+ # Org policy condition/expression. For example: `resource.instanceName.matches("[
181
+ # production|test]_.*_(\d)+")'` or, `resource.management.auto_upgrade == true`
182
+ # Corresponds to the JSON property `condition`
183
+ # @return [String]
184
+ attr_accessor :condition
185
+
186
+ # Detailed information about this custom policy constraint.
187
+ # Corresponds to the JSON property `description`
188
+ # @return [String]
189
+ attr_accessor :description
190
+
191
+ # One line display name for the UI.
192
+ # Corresponds to the JSON property `displayName`
193
+ # @return [String]
194
+ attr_accessor :display_name
195
+
196
+ # All the operations being applied for this constraint.
197
+ # Corresponds to the JSON property `methodTypes`
198
+ # @return [Array<String>]
199
+ attr_accessor :method_types
200
+
201
+ # Immutable. Name of the constraint. This is unique within the organization.
202
+ # Format of the name should be * `organizations/`organization_id`/
203
+ # customConstraints/`custom_constraint_id`` Example : "organizations/123/
204
+ # customConstraints/custom.createOnlyE2TypeVms"
205
+ # Corresponds to the JSON property `name`
206
+ # @return [String]
207
+ attr_accessor :name
208
+
209
+ # Immutable. The Resource Instance type on which this policy applies to. Format
210
+ # will be of the form : "/" Example: * `compute.googleapis.com/Instance`.
211
+ # Corresponds to the JSON property `resourceTypes`
212
+ # @return [Array<String>]
213
+ attr_accessor :resource_types
214
+
215
+ def initialize(**args)
216
+ update!(**args)
217
+ end
218
+
219
+ # Update properties of this object
220
+ def update!(**args)
221
+ @action_type = args[:action_type] if args.key?(:action_type)
222
+ @condition = args[:condition] if args.key?(:condition)
223
+ @description = args[:description] if args.key?(:description)
224
+ @display_name = args[:display_name] if args.key?(:display_name)
225
+ @method_types = args[:method_types] if args.key?(:method_types)
226
+ @name = args[:name] if args.key?(:name)
227
+ @resource_types = args[:resource_types] if args.key?(:resource_types)
228
+ end
229
+ end
230
+
168
231
  # The response returned from the ListConstraints method.
169
232
  class GoogleCloudOrgpolicyV2ListConstraintsResponse
170
233
  include Google::Apis::Core::Hashable
@@ -190,6 +253,34 @@ module Google
190
253
  end
191
254
  end
192
255
 
256
+ # The response returned from the ListCustomConstraints method. It will be empty
257
+ # if no `CustomConstraints` are set on the organization resource.
258
+ class GoogleCloudOrgpolicyV2ListCustomConstraintsResponse
259
+ include Google::Apis::Core::Hashable
260
+
261
+ # All `CustomConstraints` that exist on the organization resource. It will be
262
+ # empty if no `CustomConstraints` are set.
263
+ # Corresponds to the JSON property `customConstraints`
264
+ # @return [Array<Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2CustomConstraint>]
265
+ attr_accessor :custom_constraints
266
+
267
+ # Page token used to retrieve the next page. This is currently not used, but the
268
+ # server may at any point start supplying a valid token.
269
+ # Corresponds to the JSON property `nextPageToken`
270
+ # @return [String]
271
+ attr_accessor :next_page_token
272
+
273
+ def initialize(**args)
274
+ update!(**args)
275
+ end
276
+
277
+ # Update properties of this object
278
+ def update!(**args)
279
+ @custom_constraints = args[:custom_constraints] if args.key?(:custom_constraints)
280
+ @next_page_token = args[:next_page_token] if args.key?(:next_page_token)
281
+ end
282
+ end
283
+
193
284
  # The response returned from the ListPolicies method. It will be empty if no `
194
285
  # Policies` are set on the resource.
195
286
  class GoogleCloudOrgpolicyV2ListPoliciesResponse
@@ -16,13 +16,13 @@ module Google
16
16
  module Apis
17
17
  module OrgpolicyV2
18
18
  # Version of the google-apis-orgpolicy_v2 gem
19
- GEM_VERSION = "0.17.0"
19
+ GEM_VERSION = "0.18.0"
20
20
 
21
21
  # Version of the code generator used to generate this client
22
- GENERATOR_VERSION = "0.8.0"
22
+ GENERATOR_VERSION = "0.9.0"
23
23
 
24
24
  # Revision of the discovery document this client was generated from
25
- REVISION = "20220319"
25
+ REVISION = "20220812"
26
26
  end
27
27
  end
28
28
  end
@@ -46,12 +46,24 @@ module Google
46
46
  include Google::Apis::Core::JsonObjectSupport
47
47
  end
48
48
 
49
+ class GoogleCloudOrgpolicyV2CustomConstraint
50
+ class Representation < Google::Apis::Core::JsonRepresentation; end
51
+
52
+ include Google::Apis::Core::JsonObjectSupport
53
+ end
54
+
49
55
  class GoogleCloudOrgpolicyV2ListConstraintsResponse
50
56
  class Representation < Google::Apis::Core::JsonRepresentation; end
51
57
 
52
58
  include Google::Apis::Core::JsonObjectSupport
53
59
  end
54
60
 
61
+ class GoogleCloudOrgpolicyV2ListCustomConstraintsResponse
62
+ class Representation < Google::Apis::Core::JsonRepresentation; end
63
+
64
+ include Google::Apis::Core::JsonObjectSupport
65
+ end
66
+
55
67
  class GoogleCloudOrgpolicyV2ListPoliciesResponse
56
68
  class Representation < Google::Apis::Core::JsonRepresentation; end
57
69
 
@@ -131,6 +143,19 @@ module Google
131
143
  end
132
144
  end
133
145
 
146
+ class GoogleCloudOrgpolicyV2CustomConstraint
147
+ # @private
148
+ class Representation < Google::Apis::Core::JsonRepresentation
149
+ property :action_type, as: 'actionType'
150
+ property :condition, as: 'condition'
151
+ property :description, as: 'description'
152
+ property :display_name, as: 'displayName'
153
+ collection :method_types, as: 'methodTypes'
154
+ property :name, as: 'name'
155
+ collection :resource_types, as: 'resourceTypes'
156
+ end
157
+ end
158
+
134
159
  class GoogleCloudOrgpolicyV2ListConstraintsResponse
135
160
  # @private
136
161
  class Representation < Google::Apis::Core::JsonRepresentation
@@ -140,6 +165,15 @@ module Google
140
165
  end
141
166
  end
142
167
 
168
+ class GoogleCloudOrgpolicyV2ListCustomConstraintsResponse
169
+ # @private
170
+ class Representation < Google::Apis::Core::JsonRepresentation
171
+ collection :custom_constraints, as: 'customConstraints', class: Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2CustomConstraint, decorator: Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2CustomConstraint::Representation
172
+
173
+ property :next_page_token, as: 'nextPageToken'
174
+ end
175
+ end
176
+
143
177
  class GoogleCloudOrgpolicyV2ListPoliciesResponse
144
178
  # @private
145
179
  class Representation < Google::Apis::Core::JsonRepresentation
@@ -350,6 +350,185 @@ module Google
350
350
  execute_or_queue_command(command, &block)
351
351
  end
352
352
 
353
+ # Creates a CustomConstraint. Returns a `google.rpc.Status` with `google.rpc.
354
+ # Code.NOT_FOUND` if the organization does not exist. Returns a `google.rpc.
355
+ # Status` with `google.rpc.Code.ALREADY_EXISTS` if the constraint already exists
356
+ # on the given organization.
357
+ # @param [String] parent
358
+ # Required. Must be in the following form: * `organizations/`organization_id``
359
+ # @param [Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2CustomConstraint] google_cloud_orgpolicy_v2_custom_constraint_object
360
+ # @param [String] fields
361
+ # Selector specifying which fields to include in a partial response.
362
+ # @param [String] quota_user
363
+ # Available to use for quota purposes for server-side applications. Can be any
364
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
365
+ # @param [Google::Apis::RequestOptions] options
366
+ # Request-specific options
367
+ #
368
+ # @yield [result, err] Result & error if block supplied
369
+ # @yieldparam result [Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2CustomConstraint] parsed result object
370
+ # @yieldparam err [StandardError] error object if request failed
371
+ #
372
+ # @return [Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2CustomConstraint]
373
+ #
374
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
375
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
376
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
377
+ def create_organization_custom_constraint(parent, google_cloud_orgpolicy_v2_custom_constraint_object = nil, fields: nil, quota_user: nil, options: nil, &block)
378
+ command = make_simple_command(:post, 'v2/{+parent}/customConstraints', options)
379
+ command.request_representation = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2CustomConstraint::Representation
380
+ command.request_object = google_cloud_orgpolicy_v2_custom_constraint_object
381
+ command.response_representation = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2CustomConstraint::Representation
382
+ command.response_class = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2CustomConstraint
383
+ command.params['parent'] = parent unless parent.nil?
384
+ command.query['fields'] = fields unless fields.nil?
385
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
386
+ execute_or_queue_command(command, &block)
387
+ end
388
+
389
+ # Deletes a Custom Constraint. Returns a `google.rpc.Status` with `google.rpc.
390
+ # Code.NOT_FOUND` if the constraint does not exist.
391
+ # @param [String] name
392
+ # Required. Name of the custom constraint to delete. See `CustomConstraint` for
393
+ # naming rules.
394
+ # @param [String] fields
395
+ # Selector specifying which fields to include in a partial response.
396
+ # @param [String] quota_user
397
+ # Available to use for quota purposes for server-side applications. Can be any
398
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
399
+ # @param [Google::Apis::RequestOptions] options
400
+ # Request-specific options
401
+ #
402
+ # @yield [result, err] Result & error if block supplied
403
+ # @yieldparam result [Google::Apis::OrgpolicyV2::GoogleProtobufEmpty] parsed result object
404
+ # @yieldparam err [StandardError] error object if request failed
405
+ #
406
+ # @return [Google::Apis::OrgpolicyV2::GoogleProtobufEmpty]
407
+ #
408
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
409
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
410
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
411
+ def delete_organization_custom_constraint(name, fields: nil, quota_user: nil, options: nil, &block)
412
+ command = make_simple_command(:delete, 'v2/{+name}', options)
413
+ command.response_representation = Google::Apis::OrgpolicyV2::GoogleProtobufEmpty::Representation
414
+ command.response_class = Google::Apis::OrgpolicyV2::GoogleProtobufEmpty
415
+ command.params['name'] = name unless name.nil?
416
+ command.query['fields'] = fields unless fields.nil?
417
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
418
+ execute_or_queue_command(command, &block)
419
+ end
420
+
421
+ # Gets a CustomConstraint. Returns a `google.rpc.Status` with `google.rpc.Code.
422
+ # NOT_FOUND` if the CustomConstraint does not exist.
423
+ # @param [String] name
424
+ # Required. Resource name of the custom constraint. See `CustomConstraint` for
425
+ # naming requirements.
426
+ # @param [String] fields
427
+ # Selector specifying which fields to include in a partial response.
428
+ # @param [String] quota_user
429
+ # Available to use for quota purposes for server-side applications. Can be any
430
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
431
+ # @param [Google::Apis::RequestOptions] options
432
+ # Request-specific options
433
+ #
434
+ # @yield [result, err] Result & error if block supplied
435
+ # @yieldparam result [Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2CustomConstraint] parsed result object
436
+ # @yieldparam err [StandardError] error object if request failed
437
+ #
438
+ # @return [Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2CustomConstraint]
439
+ #
440
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
441
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
442
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
443
+ def get_organization_custom_constraint(name, fields: nil, quota_user: nil, options: nil, &block)
444
+ command = make_simple_command(:get, 'v2/{+name}', options)
445
+ command.response_representation = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2CustomConstraint::Representation
446
+ command.response_class = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2CustomConstraint
447
+ command.params['name'] = name unless name.nil?
448
+ command.query['fields'] = fields unless fields.nil?
449
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
450
+ execute_or_queue_command(command, &block)
451
+ end
452
+
453
+ # Retrieves all of the `CustomConstraints` that exist on a particular
454
+ # organization resource.
455
+ # @param [String] parent
456
+ # Required. The target Cloud resource that parents the set of custom constraints
457
+ # that will be returned from this call. Must be in one of the following forms: *
458
+ # `organizations/`organization_id``
459
+ # @param [Fixnum] page_size
460
+ # Size of the pages to be returned. This is currently unsupported and will be
461
+ # ignored. The server may at any point start using this field to limit page size.
462
+ # @param [String] page_token
463
+ # Page token used to retrieve the next page. This is currently unsupported and
464
+ # will be ignored. The server may at any point start using this field.
465
+ # @param [String] fields
466
+ # Selector specifying which fields to include in a partial response.
467
+ # @param [String] quota_user
468
+ # Available to use for quota purposes for server-side applications. Can be any
469
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
470
+ # @param [Google::Apis::RequestOptions] options
471
+ # Request-specific options
472
+ #
473
+ # @yield [result, err] Result & error if block supplied
474
+ # @yieldparam result [Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2ListCustomConstraintsResponse] parsed result object
475
+ # @yieldparam err [StandardError] error object if request failed
476
+ #
477
+ # @return [Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2ListCustomConstraintsResponse]
478
+ #
479
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
480
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
481
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
482
+ def list_organization_custom_constraints(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
483
+ command = make_simple_command(:get, 'v2/{+parent}/customConstraints', options)
484
+ command.response_representation = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2ListCustomConstraintsResponse::Representation
485
+ command.response_class = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2ListCustomConstraintsResponse
486
+ command.params['parent'] = parent unless parent.nil?
487
+ command.query['pageSize'] = page_size unless page_size.nil?
488
+ command.query['pageToken'] = page_token unless page_token.nil?
489
+ command.query['fields'] = fields unless fields.nil?
490
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
491
+ execute_or_queue_command(command, &block)
492
+ end
493
+
494
+ # Updates a Custom Constraint. Returns a `google.rpc.Status` with `google.rpc.
495
+ # Code.NOT_FOUND` if the constraint does not exist. Note: the supplied policy
496
+ # will perform a full overwrite of all fields.
497
+ # @param [String] name
498
+ # Immutable. Name of the constraint. This is unique within the organization.
499
+ # Format of the name should be * `organizations/`organization_id`/
500
+ # customConstraints/`custom_constraint_id`` Example : "organizations/123/
501
+ # customConstraints/custom.createOnlyE2TypeVms"
502
+ # @param [Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2CustomConstraint] google_cloud_orgpolicy_v2_custom_constraint_object
503
+ # @param [String] fields
504
+ # Selector specifying which fields to include in a partial response.
505
+ # @param [String] quota_user
506
+ # Available to use for quota purposes for server-side applications. Can be any
507
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
508
+ # @param [Google::Apis::RequestOptions] options
509
+ # Request-specific options
510
+ #
511
+ # @yield [result, err] Result & error if block supplied
512
+ # @yieldparam result [Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2CustomConstraint] parsed result object
513
+ # @yieldparam err [StandardError] error object if request failed
514
+ #
515
+ # @return [Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2CustomConstraint]
516
+ #
517
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
518
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
519
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
520
+ def patch_organization_custom_constraint(name, google_cloud_orgpolicy_v2_custom_constraint_object = nil, fields: nil, quota_user: nil, options: nil, &block)
521
+ command = make_simple_command(:patch, 'v2/{+name}', options)
522
+ command.request_representation = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2CustomConstraint::Representation
523
+ command.request_object = google_cloud_orgpolicy_v2_custom_constraint_object
524
+ command.response_representation = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2CustomConstraint::Representation
525
+ command.response_class = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2CustomConstraint
526
+ command.params['name'] = name unless name.nil?
527
+ command.query['fields'] = fields unless fields.nil?
528
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
529
+ execute_or_queue_command(command, &block)
530
+ end
531
+
353
532
  # Creates a Policy. Returns a `google.rpc.Status` with `google.rpc.Code.
354
533
  # NOT_FOUND` if the constraint does not exist. Returns a `google.rpc.Status`
355
534
  # with `google.rpc.Code.ALREADY_EXISTS` if the policy already exists on the
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-apis-orgpolicy_v2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.0
4
+ version: 0.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-04 00:00:00.000000000 Z
11
+ date: 2022-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-apis-core
@@ -58,7 +58,7 @@ licenses:
58
58
  metadata:
59
59
  bug_tracker_uri: https://github.com/googleapis/google-api-ruby-client/issues
60
60
  changelog_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/generated/google-apis-orgpolicy_v2/CHANGELOG.md
61
- documentation_uri: https://googleapis.dev/ruby/google-apis-orgpolicy_v2/v0.17.0
61
+ documentation_uri: https://googleapis.dev/ruby/google-apis-orgpolicy_v2/v0.18.0
62
62
  source_code_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/generated/google-apis-orgpolicy_v2
63
63
  post_install_message:
64
64
  rdoc_options: []