google-cloud-service_management-v1 0.1.1 → 0.3.3
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 +4 -4
- data/AUTHENTICATION.md +8 -8
- data/LICENSE.md +188 -190
- data/README.md +67 -3
- data/lib/google/api/servicemanagement/v1/servicemanager_services_pb.rb +1 -1
- data/lib/google/cloud/service_management/v1/service_manager.rb +1 -1
- data/lib/google/cloud/service_management/v1/service_manager/client.rb +40 -34
- data/lib/google/cloud/service_management/v1/service_manager/operations.rb +95 -10
- data/lib/google/cloud/service_management/v1/version.rb +1 -1
- data/proto_docs/google/api/auth.rb +69 -14
- data/proto_docs/google/api/backend.rb +118 -2
- data/proto_docs/google/api/billing.rb +18 -7
- data/proto_docs/google/api/config_change.rb +1 -1
- data/proto_docs/google/api/context.rb +27 -0
- data/proto_docs/google/api/documentation.rb +13 -7
- data/proto_docs/google/api/endpoint.rb +10 -10
- data/proto_docs/google/api/field_behavior.rb +12 -0
- data/proto_docs/google/api/launch_stage.rb +71 -0
- data/proto_docs/google/api/metric.rb +109 -36
- data/proto_docs/google/api/monitored_resource.rb +7 -6
- data/proto_docs/google/api/monitoring.rb +39 -20
- data/proto_docs/google/api/quota.rb +10 -84
- data/proto_docs/google/api/service.rb +16 -14
- data/proto_docs/google/api/servicemanagement/v1/resources.rb +1 -1
- data/proto_docs/google/api/servicemanagement/v1/servicemanager.rb +11 -11
- data/proto_docs/google/api/usage.rb +6 -0
- data/proto_docs/google/longrunning/operations.rb +17 -3
- data/proto_docs/google/protobuf/any.rb +5 -2
- data/proto_docs/google/protobuf/api.rb +1 -1
- data/proto_docs/google/protobuf/duration.rb +98 -0
- data/proto_docs/google/protobuf/timestamp.rb +10 -1
- metadata +21 -10
@@ -24,7 +24,7 @@ module Google
|
|
24
24
|
module ServiceManagement
|
25
25
|
module V1
|
26
26
|
module ServiceManager
|
27
|
-
# [Google Service Management API](/service-management/overview)
|
27
|
+
# [Google Service Management API](https://cloud.google.com/service-management/overview)
|
28
28
|
class Service
|
29
29
|
|
30
30
|
include GRPC::GenericService
|
@@ -31,7 +31,7 @@ module Google
|
|
31
31
|
module ServiceManagement
|
32
32
|
module V1
|
33
33
|
##
|
34
|
-
# [Google Service Management API](/service-management/overview)
|
34
|
+
# [Google Service Management API](https://cloud.google.com/service-management/overview)
|
35
35
|
#
|
36
36
|
# To load this service and instantiate a client:
|
37
37
|
#
|
@@ -27,7 +27,7 @@ module Google
|
|
27
27
|
##
|
28
28
|
# Client for the ServiceManager service.
|
29
29
|
#
|
30
|
-
# [Google Service Management API](/service-management/overview)
|
30
|
+
# [Google Service Management API](https://cloud.google.com/service-management/overview)
|
31
31
|
#
|
32
32
|
class Client
|
33
33
|
# @private
|
@@ -58,7 +58,7 @@ module Google
|
|
58
58
|
parent_config = while namespace.any?
|
59
59
|
parent_name = namespace.join "::"
|
60
60
|
parent_const = const_get parent_name
|
61
|
-
break parent_const.configure if parent_const
|
61
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
62
62
|
namespace.pop
|
63
63
|
end
|
64
64
|
default_config = Client::Configuration.new parent_config
|
@@ -124,8 +124,14 @@ module Google
|
|
124
124
|
|
125
125
|
# Create credentials
|
126
126
|
credentials = @config.credentials
|
127
|
-
|
128
|
-
if
|
127
|
+
# Use self-signed JWT if the scope and endpoint are unchanged from default,
|
128
|
+
# but only if the default endpoint does not have a region prefix.
|
129
|
+
enable_self_signed_jwt = @config.scope == Client.configure.scope &&
|
130
|
+
@config.endpoint == Client.configure.endpoint &&
|
131
|
+
!@config.endpoint.split(".").first.include?("-")
|
132
|
+
credentials ||= Credentials.default scope: @config.scope,
|
133
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
134
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
129
135
|
credentials = Credentials.new credentials, scope: @config.scope
|
130
136
|
end
|
131
137
|
@quota_project_id = @config.quota_project
|
@@ -391,7 +397,7 @@ module Google
|
|
391
397
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
392
398
|
#
|
393
399
|
# @param service_name [::String]
|
394
|
-
# Required. The name of the service. See the [overview](/service-management/overview)
|
400
|
+
# Required. The name of the service. See the [overview](https://cloud.google.com/service-management/overview)
|
395
401
|
# for naming requirements. For example: `example.googleapis.com`.
|
396
402
|
#
|
397
403
|
# @yield [response, operation] Access the result along with the RPC operation
|
@@ -464,7 +470,7 @@ module Google
|
|
464
470
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
465
471
|
#
|
466
472
|
# @param service_name [::String]
|
467
|
-
# Required. The name of the service. See the [overview](/service-management/overview)
|
473
|
+
# Required. The name of the service. See the [overview](https://cloud.google.com/service-management/overview)
|
468
474
|
# for naming requirements. For example: `example.googleapis.com`.
|
469
475
|
#
|
470
476
|
# @yield [response, operation] Access the result along with the RPC operation
|
@@ -533,7 +539,7 @@ module Google
|
|
533
539
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
534
540
|
#
|
535
541
|
# @param service_name [::String]
|
536
|
-
# Required. The name of the service. See the [overview](/service-management/overview)
|
542
|
+
# Required. The name of the service. See the [overview](https://cloud.google.com/service-management/overview)
|
537
543
|
# for naming requirements. For example: `example.googleapis.com`.
|
538
544
|
# @param page_token [::String]
|
539
545
|
# The token of the page to retrieve.
|
@@ -606,7 +612,7 @@ module Google
|
|
606
612
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
607
613
|
#
|
608
614
|
# @param service_name [::String]
|
609
|
-
# Required. The name of the service. See the [overview](/service-management/overview)
|
615
|
+
# Required. The name of the service. See the [overview](https://cloud.google.com/service-management/overview)
|
610
616
|
# for naming requirements. For example: `example.googleapis.com`.
|
611
617
|
# @param config_id [::String]
|
612
618
|
# Required. The id of the service configuration resource.
|
@@ -644,7 +650,7 @@ module Google
|
|
644
650
|
|
645
651
|
header_params = {
|
646
652
|
"service_name" => request.service_name,
|
647
|
-
"config_id"
|
653
|
+
"config_id" => request.config_id
|
648
654
|
}
|
649
655
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
650
656
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
@@ -689,7 +695,7 @@ module Google
|
|
689
695
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
690
696
|
#
|
691
697
|
# @param service_name [::String]
|
692
|
-
# Required. The name of the service. See the [overview](/service-management/overview)
|
698
|
+
# Required. The name of the service. See the [overview](https://cloud.google.com/service-management/overview)
|
693
699
|
# for naming requirements. For example: `example.googleapis.com`.
|
694
700
|
# @param service_config [::Google::Api::Service, ::Hash]
|
695
701
|
# Required. The service configuration resource.
|
@@ -770,7 +776,7 @@ module Google
|
|
770
776
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
771
777
|
#
|
772
778
|
# @param service_name [::String]
|
773
|
-
# Required. The name of the service. See the [overview](/service-management/overview)
|
779
|
+
# Required. The name of the service. See the [overview](https://cloud.google.com/service-management/overview)
|
774
780
|
# for naming requirements. For example: `example.googleapis.com`.
|
775
781
|
# @param config_source [::Google::Cloud::ServiceManagement::V1::ConfigSource, ::Hash]
|
776
782
|
# Required. The source configuration for the service.
|
@@ -845,7 +851,7 @@ module Google
|
|
845
851
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
846
852
|
#
|
847
853
|
# @param service_name [::String]
|
848
|
-
# Required. The name of the service. See the [overview](/service-management/overview)
|
854
|
+
# Required. The name of the service. See the [overview](https://cloud.google.com/service-management/overview)
|
849
855
|
# for naming requirements. For example: `example.googleapis.com`.
|
850
856
|
# @param page_token [::String]
|
851
857
|
# The token of the page to retrieve.
|
@@ -856,10 +862,10 @@ module Google
|
|
856
862
|
# Required. Use `filter` to return subset of rollouts.
|
857
863
|
# The following filters are supported:
|
858
864
|
# -- To limit the results to only those in
|
859
|
-
#
|
865
|
+
# status (google.api.servicemanagement.v1.RolloutStatus) 'SUCCESS',
|
860
866
|
# use filter='status=SUCCESS'
|
861
867
|
# -- To limit the results to those in
|
862
|
-
#
|
868
|
+
# status (google.api.servicemanagement.v1.RolloutStatus) 'CANCELLED'
|
863
869
|
# or 'FAILED', use filter='status=CANCELLED OR status=FAILED'
|
864
870
|
#
|
865
871
|
# @yield [response, operation] Access the result along with the RPC operation
|
@@ -927,7 +933,7 @@ module Google
|
|
927
933
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
928
934
|
#
|
929
935
|
# @param service_name [::String]
|
930
|
-
# Required. The name of the service. See the [overview](/service-management/overview)
|
936
|
+
# Required. The name of the service. See the [overview](https://cloud.google.com/service-management/overview)
|
931
937
|
# for naming requirements. For example: `example.googleapis.com`.
|
932
938
|
# @param rollout_id [::String]
|
933
939
|
# Required. The id of the rollout resource.
|
@@ -959,7 +965,7 @@ module Google
|
|
959
965
|
|
960
966
|
header_params = {
|
961
967
|
"service_name" => request.service_name,
|
962
|
-
"rollout_id"
|
968
|
+
"rollout_id" => request.rollout_id
|
963
969
|
}
|
964
970
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
965
971
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
@@ -1010,7 +1016,7 @@ module Google
|
|
1010
1016
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
1011
1017
|
#
|
1012
1018
|
# @param service_name [::String]
|
1013
|
-
# Required. The name of the service. See the [overview](/service-management/overview)
|
1019
|
+
# Required. The name of the service. See the [overview](https://cloud.google.com/service-management/overview)
|
1014
1020
|
# for naming requirements. For example: `example.googleapis.com`.
|
1015
1021
|
# @param rollout [::Google::Cloud::ServiceManagement::V1::Rollout, ::Hash]
|
1016
1022
|
# Required. The rollout resource. The `service_name` field is output only.
|
@@ -1398,7 +1404,7 @@ module Google
|
|
1398
1404
|
config_attr :scope, nil, ::String, ::Array, nil
|
1399
1405
|
config_attr :lib_name, nil, ::String, nil
|
1400
1406
|
config_attr :lib_version, nil, ::String, nil
|
1401
|
-
config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
|
1407
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
|
1402
1408
|
config_attr :interceptors, nil, ::Array, nil
|
1403
1409
|
config_attr :timeout, nil, ::Numeric, nil
|
1404
1410
|
config_attr :metadata, nil, ::Hash, nil
|
@@ -1419,7 +1425,7 @@ module Google
|
|
1419
1425
|
def rpcs
|
1420
1426
|
@rpcs ||= begin
|
1421
1427
|
parent_rpcs = nil
|
1422
|
-
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config
|
1428
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
1423
1429
|
Rpcs.new parent_rpcs
|
1424
1430
|
end
|
1425
1431
|
end
|
@@ -1520,35 +1526,35 @@ module Google
|
|
1520
1526
|
|
1521
1527
|
# @private
|
1522
1528
|
def initialize parent_rpcs = nil
|
1523
|
-
list_services_config = parent_rpcs
|
1529
|
+
list_services_config = parent_rpcs.list_services if parent_rpcs.respond_to? :list_services
|
1524
1530
|
@list_services = ::Gapic::Config::Method.new list_services_config
|
1525
|
-
get_service_config = parent_rpcs
|
1531
|
+
get_service_config = parent_rpcs.get_service if parent_rpcs.respond_to? :get_service
|
1526
1532
|
@get_service = ::Gapic::Config::Method.new get_service_config
|
1527
|
-
create_service_config = parent_rpcs
|
1533
|
+
create_service_config = parent_rpcs.create_service if parent_rpcs.respond_to? :create_service
|
1528
1534
|
@create_service = ::Gapic::Config::Method.new create_service_config
|
1529
|
-
delete_service_config = parent_rpcs
|
1535
|
+
delete_service_config = parent_rpcs.delete_service if parent_rpcs.respond_to? :delete_service
|
1530
1536
|
@delete_service = ::Gapic::Config::Method.new delete_service_config
|
1531
|
-
undelete_service_config = parent_rpcs
|
1537
|
+
undelete_service_config = parent_rpcs.undelete_service if parent_rpcs.respond_to? :undelete_service
|
1532
1538
|
@undelete_service = ::Gapic::Config::Method.new undelete_service_config
|
1533
|
-
list_service_configs_config = parent_rpcs
|
1539
|
+
list_service_configs_config = parent_rpcs.list_service_configs if parent_rpcs.respond_to? :list_service_configs
|
1534
1540
|
@list_service_configs = ::Gapic::Config::Method.new list_service_configs_config
|
1535
|
-
get_service_config_config = parent_rpcs
|
1541
|
+
get_service_config_config = parent_rpcs.get_service_config if parent_rpcs.respond_to? :get_service_config
|
1536
1542
|
@get_service_config = ::Gapic::Config::Method.new get_service_config_config
|
1537
|
-
create_service_config_config = parent_rpcs
|
1543
|
+
create_service_config_config = parent_rpcs.create_service_config if parent_rpcs.respond_to? :create_service_config
|
1538
1544
|
@create_service_config = ::Gapic::Config::Method.new create_service_config_config
|
1539
|
-
submit_config_source_config = parent_rpcs
|
1545
|
+
submit_config_source_config = parent_rpcs.submit_config_source if parent_rpcs.respond_to? :submit_config_source
|
1540
1546
|
@submit_config_source = ::Gapic::Config::Method.new submit_config_source_config
|
1541
|
-
list_service_rollouts_config = parent_rpcs
|
1547
|
+
list_service_rollouts_config = parent_rpcs.list_service_rollouts if parent_rpcs.respond_to? :list_service_rollouts
|
1542
1548
|
@list_service_rollouts = ::Gapic::Config::Method.new list_service_rollouts_config
|
1543
|
-
get_service_rollout_config = parent_rpcs
|
1549
|
+
get_service_rollout_config = parent_rpcs.get_service_rollout if parent_rpcs.respond_to? :get_service_rollout
|
1544
1550
|
@get_service_rollout = ::Gapic::Config::Method.new get_service_rollout_config
|
1545
|
-
create_service_rollout_config = parent_rpcs
|
1551
|
+
create_service_rollout_config = parent_rpcs.create_service_rollout if parent_rpcs.respond_to? :create_service_rollout
|
1546
1552
|
@create_service_rollout = ::Gapic::Config::Method.new create_service_rollout_config
|
1547
|
-
generate_config_report_config = parent_rpcs
|
1553
|
+
generate_config_report_config = parent_rpcs.generate_config_report if parent_rpcs.respond_to? :generate_config_report
|
1548
1554
|
@generate_config_report = ::Gapic::Config::Method.new generate_config_report_config
|
1549
|
-
enable_service_config = parent_rpcs
|
1555
|
+
enable_service_config = parent_rpcs.enable_service if parent_rpcs.respond_to? :enable_service
|
1550
1556
|
@enable_service = ::Gapic::Config::Method.new enable_service_config
|
1551
|
-
disable_service_config = parent_rpcs
|
1557
|
+
disable_service_config = parent_rpcs.disable_service if parent_rpcs.respond_to? :disable_service
|
1552
1558
|
@disable_service = ::Gapic::Config::Method.new disable_service_config
|
1553
1559
|
|
1554
1560
|
yield self if block_given?
|
@@ -82,7 +82,7 @@ module Google
|
|
82
82
|
# Create credentials
|
83
83
|
credentials = @config.credentials
|
84
84
|
credentials ||= Credentials.default scope: @config.scope
|
85
|
-
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
85
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
86
86
|
credentials = Credentials.new credentials, scope: @config.scope
|
87
87
|
end
|
88
88
|
@quota_project_id = @config.quota_project
|
@@ -103,8 +103,13 @@ module Google
|
|
103
103
|
# Lists operations that match the specified filter in the request. If the
|
104
104
|
# server doesn't support this method, it returns `UNIMPLEMENTED`.
|
105
105
|
#
|
106
|
-
# NOTE: the `name` binding
|
107
|
-
# to use different resource name schemes, such as `users/*/operations`.
|
106
|
+
# NOTE: the `name` binding allows API services to override the binding
|
107
|
+
# to use different resource name schemes, such as `users/*/operations`. To
|
108
|
+
# override the binding, API services can add a binding such as
|
109
|
+
# `"/v1/{name=users/*}/operations"` to their service configuration.
|
110
|
+
# For backwards compatibility, the default name includes the operations
|
111
|
+
# collection id, however overriding users must ensure the name binding
|
112
|
+
# is the parent resource, without the operations collection id.
|
108
113
|
#
|
109
114
|
# @overload list_operations(request, options = nil)
|
110
115
|
# Pass arguments to `list_operations` via a request object, either of type
|
@@ -122,7 +127,7 @@ module Google
|
|
122
127
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
123
128
|
#
|
124
129
|
# @param name [::String]
|
125
|
-
# The name of the operation
|
130
|
+
# The name of the operation's parent resource.
|
126
131
|
# @param filter [::String]
|
127
132
|
# The standard list filter.
|
128
133
|
# @param page_size [::Integer]
|
@@ -390,6 +395,79 @@ module Google
|
|
390
395
|
raise ::Google::Cloud::Error.from_error(e)
|
391
396
|
end
|
392
397
|
|
398
|
+
##
|
399
|
+
# Waits until the specified long-running operation is done or reaches at most
|
400
|
+
# a specified timeout, returning the latest state. If the operation is
|
401
|
+
# already done, the latest state is immediately returned. If the timeout
|
402
|
+
# specified is greater than the default HTTP/RPC timeout, the HTTP/RPC
|
403
|
+
# timeout is used. If the server does not support this method, it returns
|
404
|
+
# `google.rpc.Code.UNIMPLEMENTED`.
|
405
|
+
# Note that this method is on a best-effort basis. It may return the latest
|
406
|
+
# state before the specified timeout (including immediately), meaning even an
|
407
|
+
# immediate response is no guarantee that the operation is done.
|
408
|
+
#
|
409
|
+
# @overload wait_operation(request, options = nil)
|
410
|
+
# Pass arguments to `wait_operation` via a request object, either of type
|
411
|
+
# {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash.
|
412
|
+
#
|
413
|
+
# @param request [::Google::Longrunning::WaitOperationRequest, ::Hash]
|
414
|
+
# A request object representing the call parameters. Required. To specify no
|
415
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
416
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
417
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
418
|
+
#
|
419
|
+
# @overload wait_operation(name: nil, timeout: nil)
|
420
|
+
# Pass arguments to `wait_operation` via keyword arguments. Note that at
|
421
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
422
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
423
|
+
#
|
424
|
+
# @param name [::String]
|
425
|
+
# The name of the operation resource to wait on.
|
426
|
+
# @param timeout [::Google::Protobuf::Duration, ::Hash]
|
427
|
+
# The maximum duration to wait before timing out. If left blank, the wait
|
428
|
+
# will be at most the time permitted by the underlying HTTP/RPC protocol.
|
429
|
+
# If RPC context deadline is also specified, the shorter one will be used.
|
430
|
+
#
|
431
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
432
|
+
# @yieldparam response [::Gapic::Operation]
|
433
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
434
|
+
#
|
435
|
+
# @return [::Gapic::Operation]
|
436
|
+
#
|
437
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
438
|
+
#
|
439
|
+
def wait_operation request, options = nil
|
440
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
441
|
+
|
442
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest
|
443
|
+
|
444
|
+
# Converts hash and nil to an options object
|
445
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
446
|
+
|
447
|
+
# Customize the options with defaults
|
448
|
+
metadata = @config.rpcs.wait_operation.metadata.to_h
|
449
|
+
|
450
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
451
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
452
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
453
|
+
gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION
|
454
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
455
|
+
|
456
|
+
options.apply_defaults timeout: @config.rpcs.wait_operation.timeout,
|
457
|
+
metadata: metadata,
|
458
|
+
retry_policy: @config.rpcs.wait_operation.retry_policy
|
459
|
+
options.apply_defaults metadata: @config.metadata,
|
460
|
+
retry_policy: @config.retry_policy
|
461
|
+
|
462
|
+
@operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
|
463
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
464
|
+
yield response, operation if block_given?
|
465
|
+
return response
|
466
|
+
end
|
467
|
+
rescue ::GRPC::BadStatus => e
|
468
|
+
raise ::Google::Cloud::Error.from_error(e)
|
469
|
+
end
|
470
|
+
|
393
471
|
##
|
394
472
|
# Configuration class for the Operations API.
|
395
473
|
#
|
@@ -482,7 +560,7 @@ module Google
|
|
482
560
|
config_attr :scope, nil, ::String, ::Array, nil
|
483
561
|
config_attr :lib_name, nil, ::String, nil
|
484
562
|
config_attr :lib_version, nil, ::String, nil
|
485
|
-
config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
|
563
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
|
486
564
|
config_attr :interceptors, nil, ::Array, nil
|
487
565
|
config_attr :timeout, nil, ::Numeric, nil
|
488
566
|
config_attr :metadata, nil, ::Hash, nil
|
@@ -503,7 +581,7 @@ module Google
|
|
503
581
|
def rpcs
|
504
582
|
@rpcs ||= begin
|
505
583
|
parent_rpcs = nil
|
506
|
-
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config
|
584
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
507
585
|
Rpcs.new parent_rpcs
|
508
586
|
end
|
509
587
|
end
|
@@ -546,17 +624,24 @@ module Google
|
|
546
624
|
# @return [::Gapic::Config::Method]
|
547
625
|
#
|
548
626
|
attr_reader :cancel_operation
|
627
|
+
##
|
628
|
+
# RPC-specific configuration for `wait_operation`
|
629
|
+
# @return [::Gapic::Config::Method]
|
630
|
+
#
|
631
|
+
attr_reader :wait_operation
|
549
632
|
|
550
633
|
# @private
|
551
634
|
def initialize parent_rpcs = nil
|
552
|
-
list_operations_config = parent_rpcs
|
635
|
+
list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations
|
553
636
|
@list_operations = ::Gapic::Config::Method.new list_operations_config
|
554
|
-
get_operation_config = parent_rpcs
|
637
|
+
get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation
|
555
638
|
@get_operation = ::Gapic::Config::Method.new get_operation_config
|
556
|
-
delete_operation_config = parent_rpcs
|
639
|
+
delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation
|
557
640
|
@delete_operation = ::Gapic::Config::Method.new delete_operation_config
|
558
|
-
cancel_operation_config = parent_rpcs
|
641
|
+
cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation
|
559
642
|
@cancel_operation = ::Gapic::Config::Method.new cancel_operation_config
|
643
|
+
wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation
|
644
|
+
@wait_operation = ::Gapic::Config::Method.new wait_operation_config
|
560
645
|
|
561
646
|
yield self if block_given?
|
562
647
|
end
|
@@ -19,9 +19,10 @@
|
|
19
19
|
|
20
20
|
module Google
|
21
21
|
module Api
|
22
|
-
# `Authentication` defines the authentication configuration for
|
22
|
+
# `Authentication` defines the authentication configuration for API methods
|
23
|
+
# provided by an API service.
|
23
24
|
#
|
24
|
-
# Example
|
25
|
+
# Example:
|
25
26
|
#
|
26
27
|
# name: calendar.googleapis.com
|
27
28
|
# authentication:
|
@@ -33,6 +34,9 @@ module Google
|
|
33
34
|
# - selector: "*"
|
34
35
|
# requirements:
|
35
36
|
# provider_id: google_calendar_auth
|
37
|
+
# - selector: google.calendar.Delegate
|
38
|
+
# oauth:
|
39
|
+
# canonical_scopes: https://www.googleapis.com/auth/calendar.read
|
36
40
|
# @!attribute [rw] rules
|
37
41
|
# @return [::Array<::Google::Api::AuthenticationRule>]
|
38
42
|
# A list of authentication rules that apply to individual API methods.
|
@@ -66,6 +70,7 @@ module Google
|
|
66
70
|
# @!attribute [rw] allow_without_credential
|
67
71
|
# @return [::Boolean]
|
68
72
|
# If true, the service accepts API keys without any other credential.
|
73
|
+
# This flag only applies to HTTP and gRPC requests.
|
69
74
|
# @!attribute [rw] requirements
|
70
75
|
# @return [::Array<::Google::Api::AuthRequirement>]
|
71
76
|
# Requirements for additional authentication providers.
|
@@ -74,8 +79,31 @@ module Google
|
|
74
79
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
75
80
|
end
|
76
81
|
|
77
|
-
#
|
78
|
-
# [
|
82
|
+
# Specifies a location to extract JWT from an API request.
|
83
|
+
# @!attribute [rw] header
|
84
|
+
# @return [::String]
|
85
|
+
# Specifies HTTP header name to extract JWT token.
|
86
|
+
# @!attribute [rw] query
|
87
|
+
# @return [::String]
|
88
|
+
# Specifies URL query parameter name to extract JWT token.
|
89
|
+
# @!attribute [rw] value_prefix
|
90
|
+
# @return [::String]
|
91
|
+
# The value prefix. The value format is "value_prefix\\{token}"
|
92
|
+
# Only applies to "in" header type. Must be empty for "in" query type.
|
93
|
+
# If not empty, the header value has to match (case sensitive) this prefix.
|
94
|
+
# If not matched, JWT will not be extracted. If matched, JWT will be
|
95
|
+
# extracted after the prefix is removed.
|
96
|
+
#
|
97
|
+
# For example, for "Authorization: Bearer \\{JWT}",
|
98
|
+
# value_prefix="Bearer " with a space at the end.
|
99
|
+
class JwtLocation
|
100
|
+
include ::Google::Protobuf::MessageExts
|
101
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
102
|
+
end
|
103
|
+
|
104
|
+
# Configuration for an authentication provider, including support for
|
105
|
+
# [JSON Web Token
|
106
|
+
# (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32).
|
79
107
|
# @!attribute [rw] id
|
80
108
|
# @return [::String]
|
81
109
|
# The unique identifier of the auth provider. It will be referred to by
|
@@ -93,12 +121,15 @@ module Google
|
|
93
121
|
# @!attribute [rw] jwks_uri
|
94
122
|
# @return [::String]
|
95
123
|
# URL of the provider's public key set to validate signature of the JWT. See
|
96
|
-
# [OpenID
|
124
|
+
# [OpenID
|
125
|
+
# Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata).
|
97
126
|
# Optional if the key set document:
|
98
127
|
# - can be retrieved from
|
99
|
-
# [OpenID
|
128
|
+
# [OpenID
|
129
|
+
# Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html)
|
100
130
|
# of the issuer.
|
101
|
-
# - can be inferred from the email domain of the issuer (e.g. a Google
|
131
|
+
# - can be inferred from the email domain of the issuer (e.g. a Google
|
132
|
+
# service account).
|
102
133
|
#
|
103
134
|
# Example: https://www.googleapis.com/oauth2/v1/certs
|
104
135
|
# @!attribute [rw] audiences
|
@@ -106,11 +137,15 @@ module Google
|
|
106
137
|
# The list of JWT
|
107
138
|
# [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3).
|
108
139
|
# that are allowed to access. A JWT containing any of these audiences will
|
109
|
-
# be accepted. When this setting is absent,
|
110
|
-
#
|
111
|
-
#
|
112
|
-
#
|
113
|
-
#
|
140
|
+
# be accepted. When this setting is absent, JWTs with audiences:
|
141
|
+
# - "https://[service.name]/[google.protobuf.Api.name]"
|
142
|
+
# - "https://[service.name]/"
|
143
|
+
# will be accepted.
|
144
|
+
# For example, if no audiences are in the setting, LibraryService API will
|
145
|
+
# accept JWTs with the following audiences:
|
146
|
+
# -
|
147
|
+
# https://library-example.googleapis.com/google.example.library.v1.LibraryService
|
148
|
+
# - https://library-example.googleapis.com/
|
114
149
|
#
|
115
150
|
# Example:
|
116
151
|
#
|
@@ -118,8 +153,27 @@ module Google
|
|
118
153
|
# bookstore_web.apps.googleusercontent.com
|
119
154
|
# @!attribute [rw] authorization_url
|
120
155
|
# @return [::String]
|
121
|
-
# Redirect URL if JWT token is required but
|
156
|
+
# Redirect URL if JWT token is required but not present or is expired.
|
122
157
|
# Implement authorizationUrl of securityDefinitions in OpenAPI spec.
|
158
|
+
# @!attribute [rw] jwt_locations
|
159
|
+
# @return [::Array<::Google::Api::JwtLocation>]
|
160
|
+
# Defines the locations to extract the JWT.
|
161
|
+
#
|
162
|
+
# JWT locations can be either from HTTP headers or URL query parameters.
|
163
|
+
# The rule is that the first match wins. The checking order is: checking
|
164
|
+
# all headers first, then URL query parameters.
|
165
|
+
#
|
166
|
+
# If not specified, default to use following 3 locations:
|
167
|
+
# 1) Authorization: Bearer
|
168
|
+
# 2) x-goog-iap-jwt-assertion
|
169
|
+
# 3) access_token query parameter
|
170
|
+
#
|
171
|
+
# Default locations can be specified as followings:
|
172
|
+
# jwt_locations:
|
173
|
+
# - header: Authorization
|
174
|
+
# value_prefix: "Bearer "
|
175
|
+
# - header: x-goog-iap-jwt-assertion
|
176
|
+
# - query: access_token
|
123
177
|
class AuthProvider
|
124
178
|
include ::Google::Protobuf::MessageExts
|
125
179
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -158,7 +212,8 @@ module Google
|
|
158
212
|
end
|
159
213
|
|
160
214
|
# User-defined authentication requirements, including support for
|
161
|
-
# [JSON Web Token
|
215
|
+
# [JSON Web Token
|
216
|
+
# (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32).
|
162
217
|
# @!attribute [rw] provider_id
|
163
218
|
# @return [::String]
|
164
219
|
# {::Google::Api::AuthProvider#id id} from authentication provider.
|