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.
@@ -42,13 +42,12 @@ module Google
42
42
  # See {::Google::Cloud::Gaming::V1::GameServerClustersService::Client::Configuration}
43
43
  # for a description of the configuration fields.
44
44
  #
45
- # ## Example
45
+ # @example
46
46
  #
47
- # To modify the configuration for all GameServerClustersService clients:
48
- #
49
- # ::Google::Cloud::Gaming::V1::GameServerClustersService::Client.configure do |config|
50
- # config.timeout = 10.0
51
- # end
47
+ # # Modify the configuration for all GameServerClustersService clients
48
+ # ::Google::Cloud::Gaming::V1::GameServerClustersService::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,55 +60,40 @@ 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&.respond_to? :configure
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_game_server_clusters.timeout = 60.0
70
69
  default_config.rpcs.list_game_server_clusters.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_game_server_cluster.timeout = 60.0
78
74
  default_config.rpcs.get_game_server_cluster.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_game_server_cluster.timeout = 120.0
86
79
 
87
80
  default_config.rpcs.preview_create_game_server_cluster.timeout = 60.0
88
81
  default_config.rpcs.preview_create_game_server_cluster.retry_policy = {
89
- initial_delay: 1.0,
90
- max_delay: 10.0,
91
- multiplier: 1.3,
92
- retry_codes: [14]
82
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
93
83
  }
94
84
 
95
85
  default_config.rpcs.delete_game_server_cluster.timeout = 60.0
96
86
 
97
87
  default_config.rpcs.preview_delete_game_server_cluster.timeout = 60.0
98
88
  default_config.rpcs.preview_delete_game_server_cluster.retry_policy = {
99
- initial_delay: 1.0,
100
- max_delay: 10.0,
101
- multiplier: 1.3,
102
- retry_codes: [14]
89
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
103
90
  }
104
91
 
105
92
  default_config.rpcs.update_game_server_cluster.timeout = 60.0
106
93
 
107
94
  default_config.rpcs.preview_update_game_server_cluster.timeout = 60.0
108
95
  default_config.rpcs.preview_update_game_server_cluster.retry_policy = {
109
- initial_delay: 1.0,
110
- max_delay: 10.0,
111
- multiplier: 1.3,
112
- retry_codes: [14]
96
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
113
97
  }
114
98
 
115
99
  default_config
@@ -141,19 +125,15 @@ module Google
141
125
  ##
142
126
  # Create a new GameServerClustersService client object.
143
127
  #
144
- # ## Examples
145
- #
146
- # To create a new GameServerClustersService client with the default
147
- # configuration:
128
+ # @example
148
129
  #
149
- # client = ::Google::Cloud::Gaming::V1::GameServerClustersService::Client.new
130
+ # # Create a client using the default configuration
131
+ # client = ::Google::Cloud::Gaming::V1::GameServerClustersService::Client.new
150
132
  #
151
- # To create a new GameServerClustersService client with a custom
152
- # configuration:
153
- #
154
- # client = ::Google::Cloud::Gaming::V1::GameServerClustersService::Client.new do |config|
155
- # config.timeout = 10.0
156
- # end
133
+ # # Create a client using a custom configuration
134
+ # client = ::Google::Cloud::Gaming::V1::GameServerClustersService::Client.new do |config|
135
+ # config.timeout = 10.0
136
+ # end
157
137
  #
158
138
  # @yield [config] Configure the GameServerClustersService client.
159
139
  # @yieldparam config [Client::Configuration]
@@ -173,14 +153,13 @@ module Google
173
153
 
174
154
  # Create credentials
175
155
  credentials = @config.credentials
176
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
156
+ # Use self-signed JWT if the endpoint is unchanged from default,
177
157
  # but only if the default endpoint does not have a region prefix.
178
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
179
- @config.endpoint == Client.configure.endpoint &&
158
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
180
159
  !@config.endpoint.split(".").first.include?("-")
