google-cloud-org_policy-v2 0.5.0 → 0.7.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: ff493f46652eeff5e6b0944ebf297a667142a4d4f2d4407666dbaafc56497953
4
- data.tar.gz: 012d4efc72c58b499db22ae76e666713e9891e414b8d889d63d4e8323ae37d74
3
+ metadata.gz: e378f7877a32aa784289727dc206ca2d22fbfe049ed01088bcc446b730277f8c
4
+ data.tar.gz: 36a87a2dc8d5efe61470fba7aeae1548d5028ca205b15cecbe9ea9531655e5d1
5
5
  SHA512:
6
- metadata.gz: e836b558570788c9c04293311a72012cb74cf8397120fd0106bf2648d0e7dff7709238696a04843e711e6556566866295304ace582ea55710b05a9a3c6f7eb13
7
- data.tar.gz: 21ebb47bedc67d7a4d0e1e13a7dd01078ec0347348c6fed1552200fcfc6e86c534b8737c2f5f26c41c9e10df46a44c48bd65340798b0ed69c557ebcd8743871d
6
+ metadata.gz: c8d5699411a488557efe185a0100641136670269ba6f8bab1d06326c2d7d8acc41bb436c31643496ee858ba317a6da53c0b85b8afa28eadc7d64f78d0efb53a3
7
+ data.tar.gz: 70ba3cda52c4985c9f418a5e37b16969884c0dc7a66c32ca68cc06f764960a3113a829a690e3463d6e55c53a55cb99af0383fa018b3bfc106091c9a08f4b8df4
data/README.md CHANGED
@@ -47,7 +47,7 @@ for general usage information.
47
47
 
48
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
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://googleapis.dev/ruby/google-cloud-logging/latest)
50
+ or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest)
51
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
52
  and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
53
53
 
@@ -177,7 +177,7 @@ module Google
177
177
  credentials = @config.credentials
178
178
  # Use self-signed JWT if the endpoint is unchanged from default,
179
179
  # but only if the default endpoint does not have a region prefix.
180
- enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
180
+ enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
181
181
  !@config.endpoint.split(".").first.include?("-")
182
182
  credentials ||= Credentials.default scope: @config.scope,
183
183
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -192,7 +192,8 @@ module Google
192
192
  credentials: credentials,
193
193
  endpoint: @config.endpoint,
194
194
  channel_args: @config.channel_args,
195
- interceptors: @config.interceptors
195
+ interceptors: @config.interceptors,
196
+ channel_pool_config: @config.channel_pool
196
197
  )
197
198
  end
198
199
 
@@ -904,9 +905,9 @@ module Google
904
905
  # * (`String`) The path to a service account key file in JSON format
905
906
  # * (`Hash`) A service account key as a Hash
906
907
  # * (`Google::Auth::Credentials`) A googleauth credentials object
907
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
908
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
908
909
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
909
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
910
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
910
911
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
911
912
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
912
913
  # * (`nil`) indicating no credentials
@@ -948,7 +949,9 @@ module Google
948
949
  class Configuration
949
950
  extend ::Gapic::Config
950
951
 
951
- config_attr :endpoint, "orgpolicy.googleapis.com", ::String
952
+ DEFAULT_ENDPOINT = "orgpolicy.googleapis.com"
953
+
954
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
952
955
  config_attr :credentials, nil do |value|
953
956
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
954
957
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -983,6 +986,14 @@ module Google
983
986
  end
984
987
  end
985
988
 
989
+ ##
990
+ # Configuration for the channel pool
991
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
992
+ #
993
+ def channel_pool
994
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
995
+ end
996
+
986
997
  ##
987
998
  # Configuration RPC class for the OrgPolicy API.
988
999
  #
@@ -173,7 +173,7 @@ module Google
173
173
  credentials = @config.credentials
174
174
  # Use self-signed JWT if the endpoint is unchanged from default,
175
175
  # but only if the default endpoint does not have a region prefix.
176
- enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
176
+ enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
177
177
  !@config.endpoint.split(".").first.include?("-")
178
178
  credentials ||= Credentials.default scope: @config.scope,
179
179
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -228,6 +228,26 @@ module Google
228
228
  # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::OrgPolicy::V2::Constraint>]
229
229
  #
230
230
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
231
+ #
232
+ # @example Basic example
233
+ # require "google/cloud/org_policy/v2"
234
+ #
235
+ # # Create a client object. The client can be reused for multiple calls.
236
+ # client = Google::Cloud::OrgPolicy::V2::OrgPolicy::Rest::Client.new
237
+ #
238
+ # # Create a request. To set request fields, pass in keyword arguments.
239
+ # request = Google::Cloud::OrgPolicy::V2::ListConstraintsRequest.new
240
+ #
241
+ # # Call the list_constraints method.
242
+ # result = client.list_constraints request
243
+ #
244
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
245
+ # # over elements, and API calls will be issued to fetch pages as needed.
246
+ # result.each do |item|
247
+ # # Each element is of type ::Google::Cloud::OrgPolicy::V2::Constraint.
248
+ # p item
249
+ # end
250
+ #
231
251
  def list_constraints request, options = nil
