google-cloud-bigtable-admin-v2 0.2.0 → 0.5.1

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.
@@ -30,7 +30,7 @@ module Google
30
30
  # tables' metadata or data stored in those tables.
31
31
  class Service
32
32
 
33
- include GRPC::GenericService
33
+ include ::GRPC::GenericService
34
34
 
35
35
  self.marshal_class_method = :encode
36
36
  self.unmarshal_class_method = :decode
@@ -32,7 +32,7 @@ module Google
32
32
  # the tables.
33
33
  class Service
34
34
 
35
- include GRPC::GenericService
35
+ include ::GRPC::GenericService
36
36
 
37
37
  self.marshal_class_method = :encode
38
38
  self.unmarshal_class_method = :decode
@@ -127,7 +127,7 @@ module Google
127
127
  # backups.
128
128
  rpc :ListBackups, ::Google::Cloud::Bigtable::Admin::V2::ListBackupsRequest, ::Google::Cloud::Bigtable::Admin::V2::ListBackupsResponse
129
129
  # Create a new table by restoring from a completed backup. The new table
130
- # must be in the same instance as the instance containing the backup. The
130
+ # must be in the same project as the instance containing the backup. The
131
131
  # returned table [long-running operation][google.longrunning.Operation] can
132
132
  # be used to track the progress of the operation, and to cancel it. The
133
133
  # [metadata][google.longrunning.Operation.metadata] field type is
@@ -31,6 +31,10 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
31
31
  optional :state, :enum, 3, "google.bigtable.admin.v2.Cluster.State"
32
32
  optional :serve_nodes, :int32, 4
33
33
  optional :default_storage_type, :enum, 5, "google.bigtable.admin.v2.StorageType"
34
+ optional :encryption_config, :message, 6, "google.bigtable.admin.v2.Cluster.EncryptionConfig"
35
+ end
36
+ add_message "google.bigtable.admin.v2.Cluster.EncryptionConfig" do
37
+ optional :kms_key_name, :string, 1
34
38
  end
35
39
  add_enum "google.bigtable.admin.v2.Cluster.State" do
36
40
  value :STATE_NOT_KNOWN, 0
@@ -66,6 +70,7 @@ module Google
66
70
  Instance::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.Instance.State").enummodule
67
71
  Instance::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.Instance.Type").enummodule
68
72
  Cluster = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.Cluster").msgclass
73
+ Cluster::EncryptionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.Cluster.EncryptionConfig").msgclass
69
74
  Cluster::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.Cluster.State").enummodule
70
75
  AppProfile = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.AppProfile").msgclass
71
76
  AppProfile::MultiClusterRoutingUseAny = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny").msgclass
@@ -7,6 +7,7 @@ require 'google/api/field_behavior_pb'
7
7
  require 'google/api/resource_pb'
8
8
  require 'google/protobuf/duration_pb'
9
9
  require 'google/protobuf/timestamp_pb'
10
+ require 'google/rpc/status_pb'
10
11
  Google::Protobuf::DescriptorPool.generated_pool.build do
11
12
  add_file("google/bigtable/admin/v2/table.proto", :syntax => :proto3) do
12
13
  add_message "google.bigtable.admin.v2.RestoreInfo" do
@@ -24,6 +25,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
24
25
  end
25
26
  add_message "google.bigtable.admin.v2.Table.ClusterState" do
26
27
  optional :replication_state, :enum, 1, "google.bigtable.admin.v2.Table.ClusterState.ReplicationState"
28
+ repeated :encryption_info, :message, 2, "google.bigtable.admin.v2.EncryptionInfo"
27
29
  end
28
30
  add_enum "google.bigtable.admin.v2.Table.ClusterState.ReplicationState" do
29
31
  value :STATE_NOT_KNOWN, 0
@@ -42,6 +44,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
42
44
  value :NAME_ONLY, 1
43
45
  value :SCHEMA_VIEW, 2
44
46
  value :REPLICATION_VIEW, 3
47
+ value :ENCRYPTION_VIEW, 5
45
48
  value :FULL, 4
46
49
  end
47
50
  add_message "google.bigtable.admin.v2.ColumnFamily" do
