google-cloud-spanner-admin-database-v1 0.10.0 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1536ce544d325f282526a4e7a4f70d77e1d073372d1bc82d0cae4d12de5d1917
4
- data.tar.gz: 66ee74760e3fff07df238a2c06ad18777f77770d29eba5e3a2f84e71ea76134e
3
+ metadata.gz: 6929ebcdea92158c0fad9c88ab18ca86cb421e901e4ba3a99f06e6985c0606f8
4
+ data.tar.gz: 1afdec85fdeaadf2e9b34261a223c69143ea3bf3d62b446e4d3c65e6d0f193f7
5
5
  SHA512:
6
- metadata.gz: 6c632de0881e5b7e06b9e90c3a031ae425771dedbb4bc451dbc380b4cb0eec0ddff0929dd96bd368b7ad3a01cfa8d0cfcce2776cc788bc304eb1bb7919f7d557
7
- data.tar.gz: 07d1c5592f9f7efaa0b3c0495b5cbfd825c900e363c3be9fde0465081bf8bbb70fb7449ae16e5309e1204a2b3d7daf0f438b0a56fefc8c66009864c5296f622c
6
+ metadata.gz: 46a4bdf68256441bbe8baf778177e5a5dbe8b9596c89befdefcc22a272bd437aa0a2dc34efe0b95155bff3d0577e5f96c1f6d77f9ac598a2a138323e31fca43c
7
+ data.tar.gz: e916351643479cb10eb263e5b55c780bdad6699eed851d405e52b24fb2cf351fd3197ad35ad714defa3368ef153a2561804cb00707230f2317084d745419487f
@@ -144,6 +144,11 @@ module Google
144
144
  initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4]
145
145
  }
146
146
 
147
+ default_config.rpcs.list_database_roles.timeout = 3600.0
148
+ default_config.rpcs.list_database_roles.retry_policy = {
149
+ initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4]
150
+ }
151
+
147
152
  default_config
148
153
  end
149
154
  yield @configure if block_given?
@@ -2253,6 +2258,107 @@ module Google
2253
2258
  raise ::Google::Cloud::Error.from_error(e)
2254
2259
  end
2255
2260
 
