google-cloud-spanner-v1 0.2.2 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -33,3 +33,6 @@ module Google
33
33
  end
34
34
  end
35
35
  end
36
+
37
+ helper_path = ::File.join __dir__, "v1", "_helpers.rb"
38
+ require "google/cloud/spanner/v1/_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
@@ -71,49 +71,49 @@ module Google
71
71
  default_config.rpcs.create_session.timeout = 30.0
72
72
  default_config.rpcs.create_session.retry_policy = {
73
73
  initial_delay: 0.25,
74
- max_delay: 32.0,
75
- multiplier: 1.3,
76
- retry_codes: [14]
74
+ max_delay: 32.0,
75
+ multiplier: 1.3,
76
+ retry_codes: [14]
77
77
  }
78
78
 
79
79
  default_config.rpcs.batch_create_sessions.timeout = 60.0
80
80
  default_config.rpcs.batch_create_sessions.retry_policy = {
81
81
  initial_delay: 0.25,
82
- max_delay: 32.0,
83
- multiplier: 1.3,
84
- retry_codes: [14]
82
+ max_delay: 32.0,
83
+ multiplier: 1.3,
84
+ retry_codes: [14]
85
85
  }
86
86
 
87
87
  default_config.rpcs.get_session.timeout = 30.0
88
88
  default_config.rpcs.get_session.retry_policy = {
89
89
  initial_delay: 0.25,
90
- max_delay: 32.0,
91
- multiplier: 1.3,
92
- retry_codes: [14]
90
+ max_delay: 32.0,
91
+ multiplier: 1.3,
92
+ retry_codes: [14]
93
93
  }
94
94
 
95
95
  default_config.rpcs.list_sessions.timeout = 3600.0
96
96
  default_config.rpcs.list_sessions.retry_policy = {
97
97
  initial_delay: 0.25,
98
- max_delay: 32.0,
99
- multiplier: 1.3,
100
- retry_codes: [14]
98
+ max_delay: 32.0,
99
+ multiplier: 1.3,
100
+ retry_codes: [14]
101
101
  }
102
102
 
103
103
  default_config.rpcs.delete_session.timeout = 30.0
104
104
  default_config.rpcs.delete_session.retry_policy = {
105
105
  initial_delay: 0.25,
106
- max_delay: 32.0,
107
- multiplier: 1.3,
108
- retry_codes: [14]
106
+ max_delay: 32.0,
107
+ multiplier: 1.3,
108
+ retry_codes: [14]
109
109
  }
110
110
 
111
111
  default_config.rpcs.execute_sql.timeout = 30.0
112
112
  default_config.rpcs.execute_sql.retry_policy = {
113
113
  initial_delay: 0.25,
114
- max_delay: 32.0,
115
- multiplier: 1.3,
116
- retry_codes: [14]
114
+ max_delay: 32.0,
115
+ multiplier: 1.3,
116
+ retry_codes: [14]
117
117
  }
118
118
 
119
119
  default_config.rpcs.execute_streaming_sql.timeout = 3600.0
@@ -121,17 +121,17 @@ module Google
121
121
  default_config.rpcs.execute_batch_dml.timeout = 30.0
122
122
  default_config.rpcs.execute_batch_dml.retry_policy = {
123
123
  initial_delay: 0.25,
124
- max_delay: 32.0,
125
- multiplier: 1.3,
126
- retry_codes: [14]
124
+ max_delay: 32.0,
125
+ multiplier: 1.3,
126
+ retry_codes: [14]
127
127
  }
128
128
 
129
129
  default_config.rpcs.read.timeout = 30.0
130
130
  default_config.rpcs.read.retry_policy = {
131
131
  initial_delay: 0.25,
132
- max_delay: 32.0,
133
- multiplier: 1.3,
134
- retry_codes: [14]
132
+ max_delay: 32.0,
133
+ multiplier: 1.3,
134
+ retry_codes: [14]
135
135
  }
136
136
 
137
137
  default_config.rpcs.streaming_read.timeout = 3600.0
@@ -139,41 +139,41 @@ module Google
139
139
  default_config.rpcs.begin_transaction.timeout = 30.0
140
140
  default_config.rpcs.begin_transaction.retry_policy = {
141
141
  initial_delay: 0.25,
142
- max_delay: 32.0,
143
- multiplier: 1.3,
144
- retry_codes: [14]
142
+ max_delay: 32.0,
143
+ multiplier: 1.3,
144
+ retry_codes: [14]
145
145
  }
