google-cloud-spanner 1.16.2 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +1 -1
  3. data/CHANGELOG.md +23 -0
  4. data/lib/google-cloud-spanner.rb +10 -13
  5. data/lib/google/cloud/spanner.rb +6 -8
  6. data/lib/google/cloud/spanner/admin/database/credentials.rb +2 -2
  7. data/lib/google/cloud/spanner/admin/instance/credentials.rb +2 -2
  8. data/lib/google/cloud/spanner/backup.rb +1 -1
  9. data/lib/google/cloud/spanner/backup/job.rb +2 -2
  10. data/lib/google/cloud/spanner/backup/job/list.rb +2 -2
  11. data/lib/google/cloud/spanner/backup/list.rb +1 -2
  12. data/lib/google/cloud/spanner/backup/restore/job.rb +2 -2
  13. data/lib/google/cloud/spanner/batch_client.rb +2 -2
  14. data/lib/google/cloud/spanner/batch_snapshot.rb +6 -8
  15. data/lib/google/cloud/spanner/batch_update.rb +1 -1
  16. data/lib/google/cloud/spanner/client.rb +8 -8
  17. data/lib/google/cloud/spanner/commit.rb +14 -14
  18. data/lib/google/cloud/spanner/convert.rb +7 -7
  19. data/lib/google/cloud/spanner/credentials.rb +2 -2
  20. data/lib/google/cloud/spanner/data.rb +2 -2
  21. data/lib/google/cloud/spanner/database.rb +22 -22
  22. data/lib/google/cloud/spanner/database/backup_info.rb +1 -1
  23. data/lib/google/cloud/spanner/database/job.rb +3 -3
  24. data/lib/google/cloud/spanner/database/job/list.rb +2 -2
  25. data/lib/google/cloud/spanner/database/list.rb +1 -1
  26. data/lib/google/cloud/spanner/database/restore_info.rb +1 -1
  27. data/lib/google/cloud/spanner/fields.rb +8 -8
  28. data/lib/google/cloud/spanner/instance.rb +5 -12
  29. data/lib/google/cloud/spanner/instance/config.rb +1 -1
  30. data/lib/google/cloud/spanner/instance/config/list.rb +1 -1
  31. data/lib/google/cloud/spanner/instance/job.rb +2 -2
  32. data/lib/google/cloud/spanner/instance/list.rb +1 -1
  33. data/lib/google/cloud/spanner/partition.rb +4 -4
  34. data/lib/google/cloud/spanner/policy.rb +2 -2
  35. data/lib/google/cloud/spanner/service.rb +209 -297
  36. data/lib/google/cloud/spanner/session.rb +9 -9
  37. data/lib/google/cloud/spanner/snapshot.rb +2 -2
  38. data/lib/google/cloud/spanner/transaction.rb +2 -2
  39. data/lib/google/cloud/spanner/version.rb +1 -1
  40. metadata +18 -107
  41. data/lib/google/cloud/spanner/admin/database.rb +0 -149
  42. data/lib/google/cloud/spanner/admin/database/v1.rb +0 -147
  43. data/lib/google/cloud/spanner/admin/database/v1/credentials.rb +0 -46
  44. data/lib/google/cloud/spanner/admin/database/v1/database_admin_client.rb +0 -1513
  45. data/lib/google/cloud/spanner/admin/database/v1/database_admin_client_config.json +0 -111
  46. data/lib/google/cloud/spanner/admin/database/v1/doc/google/iam/v1/iam_policy.rb +0 -64
  47. data/lib/google/cloud/spanner/admin/database/v1/doc/google/iam/v1/options.rb +0 -33
  48. data/lib/google/cloud/spanner/admin/database/v1/doc/google/iam/v1/policy.rb +0 -151
  49. data/lib/google/cloud/spanner/admin/database/v1/doc/google/longrunning/operations.rb +0 -51
  50. data/lib/google/cloud/spanner/admin/database/v1/doc/google/protobuf/any.rb +0 -131
  51. data/lib/google/cloud/spanner/admin/database/v1/doc/google/protobuf/empty.rb +0 -29
  52. data/lib/google/cloud/spanner/admin/database/v1/doc/google/protobuf/field_mask.rb +0 -222
  53. data/lib/google/cloud/spanner/admin/database/v1/doc/google/protobuf/timestamp.rb +0 -113
  54. data/lib/google/cloud/spanner/admin/database/v1/doc/google/rpc/status.rb +0 -39
  55. data/lib/google/cloud/spanner/admin/database/v1/doc/google/spanner/admin/database/v1/backup.rb +0 -325
  56. data/lib/google/cloud/spanner/admin/database/v1/doc/google/spanner/admin/database/v1/spanner_database_admin.rb +0 -368
  57. data/lib/google/cloud/spanner/admin/database/v1/doc/google/type/expr.rb +0 -45
  58. data/lib/google/cloud/spanner/admin/instance.rb +0 -164
  59. data/lib/google/cloud/spanner/admin/instance/v1.rb +0 -162
  60. data/lib/google/cloud/spanner/admin/instance/v1/credentials.rb +0 -46
  61. data/lib/google/cloud/spanner/admin/instance/v1/doc/google/iam/v1/iam_policy.rb +0 -64
  62. data/lib/google/cloud/spanner/admin/instance/v1/doc/google/iam/v1/options.rb +0 -33
  63. data/lib/google/cloud/spanner/admin/instance/v1/doc/google/iam/v1/policy.rb +0 -151
  64. data/lib/google/cloud/spanner/admin/instance/v1/doc/google/longrunning/operations.rb +0 -51
  65. data/lib/google/cloud/spanner/admin/instance/v1/doc/google/protobuf/any.rb +0 -131
  66. data/lib/google/cloud/spanner/admin/instance/v1/doc/google/protobuf/empty.rb +0 -29
  67. data/lib/google/cloud/spanner/admin/instance/v1/doc/google/protobuf/field_mask.rb +0 -222
  68. data/lib/google/cloud/spanner/admin/instance/v1/doc/google/rpc/status.rb +0 -39
  69. data/lib/google/cloud/spanner/admin/instance/v1/doc/google/spanner/admin/instance/v1/spanner_instance_admin.rb +0 -334
  70. data/lib/google/cloud/spanner/admin/instance/v1/doc/google/type/expr.rb +0 -45
  71. data/lib/google/cloud/spanner/admin/instance/v1/instance_admin_client.rb +0 -975
  72. data/lib/google/cloud/spanner/admin/instance/v1/instance_admin_client_config.json +0 -76
  73. data/lib/google/cloud/spanner/v1.rb +0 -16
  74. data/lib/google/cloud/spanner/v1/credentials.rb +0 -42
  75. data/lib/google/cloud/spanner/v1/doc/google/protobuf/any.rb +0 -131
  76. data/lib/google/cloud/spanner/v1/doc/google/protobuf/duration.rb +0 -91
  77. data/lib/google/cloud/spanner/v1/doc/google/protobuf/empty.rb +0 -29
  78. data/lib/google/cloud/spanner/v1/doc/google/protobuf/struct.rb +0 -74
  79. data/lib/google/cloud/spanner/v1/doc/google/protobuf/timestamp.rb +0 -113
  80. data/lib/google/cloud/spanner/v1/doc/google/rpc/status.rb +0 -39
  81. data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/keys.rb +0 -150
  82. data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/mutation.rb +0 -95
  83. data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/query_plan.rb +0 -121
  84. data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/result_set.rb +0 -190
  85. data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/spanner.rb +0 -570
  86. data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/transaction.rb +0 -432
  87. data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/type.rb +0 -112
  88. data/lib/google/cloud/spanner/v1/spanner_client.rb +0 -1485
  89. data/lib/google/cloud/spanner/v1/spanner_client_config.json +0 -121
  90. data/lib/google/spanner/admin/database/v1/backup_pb.rb +0 -98
  91. data/lib/google/spanner/admin/database/v1/common_pb.rb +0 -28
  92. data/lib/google/spanner/admin/database/v1/spanner_database_admin_pb.rb +0 -141
  93. data/lib/google/spanner/admin/database/v1/spanner_database_admin_services_pb.rb +0 -169
  94. data/lib/google/spanner/admin/instance/v1/spanner_instance_admin_pb.rb +0 -125
  95. data/lib/google/spanner/admin/instance/v1/spanner_instance_admin_services_pb.rb +0 -181
  96. data/lib/google/spanner/v1/keys_pb.rb +0 -34
  97. data/lib/google/spanner/v1/mutation_pb.rb +0 -39
  98. data/lib/google/spanner/v1/query_plan_pb.rb +0 -48
  99. data/lib/google/spanner/v1/result_set_pb.rb +0 -48
  100. data/lib/google/spanner/v1/spanner_pb.rb +0 -179
  101. data/lib/google/spanner/v1/spanner_services_pb.rb +0 -179
  102. data/lib/google/spanner/v1/transaction_pb.rb +0 -56
  103. data/lib/google/spanner/v1/type_pb.rb +0 -44
