google-cloud-gaming-v1 0.2.0 → 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 +3 -3
- data/lib/google/cloud/gaming/v1/game_server_clusters_service/client.rb +69 -75
- data/lib/google/cloud/gaming/v1/game_server_clusters_service/operations.rb +39 -30
- data/lib/google/cloud/gaming/v1/game_server_configs_service/client.rb +50 -55
- data/lib/google/cloud/gaming/v1/game_server_configs_service/operations.rb +39 -30
- data/lib/google/cloud/gaming/v1/game_server_deployments_service/client.rb +73 -77
- data/lib/google/cloud/gaming/v1/game_server_deployments_service/operations.rb +39 -30
- data/lib/google/cloud/gaming/v1/realms_service/client.rb +59 -63
- data/lib/google/cloud/gaming/v1/realms_service/operations.rb +39 -30
- data/lib/google/cloud/gaming/v1/version.rb +1 -1
- data/proto_docs/google/api/field_behavior.rb +7 -1
- metadata +16 -10
@@ -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
|
@@ -169,7 +169,9 @@ module Google
|
|
169
169
|
options.apply_defaults timeout: @config.rpcs.list_operations.timeout,
|
170
170
|
metadata: metadata,
|
171
171
|
retry_policy: @config.rpcs.list_operations.retry_policy
|
172
|
-
|
172
|
+
|
173
|
+
options.apply_defaults timeout: @config.timeout,
|
174
|
+
metadata: @config.metadata,
|
173
175
|
retry_policy: @config.retry_policy
|
174
176
|
|
175
177
|
@operations_stub.call_rpc :list_operations, request, options: options do |response, operation|
|
@@ -239,7 +241,9 @@ module Google
|
|
239
241
|
options.apply_defaults timeout: @config.rpcs.get_operation.timeout,
|
240
242
|
metadata: metadata,
|
241
243
|
retry_policy: @config.rpcs.get_operation.retry_policy
|
242
|
-
|
244
|
+
|
245
|
+
options.apply_defaults timeout: @config.timeout,
|
246
|
+
metadata: @config.metadata,
|
243
247
|
retry_policy: @config.retry_policy
|
244
248
|
|
245
249
|
@operations_stub.call_rpc :get_operation, request, options: options do |response, operation|
|
@@ -309,7 +313,9 @@ module Google
|
|
309
313
|
options.apply_defaults timeout: @config.rpcs.delete_operation.timeout,
|
310
314
|
metadata: metadata,
|
311
315
|
retry_policy: @config.rpcs.delete_operation.retry_policy
|
312
|
-
|
316
|
+
|
317
|
+
options.apply_defaults timeout: @config.timeout,
|
318
|
+
metadata: @config.metadata,
|
313
319
|
retry_policy: @config.retry_policy
|
314
320
|
|
315
321
|
@operations_stub.call_rpc :delete_operation, request, options: options do |response, operation|
|
@@ -384,7 +390,9 @@ module Google
|
|
384
390
|
options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout,
|
385
391
|
metadata: metadata,
|
386
392
|
retry_policy: @config.rpcs.cancel_operation.retry_policy
|
387
|
-
|
393
|
+
|
394
|
+
options.apply_defaults timeout: @config.timeout,
|
395
|
+
metadata: @config.metadata,
|
388
396
|
retry_policy: @config.retry_policy
|
389
397
|
|
390
398
|
@operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation|
|
@@ -396,9 +404,9 @@ module Google
|
|
396
404
|
end
|
397
405
|
|
398
406
|
##
|
399
|
-
# Waits
|
400
|
-
#
|
401
|
-
#
|
407
|
+
# Waits until the specified long-running operation is done or reaches at most
|
408
|
+
# a specified timeout, returning the latest state. If the operation is
|
409
|
+
# already done, the latest state is immediately returned. If the timeout
|
402
410
|
# specified is greater than the default HTTP/RPC timeout, the HTTP/RPC
|
403
411
|
# timeout is used. If the server does not support this method, it returns
|
404
412
|
# `google.rpc.Code.UNIMPLEMENTED`.
|
@@ -456,7 +464,9 @@ module Google
|
|
456
464
|
options.apply_defaults timeout: @config.rpcs.wait_operation.timeout,
|
457
465
|
metadata: metadata,
|
458
466
|
retry_policy: @config.rpcs.wait_operation.retry_policy
|
459
|
-
|
467
|
+
|
468
|
+
options.apply_defaults timeout: @config.timeout,
|
469
|
+
metadata: @config.metadata,
|
460
470
|
retry_policy: @config.retry_policy
|
461
471
|
|
462
472
|
@operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
|
@@ -481,22 +491,21 @@ module Google
|
|
481
491
|
# Configuration can be applied globally to all clients, or to a single client
|
482
492
|
# on construction.
|
483
493
|
#
|
484
|
-
#
|
485
|
-
#
|
486
|
-
# To modify the global config, setting the timeout for list_operations
|
487
|
-
# to 20 seconds, and all remaining timeouts to 10 seconds:
|
488
|
-
#
|
489
|
-
# ::Google::Longrunning::Operations::Client.configure do |config|
|
490
|
-
# config.timeout = 10.0
|
491
|
-
# config.rpcs.list_operations.timeout = 20.0
|
492
|
-
# end
|
494
|
+
# @example
|
493
495
|
#
|
494
|
-
#
|
496
|
+
# # Modify the global config, setting the timeout for
|
497
|
+
# # list_operations to 20 seconds,
|
498
|
+
# # and all remaining timeouts to 10 seconds.
|
499
|
+
# ::Google::Longrunning::Operations::Client.configure do |config|
|
500
|
+
# config.timeout = 10.0
|
501
|
+
# config.rpcs.list_operations.timeout = 20.0
|
502
|
+
# end
|
495
503
|
#
|
496
|
-
#
|
497
|
-
#
|
498
|
-
#
|
499
|
-
#
|
504
|
+
# # Apply the above configuration only to a new client.
|
505
|
+
# client = ::Google::Longrunning::Operations::Client.new do |config|
|
506
|
+
# config.timeout = 10.0
|
507
|
+
# config.rpcs.list_operations.timeout = 20.0
|
508
|
+
# end
|
500
509
|
#
|
501
510
|
# @!attribute [rw] endpoint
|
502
511
|
# The hostname or hostname:port of the service endpoint.
|
@@ -560,7 +569,7 @@ module Google
|
|
560
569
|
config_attr :scope, nil, ::String, ::Array, nil
|
561
570
|
config_attr :lib_name, nil, ::String, nil
|
562
571
|
config_attr :lib_version, nil, ::String, nil
|
563
|
-
config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
|
572
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
|
564
573
|
config_attr :interceptors, nil, ::Array, nil
|
565
574
|
config_attr :timeout, nil, ::Numeric, nil
|
566
575
|
config_attr :metadata, nil, ::Hash, nil
|
@@ -581,7 +590,7 @@ module Google
|
|
581
590
|
def rpcs
|
582
591
|
@rpcs ||= begin
|
583
592
|
parent_rpcs = nil
|
584
|
-
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config
|
593
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
585
594
|
Rpcs.new parent_rpcs
|
586
595
|
end
|
587
596
|
end
|
@@ -632,15 +641,15 @@ module Google
|
|
632
641
|
|
633
642
|
# @private
|
634
643
|
def initialize parent_rpcs = nil
|
635
|
-
list_operations_config = parent_rpcs
|
644
|
+
list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations
|
636
645
|
@list_operations = ::Gapic::Config::Method.new list_operations_config
|
637
|
-
get_operation_config = parent_rpcs
|
646
|
+
get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation
|
638
647
|
@get_operation = ::Gapic::Config::Method.new get_operation_config
|
639
|
-
delete_operation_config = parent_rpcs
|
648
|
+
delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation
|
640
649
|
@delete_operation = ::Gapic::Config::Method.new delete_operation_config
|
641
|
-
cancel_operation_config = parent_rpcs
|
650
|
+
cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation
|
642
651
|
@cancel_operation = ::Gapic::Config::Method.new cancel_operation_config
|
643
|
-
wait_operation_config = parent_rpcs
|
652
|
+
wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation
|
644
653
|
@wait_operation = ::Gapic::Config::Method.new wait_operation_config
|
645
654
|
|
646
655
|
yield self if block_given?
|
@@ -42,13 +42,12 @@ module Google
|
|
42
42
|
# See {::Google::Cloud::Gaming::V1::RealmsService::Client::Configuration}
|
43
43
|
# for a description of the configuration fields.
|
44
44
|
#
|
45
|
-
#
|
45
|
+
# @example
|
46
46
|
#
|
47
|
-
#
|
48
|
-
#
|
49
|
-
#
|
50
|
-
#
|
51
|
-
# end
|
47
|
+
# # Modify the configuration for all RealmsService clients
|
48
|
+
# ::Google::Cloud::Gaming::V1::RealmsService::Client.configure do |config|
|
49
|
+
# config.timeout = 10.0
|
50
|
+
# end
|
52
51
|
#
|
53
52
|
# @yield [config] Configure the Client client.
|
54
53
|
# @yieldparam config [Client::Configuration]
|
@@ -61,25 +60,19 @@ module Google
|
|
61
60
|
parent_config = while namespace.any?
|
62
61
|
parent_name = namespace.join "::"
|
63
62
|
parent_const = const_get parent_name
|
64
|
-
break parent_const.configure if parent_const
|
63
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
65
64
|
namespace.pop
|
66
65
|
end
|
67
66
|
default_config = Client::Configuration.new parent_config
|
68
67
|
|
69
68
|
default_config.rpcs.list_realms.timeout = 60.0
|
70
69
|
default_config.rpcs.list_realms.retry_policy = {
|
71
|
-
initial_delay: 1.0,
|
72
|
-
max_delay: 10.0,
|
73
|
-
multiplier: 1.3,
|
74
|
-
retry_codes: [14]
|
70
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
75
71
|
}
|
76
72
|
|
77
73
|
default_config.rpcs.get_realm.timeout = 60.0
|
78
74
|
default_config.rpcs.get_realm.retry_policy = {
|
79
|
-
initial_delay: 1.0,
|
80
|
-
max_delay: 10.0,
|
81
|
-
multiplier: 1.3,
|
82
|
-
retry_codes: [14]
|
75
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
83
76
|
}
|
84
77
|
|
85
78
|
default_config.rpcs.create_realm.timeout = 60.0
|
@@ -90,10 +83,7 @@ module Google
|
|
90
83
|
|
91
84
|
default_config.rpcs.preview_realm_update.timeout = 60.0
|
92
85
|
default_config.rpcs.preview_realm_update.retry_policy = {
|
93
|
-
initial_delay: 1.0,
|
94
|
-
max_delay: 10.0,
|
95
|
-
multiplier: 1.3,
|
96
|
-
retry_codes: [14]
|
86
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
97
87
|
}
|
98
88
|
|
99
89
|
default_config
|
@@ -125,19 +115,15 @@ module Google
|
|
125
115
|
##
|
126
116
|
# Create a new RealmsService client object.
|
127
117
|
#
|
128
|
-
#
|
129
|
-
#
|
130
|
-
# To create a new RealmsService client with the default
|
131
|
-
# configuration:
|
132
|
-
#
|
133
|
-
# client = ::Google::Cloud::Gaming::V1::RealmsService::Client.new
|
118
|
+
# @example
|
134
119
|
#
|
135
|
-
#
|
136
|
-
#
|
120
|
+
# # Create a client using the default configuration
|
121
|
+
# client = ::Google::Cloud::Gaming::V1::RealmsService::Client.new
|
137
122
|
#
|
138
|
-
#
|
139
|
-
#
|
140
|
-
#
|
123
|
+
# # Create a client using a custom configuration
|
124
|
+
# client = ::Google::Cloud::Gaming::V1::RealmsService::Client.new do |config|
|
125
|
+
# config.timeout = 10.0
|
126
|
+
# end
|
141
127
|
#
|
142
128
|
# @yield [config] Configure the RealmsService client.
|
143
129
|
# @yieldparam config [Client::Configuration]
|
@@ -157,14 +143,13 @@ module Google
|
|
157
143
|
|
158
144
|
# Create credentials
|
159
145
|
credentials = @config.credentials
|
160
|
-
# Use self-signed JWT if the
|
146
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
161
147
|
# but only if the default endpoint does not have a region prefix.
|
162
|
-
enable_self_signed_jwt = @config.
|
163
|
-
@config.endpoint == Client.configure.endpoint &&
|
148
|
+
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
|
164
149
|
!@config.endpoint.split(".").first.include?("-")
|
165
|
-
credentials ||= Credentials.default scope:
|
150
|
+
credentials ||= Credentials.default scope: @config.scope,
|
166
151
|
enable_self_signed_jwt: enable_self_signed_jwt
|
167
|
-
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
152
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
168
153
|
credentials = Credentials.new credentials, scope: @config.scope
|
169
154
|
end
|
170
155
|
@quota_project_id = @config.quota_project
|
@@ -263,7 +248,9 @@ module Google
|
|
263
248
|
options.apply_defaults timeout: @config.rpcs.list_realms.timeout,
|
264
249
|
metadata: metadata,
|
265
250
|
retry_policy: @config.rpcs.list_realms.retry_policy
|
266
|
-
|
251
|
+
|
252
|
+
options.apply_defaults timeout: @config.timeout,
|
253
|
+
metadata: @config.metadata,
|
267
254
|
retry_policy: @config.retry_policy
|
268
255
|
|
269
256
|
@realms_service_stub.call_rpc :list_realms, request, options: options do |response, operation|
|
@@ -331,7 +318,9 @@ module Google
|
|
331
318
|
options.apply_defaults timeout: @config.rpcs.get_realm.timeout,
|
332
319
|
metadata: metadata,
|
333
320
|
retry_policy: @config.rpcs.get_realm.retry_policy
|
334
|
-
|
321
|
+
|
322
|
+
options.apply_defaults timeout: @config.timeout,
|
323
|
+
metadata: @config.metadata,
|
335
324
|
retry_policy: @config.retry_policy
|
336
325
|
|
337
326
|
@realms_service_stub.call_rpc :get_realm, request, options: options do |response, operation|
|
@@ -402,7 +391,9 @@ module Google
|
|
402
391
|
options.apply_defaults timeout: @config.rpcs.create_realm.timeout,
|
403
392
|
metadata: metadata,
|
404
393
|
retry_policy: @config.rpcs.create_realm.retry_policy
|
405
|
-
|
394
|
+
|
395
|
+
options.apply_defaults timeout: @config.timeout,
|
396
|
+
metadata: @config.metadata,
|
406
397
|
retry_policy: @config.retry_policy
|
407
398
|
|
408
399
|
@realms_service_stub.call_rpc :create_realm, request, options: options do |response, operation|
|
@@ -470,7 +461,9 @@ module Google
|
|
470
461
|
options.apply_defaults timeout: @config.rpcs.delete_realm.timeout,
|
471
462
|
metadata: metadata,
|
472
463
|
retry_policy: @config.rpcs.delete_realm.retry_policy
|
473
|
-
|
464
|
+
|
465
|
+
options.apply_defaults timeout: @config.timeout,
|
466
|
+
metadata: @config.metadata,
|
474
467
|
retry_policy: @config.retry_policy
|
475
468
|
|
476
469
|
@realms_service_stub.call_rpc :delete_realm, request, options: options do |response, operation|
|
@@ -545,7 +538,9 @@ module Google
|
|
545
538
|
options.apply_defaults timeout: @config.rpcs.update_realm.timeout,
|
546
539
|
metadata: metadata,
|
547
540
|
retry_policy: @config.rpcs.update_realm.retry_policy
|
548
|
-
|
541
|
+
|
542
|
+
options.apply_defaults timeout: @config.timeout,
|
543
|
+
metadata: @config.metadata,
|
549
544
|
retry_policy: @config.retry_policy
|
550
545
|
|
551
546
|
@realms_service_stub.call_rpc :update_realm, request, options: options do |response, operation|
|
@@ -622,7 +617,9 @@ module Google
|
|
622
617
|
options.apply_defaults timeout: @config.rpcs.preview_realm_update.timeout,
|
623
618
|
metadata: metadata,
|
624
619
|
retry_policy: @config.rpcs.preview_realm_update.retry_policy
|
625
|
-
|
620
|
+
|
621
|
+
options.apply_defaults timeout: @config.timeout,
|
622
|
+
metadata: @config.metadata,
|
626
623
|
retry_policy: @config.retry_policy
|
627
624
|
|
628
625
|
@realms_service_stub.call_rpc :preview_realm_update, request, options: options do |response, operation|
|
@@ -646,22 +643,21 @@ module Google
|
|
646
643
|
# Configuration can be applied globally to all clients, or to a single client
|
647
644
|
# on construction.
|
648
645
|
#
|
649
|
-
#
|
650
|
-
#
|
651
|
-
# To modify the global config, setting the timeout for list_realms
|
652
|
-
# to 20 seconds, and all remaining timeouts to 10 seconds:
|
653
|
-
#
|
654
|
-
# ::Google::Cloud::Gaming::V1::RealmsService::Client.configure do |config|
|
655
|
-
# config.timeout = 10.0
|
656
|
-
# config.rpcs.list_realms.timeout = 20.0
|
657
|
-
# end
|
646
|
+
# @example
|
658
647
|
#
|
659
|
-
#
|
648
|
+
# # Modify the global config, setting the timeout for
|
649
|
+
# # list_realms to 20 seconds,
|
650
|
+
# # and all remaining timeouts to 10 seconds.
|
651
|
+
# ::Google::Cloud::Gaming::V1::RealmsService::Client.configure do |config|
|
652
|
+
# config.timeout = 10.0
|
653
|
+
# config.rpcs.list_realms.timeout = 20.0
|
654
|
+
# end
|
660
655
|
#
|
661
|
-
#
|
662
|
-
#
|
663
|
-
#
|
664
|
-
#
|
656
|
+
# # Apply the above configuration only to a new client.
|
657
|
+
# client = ::Google::Cloud::Gaming::V1::RealmsService::Client.new do |config|
|
658
|
+
# config.timeout = 10.0
|
659
|
+
# config.rpcs.list_realms.timeout = 20.0
|
660
|
+
# end
|
665
661
|
#
|
666
662
|
# @!attribute [rw] endpoint
|
667
663
|
# The hostname or hostname:port of the service endpoint.
|
@@ -725,7 +721,7 @@ module Google
|
|
725
721
|
config_attr :scope, nil, ::String, ::Array, nil
|
726
722
|
config_attr :lib_name, nil, ::String, nil
|
727
723
|
config_attr :lib_version, nil, ::String, nil
|
728
|
-
config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
|
724
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
|
729
725
|
config_attr :interceptors, nil, ::Array, nil
|
730
726
|
config_attr :timeout, nil, ::Numeric, nil
|
731
727
|
config_attr :metadata, nil, ::Hash, nil
|
@@ -746,7 +742,7 @@ module Google
|
|
746
742
|
def rpcs
|
747
743
|
@rpcs ||= begin
|
748
744
|
parent_rpcs = nil
|
749
|
-
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config
|
745
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
750
746
|
Rpcs.new parent_rpcs
|
751
747
|
end
|
752
748
|
end
|
@@ -802,17 +798,17 @@ module Google
|
|
802
798
|
|
803
799
|
# @private
|
804
800
|
def initialize parent_rpcs = nil
|
805
|
-
list_realms_config = parent_rpcs
|
801
|
+
list_realms_config = parent_rpcs.list_realms if parent_rpcs.respond_to? :list_realms
|
806
802
|
@list_realms = ::Gapic::Config::Method.new list_realms_config
|
807
|
-
get_realm_config = parent_rpcs
|
803
|
+
get_realm_config = parent_rpcs.get_realm if parent_rpcs.respond_to? :get_realm
|
808
804
|
@get_realm = ::Gapic::Config::Method.new get_realm_config
|
809
|
-
create_realm_config = parent_rpcs
|
805
|
+
create_realm_config = parent_rpcs.create_realm if parent_rpcs.respond_to? :create_realm
|
810
806
|
@create_realm = ::Gapic::Config::Method.new create_realm_config
|
811
|
-
delete_realm_config = parent_rpcs
|
807
|
+
delete_realm_config = parent_rpcs.delete_realm if parent_rpcs.respond_to? :delete_realm
|
812
808
|
@delete_realm = ::Gapic::Config::Method.new delete_realm_config
|
813
|
-
update_realm_config = parent_rpcs
|
809
|
+
update_realm_config = parent_rpcs.update_realm if parent_rpcs.respond_to? :update_realm
|
814
810
|
@update_realm = ::Gapic::Config::Method.new update_realm_config
|
815
|
-
preview_realm_update_config = parent_rpcs
|
811
|
+
preview_realm_update_config = parent_rpcs.preview_realm_update if parent_rpcs.respond_to? :preview_realm_update
|
816
812
|
@preview_realm_update = ::Gapic::Config::Method.new preview_realm_update_config
|
817
813
|
|
818
814
|
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
|
@@ -169,7 +169,9 @@ module Google
|
|
169
169
|
options.apply_defaults timeout: @config.rpcs.list_operations.timeout,
|
170
170
|
metadata: metadata,
|
171
171
|
retry_policy: @config.rpcs.list_operations.retry_policy
|
172
|
-
|
172
|
+
|
173
|
+
options.apply_defaults timeout: @config.timeout,
|
174
|
+
metadata: @config.metadata,
|
173
175
|
retry_policy: @config.retry_policy
|
174
176
|
|
175
177
|
@operations_stub.call_rpc :list_operations, request, options: options do |response, operation|
|
@@ -239,7 +241,9 @@ module Google
|
|
239
241
|
options.apply_defaults timeout: @config.rpcs.get_operation.timeout,
|
240
242
|
metadata: metadata,
|
241
243
|
retry_policy: @config.rpcs.get_operation.retry_policy
|
242
|
-
|
244
|
+
|
245
|
+
options.apply_defaults timeout: @config.timeout,
|
246
|
+
metadata: @config.metadata,
|
243
247
|
retry_policy: @config.retry_policy
|
244
248
|
|
245
249
|
@operations_stub.call_rpc :get_operation, request, options: options do |response, operation|
|
@@ -309,7 +313,9 @@ module Google
|
|
309
313
|
options.apply_defaults timeout: @config.rpcs.delete_operation.timeout,
|
310
314
|
metadata: metadata,
|
311
315
|
retry_policy: @config.rpcs.delete_operation.retry_policy
|
312
|
-
|
316
|
+
|
317
|
+
options.apply_defaults timeout: @config.timeout,
|
318
|
+
metadata: @config.metadata,
|
313
319
|
retry_policy: @config.retry_policy
|
314
320
|
|
315
321
|
@operations_stub.call_rpc :delete_operation, request, options: options do |response, operation|
|
@@ -384,7 +390,9 @@ module Google
|
|
384
390
|
options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout,
|
385
391
|
metadata: metadata,
|
386
392
|
retry_policy: @config.rpcs.cancel_operation.retry_policy
|
387
|
-
|
393
|
+
|
394
|
+
options.apply_defaults timeout: @config.timeout,
|
395
|
+
metadata: @config.metadata,
|
388
396
|
retry_policy: @config.retry_policy
|
389
397
|
|
390
398
|
@operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation|
|
@@ -396,9 +404,9 @@ module Google
|
|
396
404
|
end
|
397
405
|
|
398
406
|
##
|
399
|
-
# Waits
|
400
|
-
#
|
401
|
-
#
|
407
|
+
# Waits until the specified long-running operation is done or reaches at most
|
408
|
+
# a specified timeout, returning the latest state. If the operation is
|
409
|
+
# already done, the latest state is immediately returned. If the timeout
|
402
410
|
# specified is greater than the default HTTP/RPC timeout, the HTTP/RPC
|
403
411
|
# timeout is used. If the server does not support this method, it returns
|
404
412
|
# `google.rpc.Code.UNIMPLEMENTED`.
|
@@ -456,7 +464,9 @@ module Google
|
|
456
464
|
options.apply_defaults timeout: @config.rpcs.wait_operation.timeout,
|
457
465
|
metadata: metadata,
|
458
466
|
retry_policy: @config.rpcs.wait_operation.retry_policy
|
459
|
-
|
467
|
+
|
468
|
+
options.apply_defaults timeout: @config.timeout,
|
469
|
+
metadata: @config.metadata,
|
460
470
|
retry_policy: @config.retry_policy
|
461
471
|
|
462
472
|
@operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
|
@@ -481,22 +491,21 @@ module Google
|
|
481
491
|
# Configuration can be applied globally to all clients, or to a single client
|
482
492
|
# on construction.
|
483
493
|
#
|
484
|
-
#
|
485
|
-
#
|
486
|
-
# To modify the global config, setting the timeout for list_operations
|
487
|
-
# to 20 seconds, and all remaining timeouts to 10 seconds:
|
488
|
-
#
|
489
|
-
# ::Google::Longrunning::Operations::Client.configure do |config|
|
490
|
-
# config.timeout = 10.0
|
491
|
-
# config.rpcs.list_operations.timeout = 20.0
|
492
|
-
# end
|
494
|
+
# @example
|
493
495
|
#
|
494
|
-
#
|
496
|
+
# # Modify the global config, setting the timeout for
|
497
|
+
# # list_operations to 20 seconds,
|
498
|
+
# # and all remaining timeouts to 10 seconds.
|
499
|
+
# ::Google::Longrunning::Operations::Client.configure do |config|
|
500
|
+
# config.timeout = 10.0
|
501
|
+
# config.rpcs.list_operations.timeout = 20.0
|
502
|
+
# end
|
495
503
|
#
|
496
|
-
#
|
497
|
-
#
|
498
|
-
#
|
499
|
-
#
|
504
|
+
# # Apply the above configuration only to a new client.
|
505
|
+
# client = ::Google::Longrunning::Operations::Client.new do |config|
|
506
|
+
# config.timeout = 10.0
|
507
|
+
# config.rpcs.list_operations.timeout = 20.0
|
508
|
+
# end
|
500
509
|
#
|
501
510
|
# @!attribute [rw] endpoint
|
502
511
|
# The hostname or hostname:port of the service endpoint.
|
@@ -560,7 +569,7 @@ module Google
|
|
560
569
|
config_attr :scope, nil, ::String, ::Array, nil
|
561
570
|
config_attr :lib_name, nil, ::String, nil
|
562
571
|
config_attr :lib_version, nil, ::String, nil
|
563
|
-
config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
|
572
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
|
564
573
|
config_attr :interceptors, nil, ::Array, nil
|
565
574
|
config_attr :timeout, nil, ::Numeric, nil
|
566
575
|
config_attr :metadata, nil, ::Hash, nil
|
@@ -581,7 +590,7 @@ module Google
|
|
581
590
|
def rpcs
|
582
591
|
@rpcs ||= begin
|
583
592
|
parent_rpcs = nil
|
584
|
-
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config
|
593
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
585
594
|
Rpcs.new parent_rpcs
|
586
595
|
end
|
587
596
|
end
|
@@ -632,15 +641,15 @@ module Google
|
|
632
641
|
|
633
642
|
# @private
|
634
643
|
def initialize parent_rpcs = nil
|
635
|
-
list_operations_config = parent_rpcs
|
644
|
+
list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations
|
636
645
|
@list_operations = ::Gapic::Config::Method.new list_operations_config
|
637
|
-
get_operation_config = parent_rpcs
|
646
|
+
get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation
|
638
647
|
@get_operation = ::Gapic::Config::Method.new get_operation_config
|
639
|
-
delete_operation_config = parent_rpcs
|
648
|
+
delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation
|
640
649
|
@delete_operation = ::Gapic::Config::Method.new delete_operation_config
|
641
|
-
cancel_operation_config = parent_rpcs
|
650
|
+
cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation
|
642
651
|
@cancel_operation = ::Gapic::Config::Method.new cancel_operation_config
|
643
|
-
wait_operation_config = parent_rpcs
|
652
|
+
wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation
|
644
653
|
@wait_operation = ::Gapic::Config::Method.new wait_operation_config
|
645
654
|
|
646
655
|
yield self if block_given?
|