146
146
 
147
147
  default_config.rpcs.commit.timeout = 3600.0
148
148
  default_config.rpcs.commit.retry_policy = {
149
149
  initial_delay: 0.25,
150
- max_delay: 32.0,
151
- multiplier: 1.3,
152
- retry_codes: [14]
150
+ max_delay: 32.0,
151
+ multiplier: 1.3,
152
+ retry_codes: [14]
153
153
  }
154
154
 
155
155
  default_config.rpcs.rollback.timeout = 30.0
156
156
  default_config.rpcs.rollback.retry_policy = {
157
157
  initial_delay: 0.25,
158
- max_delay: 32.0,
159
- multiplier: 1.3,
160
- retry_codes: [14]
158
+ max_delay: 32.0,
159
+ multiplier: 1.3,
160
+ retry_codes: [14]
161
161
  }
162
162
 
163
163
  default_config.rpcs.partition_query.timeout = 30.0
164
164
  default_config.rpcs.partition_query.retry_policy = {
165
165
  initial_delay: 0.25,
166
- max_delay: 32.0,
167
- multiplier: 1.3,
168
- retry_codes: [14]
166
+ max_delay: 32.0,
167
+ multiplier: 1.3,
168
+ retry_codes: [14]
169
169
  }
170
170
 
171
171
  default_config.rpcs.partition_read.timeout = 30.0
172
172
  default_config.rpcs.partition_read.retry_policy = {
173
173
  initial_delay: 0.25,
174
- max_delay: 32.0,
175
- multiplier: 1.3,
176
- retry_codes: [14]
174
+ max_delay: 32.0,
175
+ multiplier: 1.3,
176
+ retry_codes: [14]
177
177
  }
178
178
 
179
179
  default_config
@@ -237,7 +237,13 @@ module Google
237
237
 
238
238
  # Create credentials
239
239
  credentials = @config.credentials
240
- credentials ||= Credentials.default scope: @config.scope
240
+ # Use self-signed JWT if the scope and endpoint are unchanged from default,
241
+ # but only if the default endpoint does not have a region prefix.
242
+ enable_self_signed_jwt = @config.scope == Client.configure.scope &&
243
+ @config.endpoint == Client.configure.endpoint &&
244
+ !@config.endpoint.split(".").first.include?("-")
245
+ credentials ||= Credentials.default scope: @config.scope,
246
+ enable_self_signed_jwt: enable_self_signed_jwt
241
247
  if credentials.is_a?(String) || credentials.is_a?(Hash)
242
248
  credentials = Credentials.new credentials, scope: @config.scope
243
249
  end
@@ -662,7 +668,7 @@ module Google
662
668
  # @param options [::Gapic::CallOptions, ::Hash]
663
669
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
664
670
  #
665
- # @overload execute_sql(session: nil, transaction: nil, sql: nil, params: nil, param_types: nil, resume_token: nil, query_mode: nil, partition_token: nil, seqno: nil, query_options: nil)
671
+ # @overload execute_sql(session: nil, transaction: nil, sql: nil, params: nil, param_types: nil, resume_token: nil, query_mode: nil, partition_token: nil, seqno: nil, query_options: nil, request_options: nil)
666
672
  # Pass arguments to `execute_sql` via keyword arguments. Note that at
667
673
  # least one keyword argument is required. To specify no parameters, or to keep all
668
674
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -686,8 +692,9 @@ module Google
686
692
  # Parameter names and values that bind to placeholders in the SQL string.
687
693
  #
688
694
  # A parameter placeholder consists of the `@` character followed by the
689
- # parameter name (for example, `@firstName`). Parameter names can contain
690
- # letters, numbers, and underscores.
695
+ # parameter name (for example, `@firstName`). Parameter names must conform
696
+ # to the naming requirements of identifiers as specified at
697
+ # https://cloud.google.com/spanner/docs/lexical#identifiers.
691
698
  #
692
699
  # Parameters can appear anywhere that a literal value is expected. The same
693
700
  # parameter name can be used more than once, for example:
@@ -733,6 +740,8 @@ module Google
733
740
  # Required for DML statements. Ignored for queries.
734
741
  # @param query_options [::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryOptions, ::Hash]
735
742
  # Query optimizer configuration to use for the given query.