@@ -42,7 +42,7 @@ module Google
42
42
  #
43
43
  class Session
44
44
  ##
45
- # @private The Google::Spanner::V1::Session object
45
+ # @private The `Google::Cloud::Spanner::V1::Session` object
46
46
  attr_accessor :grpc
47
47
 
48
48
  ##
@@ -150,7 +150,7 @@ module Google
150
150
  # specified using a {Fields} object.
151
151
  #
152
152
  # Types are optional.
153
- # @param [Google::Spanner::V1::TransactionSelector] transaction The
153
+ # @param [Google::Cloud::Spanner::V1::TransactionSelector] transaction The
154
154
  # transaction selector value to send. Only used for single-use
155
155
  # transactions.
156
156
  # @param [Integer] seqno A per-transaction sequence number used to
@@ -297,7 +297,7 @@ module Google
297
297
  ##
298
298
  # Executes DML statements in a batch.
299
299
  #
300
- # @param [Google::Spanner::V1::TransactionSelector] transaction The
300
+ # @param [Google::Cloud::Spanner::V1::TransactionSelector] transaction The
301
301
  # transaction selector value to send. Only used for single-use
302
302
  # transactions.
303
303
  # @param [Integer] seqno A per-transaction sequence number used to
@@ -346,7 +346,7 @@ module Google
346
346
  # Optional.