@@ -61,6 +64,16 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
61
64
  add_message "google.bigtable.admin.v2.GcRule.Union" do
62
65
  repeated :rules, :message, 1, "google.bigtable.admin.v2.GcRule"
63
66
  end
67
+ add_message "google.bigtable.admin.v2.EncryptionInfo" do
68
+ optional :encryption_type, :enum, 3, "google.bigtable.admin.v2.EncryptionInfo.EncryptionType"
69
+ optional :encryption_status, :message, 4, "google.rpc.Status"
70
+ optional :kms_key_version, :string, 2
71
+ end
72
+ add_enum "google.bigtable.admin.v2.EncryptionInfo.EncryptionType" do
73
+ value :ENCRYPTION_TYPE_UNSPECIFIED, 0
74
+ value :GOOGLE_DEFAULT_ENCRYPTION, 1
75
+ value :CUSTOMER_MANAGED_ENCRYPTION, 2
76
+ end
64
77
  add_message "google.bigtable.admin.v2.Snapshot" do
65
78
  optional :name, :string, 1
66
79
  optional :source_table, :message, 2, "google.bigtable.admin.v2.Table"
@@ -83,6 +96,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
83
96
  optional :end_time, :message, 5, "google.protobuf.Timestamp"
84
97
  optional :size_bytes, :int64, 6
85
98
  optional :state, :enum, 7, "google.bigtable.admin.v2.Backup.State"
99
+ optional :encryption_info, :message, 9, "google.bigtable.admin.v2.EncryptionInfo"
86
100
  end
87
101
  add_enum "google.bigtable.admin.v2.Backup.State" do
88
102
  value :STATE_UNSPECIFIED, 0
@@ -117,6 +131,8 @@ module Google
117
131
  GcRule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.GcRule").msgclass
118
132
  GcRule::Intersection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.GcRule.Intersection").msgclass
119
133
  GcRule::Union = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.GcRule.Union").msgclass
134
+ EncryptionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.EncryptionInfo").msgclass
135
+ EncryptionInfo::EncryptionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.EncryptionInfo.EncryptionType").enummodule
120
136
  Snapshot = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.Snapshot").msgclass
121
137
  Snapshot::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.Snapshot.State").enummodule
122
138
  Backup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.Backup").msgclass
@@ -36,3 +36,6 @@ module Google
36
36
  end
37
37
  end
38
38
  end
39
+
40
+ helper_path = ::File.join __dir__, "v2", "_helpers.rb"
41
+ require "google/cloud/bigtable/admin/v2/_helpers" if ::File.file? helper_path
@@ -63,7 +63,7 @@ module Google
63
63
  parent_config = while namespace.any?
64
64
  parent_name = namespace.join "::"
65
65
  parent_const = const_get parent_name
66
- break parent_const.configure if parent_const&.respond_to? :configure
66
+ break parent_const.configure if parent_const.respond_to? :configure
67
67
  namespace.pop
68
68
  end
69
69
  default_config = Client::Configuration.new parent_config
@@ -73,33 +73,33 @@ module Google
73
73
  default_config.rpcs.get_instance.timeout = 60.0
74
74
  default_config.rpcs.get_instance.retry_policy = {
75
75
  initial_delay: 1.0,
76
- max_delay: 60.0,
77
- multiplier: 2,
78
- retry_codes: [14, 4]
76
+ max_delay: 60.0,
77
+ multiplier: 2,
78
+ retry_codes: [14, 4]
79
79
  }
80
80
 
81
81
  default_config.rpcs.list_instances.timeout = 60.0
82
82
  default_config.rpcs.list_instances.retry_policy = {
83
83
  initial_delay: 1.0,
84
- max_delay: 60.0,
85
- multiplier: 2,
86
- retry_codes: [14, 4]
84
+ max_delay: 60.0,
85
+ multiplier: 2,
86
+ retry_codes: [14, 4]
87
87
  }
88
88
 
89
89
  default_config.rpcs.update_instance.timeout = 60.0
90
90
  default_config.rpcs.update_instance.retry_policy = {
91
91
  initial_delay: 1.0,
92
- max_delay: 60.0,
93
- multiplier: 2,
94
- retry_codes: [14, 4]
92
+ max_delay: 60.0,
93
+ multiplier: 2,
94
+ retry_codes: [14, 4]
95
95
  }
