google-cloud-notebooks-v1beta1 0.3.0 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -41,13 +41,12 @@ module Google
41
41
  # See {::Google::Cloud::Notebooks::V1beta1::NotebookService::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 NotebookService clients:
47
- #
48
- # ::Google::Cloud::Notebooks::V1beta1::NotebookService::Client.configure do |config|
49
- # config.timeout = 10.0
50
- # end
46
+ # # Modify the configuration for all NotebookService clients
47
+ # ::Google::Cloud::Notebooks::V1beta1::NotebookService::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,17 +59,14 @@ 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.timeout = 60.0
69
68
  default_config.retry_policy = {
70
- initial_delay: 0.1,
71
- max_delay: 60.0,
72
- multiplier: 1.3,
73
- retry_codes: [14]
69
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
74
70
  }
75
71
 
76
72
  default_config.rpcs.list_instances.timeout = 60.0
@@ -140,19 +136,15 @@ module Google
140
136
  ##
141
137
  # Create a new NotebookService client object.
142
138
  #
143
- # ## Examples
144
- #
145
- # To create a new NotebookService client with the default
146
- # configuration:
139
+ # @example
147
140
  #
148
- # client = ::Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new
141
+ # # Create a client using the default configuration
142
+ # client = ::Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new
149
143
  #
150
- # To create a new NotebookService client with a custom
151
- # configuration:
152
- #
153
- # client = ::Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new do |config|
154
- # config.timeout = 10.0
155
- # end
144
+ # # Create a client using a custom configuration
145
+ # client = ::Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new do |config|
146
+ # config.timeout = 10.0
147
+ # end
156
148
  #
157
149
  # @yield [config] Configure the NotebookService client.
158
150
  # @yieldparam config [Client::Configuration]
@@ -172,14 +164,13 @@ module Google
172
164
 
173
165
  # Create credentials
174
166
  credentials = @config.credentials
175
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
167
+ # Use self-signed JWT if the endpoint is unchanged from default,
176
168
  # but only if the default endpoint does not have a region prefix.
177
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
178
- @config.endpoint == Client.configure.endpoint &&
169
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
179
170
  !@config.endpoint.split(".").first.include?("-")
180
- credentials ||= Credentials.default scope: @config.scope,
171
+ credentials ||= Credentials.default scope: @config.scope,
181
172
  enable_self_signed_jwt: enable_self_signed_jwt
182
- if credentials.is_a?(String) || credentials.is_a?(Hash)
173
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
183
174
  credentials = Credentials.new credentials, scope: @config.scope
184
175
  end
185
176
  @quota_project_id = @config.quota_project
@@ -269,7 +260,9 @@ module Google
269
260
  options.apply_defaults timeout: @config.rpcs.list_instances.timeout,
270
261
  metadata: metadata,
271
262
  retry_policy: @config.rpcs.list_instances.retry_policy
272
- options.apply_defaults metadata: @config.metadata,
263
+
264
+ options.apply_defaults timeout: @config.timeout,
265
+ metadata: @config.metadata,
273
266
  retry_policy: @config.retry_policy
274
267
 
275
268
  @notebook_service_stub.call_rpc :list_instances, request, options: options do |response, operation|
@@ -337,7 +330,9 @@ module Google
337
330
  options.apply_defaults timeout: @config.rpcs.get_instance.timeout,
338
331
  metadata: metadata,
339
332
  retry_policy: @config.rpcs.get_instance.retry_policy
340
- options.apply_defaults metadata: @config.metadata,
333
+
334
+ options.apply_defaults timeout: @config.timeout,
335
+ metadata: @config.metadata,
341
336
  retry_policy: @config.retry_policy
342
337
 
343
338
  @notebook_service_stub.call_rpc :get_instance, request, options: options do |response, operation|
@@ -408,7 +403,9 @@ module Google
408
403
  options.apply_defaults timeout: @config.rpcs.create_instance.timeout,
409
404
  metadata: metadata,
410
405
  retry_policy: @config.rpcs.create_instance.retry_policy
411
- options.apply_defaults metadata: @config.metadata,
406
+
407
+ options.apply_defaults timeout: @config.timeout,
408
+ metadata: @config.metadata,
412
409
  retry_policy: @config.retry_policy