181
- credentials ||= Credentials.default scope: @config.scope,
160
+ credentials ||= Credentials.default scope: @config.scope,
182
161
  enable_self_signed_jwt: enable_self_signed_jwt
183
- if credentials.is_a?(String) || credentials.is_a?(Hash)
162
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
184
163
  credentials = Credentials.new credentials, scope: @config.scope
185
164
  end
186
165
  @quota_project_id = @config.quota_project
@@ -278,7 +257,9 @@ module Google
278
257
  options.apply_defaults timeout: @config.rpcs.list_game_server_clusters.timeout,
279
258
  metadata: metadata,
280
259
  retry_policy: @config.rpcs.list_game_server_clusters.retry_policy
281
- options.apply_defaults metadata: @config.metadata,
260
+
261
+ options.apply_defaults timeout: @config.timeout,
262
+ metadata: @config.metadata,
282
263
  retry_policy: @config.retry_policy
283
264
 
284
265
  @game_server_clusters_service_stub.call_rpc :list_game_server_clusters, request, options: options do |response, operation|
@@ -347,7 +328,9 @@ module Google
347
328
  options.apply_defaults timeout: @config.rpcs.get_game_server_cluster.timeout,
348
329
  metadata: metadata,
349
330
  retry_policy: @config.rpcs.get_game_server_cluster.retry_policy
350
- options.apply_defaults metadata: @config.metadata,
331
+
332
+ options.apply_defaults timeout: @config.timeout,
333
+ metadata: @config.metadata,
351
334
  retry_policy: @config.retry_policy
352
335
 
353
336
  @game_server_clusters_service_stub.call_rpc :get_game_server_cluster, request, options: options do |response, operation|
@@ -418,7 +401,9 @@ module Google
418
401
  options.apply_defaults timeout: @config.rpcs.create_game_server_cluster.timeout,
419
402
  metadata: metadata,
420
403
  retry_policy: @config.rpcs.create_game_server_cluster.retry_policy
421
- options.apply_defaults metadata: @config.metadata,
404
+
405
+ options.apply_defaults timeout: @config.timeout,
406
+ metadata: @config.metadata,
422
407
  retry_policy: @config.retry_policy
423
408
 
424
409
  @game_server_clusters_service_stub.call_rpc :create_game_server_cluster, request, options: options do |response, operation|
@@ -493,7 +478,9 @@ module Google
493
478
  options.apply_defaults timeout: @config.rpcs.preview_create_game_server_cluster.timeout,
494
479
  metadata: metadata,
495
480
  retry_policy: @config.rpcs.preview_create_game_server_cluster.retry_policy
496
- options.apply_defaults metadata: @config.metadata,
481
+
482
+ options.apply_defaults timeout: @config.timeout,
483
+ metadata: @config.metadata,
497
484
  retry_policy: @config.retry_policy
498
485
 
499
486
  @game_server_clusters_service_stub.call_rpc :preview_create_game_server_cluster, request, options: options do |response, operation|
@@ -560,7 +547,9 @@ module Google
560
547
  options.apply_defaults timeout: @config.rpcs.delete_game_server_cluster.timeout,
561
548
  metadata: metadata,
562
549
  retry_policy: @config.rpcs.delete_game_server_cluster.retry_policy
563
- options.apply_defaults metadata: @config.metadata,
550
+
551
+ options.apply_defaults timeout: @config.timeout,
552
+ metadata: @config.metadata,
564
553
  retry_policy: @config.retry_policy
565
554
 
566
555
  @game_server_clusters_service_stub.call_rpc :delete_game_server_cluster, request, options: options do |response, operation|
@@ -630,7 +619,9 @@ module Google
630
619
  options.apply_defaults timeout: @config.rpcs.preview_delete_game_server_cluster.timeout,
631
620
  metadata: metadata,
632
621
  retry_policy: @config.rpcs.preview_delete_game_server_cluster.retry_policy