96
96
 
97
97
  default_config.rpcs.partial_update_instance.timeout = 60.0
98
98
  default_config.rpcs.partial_update_instance.retry_policy = {
99
99
  initial_delay: 1.0,
100
- max_delay: 60.0,
101
- multiplier: 2,
102
- retry_codes: [14, 4]
100
+ max_delay: 60.0,
101
+ multiplier: 2,
102
+ retry_codes: [14, 4]
103
103
  }
104
104
 
105
105
  default_config.rpcs.delete_instance.timeout = 60.0
@@ -109,25 +109,25 @@ module Google
109
109
  default_config.rpcs.get_cluster.timeout = 60.0
110
110
  default_config.rpcs.get_cluster.retry_policy = {
111
111
  initial_delay: 1.0,
112
- max_delay: 60.0,
113
- multiplier: 2,
114
- retry_codes: [14, 4]
112
+ max_delay: 60.0,
113
+ multiplier: 2,
114
+ retry_codes: [14, 4]
115
115
  }
116
116
 
117
117
  default_config.rpcs.list_clusters.timeout = 60.0
118
118
  default_config.rpcs.list_clusters.retry_policy = {
119
119
  initial_delay: 1.0,
120
- max_delay: 60.0,
121
- multiplier: 2,
122
- retry_codes: [14, 4]
120
+ max_delay: 60.0,
121
+ multiplier: 2,
122
+ retry_codes: [14, 4]
123
123
  }
124
124
 
125
125
  default_config.rpcs.update_cluster.timeout = 60.0
126
126
  default_config.rpcs.update_cluster.retry_policy = {
127
127
  initial_delay: 1.0,
128
- max_delay: 60.0,
129
- multiplier: 2,
130
- retry_codes: [14, 4]
128
+ max_delay: 60.0,
129
+ multiplier: 2,
130
+ retry_codes: [14, 4]
131
131
  }
132
132
 
133
133
  default_config.rpcs.delete_cluster.timeout = 60.0
@@ -137,25 +137,25 @@ module Google
137
137
  default_config.rpcs.get_app_profile.timeout = 60.0
138
138
  default_config.rpcs.get_app_profile.retry_policy = {
139
139
  initial_delay: 1.0,
140
- max_delay: 60.0,
141
- multiplier: 2,
142
- retry_codes: [14, 4]
140
+ max_delay: 60.0,
141
+ multiplier: 2,
142
+ retry_codes: [14, 4]
143
143
  }
144
144
 
145
145
  default_config.rpcs.list_app_profiles.timeout = 60.0
146
146
  default_config.rpcs.list_app_profiles.retry_policy = {
147
147
  initial_delay: 1.0,
148
- max_delay: 60.0,
149
- multiplier: 2,
150
- retry_codes: [14, 4]
148
+ max_delay: 60.0,
149
+ multiplier: 2,
150
+ retry_codes: [14, 4]
151
151
  }
152
152
 
153
153
  default_config.rpcs.update_app_profile.timeout = 60.0
154
154
  default_config.rpcs.update_app_profile.retry_policy = {
155
155
  initial_delay: 1.0,
156
- max_delay: 60.0,
157
- multiplier: 2,
158
- retry_codes: [14, 4]
156
+ max_delay: 60.0,
157
+ multiplier: 2,
158
+ retry_codes: [14, 4]
159
159
  }
160
160
 
161
161
  default_config.rpcs.delete_app_profile.timeout = 60.0
@@ -163,9 +163,9 @@ module Google
163
163
  default_config.rpcs.get_iam_policy.timeout = 60.0
164
164
  default_config.rpcs.get_iam_policy.retry_policy = {
165
165
  initial_delay: 1.0,
166
- max_delay: 60.0,
167
- multiplier: 2,
168
- retry_codes: [14, 4]
166
+ max_delay: 60.0,
167
+ multiplier: 2,
168
+ retry_codes: [14, 4]
169
169
  }
170
170
 
171
171
  default_config.rpcs.set_iam_policy.timeout = 60.0
