google-cloud-org_policy-v2 1.0.1 → 1.2.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: b5a4e6a6234d7c1f61e73ef4e9d72764e47545f0919c89377676a089128b13fd
4
- data.tar.gz: 86fd05c9656fcff83938119cc4da1b5abfe4b7017e680b8a60d1357080df7986
3
+ metadata.gz: d8ac1afe6dbbbf5abee8f24e9838b926ba8dde9a084ab2888baf33b51ca0aebb
4
+ data.tar.gz: 5cb9ce3b24637737ddf15f331e558008ac4f08e222942706f3f5c0baec1d9c7c
5
5
  SHA512:
6
- metadata.gz: 4defed69a691c5f4d362fb1c4c27d578ce226a8b73fad355dfdd0a6a435454df7d2f2eb1e603b0619671523904dab1fa59a259726668e935130f618f0d6d8a65
7
- data.tar.gz: 728a8a5e18a48bf061708b4b9973fcd7bb86ffb52fa8fc2387d880241095f790fd85adf83228e18ba90f2845ecb113017b64e68b8a903efeb3b9430eddf6cd15
6
+ metadata.gz: 31968787b5a67257c9edf692fb252e2846e6db613ae0303e1ee4f50f3c3c356e0a2e7fed850d7bc94eba3fd197fbd99d3afad552e985556423f38e8b78772874
7
+ data.tar.gz: 5d20948ca6ae5d4dfe9881b8bae1bc16f3aa65279112cd19ce06076f6b424280aed8801cc2c4cd1e73e0036c9ec3549adc9a21a7940bad99d48dd23fc709280e
data/README.md CHANGED
@@ -43,33 +43,43 @@ for class and method documentation.
43
43
  See also the [Product Documentation](https://cloud.google.com/resource-manager/docs/organization-policy/overview)
44
44
  for general usage information.
45
45
 
46
- ## Enabling Logging
47
-
48
- To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
49
- The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
50
- or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest)
51
- that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
52
- and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
53
-
54
- Configuring a Ruby stdlib logger:
46
+ ## Debug Logging
47
+
48
+ This library comes with opt-in Debug Logging that can help you troubleshoot
49
+ your application's integration with the API. When logging is activated, key
50
+ events such as requests and responses, along with data payloads and metadata
51
+ such as headers and client configuration, are logged to the standard error
52
+ stream.
53
+
54
+ **WARNING:** Client Library Debug Logging includes your data payloads in
55
+ plaintext, which could include sensitive data such as PII for yourself or your
56
+ customers, private keys, or other security data that could be compromising if
57
+ leaked. Always practice good data hygiene with your application logs, and follow
58
+ the principle of least access. Google also recommends that Client Library Debug
59
+ Logging be enabled only temporarily during active debugging, and not used
60
+ permanently in production.
61
+
62
+ To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
63
+ to the value `all`. Alternatively, you can set the value to a comma-delimited
64
+ list of client library gem names. This will select the default logging behavior,
65
+ which writes logs to the standard error stream. On a local workstation, this may
66
+ result in logs appearing on the console. When running on a Google Cloud hosting
67
+ service such as [Google Cloud Run](https://cloud.google.com/run), this generally
68
+ results in logs appearing alongside your application logs in the
69
+ [Google Cloud Logging](https://cloud.google.com/logging/) service.
70
+
71
+ You can customize logging by modifying the `logger` configuration when
72
+ constructing a client object. For example:
55
73
 
56
74
  ```ruby
75
+ require "google/cloud/org_policy/v2"
57
76
  require "logger"
58
77
 
59
- module MyLogger
60
- LOGGER = Logger.new $stderr, level: Logger::WARN
61
- def logger
62
- LOGGER
63
- end
64
- end
65
-
66
- # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
67
- module GRPC
68
- extend MyLogger
78
+ client = ::Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.new do |config|
79
+ config.logger = Logger.new "my-app.log"
69
80
  end
70
81
  ```
71
82
 
72
-
73
83
  ## Google Cloud Samples
74
84
 
75
85
  To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples).
@@ -236,8 +236,28 @@ module Google
236
236
  universe_domain: @config.universe_domain,
237
237
  channel_args: @config.channel_args,
238
238
  interceptors: @config.interceptors,
239
- channel_pool_config: @config.channel_pool
239
+ channel_pool_config: @config.channel_pool,
240
+ logger: @config.logger
240
241
  )
242
+
243
+ @org_policy_stub.stub_logger&.info do |entry|
244
+ entry.set_system_name
245
+ entry.set_service
246
+ entry.message = "Created client for #{entry.service}"
247
+ entry.set_credentials_fields credentials
248
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
249
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
250
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
251
+ end
252
+ end
253
+
254
+ ##
255
+ # The logger used for request/response debug logging.
256
+ #
257
+ # @return [Logger]
258
+ #
259
+ def logger
260
+ @org_policy_stub.logger
241
261
  end
242
262
 
243
263
  # Service calls