633
- options.apply_defaults metadata: @config.metadata,
622
+
623
+ options.apply_defaults timeout: @config.timeout,
624
+ metadata: @config.metadata,
634
625
  retry_policy: @config.retry_policy
635
626
 
636
627
  @game_server_clusters_service_stub.call_rpc :preview_delete_game_server_cluster, request, options: options do |response, operation|
@@ -704,7 +695,9 @@ module Google
704
695
  options.apply_defaults timeout: @config.rpcs.update_game_server_cluster.timeout,
705
696
  metadata: metadata,
706
697
  retry_policy: @config.rpcs.update_game_server_cluster.retry_policy
707
- options.apply_defaults metadata: @config.metadata,
698
+
699
+ options.apply_defaults timeout: @config.timeout,
700
+ metadata: @config.metadata,
708
701
  retry_policy: @config.retry_policy
709
702
 
710
703
  @game_server_clusters_service_stub.call_rpc :update_game_server_cluster, request, options: options do |response, operation|
@@ -781,7 +774,9 @@ module Google
781
774
  options.apply_defaults timeout: @config.rpcs.preview_update_game_server_cluster.timeout,
782
775
  metadata: metadata,
783
776
  retry_policy: @config.rpcs.preview_update_game_server_cluster.retry_policy
784
- options.apply_defaults metadata: @config.metadata,
777
+
778
+ options.apply_defaults timeout: @config.timeout,
779
+ metadata: @config.metadata,
785
780
  retry_policy: @config.retry_policy
786
781
 
787
782
  @game_server_clusters_service_stub.call_rpc :preview_update_game_server_cluster, request, options: options do |response, operation|
@@ -805,22 +800,21 @@ module Google
805
800
  # Configuration can be applied globally to all clients, or to a single client
806
801
  # on construction.
807
802
  #
808
- # # Examples
809
- #
810
- # To modify the global config, setting the timeout for list_game_server_clusters
811
- # to 20 seconds, and all remaining timeouts to 10 seconds:
812
- #
813
- # ::Google::Cloud::Gaming::V1::GameServerClustersService::Client.configure do |config|
814
- # config.timeout = 10.0
815
- # config.rpcs.list_game_server_clusters.timeout = 20.0
816
- # end
803
+ # @example
817
804
  #
818
- # To apply the above configuration only to a new client:
805
+ # # Modify the global config, setting the timeout for
806
+ # # list_game_server_clusters to 20 seconds,
807
+ # # and all remaining timeouts to 10 seconds.
808
+ # ::Google::Cloud::Gaming::V1::GameServerClustersService::Client.configure do |config|
809
+ # config.timeout = 10.0
810
+ # config.rpcs.list_game_server_clusters.timeout = 20.0
811
+ # end
819
812
  #
820
- # client = ::Google::Cloud::Gaming::V1::GameServerClustersService::Client.new do |config|
821
- # config.timeout = 10.0
822
- # config.rpcs.list_game_server_clusters.timeout = 20.0
823
- # end
813
+ # # Apply the above configuration only to a new client.
814
+ # client = ::Google::Cloud::Gaming::V1::GameServerClustersService::Client.new do |config|
815
+ # config.timeout = 10.0
816
+ # config.rpcs.list_game_server_clusters.timeout = 20.0
817
+ # end
824
818
  #
825
819
  # @!attribute [rw] endpoint
826
820
  # The hostname or hostname:port of the service endpoint.
@@ -884,7 +878,7 @@ module Google
884
878
  config_attr :scope, nil, ::String, ::Array, nil
885
879
  config_attr :lib_name, nil, ::String, nil
886
880
  config_attr :lib_version, nil, ::String, nil
887
- config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
881
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
888
882
  config_attr :interceptors, nil, ::Array, nil
889
883
  config_attr :timeout, nil, ::Numeric, nil
890
884
  config_attr :metadata, nil, ::Hash, nil
@@ -905,7 +899,7 @@ module Google
905
899
  def rpcs