2261
+ ##
2262
+ # Lists Cloud Spanner database roles.
2263
+ #
2264
+ # @overload list_database_roles(request, options = nil)
2265
+ # Pass arguments to `list_database_roles` via a request object, either of type
2266
+ # {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesRequest} or an equivalent Hash.
2267
+ #
2268
+ # @param request [::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesRequest, ::Hash]
2269
+ # A request object representing the call parameters. Required. To specify no
2270
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2271
+ # @param options [::Gapic::CallOptions, ::Hash]
2272
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2273
+ #
2274
+ # @overload list_database_roles(parent: nil, page_size: nil, page_token: nil)
2275
+ # Pass arguments to `list_database_roles` via keyword arguments. Note that at
2276
+ # least one keyword argument is required. To specify no parameters, or to keep all
2277
+ # the default parameter values, pass an empty Hash as a request object (see above).
2278
+ #
2279
+ # @param parent [::String]
2280
+ # Required. The database whose roles should be listed.
2281
+ # Values are of the form
2282
+ # `projects/<project>/instances/<instance>/databases/<database>/databaseRoles`.
2283
+ # @param page_size [::Integer]
2284
+ # Number of database roles to be returned in the response. If 0 or less,
2285
+ # defaults to the server's maximum allowed page size.
2286
+ # @param page_token [::String]
2287
+ # If non-empty, `page_token` should contain a
2288
+ # {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesResponse#next_page_token next_page_token} from a
2289
+ # previous {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesResponse ListDatabaseRolesResponse}.
2290
+ #
2291
+ # @yield [response, operation] Access the result along with the RPC operation
2292
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::DatabaseRole>]
2293
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2294
+ #
2295
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::DatabaseRole>]
2296
+ #
2297
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2298
+ #
2299
+ # @example Basic example
2300
+ # require "google/cloud/spanner/admin/database/v1"
2301
+ #
2302
+ # # Create a client object. The client can be reused for multiple calls.
2303
+ # client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new
2304
+ #
2305
+ # # Create a request. To set request fields, pass in keyword arguments.
2306
+ # request = Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesRequest.new
2307
+ #
2308
+ # # Call the list_database_roles method.
2309
+ # result = client.list_database_roles request
2310
+ #
2311
+ # # The returned object is of type Gapic::PagedEnumerable. You can
2312
+ # # iterate over all elements by calling #each, and the enumerable
2313
+ # # will lazily make API calls to fetch subsequent pages. Other
2314
+ # # methods are also available for managing paging directly.
2315
+ # result.each do |response|
2316
+ # # Each element is of type ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseRole.
2317
+ # p response
2318
+ # end
2319
+ #
2320
+ def list_database_roles request, options = nil
2321
+ raise ::ArgumentError, "request must be provided" if request.nil?
2322
+
2323
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesRequest
2324
+
2325
+ # Converts hash and nil to an options object
2326
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2327
+
2328
+ # Customize the options with defaults
2329
+ metadata = @config.rpcs.list_database_roles.metadata.to_h
2330
+
2331
+ # Set x-goog-api-client and x-goog-user-project headers
2332
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2333
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2334
+ gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION
2335
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2336
+
2337
+ header_params = {}
2338
+ if request.parent
2339
+ header_params["parent"] = request.parent
2340
+ end
2341
+
2342
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2343
+ metadata[:"x-goog-request-params"] ||= request_params_header
2344
+
2345
+ options.apply_defaults timeout: @config.rpcs.list_database_roles.timeout,
2346
+ metadata: metadata,
2347
+ retry_policy: @config.rpcs.list_database_roles.retry_policy
2348
+
2349
+ options.apply_defaults timeout: @config.timeout,
2350
+ metadata: @config.metadata,
2351
+ retry_policy: @config.retry_policy
2352
+
2353
+ @database_admin_stub.call_rpc :list_database_roles, request, options: options do |response, operation|
2354
+ response = ::Gapic::PagedEnumerable.new @database_admin_stub, :list_database_roles, request, response, operation, options
2355
+ yield response, operation if block_given?
2356
+ return response
2357
+ end
2358
+ rescue ::GRPC::BadStatus => e
2359
+ raise ::Google::Cloud::Error.from_error(e)
2360
+ end
2361
+
2256
2362
  ##
2257
2363
  # Configuration class for the DatabaseAdmin API.
2258
2364
  #
@@ -2478,6 +2584,11 @@ module Google
2478
2584
  # @return [::Gapic::Config::Method]
2479
2585
  #
2480
2586
  attr_reader :list_backup_operations
2587
+ ##
2588
+ # RPC-specific configuration for `list_database_roles`
2589
+ # @return [::Gapic::Config::Method]
2590
+ #
2591
+ attr_reader :list_database_roles
2481
2592
 
2482
2593
  # @private
2483
2594
  def initialize parent_rpcs = nil
@@ -2517,6 +2628,8 @@ module Google
2517
2628
  @list_database_operations = ::Gapic::Config::Method.new list_database_operations_config
2518
2629
  list_backup_operations_config = parent_rpcs.list_backup_operations if parent_rpcs.respond_to? :list_backup_operations
2519
2630
  @list_backup_operations = ::Gapic::Config::Method.new list_backup_operations_config
2631
+ list_database_roles_config = parent_rpcs.list_database_roles if parent_rpcs.respond_to? :list_database_roles
2632
+ @list_database_roles = ::Gapic::Config::Method.new list_database_roles_config
2520
2633
 
2521
2634
  yield self if block_given?
2522
2635
  end
@@ -23,7 +23,7 @@ module Google
23
23
  module Admin
24
24
  module Database
25
25
  module V1
26
- VERSION = "0.10.0"
26
+ VERSION = "0.11.0"
27
27
  end
28
28
  end
29
29
  end
@@ -126,6 +126,18 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
126
126
  optional :name, :string, 1
127
127
  optional :progress, :message, 2, "google.spanner.admin.database.v1.OperationProgress"
128
128
  end
129
+ add_message "google.spanner.admin.database.v1.DatabaseRole" do
130
+ optional :name, :string, 1
131
+ end
132
+ add_message "google.spanner.admin.database.v1.ListDatabaseRolesRequest" do
133
+ optional :parent, :string, 1
134
+ optional :page_size, :int32, 2
135
+ optional :page_token, :string, 3
136
+ end
137
+ add_message "google.spanner.admin.database.v1.ListDatabaseRolesResponse" do
138
+ repeated :database_roles, :message, 1, "google.spanner.admin.database.v1.DatabaseRole"
139
+ optional :next_page_token, :string, 2
140
+ end
129
141
  add_enum "google.spanner.admin.database.v1.RestoreSourceType" do
