google-cloud-org_policy-v2 0.2.0 → 0.2.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ffdd9f21c894b4268e2d34e7d34c483dbf6ee270c53c12db7ad7eab5ca3009f0
4
- data.tar.gz: 724f82e19a5fcb38ebd827dc97ff33ca7df605af7be8929ad85bf0c2758d5996
3
+ metadata.gz: 40fed3c2b8408cac22deba3855e131f15e1158e350d48fe312c66fc3efa4f099
4
+ data.tar.gz: 5ac856234712df874aea7ca160f1d89e9311a3935109f91b385e07a950c117ff
5
5
  SHA512:
6
- metadata.gz: d5aceabcbc8530961966e34a4ecda73b0c256c70867c7156d4e0128999f9691f4a3aa67ac79233d1c3277475c6726397559aa4c407ef34c457edf6e4feebef8e
7
- data.tar.gz: 99d2fcd37c99f2ee05b481be22c3bd50f262e78ac61dc6e6addb7f485715c3c344ab6a8ee207b709f47afe0645bc8fcb6ad8f637c1559890973de598268bda50
6
+ metadata.gz: 0cd5ff9455dc1542fd6ee6aaa0c7d530edfd2a0e639edd9ffd10d98df668492b5027d0b363557a8333d302eebaadb6ba6fb1fea045be19ea08790aa376ab9d4d
7
+ data.tar.gz: 6ee2cdcdcb57ca120f034200e4d77dc9f7ace5d30d162de6dba78af271b89d7626c2adf2d0347f2caf30e741caf97ae254b1e6578cc354e02133f021f1085e95
data/AUTHENTICATION.md CHANGED
@@ -66,11 +66,11 @@ The environment variables that google-cloud-org_policy-v2
66
66
  checks for credentials are configured on the service Credentials class (such as
67
67
  {::Google::Cloud::OrgPolicy::V2::OrgPolicy::Credentials}):
68
68
 
69
- 1. `ORG_POLICY_CREDENTIALS` - Path to JSON file, or JSON contents
70
- 2. `ORG_POLICY_KEYFILE` - Path to JSON file, or JSON contents
71
- 3. `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
72
- 4. `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents
73
- 5. `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
69
+ * `ORG_POLICY_CREDENTIALS` - Path to JSON file, or JSON contents
70
+ * `ORG_POLICY_KEYFILE` - Path to JSON file, or JSON contents
71
+ * `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
72
+ * `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents
73
+ * `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
74
74
 
75
75
  ```ruby
76
76
  require "google/cloud/org_policy/v2"
@@ -82,8 +82,8 @@ client = ::Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.new
82
82
 
83
83
  ### Configuration
84
84
 
85
- The **Credentials JSON** can be configured instead of placing them in
86
- environment variables. Either on an individual client initialization:
85
+ The path to the **Credentials JSON** file can be configured instead of storing
86
+ it in an environment variable. Either on an individual client initialization:
87
87
 
88
88
  ```ruby
89
89
  require "google/cloud/org_policy/v2"
@@ -93,7 +93,7 @@ client = ::Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.new do |config|
93
93
  end
94
94
  ```
95
95
 
96
- Or configured globally for all clients:
96
+ Or globally for all clients:
97
97
 
98
98
  ```ruby
99
99
  require "google/cloud/org_policy/v2"
data/README.md CHANGED
@@ -33,7 +33,7 @@ In order to use this library, you first need to go through the following steps:
33
33
  require "google/cloud/org_policy/v2"
34
34
 
35
35
  client = ::Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.new
36
- request = my_create_request
36
+ request = ::Google::Cloud::OrgPolicy::V2::ListConstraintsRequest.new # (request fields as keyword arguments...)
37
37
  response = client.list_constraints request