906
900
  @rpcs ||= begin
907
901
  parent_rpcs = nil
908
- parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
902
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
909
903
  Rpcs.new parent_rpcs
910
904
  end
911
905
  end
@@ -971,21 +965,21 @@ module Google
971
965
 
972
966
  # @private
973
967
  def initialize parent_rpcs = nil
974
- list_game_server_clusters_config = parent_rpcs&.list_game_server_clusters if parent_rpcs&.respond_to? :list_game_server_clusters
968
+ list_game_server_clusters_config = parent_rpcs.list_game_server_clusters if parent_rpcs.respond_to? :list_game_server_clusters
975
969
  @list_game_server_clusters = ::Gapic::Config::Method.new list_game_server_clusters_config
976
- get_game_server_cluster_config = parent_rpcs&.get_game_server_cluster if parent_rpcs&.respond_to? :get_game_server_cluster
970
+ get_game_server_cluster_config = parent_rpcs.get_game_server_cluster if parent_rpcs.respond_to? :get_game_server_cluster
977
971
  @get_game_server_cluster = ::Gapic::Config::Method.new get_game_server_cluster_config
978
- create_game_server_cluster_config = parent_rpcs&.create_game_server_cluster if parent_rpcs&.respond_to? :create_game_server_cluster
972
+ create_game_server_cluster_config = parent_rpcs.create_game_server_cluster if parent_rpcs.respond_to? :create_game_server_cluster
979
973
  @create_game_server_cluster = ::Gapic::Config::Method.new create_game_server_cluster_config
980
- preview_create_game_server_cluster_config = parent_rpcs&.preview_create_game_server_cluster if parent_rpcs&.respond_to? :preview_create_game_server_cluster
974
+ preview_create_game_server_cluster_config = parent_rpcs.preview_create_game_server_cluster if parent_rpcs.respond_to? :preview_create_game_server_cluster
981
975
  @preview_create_game_server_cluster = ::Gapic::Config::Method.new preview_create_game_server_cluster_config
982
- delete_game_server_cluster_config = parent_rpcs&.delete_game_server_cluster if parent_rpcs&.respond_to? :delete_game_server_cluster
976
+ delete_game_server_cluster_config = parent_rpcs.delete_game_server_cluster if parent_rpcs.respond_to? :delete_game_server_cluster
983
977
  @delete_game_server_cluster = ::Gapic::Config::Method.new delete_game_server_cluster_config
984
- preview_delete_game_server_cluster_config = parent_rpcs&.preview_delete_game_server_cluster if parent_rpcs&.respond_to? :preview_delete_game_server_cluster
978
+ preview_delete_game_server_cluster_config = parent_rpcs.preview_delete_game_server_cluster if parent_rpcs.respond_to? :preview_delete_game_server_cluster
985
979
  @preview_delete_game_server_cluster = ::Gapic::Config::Method.new preview_delete_game_server_cluster_config
986
- update_game_server_cluster_config = parent_rpcs&.update_game_server_cluster if parent_rpcs&.respond_to? :update_game_server_cluster
980
+ update_game_server_cluster_config = parent_rpcs.update_game_server_cluster if parent_rpcs.respond_to? :update_game_server_cluster
987
981
  @update_game_server_cluster = ::Gapic::Config::Method.new update_game_server_cluster_config
988
- preview_update_game_server_cluster_config = parent_rpcs&.preview_update_game_server_cluster if parent_rpcs&.respond_to? :preview_update_game_server_cluster
982
+ preview_update_game_server_cluster_config = parent_rpcs.preview_update_game_server_cluster if parent_rpcs.respond_to? :preview_update_game_server_cluster
989
983
  @preview_update_game_server_cluster = ::Gapic::Config::Method.new preview_update_game_server_cluster_config
990
984
 
991
985
  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