232
252
  raise ::ArgumentError, "request must be provided" if request.nil?
233
253
 
@@ -304,6 +324,26 @@ module Google
304
324
  # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::OrgPolicy::V2::Policy>]
305
325
  #
306
326
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
327
+ #
328
+ # @example Basic example
329
+ # require "google/cloud/org_policy/v2"
330
+ #
331
+ # # Create a client object. The client can be reused for multiple calls.
332
+ # client = Google::Cloud::OrgPolicy::V2::OrgPolicy::Rest::Client.new
333
+ #
334
+ # # Create a request. To set request fields, pass in keyword arguments.
335
+ # request = Google::Cloud::OrgPolicy::V2::ListPoliciesRequest.new
336
+ #
337
+ # # Call the list_policies method.
338
+ # result = client.list_policies request
339
+ #
340
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
341
+ # # over elements, and API calls will be issued to fetch pages as needed.
342
+ # result.each do |item|
343
+ # # Each element is of type ::Google::Cloud::OrgPolicy::V2::Policy.
344
+ # p item
345
+ # end
346
+ #
307
347
  def list_policies request, options = nil
308
348
  raise ::ArgumentError, "request must be provided" if request.nil?
309
349
 
@@ -372,6 +412,22 @@ module Google
372
412
  # @return [::Google::Cloud::OrgPolicy::V2::Policy]
373
413
  #
374
414
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
415
+ #
416
+ # @example Basic example
417
+ # require "google/cloud/org_policy/v2"
418
+ #
419
+ # # Create a client object. The client can be reused for multiple calls.
420
+ # client = Google::Cloud::OrgPolicy::V2::OrgPolicy::Rest::Client.new
421
+ #
422
+ # # Create a request. To set request fields, pass in keyword arguments.
423
+ # request = Google::Cloud::OrgPolicy::V2::GetPolicyRequest.new
424
+ #
425
+ # # Call the get_policy method.
426
+ # result = client.get_policy request
427
+ #
428
+ # # The returned object is of type Google::Cloud::OrgPolicy::V2::Policy.
429
+ # p result
430
+ #
375
431
  def get_policy request, options = nil
376
432
  raise ::ArgumentError, "request must be provided" if request.nil?
377
433
 
@@ -439,6 +495,22 @@ module Google
439
495
  # @return [::Google::Cloud::OrgPolicy::V2::Policy]
440
496
  #
441
497
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
498
+ #
499
+ # @example Basic example
500
+ # require "google/cloud/org_policy/v2"
501
+ #
502
+ # # Create a client object. The client can be reused for multiple calls.
503
+ # client = Google::Cloud::OrgPolicy::V2::OrgPolicy::Rest::Client.new
504
+ #
505
+ # # Create a request. To set request fields, pass in keyword arguments.
506
+ # request = Google::Cloud::OrgPolicy::V2::GetEffectivePolicyRequest.new
507
+ #
508
+ # # Call the get_effective_policy method.
509
+ # result = client.get_effective_policy request
510
+ #
511
+ # # The returned object is of type Google::Cloud::OrgPolicy::V2::Policy.
512
+ # p result
513
+ #
442
514
  def get_effective_policy request, options = nil
443
515
  raise ::ArgumentError, "request must be provided" if request.nil?
444
516
 
@@ -513,6 +585,22 @@ module Google
513
585
  # @return [::Google::Cloud::OrgPolicy::V2::Policy]
514
586
  #
515
587
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
588
+ #
589
+ # @example Basic example
590
+ # require "google/cloud/org_policy/v2"
591
+ #
592
+ # # Create a client object. The client can be reused for multiple calls.
593
+ # client = Google::Cloud::OrgPolicy::V2::OrgPolicy::Rest::Client.new
594
+ #
595
+ # # Create a request. To set request fields, pass in keyword arguments.
596
+ # request = Google::Cloud::OrgPolicy::V2::CreatePolicyRequest.new
597
+ #
598
+ # # Call the create_policy method.
599
+ # result = client.create_policy request
600
+ #
601
+ # # The returned object is of type Google::Cloud::OrgPolicy::V2::Policy.
602
+ # p result
603
+ #
516
604
  def create_policy request, options = nil
517
605
  raise ::ArgumentError, "request must be provided" if request.nil?
518
606
 
@@ -587,6 +675,22 @@ module Google
587
675
  # @return [::Google::Cloud::OrgPolicy::V2::Policy]
588
676
  #