@@ -340,7 +360,7 @@ module Google
340
360
  @org_policy_stub.call_rpc :list_constraints, request, options: options do |response, operation|
341
361
  response = ::Gapic::PagedEnumerable.new @org_policy_stub, :list_constraints, request, response, operation, options
342
362
  yield response, operation if block_given?
343
- return response
363
+ throw :response, response
344
364
  end
345
365
  rescue ::GRPC::BadStatus => e
346
366
  raise ::Google::Cloud::Error.from_error(e)
@@ -445,7 +465,7 @@ module Google
445
465
  @org_policy_stub.call_rpc :list_policies, request, options: options do |response, operation|
446
466
  response = ::Gapic::PagedEnumerable.new @org_policy_stub, :list_policies, request, response, operation, options
447
467
  yield response, operation if block_given?
448
- return response
468
+ throw :response, response
449
469
  end
450
470
  rescue ::GRPC::BadStatus => e
451
471
  raise ::Google::Cloud::Error.from_error(e)
@@ -536,7 +556,6 @@ module Google
536
556
 
537
557
  @org_policy_stub.call_rpc :get_policy, request, options: options do |response, operation|
538
558
  yield response, operation if block_given?
539
- return response
540
559
  end
541
560
  rescue ::GRPC::BadStatus => e
542
561
  raise ::Google::Cloud::Error.from_error(e)
@@ -628,7 +647,6 @@ module Google
628
647
 
629
648
  @org_policy_stub.call_rpc :get_effective_policy, request, options: options do |response, operation|
630
649
  yield response, operation if block_given?
631
- return response
632
650
  end
633
651
  rescue ::GRPC::BadStatus => e
634
652
  raise ::Google::Cloud::Error.from_error(e)
@@ -727,7 +745,6 @@ module Google
727
745
 
728
746
  @org_policy_stub.call_rpc :create_policy, request, options: options do |response, operation|
729
747
  yield response, operation if block_given?
730
- return response
731
748
  end
732
749
  rescue ::GRPC::BadStatus => e
733
750
  raise ::Google::Cloud::Error.from_error(e)
@@ -825,7 +842,6 @@ module Google
825
842
 
826
843
  @org_policy_stub.call_rpc :update_policy, request, options: options do |response, operation|
827
844
  yield response, operation if block_given?
828
- return response
829
845
  end
830
846
  rescue ::GRPC::BadStatus => e
831
847
  raise ::Google::Cloud::Error.from_error(e)
@@ -919,7 +935,6 @@ module Google
919
935
 
920
936
  @org_policy_stub.call_rpc :delete_policy, request, options: options do |response, operation|
921
937
  yield response, operation if block_given?
922
- return response
923
938
  end
924
939
  rescue ::GRPC::BadStatus => e
925
940
  raise ::Google::Cloud::Error.from_error(e)
@@ -1014,7 +1029,6 @@ module Google
1014
1029
 
1015
1030
  @org_policy_stub.call_rpc :create_custom_constraint, request, options: options do |response, operation|
1016
1031
  yield response, operation if block_given?
1017
- return response
1018
1032
  end
1019
1033
  rescue ::GRPC::BadStatus => e
1020
1034
  raise ::Google::Cloud::Error.from_error(e)
@@ -1106,7 +1120,6 @@ module Google
1106
1120
 
1107
1121
  @org_policy_stub.call_rpc :update_custom_constraint, request, options: options do |response, operation|
1108
1122
  yield response, operation if block_given?
1109
- return response
1110
1123
  end
1111
1124
  rescue ::GRPC::BadStatus => e
1112
1125
  raise ::Google::Cloud::Error.from_error(e)
@@ -1196,7 +1209,6 @@ module Google
1196
1209
 
1197
1210
  @org_policy_stub.call_rpc :get_custom_constraint, request, options: options do |response, operation|
1198
1211
  yield response, operation if block_given?
1199
- return response
1200
1212
  end
1201
1213
  rescue ::GRPC::BadStatus => e
1202
1214
  raise ::Google::Cloud::Error.from_error(e)
@@ -1299,7 +1311,7 @@ module Google
1299
1311
  @org_policy_stub.call_rpc :list_custom_constraints, request, options: options do |response, operation|
1300
1312
  response = ::Gapic::PagedEnumerable.new @org_policy_stub, :list_custom_constraints, request, response, operation, options
1301
1313
  yield response, operation if block_given?
1302
- return response
1314
+ throw :response, response
1303
1315
  end
1304
1316
  rescue ::GRPC::BadStatus => e
1305
1317
  raise ::Google::Cloud::Error.from_error(e)
@@ -1389,7 +1401,6 @@ module Google
1389
1401
 
1390
1402
  @org_policy_stub.call_rpc :delete_custom_constraint, request, options: options do |response, operation|
1391
1403
  yield response, operation if block_given?
1392
- return response
1393
1404
  end
1394
1405
  rescue ::GRPC::BadStatus => e
1395
1406
  raise ::Google::Cloud::Error.from_error(e)