- options.apply_defaults metadata: @config.metadata,
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
- options.apply_defaults metadata: @config.metadata,
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
- options.apply_defaults metadata: @config.metadata,
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
- options.apply_defaults metadata: @config.metadata,
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 for the specified long-running operation until it is done or reaches
400
- # at most a specified timeout, returning the latest state. If the operation
401
- # is already done, the latest state is immediately returned. If the timeout
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
- options.apply_defaults metadata: @config.metadata,
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
- # # Examples
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
- # To apply the above configuration only to a new client:
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
- # client = ::Google::Longrunning::Operations::Client.new do |config|
497
- # config.timeout = 10.0
498
- # config.rpcs.list_operations.timeout = 20.0
499
- # end
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&.respond_to?(:rpcs)
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&.list_operations if parent_rpcs&.respond_to? :list_operations
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&.get_operation if parent_rpcs&.respond_to? :get_operation
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&.delete_operation if parent_rpcs&.respond_to? :delete_operation
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&.cancel_operation if parent_rpcs&.respond_to? :cancel_operation
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&.wait_operation if parent_rpcs&.respond_to? :wait_operation
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?
@@ -41,13 +41,12 @@ module Google
41
41
  # See {::Google::Cloud::Gaming::V1::GameServerConfigsService::Client::Configuration}
42
42
  # for a description of the configuration fields.
43
43
  #
44
- # ## Example
44
+ # @example
45
45
  #
46
- # To modify the configuration for all GameServerConfigsService clients:
47
- #
48
- # ::Google::Cloud::Gaming::V1::GameServerConfigsService::Client.configure do |config|
49
- # config.timeout = 10.0
50
- # end
46
+ # # Modify the configuration for all GameServerConfigsService clients
47
+ # ::Google::Cloud::Gaming::V1::GameServerConfigsService::Client.configure do |config|
48
+ # config.timeout = 10.0
49
+ # end
51
50
  #
52
51
  # @yield [config] Configure the Client client.
53
52
  # @yieldparam config [Client::Configuration]
@@ -60,25 +59,19 @@ module Google
60
59
  parent_config = while namespace.any?
61
60
  parent_name = namespace.join "::"
62
61
  parent_const = const_get parent_name
63
- break parent_const.configure if parent_const&.respond_to? :configure
62
+ break parent_const.configure if parent_const.respond_to? :configure
64
63
  namespace.pop
65
64
  end
66
65
  default_config = Client::Configuration.new parent_config
67
66
 
68
67
  default_config.rpcs.list_game_server_configs.timeout = 60.0
69
68
  default_config.rpcs.list_game_server_configs.retry_policy = {
70
- initial_delay: 1.0,
71
- max_delay: 10.0,
72
- multiplier: 1.3,
73
- retry_codes: [14]
69
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
74
70
  }
75
71
 
76
72
  default_config.rpcs.get_game_server_config.timeout = 60.0
77
73
  default_config.rpcs.get_game_server_config.retry_policy = {
78
- initial_delay: 1.0,
79
- max_delay: 10.0,
80
- multiplier: 1.3,
81
- retry_codes: [14]
74
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
82
75
  }
83
76
 
84
77
  default_config.rpcs.create_game_server_config.timeout = 60.0
@@ -114,19 +107,15 @@ module Google
114
107
  ##
115
108
  # Create a new GameServerConfigsService client object.
116
109
  #
117
- # ## Examples
118
- #
119
- # To create a new GameServerConfigsService client with the default
120
- # configuration:
121
- #
122
- # client = ::Google::Cloud::Gaming::V1::GameServerConfigsService::Client.new
110
+ # @example
123
111
  #
124
- # To create a new GameServerConfigsService client with a custom
125
- # configuration:
112
+ # # Create a client using the default configuration
113
+ # client = ::Google::Cloud::Gaming::V1::GameServerConfigsService::Client.new
126
114
  #