589
677
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
678
+ #
679
+ # @example Basic example
680
+ # require "google/cloud/org_policy/v2"
681
+ #
682
+ # # Create a client object. The client can be reused for multiple calls.
683
+ # client = Google::Cloud::OrgPolicy::V2::OrgPolicy::Rest::Client.new
684
+ #
685
+ # # Create a request. To set request fields, pass in keyword arguments.
686
+ # request = Google::Cloud::OrgPolicy::V2::UpdatePolicyRequest.new
687
+ #
688
+ # # Call the update_policy method.
689
+ # result = client.update_policy request
690
+ #
691
+ # # The returned object is of type Google::Cloud::OrgPolicy::V2::Policy.
692
+ # p result
693
+ #
590
694
  def update_policy request, options = nil
591
695
  raise ::ArgumentError, "request must be provided" if request.nil?
592
696
 
@@ -653,6 +757,22 @@ module Google
653
757
  # @return [::Google::Protobuf::Empty]
654
758
  #
655
759
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
760
+ #
761
+ # @example Basic example
762
+ # require "google/cloud/org_policy/v2"
763
+ #
764
+ # # Create a client object. The client can be reused for multiple calls.
765
+ # client = Google::Cloud::OrgPolicy::V2::OrgPolicy::Rest::Client.new
766
+ #
767
+ # # Create a request. To set request fields, pass in keyword arguments.
768
+ # request = Google::Cloud::OrgPolicy::V2::DeletePolicyRequest.new
769
+ #
770
+ # # Call the delete_policy method.
771
+ # result = client.delete_policy request
772
+ #
773
+ # # The returned object is of type Google::Protobuf::Empty.
774
+ # p result
775
+ #
656
776
  def delete_policy request, options = nil
657
777
  raise ::ArgumentError, "request must be provided" if request.nil?
658
778
 
@@ -726,9 +846,9 @@ module Google
726
846
  # * (`String`) The path to a service account key file in JSON format
727
847
  # * (`Hash`) A service account key as a Hash
728
848
  # * (`Google::Auth::Credentials`) A googleauth credentials object
729
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
849
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
730
850
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
731
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
851
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
732
852
  # * (`nil`) indicating no credentials
733
853
  # @return [::Object]
734
854
  # @!attribute [rw] scope
@@ -761,7 +881,9 @@ module Google
761
881
  class Configuration
762
882
  extend ::Gapic::Config
763
883
 
764
- config_attr :endpoint, "orgpolicy.googleapis.com", ::String
884
+ DEFAULT_ENDPOINT = "orgpolicy.googleapis.com"
885
+
886
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
765
887
  config_attr :credentials, nil do |value|
766
888
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
767
889
  allowed.any? { |klass| klass === value }
@@ -59,7 +59,7 @@ module Google
59
59
 
60
60
  verb, uri, query_string_params, body = ServiceStub.transcode_list_constraints_request request_pb
61
61
  query_string_params = if query_string_params.any?
62
- query_string_params.to_h { |p| p.split("=", 2) }
62
+ query_string_params.to_h { |p| p.split "=", 2 }
63
63
  else
64
64
  {}
65
65
  end
@@ -97,7 +97,7 @@ module Google
97
97
 
98
98
  verb, uri, query_string_params, body = ServiceStub.transcode_list_policies_request request_pb
99
99
  query_string_params = if query_string_params.any?
100
- query_string_params.to_h { |p| p.split("=", 2) }
100
+ query_string_params.to_h { |p| p.split "=", 2 }
101
101
  else
102
102
  {}
103
103
  end
@@ -135,7 +135,7 @@ module Google
135
135
 
136
136
  verb, uri, query_string_params, body = ServiceStub.transcode_get_policy_request request_pb
137
137
  query_string_params = if query_string_params.any?
138
- query_string_params.to_h { |p| p.split("=", 2) }
138
+ query_string_params.to_h { |p| p.split "=", 2 }
139
139
  else
140
140
  {}
141
141
  end
@@ -173,7 +173,7 @@ module Google
173
173
 
174
174
  verb, uri, query_string_params, body = ServiceStub.transcode_get_effective_policy_request request_pb
175
175
  query_string_params = if query_string_params.any?
176
- query_string_params.to_h { |p| p.split("=", 2) }
176
+ query_string_params.to_h { |p| p.split "=", 2 }
177
177
  else
178
178
  {}
179
179
  end
@@ -211,7 +211,7 @@ module Google
211
211
 
212
212
  verb, uri, query_string_params, body = ServiceStub.transcode_create_policy_request request_pb
213
213
  query_string_params = if query_string_params.any?
214
- query_string_params.to_h { |p| p.split("=", 2) }
214
+ query_string_params.to_h { |p| p.split "=", 2 }
215
215
  else
216
216
  {}
217
217
  end
@@ -249,7 +249,7 @@ module Google
249
249
 