@@ -1478,6 +1489,11 @@ module Google
1478
1489
  # default endpoint URL. The default value of nil uses the environment
1479
1490
  # universe (usually the default "googleapis.com" universe).
1480
1491
  # @return [::String,nil]
1492
+ # @!attribute [rw] logger
1493
+ # A custom logger to use for request/response debug logging, or the value
1494
+ # `:default` (the default) to construct a default logger, or `nil` to
1495
+ # explicitly disable logging.
1496
+ # @return [::Logger,:default,nil]
1481
1497
  #
1482
1498
  class Configuration
1483
1499
  extend ::Gapic::Config
@@ -1502,6 +1518,7 @@ module Google
1502
1518
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1503
1519
  config_attr :quota_project, nil, ::String, nil
1504
1520
  config_attr :universe_domain, nil, ::String, nil
1521
+ config_attr :logger, :default, ::Logger, nil, :default
1505
1522
 
1506
1523
  # @private
1507
1524
  def initialize parent_config = nil
@@ -229,8 +229,28 @@ module Google
229
229
  endpoint: @config.endpoint,
230
230
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
231
231
  universe_domain: @config.universe_domain,
232
- credentials: credentials
232
+ credentials: credentials,
233
+ logger: @config.logger
233
234
  )
235
+
236
+ @org_policy_stub.logger(stub: true)&.info do |entry|
237
+ entry.set_system_name
238
+ entry.set_service
239
+ entry.message = "Created client for #{entry.service}"
240
+ entry.set_credentials_fields credentials
241
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
242
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
243
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
244
+ end
245
+ end
246
+
247
+ ##
248
+ # The logger used for request/response debug logging.
249
+ #
250
+ # @return [Logger]
251
+ #
252
+ def logger
253
+ @org_policy_stub.logger
234
254
  end
235
255
 
236
256
  # Service calls
@@ -326,7 +346,7 @@ module Google
326
346
  @org_policy_stub.list_constraints request, options do |result, operation|
327
347
  result = ::Gapic::Rest::PagedEnumerable.new @org_policy_stub, :list_constraints, "constraints", request, result, options
328
348
  yield result, operation if block_given?
329
- return result
349
+ throw :response, result
330
350
  end
331
351
  rescue ::Gapic::Rest::Error => e
332
352
  raise ::Google::Cloud::Error.from_error(e)
@@ -424,7 +444,7 @@ module Google
424
444
  @org_policy_stub.list_policies request, options do |result, operation|
425
445
  result = ::Gapic::Rest::PagedEnumerable.new @org_policy_stub, :list_policies, "policies", request, result, options
426
446
  yield result, operation if block_given?
427
- return result
447
+ throw :response, result
428
448
  end
429
449
  rescue ::Gapic::Rest::Error => e
430
450
  raise ::Google::Cloud::Error.from_error(e)
@@ -508,7 +528,6 @@ module Google
508
528
 
509
529
  @org_policy_stub.get_policy request, options do |result, operation|
510
530
  yield result, operation if block_given?
511
- return result
512
531
  end
513
532
  rescue ::Gapic::Rest::Error => e
514
533
  raise ::Google::Cloud::Error.from_error(e)
@@ -593,7 +612,6 @@ module Google
593
612
 
594
613
  @org_policy_stub.get_effective_policy request, options do |result, operation|
595
614
  yield result, operation if block_given?
596
- return result
597
615
  end
598
616
  rescue ::Gapic::Rest::Error => e
599
617
  raise ::Google::Cloud::Error.from_error(e)
@@ -685,7 +703,6 @@ module Google
685
703
 
686
704
  @org_policy_stub.create_policy request, options do |result, operation|
687
705
  yield result, operation if block_given?
688
- return result
689
706
  end
690
707
  rescue ::Gapic::Rest::Error => e
691
708
  raise ::Google::Cloud::Error.from_error(e)
@@ -776,7 +793,6 @@ module Google
776
793
 
777
794
  @org_policy_stub.update_policy request, options do |result, operation|
778
795
  yield result, operation if block_given?
779
- return result
780
796
  end
781
797
  rescue ::Gapic::Rest::Error => e
782
798
  raise ::Google::Cloud::Error.from_error(e)
@@ -863,7 +879,6 @@ module Google
863
879
 
864
880
  @org_policy_stub.delete_policy request, options do |result, operation|
865
881
  yield result, operation if block_given?
866
- return result
867
882
  end
868
883
  rescue ::Gapic::Rest::Error => e
869
884
  raise ::Google::Cloud::Error.from_error(e)
@@ -951,7 +966,6 @@ module Google
951
966
 
952
967
  @org_policy_stub.create_custom_constraint request, options do |result, operation|
953
968
  yield result, operation if block_given?
954
- return result
955
969
  end
956
970
  rescue ::Gapic::Rest::Error => e
957
971
  raise ::Google::Cloud::Error.from_error(e)
@@ -1036,7 +1050,6 @@ module Google
1036
1050
 