743
+ # @param request_options [::Google::Cloud::Spanner::V1::RequestOptions, ::Hash]
744
+ # Common options for this request.
736
745
  #
737
746
  # @yield [response, operation] Access the result along with the RPC operation
738
747
  # @yieldparam response [::Google::Cloud::Spanner::V1::ResultSet]
@@ -796,7 +805,7 @@ module Google
796
805
  # @param options [::Gapic::CallOptions, ::Hash]
797
806
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
798
807
  #
799
- # @overload execute_streaming_sql(session: nil, transaction: nil, sql: nil, params: nil, param_types: nil, resume_token: nil, query_mode: nil, partition_token: nil, seqno: nil, query_options: nil)
808
+ # @overload execute_streaming_sql(session: nil, transaction: nil, sql: nil, params: nil, param_types: nil, resume_token: nil, query_mode: nil, partition_token: nil, seqno: nil, query_options: nil, request_options: nil)
800
809
  # Pass arguments to `execute_streaming_sql` via keyword arguments. Note that at
801
810
  # least one keyword argument is required. To specify no parameters, or to keep all
802
811
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -820,8 +829,9 @@ module Google
820
829
  # Parameter names and values that bind to placeholders in the SQL string.
821
830
  #
822
831
  # A parameter placeholder consists of the `@` character followed by the
823
- # parameter name (for example, `@firstName`). Parameter names can contain
824
- # letters, numbers, and underscores.
832
+ # parameter name (for example, `@firstName`). Parameter names must conform
833
+ # to the naming requirements of identifiers as specified at
834
+ # https://cloud.google.com/spanner/docs/lexical#identifiers.
825
835
  #
826
836
  # Parameters can appear anywhere that a literal value is expected. The same
827
837
  # parameter name can be used more than once, for example:
@@ -867,6 +877,8 @@ module Google
867
877
  # Required for DML statements. Ignored for queries.
868
878
  # @param query_options [::Google::Cloud::Spanner::V1::ExecuteSqlRequest::QueryOptions, ::Hash]
869
879
  # Query optimizer configuration to use for the given query.
880
+ # @param request_options [::Google::Cloud::Spanner::V1::RequestOptions, ::Hash]
881
+ # Common options for this request.
870
882
  #
871
883
  # @yield [response, operation] Access the result along with the RPC operation
872
884
  # @yieldparam response [::Enumerable<::Google::Cloud::Spanner::V1::PartialResultSet>]
@@ -936,7 +948,7 @@ module Google
936
948
  # @param options [::Gapic::CallOptions, ::Hash]
937
949
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
938
950
  #
939
- # @overload execute_batch_dml(session: nil, transaction: nil, statements: nil, seqno: nil)
951
+ # @overload execute_batch_dml(session: nil, transaction: nil, statements: nil, seqno: nil, request_options: nil)
940
952
  # Pass arguments to `execute_batch_dml` via keyword arguments. Note that at
941
953
  # least one keyword argument is required. To specify no parameters, or to keep all
942
954
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -965,6 +977,8 @@ module Google
965
977
  # transaction. If a request arrives for the first time with an out-of-order
966
978
  # sequence number, the transaction may be aborted. Replays of previously
967
979
  # handled requests will yield the same response as the first execution.
980
+ # @param request_options [::Google::Cloud::Spanner::V1::RequestOptions, ::Hash]
981
+ # Common options for this request.
968
982
  #
969
983
  # @yield [response, operation] Access the result along with the RPC operation
970
984
  # @yieldparam response [::Google::Cloud::Spanner::V1::ExecuteBatchDmlResponse]
@@ -1036,7 +1050,7 @@ module Google
1036
1050
  # @param options [::Gapic::CallOptions, ::Hash]
1037
1051
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1038
1052
  #
1039
- # @overload read(session: nil, transaction: nil, table: nil, index: nil, columns: nil, key_set: nil, limit: nil, resume_token: nil, partition_token: nil)
1053
+ # @overload read(session: nil, transaction: nil, table: nil, index: nil, columns: nil, key_set: nil, limit: nil, resume_token: nil, partition_token: nil, request_options: nil)
1040
1054
  # Pass arguments to `read` via keyword arguments. Note that at
1041
1055
  # least one keyword argument is required. To specify no parameters, or to keep all
1042
1056
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -1084,6 +1098,8 @@ module Google
1084
1098
  # previously created using PartitionRead(). There must be an exact