@@ -173,9 +173,9 @@ module Google
173
173
  default_config.rpcs.test_iam_permissions.timeout = 60.0
174
174
  default_config.rpcs.test_iam_permissions.retry_policy = {
175
175
  initial_delay: 1.0,
176
- max_delay: 60.0,
177
- multiplier: 2,
178
- retry_codes: [14, 4]
176
+ max_delay: 60.0,
177
+ multiplier: 2,
178
+ retry_codes: [14, 4]
179
179
  }
180
180
 
181
181
  default_config
@@ -239,7 +239,13 @@ module Google
239
239
 
240
240
  # Create credentials
241
241
  credentials = @config.credentials
242
- credentials ||= Credentials.default scope: @config.scope
242
+ # Use self-signed JWT if the scope and endpoint are unchanged from default,
243
+ # but only if the default endpoint does not have a region prefix.
244
+ enable_self_signed_jwt = @config.scope == Client.configure.scope &&
245
+ @config.endpoint == Client.configure.endpoint &&
246
+ !@config.endpoint.split(".").first.include?("-")
247
+ credentials ||= Credentials.default scope: @config.scope,
248
+ enable_self_signed_jwt: enable_self_signed_jwt
243
249
  if credentials.is_a?(String) || credentials.is_a?(Hash)
244
250
  credentials = Credentials.new credentials, scope: @config.scope
245
251
  end
@@ -938,7 +944,7 @@ module Google
938
944
  # @param options [::Gapic::CallOptions, ::Hash]
939
945
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
940
946
  #
941
- # @overload update_cluster(location: nil, serve_nodes: nil, default_storage_type: nil)
947
+ # @overload update_cluster(location: nil, serve_nodes: nil, default_storage_type: nil, encryption_config: nil)
942
948
  # Pass arguments to `update_cluster` via keyword arguments. Note that at
943
949
  # least one keyword argument is required. To specify no parameters, or to keep all
944
950
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -956,6 +962,8 @@ module Google
956
962
  # (`CreationOnly`)
957
963
  # The type of storage used by this cluster to serve its
958
964
  # parent instance's tables, unless explicitly overridden.
965
+ # @param encryption_config [::Google::Cloud::Bigtable::Admin::V2::Cluster::EncryptionConfig, ::Hash]
966
+ # Immutable. The encryption configuration for CMEK-protected clusters.
959
967
  #
960
968
  # @yield [response, operation] Access the result along with the RPC operation
961
969
  # @yieldparam response [::Gapic::Operation]
@@ -1746,7 +1754,7 @@ module Google
1746
1754
  config_attr :scope, nil, ::String, ::Array, nil
1747
1755
  config_attr :lib_name, nil, ::String, nil
1748
1756
  config_attr :lib_version, nil, ::String, nil
1749
- config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
1757
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
1750
1758
  config_attr :interceptors, nil, ::Array, nil
1751
1759
  config_attr :timeout, nil, ::Numeric, nil
1752
1760
  config_attr :metadata, nil, ::Hash, nil
@@ -1767,7 +1775,7 @@ module Google
1767
1775
  def rpcs
1768
1776
  @rpcs ||= begin
1769
1777
  parent_rpcs = nil
1770
- parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
1778
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1771
1779
  Rpcs.new parent_rpcs
1772
1780
  end
1773
1781
  end
@@ -1779,7 +1787,7 @@ module Google
1779
1787
  # Each configuration object is of type `Gapic::Config::Method` and includes
1780
1788
  # the following configuration fields:
1781
1789
  #
1782
- # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
1790
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1783
1791
  # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
1784
1792
  # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1785
1793
  # include the following keys:
@@ -1888,43 +1896,43 @@ module Google
1888
1896
 
1889
1897
  # @private
1890
1898
  def initialize parent_rpcs = nil
1891
- create_instance_config = parent_rpcs&.create_instance if parent_rpcs&.respond_to? :create_instance
1899
+ create_instance_config = parent_rpcs.create_instance if parent_rpcs.respond_to? :create_instance
1892
1900
  @create_instance = ::Gapic::Config::Method.new create_instance_config