1037
1051
  @org_policy_stub.update_custom_constraint request, options do |result, operation|
1038
1052
  yield result, operation if block_given?
1039
- return result
1040
1053
  end
1041
1054
  rescue ::Gapic::Rest::Error => e
1042
1055
  raise ::Google::Cloud::Error.from_error(e)
@@ -1119,7 +1132,6 @@ module Google
1119
1132
 
1120
1133
  @org_policy_stub.get_custom_constraint request, options do |result, operation|
1121
1134
  yield result, operation if block_given?
1122
- return result
1123
1135
  end
1124
1136
  rescue ::Gapic::Rest::Error => e
1125
1137
  raise ::Google::Cloud::Error.from_error(e)
@@ -1215,7 +1227,7 @@ module Google
1215
1227
  @org_policy_stub.list_custom_constraints request, options do |result, operation|
1216
1228
  result = ::Gapic::Rest::PagedEnumerable.new @org_policy_stub, :list_custom_constraints, "custom_constraints", request, result, options
1217
1229
  yield result, operation if block_given?
1218
- return result
1230
+ throw :response, result
1219
1231
  end
1220
1232
  rescue ::Gapic::Rest::Error => e
1221
1233
  raise ::Google::Cloud::Error.from_error(e)
@@ -1298,7 +1310,6 @@ module Google
1298
1310
 
1299
1311
  @org_policy_stub.delete_custom_constraint request, options do |result, operation|
1300
1312
  yield result, operation if block_given?
1301
- return result
1302
1313
  end
1303
1314
  rescue ::Gapic::Rest::Error => e
1304
1315
  raise ::Google::Cloud::Error.from_error(e)
@@ -1378,6 +1389,11 @@ module Google
1378
1389
  # default endpoint URL. The default value of nil uses the environment
1379
1390
  # universe (usually the default "googleapis.com" universe).
1380
1391
  # @return [::String,nil]
1392
+ # @!attribute [rw] logger
1393
+ # A custom logger to use for request/response debug logging, or the value
1394
+ # `:default` (the default) to construct a default logger, or `nil` to
1395
+ # explicitly disable logging.
1396
+ # @return [::Logger,:default,nil]
1381
1397
  #
1382
1398
  class Configuration
1383
1399
  extend ::Gapic::Config
@@ -1399,6 +1415,7 @@ module Google
1399
1415
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1400
1416
  config_attr :quota_project, nil, ::String, nil
1401
1417
  config_attr :universe_domain, nil, ::String, nil
1418
+ config_attr :logger, :default, ::Logger, nil, :default
1402
1419
 
1403
1420
  # @private
1404
1421
  def initialize parent_config = nil
@@ -30,7 +30,8 @@ module Google
30
30
  # including transcoding, making the REST call, and deserialing the response.
31
31
  #
32
32
  class ServiceStub
33
- def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
33
+ # @private
34
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
34
35
  # These require statements are intentionally placed here to initialize
35
36
  # the REST modules only when it's required.
36
37
  require "gapic/rest"
@@ -40,7 +41,9 @@ module Google
40
41
  universe_domain: universe_domain,
41
42
  credentials: credentials,
42
43
  numeric_enums: true,
43
- raise_faraday_errors: false
44
+ service_name: self.class,
45
+ raise_faraday_errors: false,
46
+ logger: logger
44
47
  end
45
48
 
46
49
  ##
@@ -61,6 +64,15 @@ module Google
61
64
  @client_stub.endpoint
62
65
  end
63
66
 
67
+ ##
68
+ # The logger used for request/response debug logging.
69
+ #
70
+ # @return [Logger]
71
+ #
72
+ def logger stub: false
73
+ stub ? @client_stub.stub_logger : @client_stub.logger
74
+ end
75
+
64
76
  ##
65
77
  # Baseline implementation for the list_constraints REST call
66
78
  #
@@ -87,16 +99,18 @@ module Google
87
99
 
88
100
  response = @client_stub.make_http_request(
89
101
  verb,
90
- uri: uri,
91
- body: body || "",
92
- params: query_string_params,
102
+ uri: uri,
103
+ body: body || "",
104
+ params: query_string_params,
105
+ method_name: "list_constraints",
93
106
  options: options
94
107
  )
95
108
  operation = ::Gapic::Rest::TransportOperation.new response
96
109
  result = ::Google::Cloud::OrgPolicy::V2::ListConstraintsResponse.decode_json response.body, ignore_unknown_fields: true
97
-
98
- yield result, operation if block_given?
99
- result
110
+ catch :response do
111
+ yield result, operation if block_given?
112
+ result
113
+ end
100
114
  end
101
115
 
102
116
  ##
@@ -125,16 +139,18 @@ module Google
125
139
 
126
140
  response = @client_stub.make_http_request(
127
141
  verb,
128
- uri: uri,
129
- body: body || "",
130
- params: query_string_params,
142
+ uri: uri,
143
+ body: body || "",
144
+ params: query_string_params,
145
+ method_name: "list_policies",
131
146
  options: options
132
147
  )