413
410
 
414
411
  @notebook_service_stub.call_rpc :create_instance, request, options: options do |response, operation|
@@ -484,7 +481,9 @@ module Google
484
481
  options.apply_defaults timeout: @config.rpcs.register_instance.timeout,
485
482
  metadata: metadata,
486
483
  retry_policy: @config.rpcs.register_instance.retry_policy
487
- options.apply_defaults metadata: @config.metadata,
484
+
485
+ options.apply_defaults timeout: @config.timeout,
486
+ metadata: @config.metadata,
488
487
  retry_policy: @config.retry_policy
489
488
 
490
489
  @notebook_service_stub.call_rpc :register_instance, request, options: options do |response, operation|
@@ -520,10 +519,10 @@ module Google
520
519
  # @param type [::Google::Cloud::Notebooks::V1beta1::Instance::AcceleratorType]
521
520
  # Required. Type of this accelerator.
522
521
  # @param core_count [::Integer]
523
- # Required. Count of cores of this accelerator. Note that not all combinations
524
- # of `type` and `core_count` are valid. Check [GPUs on
525
- # Compute Engine](https://cloud.google.com/compute/docs/gpus/#gpus-list) to
526
- # find a valid combination. TPUs are not supported.
522
+ # Required. Count of cores of this accelerator. Note that not all
523
+ # combinations of `type` and `core_count` are valid. Check [GPUs on Compute
524
+ # Engine](https://cloud.google.com/compute/docs/gpus/#gpus-list) to find a
525
+ # valid combination. TPUs are not supported.
527
526
  #
528
527
  # @yield [response, operation] Access the result along with the RPC operation
529
528
  # @yieldparam response [::Gapic::Operation]
@@ -559,7 +558,9 @@ module Google
559
558
  options.apply_defaults timeout: @config.rpcs.set_instance_accelerator.timeout,
560
559
  metadata: metadata,
561
560
  retry_policy: @config.rpcs.set_instance_accelerator.retry_policy
562
- options.apply_defaults metadata: @config.metadata,
561
+
562
+ options.apply_defaults timeout: @config.timeout,
563
+ metadata: @config.metadata,
563
564
  retry_policy: @config.retry_policy
564
565
 
565
566
  @notebook_service_stub.call_rpc :set_instance_accelerator, request, options: options do |response, operation|
@@ -630,7 +631,9 @@ module Google
630
631
  options.apply_defaults timeout: @config.rpcs.set_instance_machine_type.timeout,
631
632
  metadata: metadata,
632
633
  retry_policy: @config.rpcs.set_instance_machine_type.retry_policy
633
- options.apply_defaults metadata: @config.metadata,
634
+
635
+ options.apply_defaults timeout: @config.timeout,
636
+ metadata: @config.metadata,
634
637
  retry_policy: @config.retry_policy
635
638
 
636
639
  @notebook_service_stub.call_rpc :set_instance_machine_type, request, options: options do |response, operation|
@@ -701,7 +704,9 @@ module Google
701
704
  options.apply_defaults timeout: @config.rpcs.set_instance_labels.timeout,
702
705
  metadata: metadata,
703
706
  retry_policy: @config.rpcs.set_instance_labels.retry_policy
704
- options.apply_defaults metadata: @config.metadata,
707
+
708
+ options.apply_defaults timeout: @config.timeout,
709
+ metadata: @config.metadata,
705
710
  retry_policy: @config.retry_policy
706
711
 
707
712
  @notebook_service_stub.call_rpc :set_instance_labels, request, options: options do |response, operation|
@@ -769,7 +774,9 @@ module Google
769
774
  options.apply_defaults timeout: @config.rpcs.delete_instance.timeout,
770
775
  metadata: metadata,
771
776
  retry_policy: @config.rpcs.delete_instance.retry_policy
772
- options.apply_defaults metadata: @config.metadata,
777
+
778
+ options.apply_defaults timeout: @config.timeout,
779
+ metadata: @config.metadata,
773
780
  retry_policy: @config.retry_policy
774
781
 
775
782
  @notebook_service_stub.call_rpc :delete_instance, request, options: options do |response, operation|
@@ -837,7 +844,9 @@ module Google
837
844
  options.apply_defaults timeout: @config.rpcs.start_instance.timeout,
