google-cloud-org_policy-v2 1.1.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8a903d7fb2c86a4f99f6664e986b62444c3282665f86329effdeb8edbd6d1ff2
4
- data.tar.gz: 475d6aaafe17791aaac5933d39e66db637ca3a435b27583a07f06a344768af6c
3
+ metadata.gz: 1c6028a0bc5acaf6270724fa6cd21a5938a6ddfcd4f2b18da3489c9ac7ab6d54
4
+ data.tar.gz: f087c14b5eb2b91e567f0ee5f0f7e7b10e4a24dfc09d588e3e5ac70b670d0a29
5
5
  SHA512:
6
- metadata.gz: 0744b4d828e5db69cf39f48428d832a72d4bf0fceabe645fb0a07f2617f48c2e1c2ea71c287e4f4d76b868ebf6079329e58758885937cb36311853652fecb5c7
7
- data.tar.gz: 857e0681b2eb7d90345c39ea189b06e63de87cc76a2629c1ecf81611fd83e91ae28c55b8eade2b83fc44b1a0869246a9b739cf53e5c4ebcb03fc45fd65dfe672
6
+ metadata.gz: e8335625ce1e1eac941066d6c06497e5588b693a2075fe86d296c768bf0bbcf6d97a432d3406756e513c1b03c98bbdb8b0a30ad757ed09f4e1c886e11a347aee
7
+ data.tar.gz: 718a5cd15e1f709df42bebfdbd087a7c857679fd4bd61707660fe2e45bfd0d638ea78a2b8d1413f3ff3d4d2fb30ef43ba470f20bf5582f56904b8e3045063ff7
data/README.md CHANGED
@@ -43,40 +43,50 @@ 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).
76
86
 
77
87
  ## Supported Ruby Versions
78
88
 
79
- This library is supported on Ruby 2.7+.
89
+ This library is supported on Ruby 3.0+.
80
90
 
81
91
  Google provides official support for Ruby versions that are actively supported
82
92
  by Ruby Core—that is, Ruby versions that are either in normal maintenance or
@@ -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)
@@ -1439,6 +1450,13 @@ module Google
1439
1450
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
1440
1451
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
1441
1452
  # * (`nil`) indicating no credentials
1453
+ #
1454
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
1455
+ # external source for authentication to Google Cloud, you must validate it before
1456
+ # providing it to a Google API client library. Providing an unvalidated credential
1457
+ # configuration to Google APIs can compromise the security of your systems and data.
1458
+ # For more information, refer to [Validate credential configurations from external
1459
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
1442
1460
  # @return [::Object]
1443
1461
  # @!attribute [rw] scope
1444
1462
  # The OAuth scopes
@@ -1478,6 +1496,11 @@ module Google
1478
1496
  # default endpoint URL. The default value of nil uses the environment
1479
1497
  # universe (usually the default "googleapis.com" universe).
1480
1498
  # @return [::String,nil]
1499
+ # @!attribute [rw] logger
1500
+ # A custom logger to use for request/response debug logging, or the value
1501
+ # `:default` (the default) to construct a default logger, or `nil` to
1502
+ # explicitly disable logging.
1503
+ # @return [::Logger,:default,nil]
1481
1504
  #
1482
1505
  class Configuration
1483
1506
  extend ::Gapic::Config
@@ -1502,6 +1525,7 @@ module Google
1502
1525
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1503
1526
  config_attr :quota_project, nil, ::String, nil
1504
1527
  config_attr :universe_domain, nil, ::String, nil
1528
+ config_attr :logger, :default, ::Logger, nil, :default
1505
1529
 
1506
1530
  # @private
1507
1531
  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)
@@ -1346,6 +1357,13 @@ module Google
1346
1357
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1347
1358
  # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
1348
1359
  # * (`nil`) indicating no credentials
1360
+ #
1361
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
1362
+ # external source for authentication to Google Cloud, you must validate it before
1363
+ # providing it to a Google API client library. Providing an unvalidated credential
1364
+ # configuration to Google APIs can compromise the security of your systems and data.
1365
+ # For more information, refer to [Validate credential configurations from external
1366
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
1349
1367
  # @return [::Object]
1350
1368
  # @!attribute [rw] scope
1351
1369
  # The OAuth scopes
@@ -1378,6 +1396,11 @@ module Google
1378
1396
  # default endpoint URL. The default value of nil uses the environment
1379
1397
  # universe (usually the default "googleapis.com" universe).
1380
1398
  # @return [::String,nil]
1399
+ # @!attribute [rw] logger
1400
+ # A custom logger to use for request/response debug logging, or the value
1401
+ # `:default` (the default) to construct a default logger, or `nil` to
1402
+ # explicitly disable logging.
1403
+ # @return [::Logger,:default,nil]
1381
1404
  #
1382
1405
  class Configuration
1383
1406
  extend ::Gapic::Config
@@ -1399,6 +1422,7 @@ module Google
1399
1422
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1400
1423
  config_attr :quota_project, nil, ::String, nil