1893
- get_instance_config = parent_rpcs&.get_instance if parent_rpcs&.respond_to? :get_instance
1901
+ get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance
1894
1902
  @get_instance = ::Gapic::Config::Method.new get_instance_config
1895
- list_instances_config = parent_rpcs&.list_instances if parent_rpcs&.respond_to? :list_instances
1903
+ list_instances_config = parent_rpcs.list_instances if parent_rpcs.respond_to? :list_instances
1896
1904
  @list_instances = ::Gapic::Config::Method.new list_instances_config
1897
- update_instance_config = parent_rpcs&.update_instance if parent_rpcs&.respond_to? :update_instance
1905
+ update_instance_config = parent_rpcs.update_instance if parent_rpcs.respond_to? :update_instance
1898
1906
  @update_instance = ::Gapic::Config::Method.new update_instance_config
1899
- partial_update_instance_config = parent_rpcs&.partial_update_instance if parent_rpcs&.respond_to? :partial_update_instance
1907
+ partial_update_instance_config = parent_rpcs.partial_update_instance if parent_rpcs.respond_to? :partial_update_instance
1900
1908
  @partial_update_instance = ::Gapic::Config::Method.new partial_update_instance_config
1901
- delete_instance_config = parent_rpcs&.delete_instance if parent_rpcs&.respond_to? :delete_instance
1909
+ delete_instance_config = parent_rpcs.delete_instance if parent_rpcs.respond_to? :delete_instance
1902
1910
  @delete_instance = ::Gapic::Config::Method.new delete_instance_config
1903
- create_cluster_config = parent_rpcs&.create_cluster if parent_rpcs&.respond_to? :create_cluster
1911
+ create_cluster_config = parent_rpcs.create_cluster if parent_rpcs.respond_to? :create_cluster
1904
1912
  @create_cluster = ::Gapic::Config::Method.new create_cluster_config
1905
- get_cluster_config = parent_rpcs&.get_cluster if parent_rpcs&.respond_to? :get_cluster
1913
+ get_cluster_config = parent_rpcs.get_cluster if parent_rpcs.respond_to? :get_cluster
1906
1914
  @get_cluster = ::Gapic::Config::Method.new get_cluster_config
1907
- list_clusters_config = parent_rpcs&.list_clusters if parent_rpcs&.respond_to? :list_clusters
1915
+ list_clusters_config = parent_rpcs.list_clusters if parent_rpcs.respond_to? :list_clusters
1908
1916
  @list_clusters = ::Gapic::Config::Method.new list_clusters_config
1909
- update_cluster_config = parent_rpcs&.update_cluster if parent_rpcs&.respond_to? :update_cluster
1917
+ update_cluster_config = parent_rpcs.update_cluster if parent_rpcs.respond_to? :update_cluster
1910
1918
  @update_cluster = ::Gapic::Config::Method.new update_cluster_config
1911
- delete_cluster_config = parent_rpcs&.delete_cluster if parent_rpcs&.respond_to? :delete_cluster
1919
+ delete_cluster_config = parent_rpcs.delete_cluster if parent_rpcs.respond_to? :delete_cluster
1912
1920
  @delete_cluster = ::Gapic::Config::Method.new delete_cluster_config
1913
- create_app_profile_config = parent_rpcs&.create_app_profile if parent_rpcs&.respond_to? :create_app_profile
1921
+ create_app_profile_config = parent_rpcs.create_app_profile if parent_rpcs.respond_to? :create_app_profile
1914
1922
  @create_app_profile = ::Gapic::Config::Method.new create_app_profile_config
1915
- get_app_profile_config = parent_rpcs&.get_app_profile if parent_rpcs&.respond_to? :get_app_profile
1923
+ get_app_profile_config = parent_rpcs.get_app_profile if parent_rpcs.respond_to? :get_app_profile
1916
1924
  @get_app_profile = ::Gapic::Config::Method.new get_app_profile_config
1917
- list_app_profiles_config = parent_rpcs&.list_app_profiles if parent_rpcs&.respond_to? :list_app_profiles
1925
+ list_app_profiles_config = parent_rpcs.list_app_profiles if parent_rpcs.respond_to? :list_app_profiles
1918
1926
  @list_app_profiles = ::Gapic::Config::Method.new list_app_profiles_config