838
845
  metadata: metadata,
839
846
  retry_policy: @config.rpcs.start_instance.retry_policy
840
- options.apply_defaults metadata: @config.metadata,
847
+
848
+ options.apply_defaults timeout: @config.timeout,
849
+ metadata: @config.metadata,
841
850
  retry_policy: @config.retry_policy
842
851
 
843
852
  @notebook_service_stub.call_rpc :start_instance, request, options: options do |response, operation|
@@ -905,7 +914,9 @@ module Google
905
914
  options.apply_defaults timeout: @config.rpcs.stop_instance.timeout,
906
915
  metadata: metadata,
907
916
  retry_policy: @config.rpcs.stop_instance.retry_policy
908
- options.apply_defaults metadata: @config.metadata,
917
+
918
+ options.apply_defaults timeout: @config.timeout,
919
+ metadata: @config.metadata,
909
920
  retry_policy: @config.retry_policy
910
921
 
911
922
  @notebook_service_stub.call_rpc :stop_instance, request, options: options do |response, operation|
@@ -973,7 +984,9 @@ module Google
973
984
  options.apply_defaults timeout: @config.rpcs.reset_instance.timeout,
974
985
  metadata: metadata,
975
986
  retry_policy: @config.rpcs.reset_instance.retry_policy
976
- options.apply_defaults metadata: @config.metadata,
987
+
988
+ options.apply_defaults timeout: @config.timeout,
989
+ metadata: @config.metadata,
977
990
  retry_policy: @config.retry_policy
978
991
 
979
992
  @notebook_service_stub.call_rpc :reset_instance, request, options: options do |response, operation|
@@ -1050,7 +1063,9 @@ module Google
1050
1063
  options.apply_defaults timeout: @config.rpcs.report_instance_info.timeout,
1051
1064
  metadata: metadata,
1052
1065
  retry_policy: @config.rpcs.report_instance_info.retry_policy
1053
- options.apply_defaults metadata: @config.metadata,
1066
+
1067
+ options.apply_defaults timeout: @config.timeout,
1068
+ metadata: @config.metadata,
1054
1069
  retry_policy: @config.retry_policy
1055
1070
 
1056
1071
  @notebook_service_stub.call_rpc :report_instance_info, request, options: options do |response, operation|
@@ -1118,7 +1133,9 @@ module Google
1118
1133
  options.apply_defaults timeout: @config.rpcs.is_instance_upgradeable.timeout,
1119
1134
  metadata: metadata,
1120
1135
  retry_policy: @config.rpcs.is_instance_upgradeable.retry_policy
1121
- options.apply_defaults metadata: @config.metadata,
1136
+
1137
+ options.apply_defaults timeout: @config.timeout,
1138
+ metadata: @config.metadata,
1122
1139
  retry_policy: @config.retry_policy
1123
1140
 
1124
1141
  @notebook_service_stub.call_rpc :is_instance_upgradeable, request, options: options do |response, operation|
@@ -1185,7 +1202,9 @@ module Google
1185
1202
  options.apply_defaults timeout: @config.rpcs.upgrade_instance.timeout,
1186
1203
  metadata: metadata,
1187
1204
  retry_policy: @config.rpcs.upgrade_instance.retry_policy
1188
- options.apply_defaults metadata: @config.metadata,
1205
+
1206
+ options.apply_defaults timeout: @config.timeout,
1207
+ metadata: @config.metadata,
1189
1208
  retry_policy: @config.retry_policy
1190
1209
 
1191
1210
  @notebook_service_stub.call_rpc :upgrade_instance, request, options: options do |response, operation|
@@ -1257,7 +1276,9 @@ module Google
1257
1276
  options.apply_defaults timeout: @config.rpcs.upgrade_instance_internal.timeout,
1258
1277
  metadata: metadata,
1259
1278
  retry_policy: @config.rpcs.upgrade_instance_internal.retry_policy
1260
- options.apply_defaults metadata: @config.metadata,
1279
+
1280
+ options.apply_defaults timeout: @config.timeout,
1281
+ metadata: @config.metadata,
1261
1282
  retry_policy: @config.retry_policy
1262
1283
 
1263
1284
  @notebook_service_stub.call_rpc :upgrade_instance_internal, request, options: options do |response, operation|