250
250
  verb, uri, query_string_params, body = ServiceStub.transcode_update_policy_request request_pb
251
251
  query_string_params = if query_string_params.any?
252
- query_string_params.to_h { |p| p.split("=", 2) }
252
+ query_string_params.to_h { |p| p.split "=", 2 }
253
253
  else
254
254
  {}
255
255
  end
@@ -287,7 +287,7 @@ module Google
287
287
 
288
288
  verb, uri, query_string_params, body = ServiceStub.transcode_delete_policy_request request_pb
289
289
  query_string_params = if query_string_params.any?
290
- query_string_params.to_h { |p| p.split("=", 2) }
290
+ query_string_params.to_h { |p| p.split "=", 2 }
291
291
  else
292
292
  {}
293
293
  end
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module OrgPolicy
23
23
  module V2
24
- VERSION = "0.5.0"
24
+ VERSION = "0.7.0"
25
25
  end
26
26
  end
27
27
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
3
  # source: google/cloud/orgpolicy/v2/constraint.proto
3
4
 
@@ -7,30 +8,31 @@ require 'google/api/field_behavior_pb'
7
8
  require 'google/api/resource_pb'
8
9
  require 'google/protobuf/timestamp_pb'
9
10
 
10
- Google::Protobuf::DescriptorPool.generated_pool.build do
11
- add_file("google/cloud/orgpolicy/v2/constraint.proto", :syntax => :proto3) do
12
- add_message "google.cloud.orgpolicy.v2.Constraint" do
13
- optional :name, :string, 1
14
- optional :display_name, :string, 2
15
- optional :description, :string, 3
16
- optional :constraint_default, :enum, 4, "google.cloud.orgpolicy.v2.Constraint.ConstraintDefault"
17
- oneof :constraint_type do
18
- optional :list_constraint, :message, 5, "google.cloud.orgpolicy.v2.Constraint.ListConstraint"
19
- optional :boolean_constraint, :message, 6, "google.cloud.orgpolicy.v2.Constraint.BooleanConstraint"
20
- end
21
- end
22
- add_message "google.cloud.orgpolicy.v2.Constraint.ListConstraint" do
23
- optional :supports_in, :bool, 1
24
- optional :supports_under, :bool, 2
25
- end
26
- add_message "google.cloud.orgpolicy.v2.Constraint.BooleanConstraint" do
27
- end
28
- add_enum "google.cloud.orgpolicy.v2.Constraint.ConstraintDefault" do
29
- value :CONSTRAINT_DEFAULT_UNSPECIFIED, 0
30
- value :ALLOW, 1
31
- value :DENY, 2
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\"\xb7\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\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_typeB\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
+
14
+ pool = Google::Protobuf::DescriptorPool.generated_pool
15
+
16
+ begin
17
+ pool.add_serialized_file(descriptor_data)
18
+ rescue TypeError => e
19
+ # Compatibility code: will be removed in the next major version.
20
+ require 'google/protobuf/descriptor_pb'
21
+ parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
22
+ parsed.clear_dependency
23
+ serialized = parsed.class.encode(parsed)
24
+ file = pool.add_serialized_file(serialized)
25
+ warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
26
+ imports = [
27
+ ]
28
+ imports.each do |type_name, expected_filename|
29
+ import_file = pool.lookup(type_name).file_descriptor
30
+ if import_file.name != expected_filename
31
+ warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
32
32
  end
33
33
  end
34
+ warn "Each proto file must use a consistent fully-qualified name."
35
+ warn "This will become an error in the next major version."
34
36
  end
35
37
 
36
38
  module Google
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
3
  # source: google/cloud/orgpolicy/v2/orgpolicy.proto
3
4
 
@@ -13,74 +14,35 @@ require 'google/protobuf/field_mask_pb'
13
14
  require 'google/protobuf/timestamp_pb'
14
15
  require 'google/type/expr_pb'
15
16
 