347
347
  # @param [Integer] limit If greater than zero, no more than this number
348
348
  # of rows will be returned. The default is no limit.
349
- # @param [Google::Spanner::V1::TransactionSelector] transaction The
349
+ # @param [Google::Cloud::Spanner::V1::TransactionSelector] transaction The
350
350
  # transaction selector value to send. Only used for single-use
351
351
  # transactions.
352
352
  #
@@ -675,8 +675,8 @@ module Google
675
675
  rescue Google::Cloud::NotFoundError
676
676
  labels = @grpc.labels.to_h unless @grpc.labels.to_h.empty?
677
677
  @grpc = service.create_session \
678
- Admin::Database::V1::DatabaseAdminClient.database_path(
679
- project_id, instance_id, database_id
678
+ V1::Spanner::Paths.database_path(
679
+ project: project_id, instance: instance_id, database: database_id
680
680
  ),
681
681
  labels: labels
682
682
  @last_updated_at = Time.now
@@ -693,8 +693,8 @@ module Google
693
693
  rescue Google::Cloud::NotFoundError
694
694
  labels = @grpc.labels.to_h unless @grpc.labels.to_h.empty?
695
695
  @grpc = service.create_session \
696
- Admin::Database::V1::DatabaseAdminClient.database_path(
697
- project_id, instance_id, database_id
696
+ V1::Spanner::Paths.database_path(
697
+ project: project_id, instance: instance_id, database: database_id
698
698
  ),
699
699
  labels: labels
700
700
  false
@@ -718,7 +718,7 @@ module Google
718
718
 
719
719
  ##
720
720
  # @private Creates a new Session instance from a
721
- # Google::Spanner::V1::Session.
721
+ # `Google::Cloud::Spanner::V1::Session`.
722
722
  def self.from_grpc grpc, service, query_options: nil
723
723
  new grpc, service, query_options: query_options
724
724
  end
@@ -414,7 +414,7 @@ module Google
414
414
 
415
415
  ##
416
416
  # @private Creates a new Snapshot instance from a
417
- # Google::Spanner::V1::Transaction.
417
+ # `Google::Cloud::Spanner::V1::Transaction`.
418
418
  def self.from_grpc grpc, session
419
419
  new.tap do |s|
420
420
  s.instance_variable_set :@grpc, grpc
@@ -427,7 +427,7 @@ module Google
427
427
  # The TransactionSelector to be used for queries
428
428
  def tx_selector
429
429
  return nil if transaction_id.nil?
430
- Google::Spanner::V1::TransactionSelector.new id: transaction_id
430
+ V1::TransactionSelector.new id: transaction_id
431
431
  end
432
432
 
433
433
  ##
@@ -920,7 +920,7 @@ module Google
920
920
 
921
921
  ##
922
922
  # @private Creates a new Transaction instance from a
923
- # Google::Spanner::V1::Transaction.
923
+ # `Google::Cloud::Spanner::V1::Transaction`.
924
924
  def self.from_grpc grpc, session
925
925
  new.tap do |s|
926
926
  s.instance_variable_set :@grpc, grpc
@@ -933,7 +933,7 @@ module Google
933
933
  # The TransactionSelector to be used for queries
934
934
  def tx_selector
935
935
  return nil if transaction_id.nil?
936
- Google::Spanner::V1::TransactionSelector.new id: transaction_id
936
+ V1::TransactionSelector.new id: transaction_id
937
937
  end
938
938
 
939
939
  ##
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module Spanner
19
- VERSION = "1.16.2".freeze
19
+ VERSION = "2.0.0".freeze
20
20
  end
21
21
  end
22
22
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-spanner
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.16.2
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Moore
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-05-28 00:00:00.000000000 Z
12
+ date: 2020-07-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: google-cloud-core
@@ -17,82 +17,56 @@ dependencies:
17
17
  requirements:
18
18
  - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: '1.2'
20
+ version: '1.5'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: '1.2'
27
+ version: '1.5'
28
28
  - !ruby/object:Gem::Dependency
29
- name: google-gax
29
+ name: google-cloud-spanner-admin-database-v1
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
32
  - - "~>"
33
33
  - !ruby/object:Gem::Version
34
- version: '1.8'
34
+ version: '0.1'
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - "~>"
40
40
  - !ruby/object:Gem::Version
41
- version: '1.8'
41
+ version: '0.1'
42
42
  - !ruby/object:Gem::Dependency
43
- name: googleapis-common-protos
43
+ name: google-cloud-spanner-admin-instance-v1
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - ">="
47
- - !ruby/object:Gem::Version
48
- version: 1.3.9
49
- - - "<"
50
- - !ruby/object:Gem::Version
51
- version: '2.0'
52
- type: :runtime
53
- prerelease: false
54
- version_requirements: !ruby/object:Gem::Requirement
55
- requirements:
56
- - - ">="
57
- - !ruby/object:Gem::Version
58
- version: 1.3.9
59
- - - "<"
60
- - !ruby/object:Gem::Version
61
- version: '2.0'
62
- - !ruby/object:Gem::Dependency
63
- name: googleapis-common-protos-types
64
- requirement: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: 1.0.4
69
- - - "<"
46
+ - - "~>"
70
47
  - !ruby/object:Gem::Version
71
- version: '2.0'
48
+ version: '0.1'
72
49
  type: :runtime
73
50
  prerelease: false
74
51
  version_requirements: !ruby/object:Gem::Requirement
75
52
  requirements:
76
- - - ">="
77
- - !ruby/object:Gem::Version
78
- version: 1.0.4
79
- - - "<"
53
+ - - "~>"
80
54
  - !ruby/object:Gem::Version
81
- version: '2.0'
55
+ version: '0.1'
82
56
  - !ruby/object:Gem::Dependency
83
- name: grpc-google-iam-v1
57
+ name: google-cloud-spanner-v1
84
58
  requirement: !ruby/object:Gem::Requirement
85
59
  requirements:
86
60
  - - "~>"
87
61
  - !ruby/object:Gem::Version
88
- version: 0.6.9
62
+ version: '0.2'
89
63
  type: :runtime
90
64
  prerelease: false
91
65
  version_requirements: !ruby/object:Gem::Requirement
92
66
  requirements:
93
67
  - - "~>"
94
68
  - !ruby/object:Gem::Version
95
- version: 0.6.9
69
+ version: '0.2'
96
70
  - !ruby/object:Gem::Dependency
97
71
  name: concurrent-ruby
98
72
  requirement: !ruby/object:Gem::Requirement
@@ -253,14 +227,14 @@ dependencies:
253
227
  requirements:
254
228
  - - "~>"
255
229
  - !ruby/object:Gem::Version
256
- version: 1.26.0
230
+ version: 1.28.0
257
231
  type: :development
258
232
  prerelease: false
259
233
  version_requirements: !ruby/object:Gem::Requirement
260
234
  requirements:
261
235
  - - "~>"
262
236
  - !ruby/object:Gem::Version
263
- version: 1.26.0
237
+ version: 1.28.0
264
238
  - !ruby/object:Gem::Dependency
265
239
  name: grpc-tools
266
240
  requirement: !ruby/object:Gem::Requirement
@@ -295,40 +269,8 @@ files:
295
269
  - TROUBLESHOOTING.md
296
270
  - lib/google-cloud-spanner.rb
297
271
  - lib/google/cloud/spanner.rb
298
- - lib/google/cloud/spanner/admin/database.rb
299
272
  - lib/google/cloud/spanner/admin/database/credentials.rb
300
- - lib/google/cloud/spanner/admin/database/v1.rb
301
- - lib/google/cloud/spanner/admin/database/v1/credentials.rb
302
- - lib/google/cloud/spanner/admin/database/v1/database_admin_client.rb
303
- - lib/google/cloud/spanner/admin/database/v1/database_admin_client_config.json
304
- - lib/google/cloud/spanner/admin/database/v1/doc/google/iam/v1/iam_policy.rb
305
- - lib/google/cloud/spanner/admin/database/v1/doc/google/iam/v1/options.rb
306
- - lib/google/cloud/spanner/admin/database/v1/doc/google/iam/v1/policy.rb
307
- - lib/google/cloud/spanner/admin/database/v1/doc/google/longrunning/operations.rb
308
- - lib/google/cloud/spanner/admin/database/v1/doc/google/protobuf/any.rb
309
- - lib/google/cloud/spanner/admin/database/v1/doc/google/protobuf/empty.rb
310
- - lib/google/cloud/spanner/admin/database/v1/doc/google/protobuf/field_mask.rb
311
- - lib/google/cloud/spanner/admin/database/v1/doc/google/protobuf/timestamp.rb
312
- - lib/google/cloud/spanner/admin/database/v1/doc/google/rpc/status.rb
313
- - lib/google/cloud/spanner/admin/database/v1/doc/google/spanner/admin/database/v1/backup.rb
314
- - lib/google/cloud/spanner/admin/database/v1/doc/google/spanner/admin/database/v1/spanner_database_admin.rb
315
- - lib/google/cloud/spanner/admin/database/v1/doc/google/type/expr.rb
316
- - lib/google/cloud/spanner/admin/instance.rb
317
273
  - lib/google/cloud/spanner/admin/instance/credentials.rb
318
- - lib/google/cloud/spanner/admin/instance/v1.rb
319
- - lib/google/cloud/spanner/admin/instance/v1/credentials.rb
320
- - lib/google/cloud/spanner/admin/instance/v1/doc/google/iam/v1/iam_policy.rb
321
- - lib/google/cloud/spanner/admin/instance/v1/doc/google/iam/v1/options.rb
322
- - lib/google/cloud/spanner/admin/instance/v1/doc/google/iam/v1/policy.rb
323
- - lib/google/cloud/spanner/admin/instance/v1/doc/google/longrunning/operations.rb
324
- - lib/google/cloud/spanner/admin/instance/v1/doc/google/protobuf/any.rb
325
- - lib/google/cloud/spanner/admin/instance/v1/doc/google/protobuf/empty.rb
326
- - lib/google/cloud/spanner/admin/instance/v1/doc/google/protobuf/field_mask.rb
327
- - lib/google/cloud/spanner/admin/instance/v1/doc/google/rpc/status.rb
328
- - lib/google/cloud/spanner/admin/instance/v1/doc/google/spanner/admin/instance/v1/spanner_instance_admin.rb
329
- - lib/google/cloud/spanner/admin/instance/v1/doc/google/type/expr.rb
330
- - lib/google/cloud/spanner/admin/instance/v1/instance_admin_client.rb
331
- - lib/google/cloud/spanner/admin/instance/v1/instance_admin_client_config.json
332
274
  - lib/google/cloud/spanner/backup.rb
333
275
  - lib/google/cloud/spanner/backup/job.rb
334
276
  - lib/google/cloud/spanner/backup/job/list.rb
@@ -367,38 +309,7 @@ files:
367
309
  - lib/google/cloud/spanner/snapshot.rb
368
310
  - lib/google/cloud/spanner/status.rb
369
311
  - lib/google/cloud/spanner/transaction.rb
370
- - lib/google/cloud/spanner/v1.rb
371
- - lib/google/cloud/spanner/v1/credentials.rb
372
- - lib/google/cloud/spanner/v1/doc/google/protobuf/any.rb
373
- - lib/google/cloud/spanner/v1/doc/google/protobuf/duration.rb
374
- - lib/google/cloud/spanner/v1/doc/google/protobuf/empty.rb
375
- - lib/google/cloud/spanner/v1/doc/google/protobuf/struct.rb
376
- - lib/google/cloud/spanner/v1/doc/google/protobuf/timestamp.rb
377
- - lib/google/cloud/spanner/v1/doc/google/rpc/status.rb
378
- - lib/google/cloud/spanner/v1/doc/google/spanner/v1/keys.rb
379
- - lib/google/cloud/spanner/v1/doc/google/spanner/v1/mutation.rb
380
- - lib/google/cloud/spanner/v1/doc/google/spanner/v1/query_plan.rb
381
- - lib/google/cloud/spanner/v1/doc/google/spanner/v1/result_set.rb
382
- - lib/google/cloud/spanner/v1/doc/google/spanner/v1/spanner.rb
383
- - lib/google/cloud/spanner/v1/doc/google/spanner/v1/transaction.rb
384
- - lib/google/cloud/spanner/v1/doc/google/spanner/v1/type.rb
385
- - lib/google/cloud/spanner/v1/spanner_client.rb
386
- - lib/google/cloud/spanner/v1/spanner_client_config.json
387
312
  - lib/google/cloud/spanner/version.rb
388
- - lib/google/spanner/admin/database/v1/backup_pb.rb
389
- - lib/google/spanner/admin/database/v1/common_pb.rb
390
- - lib/google/spanner/admin/database/v1/spanner_database_admin_pb.rb
391
- - lib/google/spanner/admin/database/v1/spanner_database_admin_services_pb.rb
392
- - lib/google/spanner/admin/instance/v1/spanner_instance_admin_pb.rb
393
- - lib/google/spanner/admin/instance/v1/spanner_instance_admin_services_pb.rb
394
- - lib/google/spanner/v1/keys_pb.rb
395
- - lib/google/spanner/v1/mutation_pb.rb
396
- - lib/google/spanner/v1/query_plan_pb.rb
397
- - lib/google/spanner/v1/result_set_pb.rb
398
- - lib/google/spanner/v1/spanner_pb.rb
399
- - lib/google/spanner/v1/spanner_services_pb.rb
400
- - lib/google/spanner/v1/transaction_pb.rb
401
- - lib/google/spanner/v1/type_pb.rb
402
313
  homepage: https://github.com/googleapis/google-cloud-ruby/tree/master/google-cloud-spanner
403
314
  licenses:
404
315
  - Apache-2.0
@@ -418,7 +329,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
418
329
  - !ruby/object:Gem::Version
419
330
  version: '0'
420
331
  requirements: []
421
- rubygems_version: 3.0.6
332
+ rubygems_version: 3.1.3
422
333
  signing_key:
423
334
  specification_version: 4
424
335
  summary: API Client library for Google Cloud Spanner API
@@ -1,149 +0,0 @@
1
- # Copyright 2020 Google LLC
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # https://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
-
16
- require "google/gax"
17
- require "pathname"
18
-
19
- module Google
20
- module Cloud
21
- module Spanner
22
- module Admin
23
- # rubocop:disable LineLength
24
-
25
- ##
26
- # # Ruby Client for Cloud Spanner Database Admin API
27
- #
28
- # [Cloud Spanner Database Admin API][Product Documentation]:
29
- #
30
- # - [Product Documentation][]
31
- #
32
- # ## Quick Start
33
- # In order to use this library, you first need to go through the following
34
- # steps:
35
- #
36
- # 1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
37
- # 2. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
38
- # 3. [Enable the Cloud Spanner Database Admin API.](https://console.cloud.google.com/apis/library/spanner.googleapis.com)
39
- # 4. [Setup Authentication.](https://googleapis.dev/ruby/google-cloud-spanner/latest/file.AUTHENTICATION.html)
40
- #
41
- # ### Installation
42
- # ```
43
- # $ gem install google-cloud-spanner
44
- # ```
45
- #
46
- # ### Next Steps
47
- # - Read the [Cloud Spanner Database Admin API Product documentation][Product Documentation]
48
- # to learn more about the product and see How-to Guides.
49
- # - View this [repository's main README](https://github.com/googleapis/google-cloud-ruby/blob/master/README.md)
50
- # to see the full list of Cloud APIs that we cover.
51
- #
52
- # [Product Documentation]: https://cloud.google.com/spanner
53
- #
54
- # ## Enabling Logging
55
- #
56
- # To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
57
- # The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib-2.5.0/libdoc/logger/rdoc/Logger.html) as shown below,
58
- # or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
59
- # that will write logs to [Stackdriver Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
60
- # and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
61
- #
62
- # Configuring a Ruby stdlib logger:
63
- #
64
- # ```ruby
65
- # require "logger"
66
- #
67
- # module MyLogger
68
- # LOGGER = Logger.new $stderr, level: Logger::WARN
69
- # def logger
70
- # LOGGER
71
- # end
72
- # end
73
- #
74
- # # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
75
- # module GRPC
76
- # extend MyLogger
77
- # end
78
- # ```
79
- #
80
- module Database
81
- # rubocop:enable LineLength
82
-
83
- FILE_DIR = File.realdirpath(Pathname.new(__FILE__).join("..").join("database"))
84
-
85
- AVAILABLE_VERSIONS = Dir["#{FILE_DIR}/*"]
86
- .select { |file| File.directory?(file) }
87
- .select { |dir| Google::Gax::VERSION_MATCHER.match(File.basename(dir)) }
88
- .select { |dir| File.exist?(dir + ".rb") }
89
- .map { |dir| File.basename(dir) }
90
-
91
- ##
92
- # Cloud Spanner Database Admin API
93
- #
94
- # The Cloud Spanner Database Admin API can be used to create, drop, and
95
- # list databases. It also enables updating the schema of pre-existing
96
- # databases. It can be also used to create, delete and list backups for a
97
- # database and to restore from an existing backup.
98
- #
99
- # @param version [Symbol, String]
100
- # The major version of the service to be used. By default :v1
101
- # is used.
102
- # @overload new(version:, credentials:, scopes:, client_config:, timeout:)
103
- # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
104
- # Provides the means for authenticating requests made by the client. This parameter can
105
- # be many types.
106
- # A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
107
- # authenticating requests made by this client.
108
- # A `String` will be treated as the path to the keyfile to be used for the construction of
109
- # credentials for this client.
110
- # A `Hash` will be treated as the contents of a keyfile to be used for the construction of
111
- # credentials for this client.
112
- # A `GRPC::Core::Channel` will be used to make calls through.
113
- # A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
114
- # should already be composed with a `GRPC::Core::CallCredentials` object.
115
- # A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
116
- # metadata for requests, generally, to give OAuth credentials.
117
- # @param scopes [Array<String>]
118
- # The OAuth scopes for this service. This parameter is ignored if
119
- # an updater_proc is supplied.
120
- # @param client_config [Hash]
121
- # A Hash for call options for each method. See
122
- # Google::Gax#construct_settings for the structure of
123
- # this data. Falls back to the default config if not specified
124
- # or the specified config is missing data points.
125
- # @param timeout [Numeric]
126
- # The default timeout, in seconds, for calls made through this client.
127
- # @param metadata [Hash]
128
- # Default metadata to be sent with each request. This can be overridden on a per call basis.
129
- # @param exception_transformer [Proc]
130
- # An optional proc that intercepts any exceptions raised during an API call to inject
131
- # custom error handling.
132
- def self.new(*args, version: :v1, **kwargs)
133
- unless AVAILABLE_VERSIONS.include?(version.to_s.downcase)
134
- raise "The version: #{version} is not available. The available versions " \
135
- "are: [#{AVAILABLE_VERSIONS.join(", ")}]"
136
- end
137
-
138
- require "#{FILE_DIR}/#{version.to_s.downcase}"
139
- version_module = Google::Cloud::Spanner::Admin::Database
140
- .constants
141
- .select {|sym| sym.to_s.downcase == version.to_s.downcase}
142
- .first
143
- Google::Cloud::Spanner::Admin::Database.const_get(version_module).new(*args, **kwargs)
144
- end
145
- end
146
- end
147
- end
148
- end
149
- end