@@ -1329,7 +1350,9 @@ module Google
1329
1350
  options.apply_defaults timeout: @config.rpcs.list_environments.timeout,
1330
1351
  metadata: metadata,
1331
1352
  retry_policy: @config.rpcs.list_environments.retry_policy
1332
- options.apply_defaults metadata: @config.metadata,
1353
+
1354
+ options.apply_defaults timeout: @config.timeout,
1355
+ metadata: @config.metadata,
1333
1356
  retry_policy: @config.retry_policy
1334
1357
 
1335
1358
  @notebook_service_stub.call_rpc :list_environments, request, options: options do |response, operation|
@@ -1397,7 +1420,9 @@ module Google
1397
1420
  options.apply_defaults timeout: @config.rpcs.get_environment.timeout,
1398
1421
  metadata: metadata,
1399
1422
  retry_policy: @config.rpcs.get_environment.retry_policy
1400
- options.apply_defaults metadata: @config.metadata,
1423
+
1424
+ options.apply_defaults timeout: @config.timeout,
1425
+ metadata: @config.metadata,
1401
1426
  retry_policy: @config.retry_policy
1402
1427
 
1403
1428
  @notebook_service_stub.call_rpc :get_environment, request, options: options do |response, operation|
@@ -1429,10 +1454,10 @@ module Google
1429
1454
  # @param parent [::String]
1430
1455
  # Required. Format: `projects/{project_id}/locations/{location}`
1431
1456
  # @param environment_id [::String]
1432
- # Required. User-defined unique ID of this environment. The `environment_id` must
1433
- # be 1 to 63 characters long and contain only lowercase letters,
1434
- # numeric characters, and dashes. The first character must be a lowercase
1435
- # letter and the last character cannot be a dash.
1457
+ # Required. User-defined unique ID of this environment. The `environment_id`
1458
+ # must be 1 to 63 characters long and contain only lowercase letters, numeric
1459
+ # characters, and dashes. The first character must be a lowercase letter and
1460
+ # the last character cannot be a dash.
1436
1461
  # @param environment [::Google::Cloud::Notebooks::V1beta1::Environment, ::Hash]
1437
1462
  # Required. The environment to be created.
1438
1463
  #
@@ -1470,7 +1495,9 @@ module Google
1470
1495
  options.apply_defaults timeout: @config.rpcs.create_environment.timeout,
1471
1496
  metadata: metadata,
1472
1497
  retry_policy: @config.rpcs.create_environment.retry_policy
1473
- options.apply_defaults metadata: @config.metadata,
1498
+
1499
+ options.apply_defaults timeout: @config.timeout,
1500
+ metadata: @config.metadata,
1474
1501
  retry_policy: @config.retry_policy
1475
1502
 
1476
1503
  @notebook_service_stub.call_rpc :create_environment, request, options: options do |response, operation|
@@ -1538,7 +1565,9 @@ module Google
1538
1565
  options.apply_defaults timeout: @config.rpcs.delete_environment.timeout,
1539
1566
  metadata: metadata,
1540
1567
  retry_policy: @config.rpcs.delete_environment.retry_policy
1541
- options.apply_defaults metadata: @config.metadata,
1568
+
1569
+ options.apply_defaults timeout: @config.timeout,
1570
+ metadata: @config.metadata,
1542
1571
  retry_policy: @config.retry_policy
1543
1572
 
1544
1573
  @notebook_service_stub.call_rpc :delete_environment, request, options: options do |response, operation|
@@ -1563,22 +1592,21 @@ module Google
1563
1592
  # Configuration can be applied globally to all clients, or to a single client
1564
1593
  # on construction.
1565
1594
  #
1566
- # # Examples
1567
- #
1568
- # To modify the global config, setting the timeout for list_instances
1569
- # to 20 seconds, and all remaining timeouts to 10 seconds:
1570
- #
1571
- # ::Google::Cloud::Notebooks::V1beta1::NotebookService::Client.configure do |config|
1572
- # config.timeout = 10.0
1573
- # config.rpcs.list_instances.timeout = 20.0
1574
- # end
1595
+ # @example
1575
1596
  #