1919
- update_app_profile_config = parent_rpcs&.update_app_profile if parent_rpcs&.respond_to? :update_app_profile
1927
+ update_app_profile_config = parent_rpcs.update_app_profile if parent_rpcs.respond_to? :update_app_profile
1920
1928
  @update_app_profile = ::Gapic::Config::Method.new update_app_profile_config
1921
- delete_app_profile_config = parent_rpcs&.delete_app_profile if parent_rpcs&.respond_to? :delete_app_profile
1929
+ delete_app_profile_config = parent_rpcs.delete_app_profile if parent_rpcs.respond_to? :delete_app_profile
1922
1930
  @delete_app_profile = ::Gapic::Config::Method.new delete_app_profile_config
1923
- get_iam_policy_config = parent_rpcs&.get_iam_policy if parent_rpcs&.respond_to? :get_iam_policy
1931
+ get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy
1924
1932
  @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config
1925
- set_iam_policy_config = parent_rpcs&.set_iam_policy if parent_rpcs&.respond_to? :set_iam_policy
1933
+ set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy
1926
1934
  @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
1927
- test_iam_permissions_config = parent_rpcs&.test_iam_permissions if parent_rpcs&.respond_to? :test_iam_permissions
1935
+ test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions
1928
1936
  @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
1929
1937
 
1930
1938
  yield self if block_given?
@@ -104,8 +104,13 @@ module Google
104
104
  # Lists operations that match the specified filter in the request. If the
105
105
  # server doesn't support this method, it returns `UNIMPLEMENTED`.
106
106
  #
107
- # NOTE: the `name` binding below allows API services to override the binding
108
- # to use different resource name schemes, such as `users/*/operations`.
107
+ # NOTE: the `name` binding allows API services to override the binding
108
+ # to use different resource name schemes, such as `users/*/operations`. To
109
+ # override the binding, API services can add a binding such as
110
+ # `"/v1/{name=users/*}/operations"` to their service configuration.
111
+ # For backwards compatibility, the default name includes the operations
112
+ # collection id, however overriding users must ensure the name binding
113
+ # is the parent resource, without the operations collection id.
109
114
  #
110
115
  # @overload list_operations(request, options = nil)
111
116
  # Pass arguments to `list_operations` via a request object, either of type
@@ -123,7 +128,7 @@ module Google
123
128
  # the default parameter values, pass an empty Hash as a request object (see above).
124
129
  #
125
130
  # @param name [::String]
126
- # The name of the operation collection.
131
+ # The name of the operation's parent resource.
127
132
  # @param filter [::String]
128
133
  # The standard list filter.
129
134
  # @param page_size [::Integer]
@@ -391,6 +396,79 @@ module Google
391
396
  raise ::Google::Cloud::Error.from_error(e)
392
397
  end
393
398
 