133
148
  operation = ::Gapic::Rest::TransportOperation.new response
134
149
  result = ::Google::Cloud::OrgPolicy::V2::ListPoliciesResponse.decode_json response.body, ignore_unknown_fields: true
135
-
136
- yield result, operation if block_given?
137
- result
150
+ catch :response do
151
+ yield result, operation if block_given?
152
+ result
153
+ end
138
154
  end
139
155
 
140
156
  ##
@@ -163,16 +179,18 @@ module Google
163
179
 
164
180
  response = @client_stub.make_http_request(
165
181
  verb,
166
- uri: uri,
167
- body: body || "",
168
- params: query_string_params,
182
+ uri: uri,
183
+ body: body || "",
184
+ params: query_string_params,
185
+ method_name: "get_policy",
169
186
  options: options
170
187
  )
171
188
  operation = ::Gapic::Rest::TransportOperation.new response
172
189
  result = ::Google::Cloud::OrgPolicy::V2::Policy.decode_json response.body, ignore_unknown_fields: true
173
-
174
- yield result, operation if block_given?
175
- result
190
+ catch :response do
191
+ yield result, operation if block_given?
192
+ result
193
+ end
176
194
  end
177
195
 
178
196
  ##
@@ -201,16 +219,18 @@ module Google
201
219
 
202
220
  response = @client_stub.make_http_request(
203
221
  verb,
204
- uri: uri,
205
- body: body || "",
206
- params: query_string_params,
222
+ uri: uri,
223
+ body: body || "",
224
+ params: query_string_params,
225
+ method_name: "get_effective_policy",
207
226
  options: options
208
227
  )
209
228
  operation = ::Gapic::Rest::TransportOperation.new response
210
229
  result = ::Google::Cloud::OrgPolicy::V2::Policy.decode_json response.body, ignore_unknown_fields: true
211
-
212
- yield result, operation if block_given?
213
- result
230
+ catch :response do
231
+ yield result, operation if block_given?
232
+ result
233
+ end
214
234
  end
215
235
 
216
236
  ##
@@ -239,16 +259,18 @@ module Google
239
259
 
240
260
  response = @client_stub.make_http_request(
241
261
  verb,
242
- uri: uri,
243
- body: body || "",
244
- params: query_string_params,
262
+ uri: uri,
263
+ body: body || "",
264
+ params: query_string_params,
265
+ method_name: "create_policy",
245
266
  options: options
246
267
  )
247
268
  operation = ::Gapic::Rest::TransportOperation.new response
248
269
  result = ::Google::Cloud::OrgPolicy::V2::Policy.decode_json response.body, ignore_unknown_fields: true
249
-
250
- yield result, operation if block_given?
251
- result
270
+ catch :response do
271
+ yield result, operation if block_given?
272
+ result
273
+ end
252
274
  end
253
275
 
254
276
  ##
@@ -277,16 +299,18 @@ module Google
277
299
 
278
300
  response = @client_stub.make_http_request(
279
301
  verb,
280
- uri: uri,
281
- body: body || "",
282
- params: query_string_params,
302
+ uri: uri,
303
+ body: body || "",
304
+ params: query_string_params,
305
+ method_name: "update_policy",
283
306
  options: options
284
307
  )
285
308
  operation = ::Gapic::Rest::TransportOperation.new response
286
309
  result = ::Google::Cloud::OrgPolicy::V2::Policy.decode_json response.body, ignore_unknown_fields: true
287
-
288
- yield result, operation if block_given?
289
- result
310
+ catch :response do
311
+ yield result, operation if block_given?
312
+ result
313
+ end
290
314
  end
291
315
 
292
316
  ##
@@ -315,16 +339,18 @@ module Google
315
339
 
316
340
  response = @client_stub.make_http_request(
317
341
  verb,
318
- uri: uri,
319
- body: body || "",
320
- params: query_string_params,
342
+ uri: uri,
343
+ body: body || "",
344
+ params: query_string_params,
345
+ method_name: "delete_policy",
321
346
  options: options
322
347
  )
323
348
  operation = ::Gapic::Rest::TransportOperation.new response
324
349
  result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
325
-
326
- yield result, operation if block_given?
327
- result
350
+ catch :response do
351
+ yield result, operation if block_given?
352
+ result
353
+ end
328
354
  end
329
355
 
330
356
  ##
@@ -353,16 +379,18 @@ module Google
353
379
 
354
380
  response = @client_stub.make_http_request(
355
381
  verb,
356
- uri: uri,
357
- body: body || "",
358
- params: query_string_params,
382
+ uri: uri,
383
+ body: body || "",
384
+ params: query_string_params,
385
+ method_name: "create_custom_constraint",
359
386
  options: options
360
387
  )
361
388
  operation = ::Gapic::Rest::TransportOperation.new response
362
389
  result = ::Google::Cloud::OrgPolicy::V2::CustomConstraint.decode_json response.body, ignore_unknown_fields: true