1576
- # To apply the above configuration only to a new client:
1597
+ # # Modify the global config, setting the timeout for
1598
+ # # list_instances to 20 seconds,
1599
+ # # and all remaining timeouts to 10 seconds.
1600
+ # ::Google::Cloud::Notebooks::V1beta1::NotebookService::Client.configure do |config|
1601
+ # config.timeout = 10.0
1602
+ # config.rpcs.list_instances.timeout = 20.0
1603
+ # end
1577
1604
  #
1578
- # client = ::Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new do |config|
1579
- # config.timeout = 10.0
1580
- # config.rpcs.list_instances.timeout = 20.0
1581
- # end
1605
+ # # Apply the above configuration only to a new client.
1606
+ # client = ::Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new do |config|
1607
+ # config.timeout = 10.0
1608
+ # config.rpcs.list_instances.timeout = 20.0
1609
+ # end
1582
1610
  #
1583
1611
  # @!attribute [rw] endpoint
1584
1612
  # The hostname or hostname:port of the service endpoint.
@@ -1642,7 +1670,7 @@ module Google
1642
1670
  config_attr :scope, nil, ::String, ::Array, nil
1643
1671
  config_attr :lib_name, nil, ::String, nil
1644
1672
  config_attr :lib_version, nil, ::String, nil
1645
- config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
1673
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
1646
1674
  config_attr :interceptors, nil, ::Array, nil
1647
1675
  config_attr :timeout, nil, ::Numeric, nil
1648
1676
  config_attr :metadata, nil, ::Hash, nil
@@ -1663,7 +1691,7 @@ module Google
1663
1691
  def rpcs
1664
1692
  @rpcs ||= begin
1665
1693
  parent_rpcs = nil
1666
- parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
1694
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1667
1695
  Rpcs.new parent_rpcs
1668
1696
  end
1669
1697
  end
@@ -1784,43 +1812,43 @@ module Google
1784
1812
 
1785
1813
  # @private
1786
1814
  def initialize parent_rpcs = nil
1787
- list_instances_config = parent_rpcs&.list_instances if parent_rpcs&.respond_to? :list_instances
1815
+ list_instances_config = parent_rpcs.list_instances if parent_rpcs.respond_to? :list_instances
1788
1816
  @list_instances = ::Gapic::Config::Method.new list_instances_config
1789
- get_instance_config = parent_rpcs&.get_instance if parent_rpcs&.respond_to? :get_instance
1817
+ get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance
1790
1818
  @get_instance = ::Gapic::Config::Method.new get_instance_config
1791
- create_instance_config = parent_rpcs&.create_instance if parent_rpcs&.respond_to? :create_instance
1819
+ create_instance_config = parent_rpcs.create_instance if parent_rpcs.respond_to? :create_instance
1792
1820
  @create_instance = ::Gapic::Config::Method.new create_instance_config
1793
- register_instance_config = parent_rpcs&.register_instance if parent_rpcs&.respond_to? :register_instance
1821
+ register_instance_config = parent_rpcs.register_instance if parent_rpcs.respond_to? :register_instance
1794
1822
  @register_instance = ::Gapic::Config::Method.new register_instance_config
1795
- set_instance_accelerator_config = parent_rpcs&.set_instance_accelerator if parent_rpcs&.respond_to? :set_instance_accelerator
1823
+ set_instance_accelerator_config = parent_rpcs.set_instance_accelerator if parent_rpcs.respond_to? :set_instance_accelerator
1796
1824
  @set_instance_accelerator = ::Gapic::Config::Method.new set_instance_accelerator_config
1797
- set_instance_machine_type_config = parent_rpcs&.set_instance_machine_type if parent_rpcs&.respond_to? :set_instance_machine_type
1825
+ set_instance_machine_type_config = parent_rpcs.set_instance_machine_type if parent_rpcs.respond_to? :set_instance_machine_type
1798
1826
  @set_instance_machine_type = ::Gapic::Config::Method.new set_instance_machine_type_config
1799
- set_instance_labels_config = parent_rpcs&.set_instance_labels if parent_rpcs&.respond_to? :set_instance_labels
1827
+ set_instance_labels_config = parent_rpcs.set_instance_labels if parent_rpcs.respond_to? :set_instance_labels
1800
1828
  @set_instance_labels = ::Gapic::Config::Method.new set_instance_labels_config