1085
1099
  # match for the values of fields common to this message and the
1086
1100
  # PartitionReadRequest message used to create this partition_token.
1101
+ # @param request_options [::Google::Cloud::Spanner::V1::RequestOptions, ::Hash]
1102
+ # Common options for this request.
1087
1103
  #
1088
1104
  # @yield [response, operation] Access the result along with the RPC operation
1089
1105
  # @yieldparam response [::Google::Cloud::Spanner::V1::ResultSet]
@@ -1147,7 +1163,7 @@ module Google
1147
1163
  # @param options [::Gapic::CallOptions, ::Hash]
1148
1164
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1149
1165
  #
1150
- # @overload streaming_read(session: nil, transaction: nil, table: nil, index: nil, columns: nil, key_set: nil, limit: nil, resume_token: nil, partition_token: nil)
1166
+ # @overload streaming_read(session: nil, transaction: nil, table: nil, index: nil, columns: nil, key_set: nil, limit: nil, resume_token: nil, partition_token: nil, request_options: nil)
1151
1167
  # Pass arguments to `streaming_read` via keyword arguments. Note that at
1152
1168
  # least one keyword argument is required. To specify no parameters, or to keep all
1153
1169
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -1195,6 +1211,8 @@ module Google
1195
1211
  # previously created using PartitionRead(). There must be an exact
1196
1212
  # match for the values of fields common to this message and the
1197
1213
  # PartitionReadRequest message used to create this partition_token.
1214
+ # @param request_options [::Google::Cloud::Spanner::V1::RequestOptions, ::Hash]
1215
+ # Common options for this request.
1198
1216
  #
1199
1217
  # @yield [response, operation] Access the result along with the RPC operation
1200
1218
  # @yieldparam response [::Enumerable<::Google::Cloud::Spanner::V1::PartialResultSet>]
@@ -1257,7 +1275,7 @@ module Google
1257
1275
  # @param options [::Gapic::CallOptions, ::Hash]
1258
1276
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1259
1277
  #
1260
- # @overload begin_transaction(session: nil, options: nil)
1278
+ # @overload begin_transaction(session: nil, options: nil, request_options: nil)
1261
1279
  # Pass arguments to `begin_transaction` via keyword arguments. Note that at
1262
1280
  # least one keyword argument is required. To specify no parameters, or to keep all
1263
1281
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -1266,6 +1284,12 @@ module Google
1266
1284
  # Required. The session in which the transaction runs.
1267
1285
  # @param options [::Google::Cloud::Spanner::V1::TransactionOptions, ::Hash]
1268
1286
  # Required. Options for the new transaction.
1287
+ # @param request_options [::Google::Cloud::Spanner::V1::RequestOptions, ::Hash]
1288
+ # Common options for this request.
1289
+ # Priority is ignored for this request. Setting the priority in this
1290
+ # request_options struct will not do anything. To set the priority for a
1291
+ # transaction, set it on the reads and writes that are part of this
1292
+ # transaction instead.
1269
1293
  #
1270
1294
  # @yield [response, operation] Access the result along with the RPC operation
1271
1295
  # @yieldparam response [::Google::Cloud::Spanner::V1::Transaction]
@@ -1322,6 +1346,12 @@ module Google
1322
1346
  # reasons. If `Commit` returns `ABORTED`, the caller should re-attempt
1323
1347
  # the transaction from the beginning, re-using the same session.
1324
1348
  #
1349
+ # On very rare occasions, `Commit` might return `UNKNOWN`. This can happen,
1350
+ # for example, if the client job experiences a 1+ hour networking failure.
1351
+ # At that point, Cloud Spanner has lost track of the transaction outcome and
1352
+ # we recommend that you perform another read from the database to see the
1353
+ # state of things as they are now.
1354
+ #
1325
1355
  # @overload commit(request, options = nil)
1326
1356
  # Pass arguments to `commit` via a request object, either of type
1327
1357
  # {::Google::Cloud::Spanner::V1::CommitRequest} or an equivalent Hash.
@@ -1332,7 +1362,7 @@ module Google
1332
1362
  # @param options [::Gapic::CallOptions, ::Hash]
1333
1363
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1334
1364
  #