363
-
364
- yield result, operation if block_given?
365
- result
390
+ catch :response do
391
+ yield result, operation if block_given?
392
+ result
393
+ end
366
394
  end
367
395
 
368
396
  ##
@@ -391,16 +419,18 @@ module Google
391
419
 
392
420
  response = @client_stub.make_http_request(
393
421
  verb,
394
- uri: uri,
395
- body: body || "",
396
- params: query_string_params,
422
+ uri: uri,
423
+ body: body || "",
424
+ params: query_string_params,
425
+ method_name: "update_custom_constraint",
397
426
  options: options
398
427
  )
399
428
  operation = ::Gapic::Rest::TransportOperation.new response
400
429
  result = ::Google::Cloud::OrgPolicy::V2::CustomConstraint.decode_json response.body, ignore_unknown_fields: true
401
-
402
- yield result, operation if block_given?
403
- result
430
+ catch :response do
431
+ yield result, operation if block_given?
432
+ result
433
+ end
404
434
  end
405
435
 
406
436
  ##
@@ -429,16 +459,18 @@ module Google
429
459
 
430
460
  response = @client_stub.make_http_request(
431
461
  verb,
432
- uri: uri,
433
- body: body || "",
434
- params: query_string_params,
462
+ uri: uri,
463
+ body: body || "",
464
+ params: query_string_params,
465
+ method_name: "get_custom_constraint",
435
466
  options: options
436
467
  )
437
468
  operation = ::Gapic::Rest::TransportOperation.new response
438
469
  result = ::Google::Cloud::OrgPolicy::V2::CustomConstraint.decode_json response.body, ignore_unknown_fields: true
439
-
440
- yield result, operation if block_given?
441
- result
470
+ catch :response do
471
+ yield result, operation if block_given?
472
+ result
473
+ end
442
474
  end
443
475
 
444
476
  ##
@@ -467,16 +499,18 @@ module Google
467
499
 
468
500
  response = @client_stub.make_http_request(
469
501
  verb,
470
- uri: uri,
471
- body: body || "",
472
- params: query_string_params,
502
+ uri: uri,
503
+ body: body || "",
504
+ params: query_string_params,
505
+ method_name: "list_custom_constraints",
473
506
  options: options
474
507
  )
475
508
  operation = ::Gapic::Rest::TransportOperation.new response
476
509
  result = ::Google::Cloud::OrgPolicy::V2::ListCustomConstraintsResponse.decode_json response.body, ignore_unknown_fields: true
477
-
478
- yield result, operation if block_given?
479
- result
510
+ catch :response do
511
+ yield result, operation if block_given?
512
+ result
513
+ end
480
514
  end
481
515
 
482
516
  ##
@@ -505,16 +539,18 @@ module Google
505
539
 
506
540
  response = @client_stub.make_http_request(
507
541
  verb,
508
- uri: uri,
509
- body: body || "",
510
- params: query_string_params,
542
+ uri: uri,
543
+ body: body || "",
544
+ params: query_string_params,
545
+ method_name: "delete_custom_constraint",
511
546
  options: options
512
547
  )
513
548
  operation = ::Gapic::Rest::TransportOperation.new response
514
549
  result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
515
-
516
- yield result, operation if block_given?
517
- result
550
+ catch :response do
551
+ yield result, operation if block_given?
552
+ result
553
+ end
518
554
  end
519
555
 
520
556
  ##
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module OrgPolicy
23
23
  module V2
24
- VERSION = "1.0.1"
24
+ VERSION = "1.2.0"
25
25
  end
26
26
  end
27
27
  end
@@ -9,7 +9,7 @@ require 'google/api/resource_pb'
9
9
  require 'google/protobuf/timestamp_pb'
10
10
 
11
11
 