399
+ ##
400
+ # Waits for the specified long-running operation until it is done or reaches
401
+ # at most a specified timeout, returning the latest state. If the operation
402
+ # is already done, the latest state is immediately returned. If the timeout
403
+ # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC
404
+ # timeout is used. If the server does not support this method, it returns
405
+ # `google.rpc.Code.UNIMPLEMENTED`.
406
+ # Note that this method is on a best-effort basis. It may return the latest
407
+ # state before the specified timeout (including immediately), meaning even an
408
+ # immediate response is no guarantee that the operation is done.
409
+ #
410
+ # @overload wait_operation(request, options = nil)
411
+ # Pass arguments to `wait_operation` via a request object, either of type
412
+ # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash.
413
+ #
414
+ # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash]
415
+ # A request object representing the call parameters. Required. To specify no
416
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
417
+ # @param options [::Gapic::CallOptions, ::Hash]
418
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
419
+ #
420
+ # @overload wait_operation(name: nil, timeout: nil)
421
+ # Pass arguments to `wait_operation` via keyword arguments. Note that at
422
+ # least one keyword argument is required. To specify no parameters, or to keep all
423
+ # the default parameter values, pass an empty Hash as a request object (see above).
424
+ #
425
+ # @param name [::String]
426
+ # The name of the operation resource to wait on.
427
+ # @param timeout [::Google::Protobuf::Duration, ::Hash]
428
+ # The maximum duration to wait before timing out. If left blank, the wait
429
+ # will be at most the time permitted by the underlying HTTP/RPC protocol.
430
+ # If RPC context deadline is also specified, the shorter one will be used.
431
+ #
432
+ # @yield [response, operation] Access the result along with the RPC operation
433
+ # @yieldparam response [::Gapic::Operation]
434
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
435
+ #
436
+ # @return [::Gapic::Operation]
437
+ #
438
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
439
+ #
440
+ def wait_operation request, options = nil
441
+ raise ::ArgumentError, "request must be provided" if request.nil?
442
+
443
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest
444
+
445
+ # Converts hash and nil to an options object
446
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
447
+
448
+ # Customize the options with defaults
449
+ metadata = @config.rpcs.wait_operation.metadata.to_h
450
+
451
+ # Set x-goog-api-client and x-goog-user-project headers
452
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
453
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
454
+ gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
455
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
456
+
457
+ options.apply_defaults timeout: @config.rpcs.wait_operation.timeout,
458
+ metadata: metadata,
459
+ retry_policy: @config.rpcs.wait_operation.retry_policy
460
+ options.apply_defaults metadata: @config.metadata,
461
+ retry_policy: @config.retry_policy
462
+
463
+ @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
464
+ response = ::Gapic::Operation.new response, @operations_client, options: options
465
+ yield response, operation if block_given?
466
+ return response
467
+ end
468
+ rescue ::GRPC::BadStatus => e
469
+ raise ::Google::Cloud::Error.from_error(e)
470
+ end
471
+
394
472
  ##
395
473
  # Configuration class for the Operations API.
396
474
  #
@@ -483,7 +561,7 @@ module Google
483
561
  config_attr :scope, nil, ::String, ::Array, nil
484
562
  config_attr :lib_name, nil, ::String, nil
485
563
  config_attr :lib_version, nil, ::String, nil
486
- config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
564
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
487
565
  config_attr :interceptors, nil, ::Array, nil
488
566
  config_attr :timeout, nil, ::Numeric, nil
489
567
  config_attr :metadata, nil, ::Hash, nil
@@ -504,7 +582,7 @@ module Google
504
582
  def rpcs
505
583
  @rpcs ||= begin
506
584
  parent_rpcs = nil
507
- parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
585
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
508
586
  Rpcs.new parent_rpcs
509
587
  end
510
588
  end
@@ -516,7 +594,7 @@ module Google
516
594
  # Each configuration object is of type `Gapic::Config::Method` and includes
517
595
  # the following configuration fields:
518
596
  #
519
- # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
597
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
520
598
  # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
521
599
  # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
522
600
  # include the following keys:
@@ -547,17 +625,24 @@ module Google
547
625
  # @return [::Gapic::Config::Method]
548
626
  #
549
627
  attr_reader :cancel_operation
628
+ ##
629
+ # RPC-specific configuration for `wait_operation`
630
+ # @return [::Gapic::Config::Method]
631
+ #
632
+ attr_reader :wait_operation
550
633
 
551
634
  # @private
552
635
  def initialize parent_rpcs = nil
553
- list_operations_config = parent_rpcs&.list_operations if parent_rpcs&.respond_to? :list_operations
636
+ list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations
554
637
  @list_operations = ::Gapic::Config::Method.new list_operations_config
555
- get_operation_config = parent_rpcs&.get_operation if parent_rpcs&.respond_to? :get_operation
638
+ get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation
556
639
  @get_operation = ::Gapic::Config::Method.new get_operation_config
557
- delete_operation_config = parent_rpcs&.delete_operation if parent_rpcs&.respond_to? :delete_operation
640
+ delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation
558
641
  @delete_operation = ::Gapic::Config::Method.new delete_operation_config
559
- cancel_operation_config = parent_rpcs&.cancel_operation if parent_rpcs&.respond_to? :cancel_operation
642
+ cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation
560
643
  @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config
644
+ wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation
645
+ @wait_operation = ::Gapic::Config::Method.new wait_operation_config
561
646
 
562
647
  yield self if block_given?
563
648
  end