1335
- # @overload commit(session: nil, transaction_id: nil, single_use_transaction: nil, mutations: nil)
1365
+ # @overload commit(session: nil, transaction_id: nil, single_use_transaction: nil, mutations: nil, return_commit_stats: nil, request_options: nil)
1336
1366
  # Pass arguments to `commit` via keyword arguments. Note that at
1337
1367
  # least one keyword argument is required. To specify no parameters, or to keep all
1338
1368
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -1355,6 +1385,12 @@ module Google
1355
1385
  # The mutations to be executed when this transaction commits. All
1356
1386
  # mutations are applied atomically, in the order they appear in
1357
1387
  # this list.
1388
+ # @param return_commit_stats [::Boolean]
1389
+ # If `true`, then statistics related to the transaction will be included in
1390
+ # the {::Google::Cloud::Spanner::V1::CommitResponse#commit_stats CommitResponse}. Default value is
1391
+ # `false`.
1392
+ # @param request_options [::Google::Cloud::Spanner::V1::RequestOptions, ::Hash]
1393
+ # Common options for this request.
1358
1394
  #
1359
1395
  # @yield [response, operation] Access the result along with the RPC operation
1360
1396
  # @yieldparam response [::Google::Cloud::Spanner::V1::CommitResponse]
@@ -1782,7 +1818,7 @@ module Google
1782
1818
  config_attr :scope, nil, ::String, ::Array, nil
1783
1819
  config_attr :lib_name, nil, ::String, nil
1784
1820
  config_attr :lib_version, nil, ::String, nil
1785
- config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
1821
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
1786
1822
  config_attr :interceptors, nil, ::Array, nil
1787
1823
  config_attr :timeout, nil, ::Numeric, nil
1788
1824
  config_attr :metadata, nil, ::Hash, nil
@@ -1803,7 +1839,7 @@ module Google
1803
1839
  def rpcs
1804
1840
  @rpcs ||= begin
1805
1841
  parent_rpcs = nil
1806
- parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
1842
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1807
1843
  Rpcs.new parent_rpcs
1808
1844
  end
1809
1845
  end
@@ -1815,7 +1851,7 @@ module Google
1815
1851
  # Each configuration object is of type `Gapic::Config::Method` and includes
1816
1852
  # the following configuration fields:
1817
1853
  #
1818
- # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
1854
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1819
1855
  # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
1820
1856
  # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1821
1857
  # include the following keys:
@@ -1904,35 +1940,35 @@ module Google
1904
1940
 
1905
1941
  # @private
1906
1942
  def initialize parent_rpcs = nil
1907
- create_session_config = parent_rpcs&.create_session if parent_rpcs&.respond_to? :create_session
1943
+ create_session_config = parent_rpcs.create_session if parent_rpcs.respond_to? :create_session
1908
1944
  @create_session = ::Gapic::Config::Method.new create_session_config
1909
- batch_create_sessions_config = parent_rpcs&.batch_create_sessions if parent_rpcs&.respond_to? :batch_create_sessions
1945
+ batch_create_sessions_config = parent_rpcs.batch_create_sessions if parent_rpcs.respond_to? :batch_create_sessions
1910
1946
  @batch_create_sessions = ::Gapic::Config::Method.new batch_create_sessions_config
1911
- get_session_config = parent_rpcs&.get_session if parent_rpcs&.respond_to? :get_session
1947
+ get_session_config = parent_rpcs.get_session if parent_rpcs.respond_to? :get_session
1912
1948
  @get_session = ::Gapic::Config::Method.new get_session_config
1913
- list_sessions_config = parent_rpcs&.list_sessions if parent_rpcs&.respond_to? :list_sessions
1949
+ list_sessions_config = parent_rpcs.list_sessions if parent_rpcs.respond_to? :list_sessions
1914
1950
  @list_sessions = ::Gapic::Config::Method.new list_sessions_config
1915
- delete_session_config = parent_rpcs&.delete_session if parent_rpcs&.respond_to? :delete_session
1951
+ delete_session_config = parent_rpcs.delete_session if parent_rpcs.respond_to? :delete_session
1916
1952
  @delete_session = ::Gapic::Config::Method.new delete_session_config
1917
- execute_sql_config = parent_rpcs&.execute_sql if parent_rpcs&.respond_to? :execute_sql
1953
+ execute_sql_config = parent_rpcs.execute_sql if parent_rpcs.respond_to? :execute_sql
1918
1954
  @execute_sql = ::Gapic::Config::Method.new execute_sql_config