38
38
  ```
39
39
 
@@ -60,13 +60,12 @@ module Google
60
60
  # See {::Google::Cloud::OrgPolicy::V2::OrgPolicy::Client::Configuration}
61
61
  # for a description of the configuration fields.
62
62
  #
63
- # ## Example
63
+ # @example
64
64
  #
65
- # To modify the configuration for all OrgPolicy clients:
66
- #
67
- # ::Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.configure do |config|
68
- # config.timeout = 10.0
69
- # end
65
+ # # Modify the configuration for all OrgPolicy clients
66
+ # ::Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.configure do |config|
67
+ # config.timeout = 10.0
68
+ # end
70
69
  #
71
70
  # @yield [config] Configure the Client client.
72
71
  # @yieldparam config [Client::Configuration]
@@ -86,58 +85,37 @@ module Google
86
85
 
87
86
  default_config.rpcs.list_constraints.timeout = 60.0
88
87
  default_config.rpcs.list_constraints.retry_policy = {
89
- initial_delay: 1.0,
90
- max_delay: 10.0,
91
- multiplier: 1.3,
92
- retry_codes: [14, 4]
88
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4]
93
89
  }
94
90
 
95
91
  default_config.rpcs.list_policies.timeout = 60.0
96
92
  default_config.rpcs.list_policies.retry_policy = {
97
- initial_delay: 1.0,
98
- max_delay: 10.0,
99
- multiplier: 1.3,
100
- retry_codes: [14, 4]
93
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4]
101
94
  }
102
95
 
103
96
  default_config.rpcs.get_policy.timeout = 60.0
104
97
  default_config.rpcs.get_policy.retry_policy = {
105
- initial_delay: 1.0,
106
- max_delay: 10.0,
107
- multiplier: 1.3,
108
- retry_codes: [14, 4]
98
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4]
109
99
  }
110
100
 
111
101
  default_config.rpcs.get_effective_policy.timeout = 60.0
112
102
  default_config.rpcs.get_effective_policy.retry_policy = {
113
- initial_delay: 1.0,
114
- max_delay: 10.0,
115
- multiplier: 1.3,
116
- retry_codes: [14, 4]
103
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4]
117
104
  }
118
105
 
119
106
  default_config.rpcs.create_policy.timeout = 60.0
120
107
  default_config.rpcs.create_policy.retry_policy = {
121
- initial_delay: 1.0,
122
- max_delay: 10.0,
123
- multiplier: 1.3,
124
- retry_codes: [14, 4]
108
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4]
125
109
  }
126
110
 
127
111
  default_config.rpcs.update_policy.timeout = 60.0
128
112
  default_config.rpcs.update_policy.retry_policy = {
129
- initial_delay: 1.0,
130
- max_delay: 10.0,
131
- multiplier: 1.3,
132
- retry_codes: [14, 4]
113
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4]
133
114
  }
134
115
 
135
116
  default_config.rpcs.delete_policy.timeout = 60.0
136
117
  default_config.rpcs.delete_policy.retry_policy = {
137
- initial_delay: 1.0,
138
- max_delay: 10.0,
139
- multiplier: 1.3,
140
- retry_codes: [14, 4]
118
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4]
141
119
  }
142
120
 
143
121
  default_config
@@ -169,19 +147,15 @@ module Google
169
147
  ##
170
148
  # Create a new OrgPolicy client object.
171
149
  #
172
- # ## Examples
173
- #
174
- # To create a new OrgPolicy client with the default
175
- # configuration:
150
+ # @example
176
151
  #
177
- # client = ::Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.new
152
+ # # Create a client using the default configuration
153
+ # client = ::Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.new
178
154
  #
179
- # To create a new OrgPolicy client with a custom
180
- # configuration:
181
- #
182
- # client = ::Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.new do |config|
183
- # config.timeout = 10.0
184
- # end
155
+ # # Create a client using a custom configuration
156
+ # client = ::Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.new do |config|
157
+ # config.timeout = 10.0
158
+ # end
185
159
  #
186
160
  # @yield [config] Configure the OrgPolicy client.
187
161
  # @yieldparam config [Client::Configuration]
@@ -201,14 +175,13 @@ module Google
201
175
 
202
176
  # Create credentials
203
177
  credentials = @config.credentials
204
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
178
+ # Use self-signed JWT if the endpoint is unchanged from default,
205
179
  # but only if the default endpoint does not have a region prefix.
206
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
207
- @config.endpoint == Client.configure.endpoint &&
180
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
208
181
  !@config.endpoint.split(".").first.include?("-")
209
182
  credentials ||= Credentials.default scope: @config.scope,
210
183
  enable_self_signed_jwt: enable_self_signed_jwt
211
- if credentials.is_a?(String) || credentials.is_a?(Hash)
184
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
212
185
  credentials = Credentials.new credentials, scope: @config.scope
213
186
  end
214
187
  @quota_project_id = @config.quota_project
@@ -266,6 +239,27 @@ module Google
266
239
  #
267
240
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
268
241
  #
242
+ # @example Basic example
243
+ # require "google/cloud/org_policy/v2"
244
+ #
245
+ # # Create a client object. The client can be reused for multiple calls.
246
+ # client = Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.new
247
+ #
248
+ # # Create a request. To set request fields, pass in keyword arguments.
249
+ # request = Google::Cloud::OrgPolicy::V2::ListConstraintsRequest.new
250
+ #
251
+ # # Call the list_constraints method.
252
+ # result = client.list_constraints request
253
+ #
254
+ # # The returned object is of type Gapic::PagedEnumerable. You can
255
+ # # iterate over all elements by calling #each, and the enumerable
256
+ # # will lazily make API calls to fetch subsequent pages. Other
257
+ # # methods are also available for managing paging directly.
258
+ # result.each do |response|
259
+ # # Each element is of type ::Google::Cloud::OrgPolicy::V2::Constraint.
260
+ # p response
261
+ # end
262
+ #
269
263
  def list_constraints request, options = nil
270
264
  raise ::ArgumentError, "request must be provided" if request.nil?
271
265
 
@@ -283,16 +277,20 @@ module Google
283
277
  gapic_version: ::Google::Cloud::OrgPolicy::V2::VERSION
284
278
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
285
279
 
286
- header_params = {
287
- "parent" => request.parent
288
- }
280
+ header_params = {}
281
+ if request.parent
282
+ header_params["parent"] = request.parent
283
+ end
284
+
289
285
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
290
286
  metadata[:"x-goog-request-params"] ||= request_params_header
291
287
 
292
288
  options.apply_defaults timeout: @config.rpcs.list_constraints.timeout,
293
289
  metadata: metadata,
294
290
  retry_policy: @config.rpcs.list_constraints.retry_policy
295
- options.apply_defaults metadata: @config.metadata,
291
+
292
+ options.apply_defaults timeout: @config.timeout,
293
+ metadata: @config.metadata,
296
294
  retry_policy: @config.retry_policy
297
295
 
298
296
  @org_policy_stub.call_rpc :list_constraints, request, options: options do |response, operation|
@@ -346,6 +344,27 @@ module Google
346
344
  #
347
345
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
348
346
  #
347
+ # @example Basic example
348
+ # require "google/cloud/org_policy/v2"
349
+ #
350
+ # # Create a client object. The client can be reused for multiple calls.
351
+ # client = Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.new
352
+ #
353
+ # # Create a request. To set request fields, pass in keyword arguments.
354
+ # request = Google::Cloud::OrgPolicy::V2::ListPoliciesRequest.new
355
+ #
356
+ # # Call the list_policies method.
357
+ # result = client.list_policies request
358
+ #
359
+ # # The returned object is of type Gapic::PagedEnumerable. You can
360
+ # # iterate over all elements by calling #each, and the enumerable
361
+ # # will lazily make API calls to fetch subsequent pages. Other
362
+ # # methods are also available for managing paging directly.
363
+ # result.each do |response|
364
+ # # Each element is of type ::Google::Cloud::OrgPolicy::V2::Policy.
365
+ # p response
366
+ # end
367
+ #
349
368
  def list_policies request, options = nil
350
369
  raise ::ArgumentError, "request must be provided" if request.nil?
351
370
 
@@ -363,16 +382,20 @@ module Google
363
382
  gapic_version: ::Google::Cloud::OrgPolicy::V2::VERSION
364
383
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
365
384
 
366
- header_params = {
367
- "parent" => request.parent
368
- }
385
+ header_params = {}
386
+ if request.parent
387
+ header_params["parent"] = request.parent
388
+ end
389
+
369
390
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
370
391
  metadata[:"x-goog-request-params"] ||= request_params_header
371
392
 
372
393
  options.apply_defaults timeout: @config.rpcs.list_policies.timeout,
373
394
  metadata: metadata,
374
395
  retry_policy: @config.rpcs.list_policies.retry_policy
375
- options.apply_defaults metadata: @config.metadata,
396
+
397
+ options.apply_defaults timeout: @config.timeout,
398
+ metadata: @config.metadata,
376
399
  retry_policy: @config.retry_policy
377
400
 
378
401
  @org_policy_stub.call_rpc :list_policies, request, options: options do |response, operation|
@@ -417,6 +440,21 @@ module Google
417
440
  #
418
441
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
419
442
  #
443
+ # @example Basic example
444
+ # require "google/cloud/org_policy/v2"
445
+ #
446
+ # # Create a client object. The client can be reused for multiple calls.
447
+ # client = Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.new
448
+ #
449
+ # # Create a request. To set request fields, pass in keyword arguments.
450
+ # request = Google::Cloud::OrgPolicy::V2::GetPolicyRequest.new
451
+ #
452
+ # # Call the get_policy method.
453
+ # result = client.get_policy request
454
+ #
455
+ # # The returned object is of type Google::Cloud::OrgPolicy::V2::Policy.
456
+ # p result
457
+ #
420
458
  def get_policy request, options = nil
421
459
  raise ::ArgumentError, "request must be provided" if request.nil?
422
460
 
@@ -434,16 +472,20 @@ module Google
434
472
  gapic_version: ::Google::Cloud::OrgPolicy::V2::VERSION
435
473
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
436
474
 
437
- header_params = {
438
- "name" => request.name
439
- }
475
+ header_params = {}
476
+ if request.name
477
+ header_params["name"] = request.name
478
+ end
479
+
440
480
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
441
481
  metadata[:"x-goog-request-params"] ||= request_params_header
442
482
 
443
483
  options.apply_defaults timeout: @config.rpcs.get_policy.timeout,
444
484
  metadata: metadata,
445
485
  retry_policy: @config.rpcs.get_policy.retry_policy
446
- options.apply_defaults metadata: @config.metadata,
486
+
487
+ options.apply_defaults timeout: @config.timeout,
488
+ metadata: @config.metadata,
447
489
  retry_policy: @config.retry_policy
448
490
 
449
491
  @org_policy_stub.call_rpc :get_policy, request, options: options do |response, operation|
@@ -488,6 +530,21 @@ module Google
488
530
  #
489
531
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
490
532
  #
533
+ # @example Basic example
534
+ # require "google/cloud/org_policy/v2"
535
+ #
536
+ # # Create a client object. The client can be reused for multiple calls.
537
+ # client = Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.new
538
+ #
539
+ # # Create a request. To set request fields, pass in keyword arguments.
540
+ # request = Google::Cloud::OrgPolicy::V2::GetEffectivePolicyRequest.new
541
+ #
542
+ # # Call the get_effective_policy method.
543
+ # result = client.get_effective_policy request
544
+ #
545
+ # # The returned object is of type Google::Cloud::OrgPolicy::V2::Policy.
546
+ # p result
547
+ #
491
548
  def get_effective_policy request, options = nil
492
549
  raise ::ArgumentError, "request must be provided" if request.nil?
493
550
 
@@ -505,16 +562,20 @@ module Google
505
562
  gapic_version: ::Google::Cloud::OrgPolicy::V2::VERSION
506
563
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
507
564
 
508
- header_params = {
509
- "name" => request.name
510
- }
565
+ header_params = {}
566
+ if request.name
567
+ header_params["name"] = request.name
568
+ end
569
+
511
570
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
512
571
  metadata[:"x-goog-request-params"] ||= request_params_header
513
572
 
514
573
  options.apply_defaults timeout: @config.rpcs.get_effective_policy.timeout,
515
574
  metadata: metadata,
516
575
  retry_policy: @config.rpcs.get_effective_policy.retry_policy
517
- options.apply_defaults metadata: @config.metadata,
576
+
577
+ options.apply_defaults timeout: @config.timeout,
578
+ metadata: @config.metadata,
518
579
  retry_policy: @config.retry_policy
519
580
 
520
581
  @org_policy_stub.call_rpc :get_effective_policy, request, options: options do |response, operation|
@@ -566,6 +627,21 @@ module Google
566
627
  #
567
628
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
568
629
  #
630
+ # @example Basic example
631
+ # require "google/cloud/org_policy/v2"
632
+ #
633
+ # # Create a client object. The client can be reused for multiple calls.
634
+ # client = Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.new
635
+ #
636
+ # # Create a request. To set request fields, pass in keyword arguments.
637
+ # request = Google::Cloud::OrgPolicy::V2::CreatePolicyRequest.new
638
+ #
639
+ # # Call the create_policy method.
640
+ # result = client.create_policy request
641
+ #
642
+ # # The returned object is of type Google::Cloud::OrgPolicy::V2::Policy.
643
+ # p result
644
+ #
569
645
  def create_policy request, options = nil
570
646
  raise ::ArgumentError, "request must be provided" if request.nil?
571
647
 
@@ -583,16 +659,20 @@ module Google
583
659
  gapic_version: ::Google::Cloud::OrgPolicy::V2::VERSION
584
660
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
585
661
 
586
- header_params = {
587
- "parent" => request.parent
588
- }
662
+ header_params = {}
663
+ if request.parent
664
+ header_params["parent"] = request.parent
665
+ end
666
+
589
667
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
590
668
  metadata[:"x-goog-request-params"] ||= request_params_header
591
669
 
592
670
  options.apply_defaults timeout: @config.rpcs.create_policy.timeout,
593
671
  metadata: metadata,
594
672
  retry_policy: @config.rpcs.create_policy.retry_policy
595
- options.apply_defaults metadata: @config.metadata,
673
+
674
+ options.apply_defaults timeout: @config.timeout,
675
+ metadata: @config.metadata,
596
676
  retry_policy: @config.retry_policy
597
677
 
598
678
  @org_policy_stub.call_rpc :create_policy, request, options: options do |response, operation|
@@ -640,6 +720,21 @@ module Google
640
720
  #
641
721
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
642
722
  #
723
+ # @example Basic example
724
+ # require "google/cloud/org_policy/v2"
725
+ #
726
+ # # Create a client object. The client can be reused for multiple calls.
727
+ # client = Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.new
728
+ #
729
+ # # Create a request. To set request fields, pass in keyword arguments.
730
+ # request = Google::Cloud::OrgPolicy::V2::UpdatePolicyRequest.new
731
+ #
732
+ # # Call the update_policy method.
733
+ # result = client.update_policy request
734
+ #
735
+ # # The returned object is of type Google::Cloud::OrgPolicy::V2::Policy.
736
+ # p result
737
+ #
643
738
  def update_policy request, options = nil
644
739
  raise ::ArgumentError, "request must be provided" if request.nil?
645
740
 
@@ -657,16 +752,20 @@ module Google
657
752
  gapic_version: ::Google::Cloud::OrgPolicy::V2::VERSION
658
753
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
659
754
 
660
- header_params = {
661
- "policy.name" => request.policy.name
662
- }
755
+ header_params = {}
756
+ if request.policy&.name
757
+ header_params["policy.name"] = request.policy.name
758
+ end
759
+
663
760
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
664
761
  metadata[:"x-goog-request-params"] ||= request_params_header
665
762
 
666
763
  options.apply_defaults timeout: @config.rpcs.update_policy.timeout,
667
764
  metadata: metadata,
668
765
  retry_policy: @config.rpcs.update_policy.retry_policy
669
- options.apply_defaults metadata: @config.metadata,
766
+
767
+ options.apply_defaults timeout: @config.timeout,
768
+ metadata: @config.metadata,
670
769
  retry_policy: @config.retry_policy
671
770
 
672
771
  @org_policy_stub.call_rpc :update_policy, request, options: options do |response, operation|
@@ -710,6 +809,21 @@ module Google
710
809
  #
711
810
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
712
811
  #
812
+ # @example Basic example
813
+ # require "google/cloud/org_policy/v2"
814
+ #
815
+ # # Create a client object. The client can be reused for multiple calls.
816
+ # client = Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.new
817
+ #
818
+ # # Create a request. To set request fields, pass in keyword arguments.
819
+ # request = Google::Cloud::OrgPolicy::V2::DeletePolicyRequest.new
820
+ #
821
+ # # Call the delete_policy method.
822
+ # result = client.delete_policy request
823
+ #
824
+ # # The returned object is of type Google::Protobuf::Empty.
825
+ # p result
826
+ #
713
827
  def delete_policy request, options = nil
714
828
  raise ::ArgumentError, "request must be provided" if request.nil?
715
829
 
@@ -727,16 +841,20 @@ module Google
727
841
  gapic_version: ::Google::Cloud::OrgPolicy::V2::VERSION
728
842
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
729
843
 
730
- header_params = {
731
- "name" => request.name
732
- }
844
+ header_params = {}
845
+ if request.name
846
+ header_params["name"] = request.name
847
+ end
848
+
733
849
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
734
850
  metadata[:"x-goog-request-params"] ||= request_params_header
735
851
 
736
852
  options.apply_defaults timeout: @config.rpcs.delete_policy.timeout,
737
853
  metadata: metadata,
738
854
  retry_policy: @config.rpcs.delete_policy.retry_policy
739
- options.apply_defaults metadata: @config.metadata,
855
+
856
+ options.apply_defaults timeout: @config.timeout,
857
+ metadata: @config.metadata,
740
858
  retry_policy: @config.retry_policy
741
859
 
742
860
  @org_policy_stub.call_rpc :delete_policy, request, options: options do |response, operation|
@@ -760,22 +878,21 @@ module Google
760
878
  # Configuration can be applied globally to all clients, or to a single client
761
879
  # on construction.
762
880
  #
763
- # # Examples
764
- #
765
- # To modify the global config, setting the timeout for list_constraints
766
- # to 20 seconds, and all remaining timeouts to 10 seconds:
767
- #
768
- # ::Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.configure do |config|
769
- # config.timeout = 10.0
770
- # config.rpcs.list_constraints.timeout = 20.0
771
- # end
772
- #
773
- # To apply the above configuration only to a new client:
774
- #
775
- # client = ::Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.new do |config|
776
- # config.timeout = 10.0
777
- # config.rpcs.list_constraints.timeout = 20.0
778
- # end
881
+ # @example
882
+ #
883
+ # # Modify the global config, setting the timeout for
884
+ # # list_constraints to 20 seconds,
885
+ # # and all remaining timeouts to 10 seconds.
886
+ # ::Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.configure do |config|
887
+ # config.timeout = 10.0
888
+ # config.rpcs.list_constraints.timeout = 20.0
889
+ # end
890
+ #
891
+ # # Apply the above configuration only to a new client.
892
+ # client = ::Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.new do |config|
893
+ # config.timeout = 10.0
894
+ # config.rpcs.list_constraints.timeout = 20.0
895
+ # end
779
896
  #
780
897
  # @!attribute [rw] endpoint
781
898
  # The hostname or hostname:port of the service endpoint.
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module OrgPolicy
23
23
  module V2
24
- VERSION = "0.2.0"
24
+ VERSION = "0.2.4"
25
25
  end
26
26
  end
27
27
  end
@@ -1,10 +1,10 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/orgpolicy/v2/constraint.proto
3
3
 
4
- require 'google/protobuf'
5
-
6
4
  require 'google/api/field_behavior_pb'
7
5
  require 'google/api/resource_pb'
6
+ require 'google/protobuf'
7
+
8
8
  Google::Protobuf::DescriptorPool.generated_pool.build do
9
9
  add_file("google/cloud/orgpolicy/v2/constraint.proto", :syntax => :proto3) do
10
10
  add_message "google.cloud.orgpolicy.v2.Constraint" do
@@ -1,8 +1,6 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/orgpolicy/v2/orgpolicy.proto
3
3
 
4
- require 'google/protobuf'
5
-
6
4
  require 'google/api/annotations_pb'
7
5
  require 'google/api/client_pb'
8
6
  require 'google/api/field_behavior_pb'
@@ -11,6 +9,8 @@ require 'google/cloud/orgpolicy/v2/constraint_pb'
11
9
  require 'google/protobuf/empty_pb'
12
10
  require 'google/protobuf/timestamp_pb'
13
11
  require 'google/type/expr_pb'
12
+ require 'google/protobuf'
13
+
14
14
  Google::Protobuf::DescriptorPool.generated_pool.build do
15
15
  add_file("google/cloud/orgpolicy/v2/orgpolicy.proto", :syntax => :proto3) do
16
16
  add_message "google.cloud.orgpolicy.v2.Policy" do
@@ -46,7 +46,7 @@ module Google
46
46
  # particular resource and its child resources.
47
47
  class Service
48
48
 
49
- include GRPC::GenericService
49
+ include ::GRPC::GenericService
50
50
 
51
51
  self.marshal_class_method = :encode
52
52
  self.unmarshal_class_method = :decode
@@ -57,9 +57,15 @@ module Google
57
57
 
58
58
  # Denotes that a (repeated) field is an unordered list.
59
59
  # This indicates that the service may provide the elements of the list
60
- # in any arbitrary order, rather than the order the user originally
60
+ # in any arbitrary order, rather than the order the user originally
61
61
  # provided. Additionally, the list's order may or may not be stable.
62
62
  UNORDERED_LIST = 6
63
+
64
+ # Denotes that this field returns a non-empty default value if not set.
65
+ # This indicates that if the user provides the empty value in a request,
66
+ # a non-empty value will be returned. The user will not be aware of what
67
+ # non-empty value to expect.
68
+ NON_EMPTY_DEFAULT = 7
63
69
  end
64
70
  end
65
71
  end
@@ -19,30 +19,53 @@
19
19
 
20
20
  module Google
21
21
  module Type
22
- # Represents an expression text. Example:
22
+ # Represents a textual expression in the Common Expression Language (CEL)
23
+ # syntax. CEL is a C-like expression language. The syntax and semantics of CEL
24
+ # are documented at https://github.com/google/cel-spec.
23
25
  #
24
- # title: "User account presence"
25
- # description: "Determines whether the request has a user account"
26
- # expression: "size(request.user) > 0"
26
+ # Example (Comparison):
27
+ #
28
+ # title: "Summary size limit"
29
+ # description: "Determines if a summary is less than 100 chars"
30
+ # expression: "document.summary.size() < 100"
31
+ #
32
+ # Example (Equality):
33
+ #
34
+ # title: "Requestor is owner"
35
+ # description: "Determines if requestor is the document owner"
36
+ # expression: "document.owner == request.auth.claims.email"
37
+ #
38
+ # Example (Logic):
39
+ #
40
+ # title: "Public documents"
41
+ # description: "Determine whether the document should be publicly visible"
42
+ # expression: "document.type != 'private' && document.type != 'internal'"
43
+ #
44
+ # Example (Data Manipulation):
45
+ #
46
+ # title: "Notification string"
47
+ # description: "Create a notification string with a timestamp."
48
+ # expression: "'New message received at ' + string(document.create_time)"
49
+ #
50
+ # The exact variables and functions that may be referenced within an expression
51
+ # are determined by the service that evaluates it. See the service
52
+ # documentation for additional information.
27
53
  # @!attribute [rw] expression
28
54
  # @return [::String]
29
- # Textual representation of an expression in
30
- # Common Expression Language syntax.
31
- #
32
- # The application context of the containing message determines which
33
- # well-known feature set of CEL is supported.
55
+ # Textual representation of an expression in Common Expression Language
56
+ # syntax.
34
57
  # @!attribute [rw] title
35
58
  # @return [::String]
36
- # An optional title for the expression, i.e. a short string describing
59
+ # Optional. Title for the expression, i.e. a short string describing
37
60
  # its purpose. This can be used e.g. in UIs which allow to enter the
38
61
  # expression.
39
62
  # @!attribute [rw] description
40
63
  # @return [::String]
41
- # An optional description of the expression. This is a longer text which
64
+ # Optional. Description of the expression. This is a longer text which
42
65
  # describes the expression, e.g. when hovered over it in a UI.
43
66
  # @!attribute [rw] location
44
67
  # @return [::String]
45
- # An optional string indicating the location of the expression for error
68
+ # Optional. String indicating the location of the expression for error
46
69
  # reporting, e.g. a file name and a position in the file.
47
70
  class Expr
48
71
  include ::Google::Protobuf::MessageExts
metadata CHANGED
@@ -1,29 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-org_policy-v2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-09 00:00:00.000000000 Z
11
+ date: 2021-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0.7'
20
+ - - "<"
18
21
  - !ruby/object:Gem::Version
19
- version: '0.3'
22
+ version: 2.a
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: '0.7'
30
+ - - "<"
25
31
  - !ruby/object:Gem::Version
26
- version: '0.3'
32
+ version: 2.a
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: google-cloud-errors
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -201,7 +207,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
201
207
  - !ruby/object:Gem::Version
202
208
  version: '0'
203
209
  requirements: []
204
- rubygems_version: 3.2.13
210
+ rubygems_version: 3.2.17
205
211
  signing_key:
206
212
  specification_version: 4
207
213
  summary: API Client library for the Organization Policy V2 API