12
- descriptor_data = "\n*google/cloud/orgpolicy/v2/constraint.proto\x12\x19google.cloud.orgpolicy.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xd1\x05\n\nConstraint\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12S\n\x12\x63onstraint_default\x18\x04 \x01(\x0e\x32\x37.google.cloud.orgpolicy.v2.Constraint.ConstraintDefault\x12O\n\x0flist_constraint\x18\x05 \x01(\x0b\x32\x34.google.cloud.orgpolicy.v2.Constraint.ListConstraintH\x00\x12U\n\x12\x62oolean_constraint\x18\x06 \x01(\x0b\x32\x37.google.cloud.orgpolicy.v2.Constraint.BooleanConstraintH\x00\x12\x18\n\x10supports_dry_run\x18\x07 \x01(\x08\x1a=\n\x0eListConstraint\x12\x13\n\x0bsupports_in\x18\x01 \x01(\x08\x12\x16\n\x0esupports_under\x18\x02 \x01(\x08\x1a\x13\n\x11\x42ooleanConstraint\"L\n\x11\x43onstraintDefault\x12\"\n\x1e\x43ONSTRAINT_DEFAULT_UNSPECIFIED\x10\x00\x12\t\n\x05\x41LLOW\x10\x01\x12\x08\n\x04\x44\x45NY\x10\x02:\xb8\x01\xea\x41\xb4\x01\n#orgpolicy.googleapis.com/Constraint\x12+projects/{project}/constraints/{constraint}\x12)folders/{folder}/constraints/{constraint}\x12\x35organizations/{organization}/constraints/{constraint}B\x11\n\x0f\x63onstraint_type\"\xd4\x04\n\x10\x43ustomConstraint\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\x1b\n\x0eresource_types\x18\x02 \x03(\tB\x03\xe0\x41\x05\x12L\n\x0cmethod_types\x18\x03 \x03(\x0e\x32\x36.google.cloud.orgpolicy.v2.CustomConstraint.MethodType\x12\x11\n\tcondition\x18\x04 \x01(\t\x12K\n\x0b\x61\x63tion_type\x18\x05 \x01(\x0e\x32\x36.google.cloud.orgpolicy.v2.CustomConstraint.ActionType\x12\x14\n\x0c\x64isplay_name\x18\x06 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x07 \x01(\t\x12\x34\n\x0bupdate_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"M\n\nMethodType\x12\x1b\n\x17METHOD_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06\x43REATE\x10\x01\x12\n\n\x06UPDATE\x10\x02\x12\n\n\x06\x44\x45LETE\x10\x03\">\n\nActionType\x12\x1b\n\x17\x41\x43TION_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05\x41LLOW\x10\x01\x12\x08\n\x04\x44\x45NY\x10\x02:r\xea\x41o\n)orgpolicy.googleapis.com/CustomConstraint\x12\x42organizations/{organization}/customConstraints/{custom_constraint}B\xc6\x01\n\x1d\x63om.google.cloud.orgpolicy.v2B\x0f\x43onstraintProtoP\x01Z;cloud.google.com/go/orgpolicy/apiv2/orgpolicypb;orgpolicypb\xaa\x02\x19Google.Cloud.OrgPolicy.V2\xca\x02\x19Google\\Cloud\\OrgPolicy\\V2\xea\x02\x1cGoogle::Cloud::OrgPolicy::V2b\x06proto3"
12
+ descriptor_data = "\n*google/cloud/orgpolicy/v2/constraint.proto\x12\x19google.cloud.orgpolicy.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xd1\x05\n\nConstraint\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12S\n\x12\x63onstraint_default\x18\x04 \x01(\x0e\x32\x37.google.cloud.orgpolicy.v2.Constraint.ConstraintDefault\x12O\n\x0flist_constraint\x18\x05 \x01(\x0b\x32\x34.google.cloud.orgpolicy.v2.Constraint.ListConstraintH\x00\x12U\n\x12\x62oolean_constraint\x18\x06 \x01(\x0b\x32\x37.google.cloud.orgpolicy.v2.Constraint.BooleanConstraintH\x00\x12\x18\n\x10supports_dry_run\x18\x07 \x01(\x08\x1a=\n\x0eListConstraint\x12\x13\n\x0bsupports_in\x18\x01 \x01(\x08\x12\x16\n\x0esupports_under\x18\x02 \x01(\x08\x1a\x13\n\x11\x42ooleanConstraint\"L\n\x11\x43onstraintDefault\x12\"\n\x1e\x43ONSTRAINT_DEFAULT_UNSPECIFIED\x10\x00\x12\t\n\x05\x41LLOW\x10\x01\x12\x08\n\x04\x44\x45NY\x10\x02:\xb8\x01\xea\x41\xb4\x01\n#orgpolicy.googleapis.com/Constraint\x12+projects/{project}/constraints/{constraint}\x12)folders/{folder}/constraints/{constraint}\x12\x35organizations/{organization}/constraints/{constraint}B\x11\n\x0f\x63onstraint_type\"\xf7\x04\n\x10\x43ustomConstraint\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\x1b\n\x0eresource_types\x18\x02 \x03(\tB\x03\xe0\x41\x05\x12L\n\x0cmethod_types\x18\x03 \x03(\x0e\x32\x36.google.cloud.orgpolicy.v2.CustomConstraint.MethodType\x12\x11\n\tcondition\x18\x04 \x01(\t\x12K\n\x0b\x61\x63tion_type\x18\x05 \x01(\x0e\x32\x36.google.cloud.orgpolicy.v2.CustomConstraint.ActionType\x12\x14\n\x0c\x64isplay_name\x18\x06 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x07 \x01(\t\x12\x34\n\x0bupdate_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"p\n\nMethodType\x12\x1b\n\x17METHOD_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06\x43REATE\x10\x01\x12\n\n\x06UPDATE\x10\x02\x12\n\n\x06\x44\x45LETE\x10\x03\x12\x10\n\x0cREMOVE_GRANT\x10\x04\x12\x0f\n\x0bGOVERN_TAGS\x10\x05\">\n\nActionType\x12\x1b\n\x17\x41\x43TION_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05\x41LLOW\x10\x01\x12\x08\n\x04\x44\x45NY\x10\x02:r\xea\x41o\n)orgpolicy.googleapis.com/CustomConstraint\x12\x42organizations/{organization}/customConstraints/{custom_constraint}B\xc6\x01\n\x1d\x63om.google.cloud.orgpolicy.v2B\x0f\x43onstraintProtoP\x01Z;cloud.google.com/go/orgpolicy/apiv2/orgpolicypb;orgpolicypb\xaa\x02\x19Google.Cloud.OrgPolicy.V2\xca\x02\x19Google\\Cloud\\OrgPolicy\\V2\xea\x02\x1cGoogle::Cloud::OrgPolicy::V2b\x06proto3"
13
13
 