127
- # client = ::Google::Cloud::Gaming::V1::GameServerConfigsService::Client.new do |config|
128
- # config.timeout = 10.0
129
- # end
115
+ # # Create a client using a custom configuration
116
+ # client = ::Google::Cloud::Gaming::V1::GameServerConfigsService::Client.new do |config|
117
+ # config.timeout = 10.0
118
+ # end
130
119
  #
131
120
  # @yield [config] Configure the GameServerConfigsService client.
132
121
  # @yieldparam config [Client::Configuration]
@@ -146,14 +135,13 @@ module Google
146
135
 
147
136
  # Create credentials
148
137
  credentials = @config.credentials
149
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
138
+ # Use self-signed JWT if the endpoint is unchanged from default,
150
139
  # but only if the default endpoint does not have a region prefix.
151
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
152
- @config.endpoint == Client.configure.endpoint &&
140
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
153
141
  !@config.endpoint.split(".").first.include?("-")
154
- credentials ||= Credentials.default scope: @config.scope,
142
+ credentials ||= Credentials.default scope: @config.scope,
155
143
  enable_self_signed_jwt: enable_self_signed_jwt
156
- if credentials.is_a?(String) || credentials.is_a?(Hash)
144
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
157
145
  credentials = Credentials.new credentials, scope: @config.scope
158
146
  end
159
147
  @quota_project_id = @config.quota_project
@@ -253,7 +241,9 @@ module Google
253
241
  options.apply_defaults timeout: @config.rpcs.list_game_server_configs.timeout,
254
242
  metadata: metadata,
255
243
  retry_policy: @config.rpcs.list_game_server_configs.retry_policy
256
- options.apply_defaults metadata: @config.metadata,
244
+
245
+ options.apply_defaults timeout: @config.timeout,
246
+ metadata: @config.metadata,
257
247
  retry_policy: @config.retry_policy
258
248
 
259
249
  @game_server_configs_service_stub.call_rpc :list_game_server_configs, request, options: options do |response, operation|
@@ -322,7 +312,9 @@ module Google
322
312
  options.apply_defaults timeout: @config.rpcs.get_game_server_config.timeout,
323
313
  metadata: metadata,
324
314
  retry_policy: @config.rpcs.get_game_server_config.retry_policy
325
- options.apply_defaults metadata: @config.metadata,
315
+
316
+ options.apply_defaults timeout: @config.timeout,
317
+ metadata: @config.metadata,
326
318
  retry_policy: @config.retry_policy
327
319
 
328
320
  @game_server_configs_service_stub.call_rpc :get_game_server_config, request, options: options do |response, operation|
@@ -396,7 +388,9 @@ module Google
396
388
  options.apply_defaults timeout: @config.rpcs.create_game_server_config.timeout,
397
389
  metadata: metadata,
398
390
  retry_policy: @config.rpcs.create_game_server_config.retry_policy
399
- options.apply_defaults metadata: @config.metadata,
391
+
392
+ options.apply_defaults timeout: @config.timeout,
393
+ metadata: @config.metadata,
400
394
  retry_policy: @config.retry_policy
401
395
 
402
396
  @game_server_configs_service_stub.call_rpc :create_game_server_config, request, options: options do |response, operation|
@@ -466,7 +460,9 @@ module Google
466
460
  options.apply_defaults timeout: @config.rpcs.delete_game_server_config.timeout,
467
461
  metadata: metadata,
468
462
  retry_policy: @config.rpcs.delete_game_server_config.retry_policy
469
- options.apply_defaults metadata: @config.metadata,
463
+
464
+ options.apply_defaults timeout: @config.timeout,
465
+ metadata: @config.metadata,
470
466
  retry_policy: @config.retry_policy
471
467
 
472
468
  @game_server_configs_service_stub.call_rpc :delete_game_server_config, request, options: options do |response, operation|
@@ -491,22 +487,21 @@ module Google
491
487
  # Configuration can be applied globally to all clients, or to a single client
492
488
  # on construction.
493
489
  #