1919
- execute_streaming_sql_config = parent_rpcs&.execute_streaming_sql if parent_rpcs&.respond_to? :execute_streaming_sql
1955
+ execute_streaming_sql_config = parent_rpcs.execute_streaming_sql if parent_rpcs.respond_to? :execute_streaming_sql
1920
1956
  @execute_streaming_sql = ::Gapic::Config::Method.new execute_streaming_sql_config
1921
- execute_batch_dml_config = parent_rpcs&.execute_batch_dml if parent_rpcs&.respond_to? :execute_batch_dml
1957
+ execute_batch_dml_config = parent_rpcs.execute_batch_dml if parent_rpcs.respond_to? :execute_batch_dml
1922
1958
  @execute_batch_dml = ::Gapic::Config::Method.new execute_batch_dml_config
1923
- read_config = parent_rpcs&.read if parent_rpcs&.respond_to? :read
1959
+ read_config = parent_rpcs.read if parent_rpcs.respond_to? :read
1924
1960
  @read = ::Gapic::Config::Method.new read_config
1925
- streaming_read_config = parent_rpcs&.streaming_read if parent_rpcs&.respond_to? :streaming_read
1961
+ streaming_read_config = parent_rpcs.streaming_read if parent_rpcs.respond_to? :streaming_read
1926
1962
  @streaming_read = ::Gapic::Config::Method.new streaming_read_config
1927
- begin_transaction_config = parent_rpcs&.begin_transaction if parent_rpcs&.respond_to? :begin_transaction
1963
+ begin_transaction_config = parent_rpcs.begin_transaction if parent_rpcs.respond_to? :begin_transaction
1928
1964
  @begin_transaction = ::Gapic::Config::Method.new begin_transaction_config
1929
- commit_config = parent_rpcs&.commit if parent_rpcs&.respond_to? :commit
1965
+ commit_config = parent_rpcs.commit if parent_rpcs.respond_to? :commit
1930
1966
  @commit = ::Gapic::Config::Method.new commit_config
1931
- rollback_config = parent_rpcs&.rollback if parent_rpcs&.respond_to? :rollback
1967
+ rollback_config = parent_rpcs.rollback if parent_rpcs.respond_to? :rollback
1932
1968
  @rollback = ::Gapic::Config::Method.new rollback_config
1933
- partition_query_config = parent_rpcs&.partition_query if parent_rpcs&.respond_to? :partition_query
1969
+ partition_query_config = parent_rpcs.partition_query if parent_rpcs.respond_to? :partition_query
1934
1970
  @partition_query = ::Gapic::Config::Method.new partition_query_config
1935
- partition_read_config = parent_rpcs&.partition_read if parent_rpcs&.respond_to? :partition_read
1971
+ partition_read_config = parent_rpcs.partition_read if parent_rpcs.respond_to? :partition_read
1936
1972
  @partition_read = ::Gapic::Config::Method.new partition_read_config
1937
1973
 
1938
1974
  yield self if block_given?
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module Spanner
23
23
  module V1
24
- VERSION = "0.2.2"
24
+ VERSION = "0.6.0"
25
25
  end
26
26
  end
27
27
  end
@@ -7,6 +7,7 @@ require 'google/api/annotations_pb'
7
7
  require 'google/api/client_pb'
8
8
  require 'google/api/field_behavior_pb'
9
9
  require 'google/api/resource_pb'
10
+ require 'google/protobuf/duration_pb'
10
11
  require 'google/protobuf/empty_pb'
11
12
  require 'google/protobuf/struct_pb'
12
13
  require 'google/protobuf/timestamp_pb'
@@ -52,6 +53,17 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
52
53
  add_message "google.spanner.v1.DeleteSessionRequest" do
53
54
  optional :name, :string, 1
54
55
  end
56
+ add_message "google.spanner.v1.RequestOptions" do
57
+ optional :priority, :enum, 1, "google.spanner.v1.RequestOptions.Priority"
58
+ optional :request_tag, :string, 2
59
+ optional :transaction_tag, :string, 3
60
+ end
61
+ add_enum "google.spanner.v1.RequestOptions.Priority" do
62
+ value :PRIORITY_UNSPECIFIED, 0
63
+ value :PRIORITY_LOW, 1
64
+ value :PRIORITY_MEDIUM, 2
65
+ value :PRIORITY_HIGH, 3
66
+ end
55
67
  add_message "google.spanner.v1.ExecuteSqlRequest" do