16
- Google::Protobuf::DescriptorPool.generated_pool.build do
17
- add_file("google/cloud/orgpolicy/v2/orgpolicy.proto", :syntax => :proto3) do
18
- add_message "google.cloud.orgpolicy.v2.Policy" do
19
- optional :name, :string, 1
20
- optional :spec, :message, 2, "google.cloud.orgpolicy.v2.PolicySpec"
21
- optional :alternate, :message, 3, "google.cloud.orgpolicy.v2.AlternatePolicySpec"
22
- optional :dry_run_spec, :message, 4, "google.cloud.orgpolicy.v2.PolicySpec"
23
- end
24
- add_message "google.cloud.orgpolicy.v2.AlternatePolicySpec" do
25
- optional :launch, :string, 1
26
- optional :spec, :message, 2, "google.cloud.orgpolicy.v2.PolicySpec"
27
- end
28
- add_message "google.cloud.orgpolicy.v2.PolicySpec" do
29
- optional :etag, :string, 1
30
- optional :update_time, :message, 2, "google.protobuf.Timestamp"
31
- repeated :rules, :message, 3, "google.cloud.orgpolicy.v2.PolicySpec.PolicyRule"
32
- optional :inherit_from_parent, :bool, 4
33
- optional :reset, :bool, 5
34
- end
35
- add_message "google.cloud.orgpolicy.v2.PolicySpec.PolicyRule" do
36
- optional :condition, :message, 5, "google.type.Expr"
37
- oneof :kind do
38
- optional :values, :message, 1, "google.cloud.orgpolicy.v2.PolicySpec.PolicyRule.StringValues"
39
- optional :allow_all, :bool, 2
40
- optional :deny_all, :bool, 3
41
- optional :enforce, :bool, 4
42
- end
43
- end
44
- add_message "google.cloud.orgpolicy.v2.PolicySpec.PolicyRule.StringValues" do
45
- repeated :allowed_values, :string, 1
46
- repeated :denied_values, :string, 2
47
- end
48
- add_message "google.cloud.orgpolicy.v2.ListConstraintsRequest" do
49
- optional :parent, :string, 1
50
- optional :page_size, :int32, 2
51
- optional :page_token, :string, 3
52
- end
53
- add_message "google.cloud.orgpolicy.v2.ListConstraintsResponse" do
54
- repeated :constraints, :message, 1, "google.cloud.orgpolicy.v2.Constraint"
55
- optional :next_page_token, :string, 2
56
- end
57
- add_message "google.cloud.orgpolicy.v2.ListPoliciesRequest" do
58
- optional :parent, :string, 1
59
- optional :page_size, :int32, 2
60
- optional :page_token, :string, 3
61
- end
62
- add_message "google.cloud.orgpolicy.v2.ListPoliciesResponse" do
63
- repeated :policies, :message, 1, "google.cloud.orgpolicy.v2.Policy"
64
- optional :next_page_token, :string, 2
65
- end
66
- add_message "google.cloud.orgpolicy.v2.GetPolicyRequest" do
67
- optional :name, :string, 1
68
- end
69
- add_message "google.cloud.orgpolicy.v2.GetEffectivePolicyRequest" do
70
- optional :name, :string, 1
71
- end
72
- add_message "google.cloud.orgpolicy.v2.CreatePolicyRequest" do
73
- optional :parent, :string, 1
74
- optional :policy, :message, 3, "google.cloud.orgpolicy.v2.Policy"
75
- end
76
- add_message "google.cloud.orgpolicy.v2.UpdatePolicyRequest" do
77
- optional :policy, :message, 1, "google.cloud.orgpolicy.v2.Policy"
78
- optional :update_mask, :message, 3, "google.protobuf.FieldMask"
79
- end
80
- add_message "google.cloud.orgpolicy.v2.DeletePolicyRequest" do
81
- optional :name, :string, 1
17
+
18
+ descriptor_data = "\n)google/cloud/orgpolicy/v2/orgpolicy.proto\x12\x19google.cloud.orgpolicy.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a*google/cloud/orgpolicy/v2/constraint.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x16google/type/expr.proto\"\xf6\x02\n\x06Policy\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\x33\n\x04spec\x18\x02 \x01(\x0b\x32%.google.cloud.orgpolicy.v2.PolicySpec\x12\x45\n\talternate\x18\x03 \x01(\x0b\x32..google.cloud.orgpolicy.v2.AlternatePolicySpecB\x02\x18\x01\x12;\n\x0c\x64ry_run_spec\x18\x04 \x01(\x0b\x32%.google.cloud.orgpolicy.v2.PolicySpec:\x9f\x01\xea\x41\x9b\x01\n\x1forgpolicy.googleapis.com/Policy\x12$projects/{project}/policies/{policy}\x12\"folders/{folder}/policies/{policy}\x12.organizations/{organization}/policies/{policy}\"Z\n\x13\x41lternatePolicySpec\x12\x0e\n\x06launch\x18\x01 \x01(\t\x12\x33\n\x04spec\x18\x02 \x01(\x0b\x32%.google.cloud.orgpolicy.v2.PolicySpec\"\xc6\x03\n\nPolicySpec\x12\x0c\n\x04\x65tag\x18\x01 \x01(\t\x12\x34\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12?\n\x05rules\x18\x03 \x03(\x0b\x32\x30.google.cloud.orgpolicy.v2.PolicySpec.PolicyRule\x12\x1b\n\x13inherit_from_parent\x18\x04 \x01(\x08\x12\r\n\x05reset\x18\x05 \x01(\x08\x1a\x86\x02\n\nPolicyRule\x12O\n\x06values\x18\x01 \x01(\x0b\x32=.google.cloud.orgpolicy.v2.PolicySpec.PolicyRule.StringValuesH\x00\x12\x13\n\tallow_all\x18\x02 \x01(\x08H\x00\x12\x12\n\x08\x64\x65ny_all\x18\x03 \x01(\x08H\x00\x12\x11\n\x07\x65nforce\x18\x04 \x01(\x08H\x00\x12$\n\tcondition\x18\x05 \x01(\x0b\x32\x11.google.type.Expr\x1a=\n\x0cStringValues\x12\x16\n\x0e\x61llowed_values\x18\x01 \x03(\t\x12\x15\n\rdenied_values\x18\x02 \x03(\tB\x06\n\x04kind\"|\n\x16ListConstraintsRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#orgpolicy.googleapis.com/Constraint\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"n\n\x17ListConstraintsResponse\x12:\n\x0b\x63onstraints\x18\x01 \x03(\x0b\x32%.google.cloud.orgpolicy.v2.Constraint\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"u\n\x13ListPoliciesRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1forgpolicy.googleapis.com/Policy\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"d\n\x14ListPoliciesResponse\x12\x33\n\x08policies\x18\x01 \x03(\x0b\x32!.google.cloud.orgpolicy.v2.Policy\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"I\n\x10GetPolicyRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1forgpolicy.googleapis.com/Policy\"R\n\x19GetEffectivePolicyRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1forgpolicy.googleapis.com/Policy\"\x86\x01\n\x13\x43reatePolicyRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1forgpolicy.googleapis.com/Policy\x12\x36\n\x06policy\x18\x03 \x01(\x0b\x32!.google.cloud.orgpolicy.v2.PolicyB\x03\xe0\x41\x02\"~\n\x13UpdatePolicyRequest\x12\x36\n\x06policy\x18\x01 \x01(\x0b\x32!.google.cloud.orgpolicy.v2.PolicyB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"L\n\x13\x44\x65letePolicyRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1forgpolicy.googleapis.com/Policy2\xbd\x0e\n\tOrgPolicy\x12\x81\x02\n\x0fListConstraints\x12\x31.google.cloud.orgpolicy.v2.ListConstraintsRequest\x1a\x32.google.cloud.orgpolicy.v2.ListConstraintsResponse\"\x86\x01\x82\xd3\xe4\x93\x02w\x12#/v2/{parent=projects/*}/constraintsZ$\x12\"/v2/{parent=folders/*}/constraintsZ*\x12(/v2/{parent=organizations/*}/constraints\xda\x41\x06parent\x12\xee\x01\n\x0cListPolicies\x12..google.cloud.orgpolicy.v2.ListPoliciesRequest\x1a/.google.cloud.orgpolicy.v2.ListPoliciesResponse\"}\x82\xd3\xe4\x93\x02n\x12 /v2/{parent=projects/*}/policiesZ!\x12\x1f/v2/{parent=folders/*}/policiesZ\'\x12%/v2/{parent=organizations/*}/policies\xda\x41\x06parent\x12\xd8\x01\n\tGetPolicy\x12+.google.cloud.orgpolicy.v2.GetPolicyRequest\x1a!.google.cloud.orgpolicy.v2.Policy\"{\x82\xd3\xe4\x93\x02n\x12 /v2/{name=projects/*/policies/*}Z!\x12\x1f/v2/{name=folders/*/policies/*}Z\'\x12%/v2/{name=organizations/*/policies/*}\xda\x41\x04name\x12\xa5\x02\n\x12GetEffectivePolicy\x12\x34.google.cloud.orgpolicy.v2.GetEffectivePolicyRequest\x1a!.google.cloud.orgpolicy.v2.Policy\"\xb5\x01\x82\xd3\xe4\x93\x02\xa7\x01\x12\x33/v2/{name=projects/*/policies/*}:getEffectivePolicyZ4\x12\x32/v2/{name=folders/*/policies/*}:getEffectivePolicyZ:\x12\x38/v2/{name=organizations/*/policies/*}:getEffectivePolicy\xda\x41\x04name\x12\x81\x02\n\x0c\x43reatePolicy\x12..google.cloud.orgpolicy.v2.CreatePolicyRequest\x1a!.google.cloud.orgpolicy.v2.Policy\"\x9d\x01\x82\xd3\xe4\x93\x02\x86\x01\" /v2/{parent=projects/*}/policies:\x06policyZ)\"\x1f/v2/{parent=folders/*}/policies:\x06policyZ/\"%/v2/{parent=organizations/*}/policies:\x06policy\xda\x41\rparent,policy\x12\x8f\x02\n\x0cUpdatePolicy\x12..google.cloud.orgpolicy.v2.UpdatePolicyRequest\x1a!.google.cloud.orgpolicy.v2.Policy\"\xab\x01\x82\xd3\xe4\x93\x02\x9b\x01\x32\'/v2/{policy.name=projects/*/policies/*}:\x06policyZ02&/v2/{policy.name=folders/*/policies/*}:\x06policyZ62,/v2/{policy.name=organizations/*/policies/*}:\x06policy\xda\x41\x06policy\x12\xd3\x01\n\x0c\x44\x65letePolicy\x12..google.cloud.orgpolicy.v2.DeletePolicyRequest\x1a\x16.google.protobuf.Empty\"{\x82\xd3\xe4\x93\x02n* /v2/{name=projects/*/policies/*}Z!*\x1f/v2/{name=folders/*/policies/*}Z\'*%/v2/{name=organizations/*/policies/*}\xda\x41\x04name\x1aL\xca\x41\x18orgpolicy.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xc5\x01\n\x1d\x63om.google.cloud.orgpolicy.v2B\x0eOrgPolicyProtoP\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"
19
+
20
+ pool = Google::Protobuf::DescriptorPool.generated_pool
21
+
22
+ begin
23
+ pool.add_serialized_file(descriptor_data)
24
+ rescue TypeError => e
25
+ # Compatibility code: will be removed in the next major version.
26
+ require 'google/protobuf/descriptor_pb'
27
+ parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
28
+ parsed.clear_dependency
29
+ serialized = parsed.class.encode(parsed)
30
+ file = pool.add_serialized_file(serialized)
31
+ warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
32
+ imports = [
33
+ ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"],
34
+ ["google.type.Expr", "google/type/expr.proto"],
35
+ ["google.cloud.orgpolicy.v2.Constraint", "google/cloud/orgpolicy/v2/constraint.proto"],
36
+ ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"],
37
+ ]
38
+ imports.each do |type_name, expected_filename|
39
+ import_file = pool.lookup(type_name).file_descriptor
40
+ if import_file.name != expected_filename
41
+ warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
82
42
  end
83
43
  end
44
+ warn "Each proto file must use a consistent fully-qualified name."
45
+ warn "This will become an error in the next major version."
84
46
  end
85
47
 
86
48
  module Google
@@ -35,7 +35,9 @@ module Google
35
35
  # Details about how and where to publish client libraries.
36
36
  # @!attribute [rw] version
37
37
  # @return [::String]
38
- # Version of the API to apply these settings to.
38
+ # Version of the API to apply these settings to. This is the full protobuf
39
+ # package for the API, ending in the version element.
40
+ # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1".
39
41
  # @!attribute [rw] launch_stage
40
42
  # @return [::Google::Api::LaunchStage]
41
43
  # Launch stage of this version of the API.
@@ -81,7 +83,7 @@ module Google
81
83
  # long-running operation pattern.
82
84
  # @!attribute [rw] new_issue_uri
83
85
  # @return [::String]
84
- # Link to a place that API users can report issues. Example:
86
+ # Link to a *public* URI where users can report issues. Example:
85
87
  # https://issuetracker.google.com/issues/new?component=190865&template=1161103
86
88
  # @!attribute [rw] documentation_uri
87
89
  # @return [::String]
@@ -111,6 +113,10 @@ module Google
111
113
  # Client library settings. If the same version string appears multiple
112
114
  # times in this list, then the last one wins. Settings from earlier
113
115
  # settings with the same version string are discarded.
116
+ # @!attribute [rw] proto_reference_documentation_uri
117
+ # @return [::String]
118
+ # Optional link to proto reference documentation. Example:
119
+ # https://cloud.google.com/pubsub/lite/docs/reference/rpc
114
120
  class Publishing
115
121
  include ::Google::Protobuf::MessageExts
116
122
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -203,9 +209,57 @@ module Google
203
209
  # @!attribute [rw] common
204
210
  # @return [::Google::Api::CommonLanguageSettings]
205
211
  # Some settings.
212
+ # @!attribute [rw] renamed_services
213
+ # @return [::Google::Protobuf::Map{::String => ::String}]
214
+ # Map from original service names to renamed versions.
215
+ # This is used when the default generated types
216
+ # would cause a naming conflict. (Neither name is
217
+ # fully-qualified.)
218
+ # Example: Subscriber to SubscriberServiceApi.
219
+ # @!attribute [rw] renamed_resources
220
+ # @return [::Google::Protobuf::Map{::String => ::String}]
221
+ # Map from full resource types to the effective short name
222
+ # for the resource. This is used when otherwise resource
223
+ # named from different services would cause naming collisions.
224
+ # Example entry:
225
+ # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset"
226
+ # @!attribute [rw] ignored_resources
227
+ # @return [::Array<::String>]
228
+ # List of full resource types to ignore during generation.
229
+ # This is typically used for API-specific Location resources,
230
+ # which should be handled by the generator as if they were actually
231
+ # the common Location resources.
232
+ # Example entry: "documentai.googleapis.com/Location"
233
+ # @!attribute [rw] forced_namespace_aliases
234
+ # @return [::Array<::String>]
235
+ # Namespaces which must be aliased in snippets due to
236
+ # a known (but non-generator-predictable) naming collision
237
+ # @!attribute [rw] handwritten_signatures
238
+ # @return [::Array<::String>]
239
+ # Method signatures (in the form "service.method(signature)")
240
+ # which are provided separately, so shouldn't be generated.
241
+ # Snippets *calling* these methods are still generated, however.
206
242
  class DotnetSettings
207
243
  include ::Google::Protobuf::MessageExts
208
244
  extend ::Google::Protobuf::MessageExts::ClassMethods
245
+
246
+ # @!attribute [rw] key
247
+ # @return [::String]
248
+ # @!attribute [rw] value
249
+ # @return [::String]
250
+ class RenamedServicesEntry
251
+ include ::Google::Protobuf::MessageExts
252
+ extend ::Google::Protobuf::MessageExts::ClassMethods
253
+ end
254
+
255
+ # @!attribute [rw] key
256
+ # @return [::String]
257
+ # @!attribute [rw] value
258
+ # @return [::String]
259
+ class RenamedResourcesEntry
260
+ include ::Google::Protobuf::MessageExts
261
+ extend ::Google::Protobuf::MessageExts::ClassMethods
262
+ end
209
263
  end
210
264
 
211
265
  # Settings for Ruby client libraries.
@@ -240,8 +294,8 @@ module Google
240
294
  # Example of a YAML configuration::
241
295
  #
242
296
  # publishing:
243
- # method_behavior:
244
- # - selector: CreateAdDomain
297
+ # method_settings:
298
+ # - selector: google.cloud.speech.v2.Speech.BatchRecognize
245
299
  # long_running:
246
300
  # initial_poll_delay:
247
301
  # seconds: 60 # 1 minute
@@ -299,6 +353,15 @@ module Google
299
353
 
300
354
  # Street View Org.
301
355
  STREET_VIEW = 4
356
+
357
+ # Shopping Org.
358
+ SHOPPING = 5
359
+
360
+ # Geo Org.
361
+ GEO = 6
362
+
363
+ # Generative AI - https://developers.generativeai.google
364
+ GENERATIVE_AI = 7
302
365
  end
303
366
 
304
367
  # To where should client libraries be published?
@@ -66,6 +66,20 @@ module Google
66
66
  # a non-empty value will be returned. The user will not be aware of what
67
67
  # non-empty value to expect.
68
68
  NON_EMPTY_DEFAULT = 7
69
+
70
+ # Denotes that the field in a resource (a message annotated with
71
+ # google.api.resource) is used in the resource name to uniquely identify the
72
+ # resource. For AIP-compliant APIs, this should only be applied to the
73
+ # `name` field on the resource.
74
+ #
75
+ # This behavior should not be applied to references to other resources within
76
+ # the message.
77
+ #
78
+ # The identifier field of resources often have different field behavior
79
+ # depending on the request it is embedded in (e.g. for Create methods name
80
+ # is optional and unused, while for Update methods it is required). Instead
81
+ # of method-specific annotations, only `IDENTIFIER` is required.
82
+ IDENTIFIER = 8
69
83
  end
70
84
  end
71
85
  end
@@ -69,7 +69,6 @@ module Google
69
69
  # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
70
70
  # .setNanos((int) ((millis % 1000) * 1000000)).build();
71
71
  #
72
- #
73
72
  # Example 5: Compute Timestamp from Java `Instant.now()`.
74
73
  #
75
74
  # Instant now = Instant.now();
@@ -78,7 +77,6 @@ module Google
78
77
  # Timestamp.newBuilder().setSeconds(now.getEpochSecond())
79
78
  # .setNanos(now.getNano()).build();
80
79
  #
81
- #
82
80
  # Example 6: Compute Timestamp from current time in Python.
83
81
  #
84
82
  # timestamp = Timestamp()
@@ -108,7 +106,7 @@ module Google
108
106
  # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
109
107
  # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
110
108
  # the Joda Time's [`ISODateTimeFormat.dateTime()`](
111
- # http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
109
+ # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()
112
110
  # ) to obtain a formatter capable of generating timestamps in this format.
113
111
  # @!attribute [rw] seconds
114
112
  # @return [::Integer]
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: 0.5.0
4
+ version: 0.7.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: 2023-03-08 00:00:00.000000000 Z
11
+ date: 2023-09-12 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.18.0
19
+ version: 0.20.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.18.0
29
+ version: 0.20.0
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: 2.a
@@ -215,7 +215,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
215
215
  - !ruby/object:Gem::Version
216
216
  version: '0'
217
217
  requirements: []
218
- rubygems_version: 3.4.2
218
+ rubygems_version: 3.4.19
219
219
  signing_key:
220
220
  specification_version: 4
221
221
  summary: The Organization Policy API allows users to configure governance rules on