494
- # # Examples
495
- #
496
- # To modify the global config, setting the timeout for list_game_server_configs
497
- # to 20 seconds, and all remaining timeouts to 10 seconds:
498
- #
499
- # ::Google::Cloud::Gaming::V1::GameServerConfigsService::Client.configure do |config|
500
- # config.timeout = 10.0
501
- # config.rpcs.list_game_server_configs.timeout = 20.0
502
- # end
490
+ # @example
503
491
  #
504
- # To apply the above configuration only to a new client:
492
+ # # Modify the global config, setting the timeout for
493
+ # # list_game_server_configs to 20 seconds,
494
+ # # and all remaining timeouts to 10 seconds.
495
+ # ::Google::Cloud::Gaming::V1::GameServerConfigsService::Client.configure do |config|
496
+ # config.timeout = 10.0
497
+ # config.rpcs.list_game_server_configs.timeout = 20.0
498
+ # end
505
499
  #
506
- # client = ::Google::Cloud::Gaming::V1::GameServerConfigsService::Client.new do |config|
507
- # config.timeout = 10.0
508
- # config.rpcs.list_game_server_configs.timeout = 20.0
509
- # end
500
+ # # Apply the above configuration only to a new client.
501
+ # client = ::Google::Cloud::Gaming::V1::GameServerConfigsService::Client.new do |config|
502
+ # config.timeout = 10.0
503
+ # config.rpcs.list_game_server_configs.timeout = 20.0
504
+ # end
510
505
  #
511
506
  # @!attribute [rw] endpoint
512
507
  # The hostname or hostname:port of the service endpoint.
@@ -570,7 +565,7 @@ module Google
570
565
  config_attr :scope, nil, ::String, ::Array, nil
571
566
  config_attr :lib_name, nil, ::String, nil
572
567
  config_attr :lib_version, nil, ::String, nil
573
- config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
568
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
574
569
  config_attr :interceptors, nil, ::Array, nil
575
570
  config_attr :timeout, nil, ::Numeric, nil
576
571
  config_attr :metadata, nil, ::Hash, nil
@@ -591,7 +586,7 @@ module Google
591
586
  def rpcs
592
587
  @rpcs ||= begin
593
588
  parent_rpcs = nil
594
- parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
589
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
595
590
  Rpcs.new parent_rpcs
596
591
  end
597
592
  end
@@ -637,13 +632,13 @@ module Google
637
632
 
638
633
  # @private
639
634
  def initialize parent_rpcs = nil
640
- list_game_server_configs_config = parent_rpcs&.list_game_server_configs if parent_rpcs&.respond_to? :list_game_server_configs
635
+ list_game_server_configs_config = parent_rpcs.list_game_server_configs if parent_rpcs.respond_to? :list_game_server_configs
641
636
  @list_game_server_configs = ::Gapic::Config::Method.new list_game_server_configs_config
642
- get_game_server_config_config = parent_rpcs&.get_game_server_config if parent_rpcs&.respond_to? :get_game_server_config
637
+ get_game_server_config_config = parent_rpcs.get_game_server_config if parent_rpcs.respond_to? :get_game_server_config
643
638
  @get_game_server_config = ::Gapic::Config::Method.new get_game_server_config_config
644
- create_game_server_config_config = parent_rpcs&.create_game_server_config if parent_rpcs&.respond_to? :create_game_server_config
639
+ create_game_server_config_config = parent_rpcs.create_game_server_config if parent_rpcs.respond_to? :create_game_server_config
645
640
  @create_game_server_config = ::Gapic::Config::Method.new create_game_server_config_config
646
- delete_game_server_config_config = parent_rpcs&.delete_game_server_config if parent_rpcs&.respond_to? :delete_game_server_config
641
+ delete_game_server_config_config = parent_rpcs.delete_game_server_config if parent_rpcs.respond_to? :delete_game_server_config
647
642
  @delete_game_server_config = ::Gapic::Config::Method.new delete_game_server_config_config
648
643
 
649
644
  yield self if block_given?