1401
1424
  config_attr :universe_domain, nil, ::String, nil
1425
+ config_attr :logger, :default, ::Logger, nil, :default
1402
1426
 
1403
1427
  # @private
1404
1428
  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.1.0"
24
+ VERSION = "1.3.0"
25
25
  end
26
26
  end
27
27
  end
@@ -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
@@ -62,9 +62,13 @@ module Google
62
62
  # @!attribute [rw] list_constraint
63
63
  # @return [::Google::Cloud::OrgPolicy::V2::Constraint::ListConstraint]
64
64
  # Defines this constraint as being a ListConstraint.
65
+ #
66
+ # Note: The following fields are mutually exclusive: `list_constraint`, `boolean_constraint`. If a field in that set is populated, all other fields in the set will automatically be cleared.
65
67
  # @!attribute [rw] boolean_constraint
66
68
  # @return [::Google::Cloud::OrgPolicy::V2::Constraint::BooleanConstraint]
67
69
  # Defines this constraint as being a BooleanConstraint.
70
+ #
71
+ # Note: The following fields are mutually exclusive: `boolean_constraint`, `list_constraint`. If a field in that set is populated, all other fields in the set will automatically be cleared.
68
72
  # @!attribute [rw] supports_dry_run
69
73
  # @return [::Boolean]
70
74
  # Shows if dry run is supported for this constraint or not.
@@ -131,19 +131,27 @@ module Google
131
131
  # @return [::Google::Cloud::OrgPolicy::V2::PolicySpec::PolicyRule::StringValues]
132
132
  # List of values to be used for this policy rule. This field can be set
133
133
  # only in policies for list constraints.
134
+ #
135
+ # Note: The following fields are mutually exclusive: `values`, `allow_all`, `deny_all`, `enforce`. If a field in that set is populated, all other fields in the set will automatically be cleared.
134
136
  # @!attribute [rw] allow_all
135
137
  # @return [::Boolean]
136
138
  # Setting this to true means that all values are allowed. This field can
137
139
  # be set only in policies for list constraints.
140
+ #
141
+ # Note: The following fields are mutually exclusive: `allow_all`, `values`, `deny_all`, `enforce`. If a field in that set is populated, all other fields in the set will automatically be cleared.
138
142
  # @!attribute [rw] deny_all
139
143
  # @return [::Boolean]
140
144
  # Setting this to true means that all values are denied. This field can
141
145
  # be set only in policies for list constraints.
146
+ #
147
+ # Note: The following fields are mutually exclusive: `deny_all`, `values`, `allow_all`, `enforce`. If a field in that set is populated, all other fields in the set will automatically be cleared.
142
148
  # @!attribute [rw] enforce
143
149
  # @return [::Boolean]
144
150
  # If `true`, then the policy is enforced. If `false`, then any
145
151
  # configuration is acceptable.
146
152
  # This field can be set only in policies for boolean constraints.
153
+ #
154
+ # Note: The following fields are mutually exclusive: `enforce`, `values`, `allow_all`, `deny_all`. If a field in that set is populated, all other fields in the set will automatically be cleared.
147
155
  # @!attribute [rw] condition
148
156
  # @return [::Google::Type::Expr]
149
157
  # A condition which determines whether this rule is used
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-org_policy-v2
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-09-20 00:00:00.000000000 Z
10
+ date: 2025-01-29 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: gapic-common
@@ -16,7 +15,7 @@ dependencies:
16
15
  requirements:
17
16
  - - ">="
18
17
  - !ruby/object:Gem::Version
19
- version: 0.21.1
18
+ version: 0.25.0
20
19
  - - "<"
21
20
  - !ruby/object:Gem::Version
22
21
  version: 2.a
@@ -26,7 +25,7 @@ dependencies:
26
25
  requirements:
27
26
  - - ">="
28
27
  - !ruby/object:Gem::Version
29
- version: 0.21.1
28
+ version: 0.25.0
30
29
  - - "<"
31
30
  - !ruby/object:Gem::Version
32
31
  version: 2.a
@@ -88,7 +87,6 @@ homepage: https://github.com/googleapis/google-cloud-ruby
88
87
  licenses:
89
88
  - Apache-2.0
90
89
  metadata: {}
91
- post_install_message:
92
90
  rdoc_options: []
93
91
  require_paths:
94
92
  - lib
@@ -96,15 +94,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
96
94
  requirements:
97
95
  - - ">="
98
96
  - !ruby/object:Gem::Version
99
- version: '2.7'
97
+ version: '3.0'
100
98
  required_rubygems_version: !ruby/object:Gem::Requirement
101
99
  requirements:
102
100
  - - ">="
103
101
  - !ruby/object:Gem::Version
104
102
  version: '0'
105
103
  requirements: []
106
- rubygems_version: 3.5.6
107
- signing_key:
104
+ rubygems_version: 3.6.2
108
105
  specification_version: 4
109
106
  summary: The Organization Policy API allows users to configure governance rules on
110
107
  their Google Cloud resources across the resource hierarchy.