14
14
  pool = Google::Protobuf::DescriptorPool.generated_pool
15
15
 
@@ -28,6 +28,9 @@ module Google
28
28
  # @!attribute [rw] destinations
29
29
  # @return [::Array<::Google::Api::ClientLibraryDestination>]
30
30
  # The destination where API teams want this client library to be published.
31
+ # @!attribute [rw] selective_gapic_generation
32
+ # @return [::Google::Api::SelectiveGapicGeneration]
33
+ # Configuration for which RPCs should be generated in the GAPIC client.
31
34
  class CommonLanguageSettings
32
35
  include ::Google::Protobuf::MessageExts
33
36
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -212,6 +215,12 @@ module Google
212
215
  # enabled. By default, asynchronous REST clients will not be generated.
213
216
  # This feature will be enabled by default 1 month after launching the
214
217
  # feature in preview packages.
218
+ # @!attribute [rw] protobuf_pythonic_types_enabled
219
+ # @return [::Boolean]
220
+ # Enables generation of protobuf code using new types that are more
221
+ # Pythonic which are included in `protobuf>=5.29.x`. This feature will be
222
+ # enabled by default 1 month after launching the feature in preview
223
+ # packages.
215
224
  class ExperimentalFeatures
216
225
  include ::Google::Protobuf::MessageExts
217
226
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -297,9 +306,28 @@ module Google
297
306
  # @!attribute [rw] common
298
307
  # @return [::Google::Api::CommonLanguageSettings]
299
308
  # Some settings.
309
+ # @!attribute [rw] renamed_services
310
+ # @return [::Google::Protobuf::Map{::String => ::String}]
311
+ # Map of service names to renamed services. Keys are the package relative
312
+ # service names and values are the name to be used for the service client
313
+ # and call options.
314
+ #
315
+ # publishing:
316
+ # go_settings:
317
+ # renamed_services:
318
+ # Publisher: TopicAdmin
300
319
  class GoSettings
301
320
  include ::Google::Protobuf::MessageExts
302
321
  extend ::Google::Protobuf::MessageExts::ClassMethods
322
+
323
+ # @!attribute [rw] key
324
+ # @return [::String]
325
+ # @!attribute [rw] value
326
+ # @return [::String]
327
+ class RenamedServicesEntry
328
+ include ::Google::Protobuf::MessageExts
329
+ extend ::Google::Protobuf::MessageExts::ClassMethods
330
+ end
303
331
  end
304
332
 
305
333
  # Describes the generator configuration for a method.
@@ -375,6 +403,17 @@ module Google
375
403
  end
376
404
  end
377
405
 
406
+ # This message is used to configure the generation of a subset of the RPCs in
407
+ # a service for client libraries.
408
+ # @!attribute [rw] methods
409
+ # @return [::Array<::String>]
410
+ # An allowlist of the fully qualified names of RPCs that should be included
411
+ # on public client surfaces.
412
+ class SelectiveGapicGeneration
413
+ include ::Google::Protobuf::MessageExts
414
+ extend ::Google::Protobuf::MessageExts::ClassMethods
415
+ end
416
+
378
417
  # The organization for which the client libraries are being published.
379
418
  # Affects the url where generated docs are published, etc.
380
419
  module ClientLibraryOrganization
@@ -192,6 +192,12 @@ module Google
192
192
  # Constraint applied when deleting the resource.
193
193
  # Not supported yet.
194
194
  DELETE = 3
195
+
196
+ # Constraint applied when removing an IAM grant.
197
+ REMOVE_GRANT = 4
198
+
199
+ # Constraint applied when enforcing forced tagging.
200
+ GOVERN_TAGS = 5
195
201
  end
196
202
 
197
203
  # Allow or deny type.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-org_policy-v2
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.2.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: 2024-08-30 00:00:00.000000000 Z
11
+ date: 2024-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.21.1
19
+ version: 0.24.0
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: 2.a
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: 0.21.1
29
+ version: 0.24.0
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: 2.a
@@ -103,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
103
  - !ruby/object:Gem::Version
104
104
  version: '0'
105
105
  requirements: []
106
- rubygems_version: 3.5.6
106
+ rubygems_version: 3.5.23
107
107
  signing_key:
108
108
  specification_version: 4
109
109
  summary: The Organization Policy API allows users to configure governance rules on