130
142
  value :TYPE_UNSPECIFIED, 0
131
143
  value :BACKUP, 1
@@ -159,6 +171,9 @@ module Google
159
171
  RestoreDatabaseEncryptionConfig::EncryptionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.EncryptionType").enummodule
160
172
  RestoreDatabaseMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.RestoreDatabaseMetadata").msgclass
161
173
  OptimizeRestoredDatabaseMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata").msgclass
174
+ DatabaseRole = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.DatabaseRole").msgclass
175
+ ListDatabaseRolesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.ListDatabaseRolesRequest").msgclass
176
+ ListDatabaseRolesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.ListDatabaseRolesResponse").msgclass
162
177
  RestoreSourceType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.RestoreSourceType").enummodule
163
178
  end
164
179
  end
@@ -174,6 +174,8 @@ module Google
174
174
  # `operation.metadata.value.progress.start_time` in descending order starting
175
175
  # from the most recently started operation.
176
176
  rpc :ListBackupOperations, ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsRequest, ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsResponse
177
+ # Lists Cloud Spanner database roles.
178
+ rpc :ListDatabaseRoles, ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesRequest, ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesResponse
177
179
  end
178
180
 
179
181
  Stub = Service.rpc_stub_class
@@ -531,6 +531,53 @@ module Google
531
531
  extend ::Google::Protobuf::MessageExts::ClassMethods
532
532
  end
533
533
 
534
+ # A Cloud Spanner database role.
535
+ # @!attribute [rw] name
536
+ # @return [::String]
537
+ # Required. The name of the database role. Values are of the form
538
+ # `projects/<project>/instances/<instance>/databases/<database>/databaseRoles/
539
+ # \\{role}`, where `<role>` is as specified in the `CREATE ROLE`
540
+ # DDL statement. This name can be passed to Get/Set IAMPolicy methods to
541
+ # identify the database role.
542
+ class DatabaseRole
543
+ include ::Google::Protobuf::MessageExts
544
+ extend ::Google::Protobuf::MessageExts::ClassMethods
545
+ end
546
+
547
+ # The request for {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_database_roles ListDatabaseRoles}.
548
+ # @!attribute [rw] parent
549
+ # @return [::String]
550
+ # Required. The database whose roles should be listed.
551
+ # Values are of the form
552
+ # `projects/<project>/instances/<instance>/databases/<database>/databaseRoles`.
553
+ # @!attribute [rw] page_size
554
+ # @return [::Integer]
555
+ # Number of database roles to be returned in the response. If 0 or less,
556
+ # defaults to the server's maximum allowed page size.
557
+ # @!attribute [rw] page_token
558
+ # @return [::String]
559
+ # If non-empty, `page_token` should contain a
560
+ # {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesResponse#next_page_token next_page_token} from a
561
+ # previous {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesResponse ListDatabaseRolesResponse}.
562
+ class ListDatabaseRolesRequest
563
+ include ::Google::Protobuf::MessageExts
564
+ extend ::Google::Protobuf::MessageExts::ClassMethods
565
+ end
566
+
567
+ # The response for {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_database_roles ListDatabaseRoles}.
568
+ # @!attribute [rw] database_roles
569
+ # @return [::Array<::Google::Cloud::Spanner::Admin::Database::V1::DatabaseRole>]
570
+ # Database roles that matched the request.
571
+ # @!attribute [rw] next_page_token
572
+ # @return [::String]
573
+ # `next_page_token` can be sent in a subsequent
574
+ # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_database_roles ListDatabaseRoles}
575
+ # call to fetch more of the matching roles.
576
+ class ListDatabaseRolesResponse
577
+ include ::Google::Protobuf::MessageExts
578
+ extend ::Google::Protobuf::MessageExts::ClassMethods
579
+ end
580
+
534
581
  # Indicates the type of the restore source.
535
582
  module RestoreSourceType
536
583
  # No restore associated.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-spanner-admin-database-v1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-08 00:00:00.000000000 Z
11
+ date: 2022-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common