56
68
  optional :session, :string, 1
57
69
  optional :transaction, :message, 2, "google.spanner.v1.TransactionSelector"
@@ -63,9 +75,11 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
63
75
  optional :partition_token, :bytes, 8
64
76
  optional :seqno, :int64, 9
65
77
  optional :query_options, :message, 10, "google.spanner.v1.ExecuteSqlRequest.QueryOptions"
78
+ optional :request_options, :message, 11, "google.spanner.v1.RequestOptions"
66
79
  end
67
80
  add_message "google.spanner.v1.ExecuteSqlRequest.QueryOptions" do
68
81
  optional :optimizer_version, :string, 1
82
+ optional :optimizer_statistics_package, :string, 2
69
83
  end
70
84
  add_enum "google.spanner.v1.ExecuteSqlRequest.QueryMode" do
71
85
  value :NORMAL, 0
@@ -77,6 +91,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
77
91
  optional :transaction, :message, 2, "google.spanner.v1.TransactionSelector"
78
92
  repeated :statements, :message, 3, "google.spanner.v1.ExecuteBatchDmlRequest.Statement"
79
93
  optional :seqno, :int64, 4
94
+ optional :request_options, :message, 5, "google.spanner.v1.RequestOptions"
80
95
  end
81
96
  add_message "google.spanner.v1.ExecuteBatchDmlRequest.Statement" do
82
97
  optional :sql, :string, 1
@@ -125,14 +140,18 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
125
140
  optional :limit, :int64, 8
126
141
  optional :resume_token, :bytes, 9
127
142
  optional :partition_token, :bytes, 10
143
+ optional :request_options, :message, 11, "google.spanner.v1.RequestOptions"
128
144
  end
129
145
  add_message "google.spanner.v1.BeginTransactionRequest" do
130
146
  optional :session, :string, 1
131
147
  optional :options, :message, 2, "google.spanner.v1.TransactionOptions"
148
+ optional :request_options, :message, 3, "google.spanner.v1.RequestOptions"
132
149
  end
133
150
  add_message "google.spanner.v1.CommitRequest" do
134
151
  optional :session, :string, 1
135
152
  repeated :mutations, :message, 4, "google.spanner.v1.Mutation"
153
+ optional :return_commit_stats, :bool, 5
154
+ optional :request_options, :message, 6, "google.spanner.v1.RequestOptions"
136
155
  oneof :transaction do
137
156
  optional :transaction_id, :bytes, 2
138
157
  optional :single_use_transaction, :message, 3, "google.spanner.v1.TransactionOptions"
@@ -140,6 +159,10 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
140
159
  end
141
160
  add_message "google.spanner.v1.CommitResponse" do
142
161
  optional :commit_timestamp, :message, 1, "google.protobuf.Timestamp"
162
+ optional :commit_stats, :message, 2, "google.spanner.v1.CommitResponse.CommitStats"
163
+ end
164
+ add_message "google.spanner.v1.CommitResponse.CommitStats" do
165
+ optional :mutation_count, :int64, 1
143
166
  end
144
167
  add_message "google.spanner.v1.RollbackRequest" do
145
168
  optional :session, :string, 1
@@ -160,6 +183,8 @@ module Google
160
183
  ListSessionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ListSessionsRequest").msgclass
161
184
  ListSessionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ListSessionsResponse").msgclass
162
185
  DeleteSessionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.DeleteSessionRequest").msgclass
186
+ RequestOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.RequestOptions").msgclass
187
+ RequestOptions::Priority = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.RequestOptions.Priority").enummodule
163
188
  ExecuteSqlRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ExecuteSqlRequest").msgclass
164
189
  ExecuteSqlRequest::QueryOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ExecuteSqlRequest.QueryOptions").msgclass
165
190
  ExecuteSqlRequest::QueryMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ExecuteSqlRequest.QueryMode").enummodule
@@ -175,6 +200,7 @@ module Google
175
200
  BeginTransactionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.BeginTransactionRequest").msgclass
176
201
  CommitRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.CommitRequest").msgclass
177
202
  CommitResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.CommitResponse").msgclass
203
+ CommitResponse::CommitStats = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.CommitResponse.CommitStats").msgclass
178
204
  RollbackRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.RollbackRequest").msgclass
179
205
  end
180
206
  end