1801
- delete_instance_config = parent_rpcs&.delete_instance if parent_rpcs&.respond_to? :delete_instance
1829
+ delete_instance_config = parent_rpcs.delete_instance if parent_rpcs.respond_to? :delete_instance
1802
1830
  @delete_instance = ::Gapic::Config::Method.new delete_instance_config
1803
- start_instance_config = parent_rpcs&.start_instance if parent_rpcs&.respond_to? :start_instance
1831
+ start_instance_config = parent_rpcs.start_instance if parent_rpcs.respond_to? :start_instance
1804
1832
  @start_instance = ::Gapic::Config::Method.new start_instance_config
1805
- stop_instance_config = parent_rpcs&.stop_instance if parent_rpcs&.respond_to? :stop_instance
1833
+ stop_instance_config = parent_rpcs.stop_instance if parent_rpcs.respond_to? :stop_instance
1806
1834
  @stop_instance = ::Gapic::Config::Method.new stop_instance_config
1807
- reset_instance_config = parent_rpcs&.reset_instance if parent_rpcs&.respond_to? :reset_instance
1835
+ reset_instance_config = parent_rpcs.reset_instance if parent_rpcs.respond_to? :reset_instance
1808
1836
  @reset_instance = ::Gapic::Config::Method.new reset_instance_config
1809
- report_instance_info_config = parent_rpcs&.report_instance_info if parent_rpcs&.respond_to? :report_instance_info
1837
+ report_instance_info_config = parent_rpcs.report_instance_info if parent_rpcs.respond_to? :report_instance_info
1810
1838
  @report_instance_info = ::Gapic::Config::Method.new report_instance_info_config
1811
- is_instance_upgradeable_config = parent_rpcs&.is_instance_upgradeable if parent_rpcs&.respond_to? :is_instance_upgradeable
1839
+ is_instance_upgradeable_config = parent_rpcs.is_instance_upgradeable if parent_rpcs.respond_to? :is_instance_upgradeable
1812
1840
  @is_instance_upgradeable = ::Gapic::Config::Method.new is_instance_upgradeable_config
1813
- upgrade_instance_config = parent_rpcs&.upgrade_instance if parent_rpcs&.respond_to? :upgrade_instance
1841
+ upgrade_instance_config = parent_rpcs.upgrade_instance if parent_rpcs.respond_to? :upgrade_instance
1814
1842
  @upgrade_instance = ::Gapic::Config::Method.new upgrade_instance_config
1815
- upgrade_instance_internal_config = parent_rpcs&.upgrade_instance_internal if parent_rpcs&.respond_to? :upgrade_instance_internal
1843
+ upgrade_instance_internal_config = parent_rpcs.upgrade_instance_internal if parent_rpcs.respond_to? :upgrade_instance_internal
1816
1844
  @upgrade_instance_internal = ::Gapic::Config::Method.new upgrade_instance_internal_config
1817
- list_environments_config = parent_rpcs&.list_environments if parent_rpcs&.respond_to? :list_environments
1845
+ list_environments_config = parent_rpcs.list_environments if parent_rpcs.respond_to? :list_environments
1818
1846
  @list_environments = ::Gapic::Config::Method.new list_environments_config
1819
- get_environment_config = parent_rpcs&.get_environment if parent_rpcs&.respond_to? :get_environment
1847
+ get_environment_config = parent_rpcs.get_environment if parent_rpcs.respond_to? :get_environment
1820
1848
  @get_environment = ::Gapic::Config::Method.new get_environment_config
1821
- create_environment_config = parent_rpcs&.create_environment if parent_rpcs&.respond_to? :create_environment
1849
+ create_environment_config = parent_rpcs.create_environment if parent_rpcs.respond_to? :create_environment
1822
1850
  @create_environment = ::Gapic::Config::Method.new create_environment_config
1823
- delete_environment_config = parent_rpcs&.delete_environment if parent_rpcs&.respond_to? :delete_environment
1851
+ delete_environment_config = parent_rpcs.delete_environment if parent_rpcs.respond_to? :delete_environment
1824
1852
  @delete_environment = ::Gapic::Config::Method.new delete_environment_config
1825
1853
 
1826
1854
  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?