diff --git a/google-cloud-memorystore-v1beta/.owlbot-manifest.json b/google-cloud-memorystore-v1beta/.owlbot-manifest.json index 422b853c662d..b4d37b622875 100644 --- a/google-cloud-memorystore-v1beta/.owlbot-manifest.json +++ b/google-cloud-memorystore-v1beta/.owlbot-manifest.json @@ -43,13 +43,33 @@ "proto_docs/google/protobuf/field_mask.rb", "proto_docs/google/protobuf/timestamp.rb", "proto_docs/google/rpc/status.rb", + "proto_docs/google/type/dayofweek.rb", + "proto_docs/google/type/timeofday.rb", "snippets/Gemfile", + "snippets/memorystore/add_auth_token.rb", + "snippets/memorystore/add_token_auth_user.rb", + "snippets/memorystore/backup_instance.rb", "snippets/memorystore/create_instance.rb", + "snippets/memorystore/delete_auth_token.rb", + "snippets/memorystore/delete_backup.rb", "snippets/memorystore/delete_instance.rb", + "snippets/memorystore/delete_token_auth_user.rb", + "snippets/memorystore/export_backup.rb", + "snippets/memorystore/finish_migration.rb", + "snippets/memorystore/get_auth_token.rb", + "snippets/memorystore/get_backup.rb", + "snippets/memorystore/get_backup_collection.rb", "snippets/memorystore/get_certificate_authority.rb", "snippets/memorystore/get_instance.rb", "snippets/memorystore/get_shared_regional_certificate_authority.rb", + "snippets/memorystore/get_token_auth_user.rb", + "snippets/memorystore/list_auth_tokens.rb", + "snippets/memorystore/list_backup_collections.rb", + "snippets/memorystore/list_backups.rb", "snippets/memorystore/list_instances.rb", + "snippets/memorystore/list_token_auth_users.rb", + "snippets/memorystore/reschedule_maintenance.rb", + "snippets/memorystore/start_migration.rb", "snippets/memorystore/update_instance.rb", "snippets/snippet_metadata_google.cloud.memorystore.v1beta.json", "test/google/cloud/memorystore/v1beta/memorystore_operations_test.rb", diff --git a/google-cloud-memorystore-v1beta/gapic_metadata.json b/google-cloud-memorystore-v1beta/gapic_metadata.json index 0398061dd09d..44d143777b01 100644 --- a/google-cloud-memorystore-v1beta/gapic_metadata.json +++ b/google-cloud-memorystore-v1beta/gapic_metadata.json @@ -44,6 +44,96 @@ "methods": [ "get_shared_regional_certificate_authority" ] + }, + "RescheduleMaintenance": { + "methods": [ + "reschedule_maintenance" + ] + }, + "ListBackupCollections": { + "methods": [ + "list_backup_collections" + ] + }, + "GetBackupCollection": { + "methods": [ + "get_backup_collection" + ] + }, + "ListBackups": { + "methods": [ + "list_backups" + ] + }, + "GetBackup": { + "methods": [ + "get_backup" + ] + }, + "DeleteBackup": { + "methods": [ + "delete_backup" + ] + }, + "ExportBackup": { + "methods": [ + "export_backup" + ] + }, + "BackupInstance": { + "methods": [ + "backup_instance" + ] + }, + "StartMigration": { + "methods": [ + "start_migration" + ] + }, + "FinishMigration": { + "methods": [ + "finish_migration" + ] + }, + "ListTokenAuthUsers": { + "methods": [ + "list_token_auth_users" + ] + }, + "GetTokenAuthUser": { + "methods": [ + "get_token_auth_user" + ] + }, + "ListAuthTokens": { + "methods": [ + "list_auth_tokens" + ] + }, + "GetAuthToken": { + "methods": [ + "get_auth_token" + ] + }, + "AddTokenAuthUser": { + "methods": [ + "add_token_auth_user" + ] + }, + "DeleteTokenAuthUser": { + "methods": [ + "delete_token_auth_user" + ] + }, + "AddAuthToken": { + "methods": [ + "add_auth_token" + ] + }, + "DeleteAuthToken": { + "methods": [ + "delete_auth_token" + ] } } } diff --git a/google-cloud-memorystore-v1beta/lib/google/cloud/memorystore/v1beta/memorystore/client.rb b/google-cloud-memorystore-v1beta/lib/google/cloud/memorystore/v1beta/memorystore/client.rb index b48c7ba1c090..d71e84eaf3eb 100644 --- a/google-cloud-memorystore-v1beta/lib/google/cloud/memorystore/v1beta/memorystore/client.rb +++ b/google-cloud-memorystore-v1beta/lib/google/cloud/memorystore/v1beta/memorystore/client.rb @@ -939,6 +939,1801 @@ def get_shared_regional_certificate_authority request, options = nil raise ::Google::Cloud::Error.from_error(e) end + ## + # Reschedules upcoming maintenance event. + # + # @overload reschedule_maintenance(request, options = nil) + # Pass arguments to `reschedule_maintenance` via a request object, either of type + # {::Google::Cloud::Memorystore::V1beta::RescheduleMaintenanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1beta::RescheduleMaintenanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload reschedule_maintenance(name: nil, reschedule_type: nil, schedule_time: nil) + # Pass arguments to `reschedule_maintenance` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the instance to reschedule maintenance for: + # `projects/{project}/locations/{location_id}/instances/{instance}` + # @param reschedule_type [::Google::Cloud::Memorystore::V1beta::RescheduleMaintenanceRequest::RescheduleType] + # Required. If reschedule type is SPECIFIC_TIME, schedule_time must be set. + # @param schedule_time [::Google::Protobuf::Timestamp, ::Hash] + # Optional. Timestamp when the maintenance shall be rescheduled to if + # reschedule_type=SPECIFIC_TIME, in RFC 3339 format. + # Example: `2012-11-15T16:19:00.094Z`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/memorystore/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Memorystore::V1beta::Memorystore::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Memorystore::V1beta::RescheduleMaintenanceRequest.new + # + # # Call the reschedule_maintenance method. + # result = client.reschedule_maintenance request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def reschedule_maintenance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1beta::RescheduleMaintenanceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.reschedule_maintenance.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Memorystore::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.reschedule_maintenance.timeout, + metadata: metadata, + retry_policy: @config.rpcs.reschedule_maintenance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @memorystore_stub.call_rpc :reschedule_maintenance, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all backup collections owned by a consumer project in either the + # specified location (region) or all locations. + # + # If `location_id` is specified as `-` (wildcard), then all regions + # available to the project are queried, and the results are aggregated. + # + # @overload list_backup_collections(request, options = nil) + # Pass arguments to `list_backup_collections` via a request object, either of type + # {::Google::Cloud::Memorystore::V1beta::ListBackupCollectionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1beta::ListBackupCollectionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_backup_collections(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_backup_collections` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the backupCollection location using the + # form: + # `projects/{project_id}/locations/{location_id}` + # where `location_id` refers to a Google Cloud region. + # @param page_size [::Integer] + # Optional. The maximum number of items to return. + # + # If not specified, a default value of 1000 will be used by the service. + # Regardless of the page_size value, the response may include a partial list + # and a caller should only rely on response's + # `next_page_token` + # to determine if there are more clusters left to be queried. + # @param page_token [::String] + # Optional. The `next_page_token` value returned from a previous + # `ListBackupCollections` request, if any. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Memorystore::V1beta::BackupCollection>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Memorystore::V1beta::BackupCollection>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/memorystore/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Memorystore::V1beta::Memorystore::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Memorystore::V1beta::ListBackupCollectionsRequest.new + # + # # Call the list_backup_collections method. + # result = client.list_backup_collections request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Memorystore::V1beta::BackupCollection. + # p item + # end + # + def list_backup_collections request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1beta::ListBackupCollectionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_backup_collections.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Memorystore::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_backup_collections.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_backup_collections.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @memorystore_stub.call_rpc :list_backup_collections, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @memorystore_stub, :list_backup_collections, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Get a backup collection. + # + # @overload get_backup_collection(request, options = nil) + # Pass arguments to `get_backup_collection` via a request object, either of type + # {::Google::Cloud::Memorystore::V1beta::GetBackupCollectionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1beta::GetBackupCollectionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_backup_collection(name: nil) + # Pass arguments to `get_backup_collection` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Instance backupCollection resource name using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}` + # where `location_id` refers to a Google Cloud region. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Memorystore::V1beta::BackupCollection] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Memorystore::V1beta::BackupCollection] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/memorystore/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Memorystore::V1beta::Memorystore::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Memorystore::V1beta::GetBackupCollectionRequest.new + # + # # Call the get_backup_collection method. + # result = client.get_backup_collection request + # + # # The returned object is of type Google::Cloud::Memorystore::V1beta::BackupCollection. + # p result + # + def get_backup_collection request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1beta::GetBackupCollectionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_backup_collection.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Memorystore::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_backup_collection.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_backup_collection.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @memorystore_stub.call_rpc :get_backup_collection, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all backups owned by a backup collection. + # + # @overload list_backups(request, options = nil) + # Pass arguments to `list_backups` via a request object, either of type + # {::Google::Cloud::Memorystore::V1beta::ListBackupsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1beta::ListBackupsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_backups(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_backups` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the backupCollection using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}` + # @param page_size [::Integer] + # Optional. The maximum number of items to return. + # + # If not specified, a default value of 1000 will be used by the service. + # Regardless of the page_size value, the response may include a partial list + # and a caller should only rely on response's + # `next_page_token` + # to determine if there are more clusters left to be queried. + # @param page_token [::String] + # Optional. The `next_page_token` value returned from a previous + # `ListBackupCollections` request, if any. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Memorystore::V1beta::Backup>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Memorystore::V1beta::Backup>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/memorystore/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Memorystore::V1beta::Memorystore::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Memorystore::V1beta::ListBackupsRequest.new + # + # # Call the list_backups method. + # result = client.list_backups request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Memorystore::V1beta::Backup. + # p item + # end + # + def list_backups request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1beta::ListBackupsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_backups.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Memorystore::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_backups.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_backups.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @memorystore_stub.call_rpc :list_backups, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @memorystore_stub, :list_backups, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the details of a specific backup. + # + # @overload get_backup(request, options = nil) + # Pass arguments to `get_backup` via a request object, either of type + # {::Google::Cloud::Memorystore::V1beta::GetBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1beta::GetBackupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_backup(name: nil) + # Pass arguments to `get_backup` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Instance backup resource name using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Memorystore::V1beta::Backup] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Memorystore::V1beta::Backup] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/memorystore/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Memorystore::V1beta::Memorystore::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Memorystore::V1beta::GetBackupRequest.new + # + # # Call the get_backup method. + # result = client.get_backup request + # + # # The returned object is of type Google::Cloud::Memorystore::V1beta::Backup. + # p result + # + def get_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1beta::GetBackupRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_backup.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Memorystore::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_backup.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_backup.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @memorystore_stub.call_rpc :get_backup, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a specific backup. + # + # @overload delete_backup(request, options = nil) + # Pass arguments to `delete_backup` via a request object, either of type + # {::Google::Cloud::Memorystore::V1beta::DeleteBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1beta::DeleteBackupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_backup(name: nil, request_id: nil) + # Pass arguments to `delete_backup` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Instance backup resource name using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` + # @param request_id [::String] + # Optional. Idempotent request UUID. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/memorystore/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Memorystore::V1beta::Memorystore::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Memorystore::V1beta::DeleteBackupRequest.new + # + # # Call the delete_backup method. + # result = client.delete_backup request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1beta::DeleteBackupRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_backup.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Memorystore::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_backup.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_backup.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @memorystore_stub.call_rpc :delete_backup, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Exports a specific backup to a customer target Cloud Storage URI. + # + # @overload export_backup(request, options = nil) + # Pass arguments to `export_backup` via a request object, either of type + # {::Google::Cloud::Memorystore::V1beta::ExportBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1beta::ExportBackupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload export_backup(gcs_bucket: nil, name: nil) + # Pass arguments to `export_backup` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param gcs_bucket [::String] + # Google Cloud Storage bucket, like "my-bucket". + # @param name [::String] + # Required. Instance backup resource name using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/memorystore/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Memorystore::V1beta::Memorystore::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Memorystore::V1beta::ExportBackupRequest.new + # + # # Call the export_backup method. + # result = client.export_backup request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def export_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1beta::ExportBackupRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.export_backup.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Memorystore::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.export_backup.timeout, + metadata: metadata, + retry_policy: @config.rpcs.export_backup.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @memorystore_stub.call_rpc :export_backup, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Backup Instance. + # If this is the first time a backup is being created, a backup collection + # will be created at the backend, and this backup belongs to this collection. + # Both collection and backup will have a resource name. Backup will be + # executed for each shard. A replica (primary if nonHA) will be selected to + # perform the execution. Backup call will be rejected if there is an ongoing + # backup or update operation. Be aware that during preview, if the instance's + # internal software version is too old, critical update will be performed + # before actual backup. Once the internal software version is updated to the + # minimum version required by the backup feature, subsequent backups will not + # require critical update. After preview, there will be no critical update + # needed for backup. + # + # @overload backup_instance(request, options = nil) + # Pass arguments to `backup_instance` via a request object, either of type + # {::Google::Cloud::Memorystore::V1beta::BackupInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1beta::BackupInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload backup_instance(name: nil, ttl: nil, backup_id: nil) + # Pass arguments to `backup_instance` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a Google Cloud region. + # @param ttl [::Google::Protobuf::Duration, ::Hash] + # Optional. TTL for the backup to expire. Value range is 1 day to 100 years. + # If not specified, the default value is 100 years. + # @param backup_id [::String] + # Optional. The id of the backup to be created. If not specified, the + # default value ([YYYYMMDDHHMMSS]_[Shortened Instance UID] is used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/memorystore/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Memorystore::V1beta::Memorystore::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Memorystore::V1beta::BackupInstanceRequest.new + # + # # Call the backup_instance method. + # result = client.backup_instance request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def backup_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1beta::BackupInstanceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.backup_instance.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Memorystore::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.backup_instance.timeout, + metadata: metadata, + retry_policy: @config.rpcs.backup_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @memorystore_stub.call_rpc :backup_instance, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Initiates the migration of a source instance to the target Memorystore + # instance. + # + # After the successful completion of this operation, the target instance + # will: + # 1. Set up replication with the source instance and replicate any writes to + # the source instance. + # 2. Only allow reads. + # + # @overload start_migration(request, options = nil) + # Pass arguments to `start_migration` via a request object, either of type + # {::Google::Cloud::Memorystore::V1beta::StartMigrationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1beta::StartMigrationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload start_migration(self_managed_source: nil, name: nil) + # Pass arguments to `start_migration` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param self_managed_source [::Google::Cloud::Memorystore::V1beta::SelfManagedSource, ::Hash] + # Required. Configuration for migrating from a self-managed Valkey/Redis + # instance + # @param name [::String] + # Required. The resource name of the instance to start migration on. + # Format: projects/\\{project}/locations/\\{location}/instances/\\{instance} + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/memorystore/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Memorystore::V1beta::Memorystore::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Memorystore::V1beta::StartMigrationRequest.new + # + # # Call the start_migration method. + # result = client.start_migration request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def start_migration request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1beta::StartMigrationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.start_migration.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Memorystore::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.start_migration.timeout, + metadata: metadata, + retry_policy: @config.rpcs.start_migration.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @memorystore_stub.call_rpc :start_migration, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Finalizes the migration process. + # + # After the successful completion of this operation, the target instance + # will: + # 1. Stop replicating from the source instance. + # 2. Allow both reads and writes. + # + # @overload finish_migration(request, options = nil) + # Pass arguments to `finish_migration` via a request object, either of type + # {::Google::Cloud::Memorystore::V1beta::FinishMigrationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1beta::FinishMigrationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload finish_migration(name: nil, force: nil) + # Pass arguments to `finish_migration` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the instance to finalize migration on. + # Format: projects/\\{project}/locations/\\{location}/instances/\\{instance} + # @param force [::Boolean] + # Optional. By default, the `FinishMigration` operation ensures the target + # replication offset to catch up to the source offset as of the time of the + # call. Set this field to `true` to bypass this offset verification check. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/memorystore/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Memorystore::V1beta::Memorystore::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Memorystore::V1beta::FinishMigrationRequest.new + # + # # Call the finish_migration method. + # result = client.finish_migration request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def finish_migration request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1beta::FinishMigrationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.finish_migration.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Memorystore::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.finish_migration.timeout, + metadata: metadata, + retry_policy: @config.rpcs.finish_migration.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @memorystore_stub.call_rpc :finish_migration, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all the token auth users for a token based auth enabled instance. + # + # @overload list_token_auth_users(request, options = nil) + # Pass arguments to `list_token_auth_users` via a request object, either of type + # {::Google::Cloud::Memorystore::V1beta::ListTokenAuthUsersRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1beta::ListTokenAuthUsersRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_token_auth_users(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_token_auth_users` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent to list token auth users from. + # Format: projects/\\{project}/locations/\\{location}/instances/\\{instance} + # @param page_size [::Integer] + # Optional. The maximum number of items to return. The maximum value is 1000; + # values above 1000 will be coerced to 1000. If not specified, a default + # value of 1000 will be used by the service. Regardless of the page_size + # value, the response may include a partial list and a caller should only + # rely on response's `next_page_token` to determine if there are more token + # auth users left to be queried. + # @param page_token [::String] + # Optional. The `next_page_token` value returned from a previous + # `ListTokenAuthUsers` request, if any. + # @param filter [::String] + # Optional. Expression for filtering results. + # @param order_by [::String] + # Optional. Sort results by a defined order. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Memorystore::V1beta::TokenAuthUser>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Memorystore::V1beta::TokenAuthUser>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/memorystore/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Memorystore::V1beta::Memorystore::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Memorystore::V1beta::ListTokenAuthUsersRequest.new + # + # # Call the list_token_auth_users method. + # result = client.list_token_auth_users request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Memorystore::V1beta::TokenAuthUser. + # p item + # end + # + def list_token_auth_users request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1beta::ListTokenAuthUsersRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_token_auth_users.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Memorystore::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_token_auth_users.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_token_auth_users.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @memorystore_stub.call_rpc :list_token_auth_users, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @memorystore_stub, :list_token_auth_users, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a specific token auth user for a token based auth enabled instance. + # + # @overload get_token_auth_user(request, options = nil) + # Pass arguments to `get_token_auth_user` via a request object, either of type + # {::Google::Cloud::Memorystore::V1beta::GetTokenAuthUserRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1beta::GetTokenAuthUserRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_token_auth_user(name: nil) + # Pass arguments to `get_token_auth_user` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of token auth user for a basic auth enabled instance. + # Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/tokenAuthUsers/\\{token_auth_user} + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Memorystore::V1beta::TokenAuthUser] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Memorystore::V1beta::TokenAuthUser] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/memorystore/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Memorystore::V1beta::Memorystore::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Memorystore::V1beta::GetTokenAuthUserRequest.new + # + # # Call the get_token_auth_user method. + # result = client.get_token_auth_user request + # + # # The returned object is of type Google::Cloud::Memorystore::V1beta::TokenAuthUser. + # p result + # + def get_token_auth_user request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1beta::GetTokenAuthUserRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_token_auth_user.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Memorystore::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_token_auth_user.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_token_auth_user.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @memorystore_stub.call_rpc :get_token_auth_user, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all the auth tokens for a specific token auth user. + # + # @overload list_auth_tokens(request, options = nil) + # Pass arguments to `list_auth_tokens` via a request object, either of type + # {::Google::Cloud::Memorystore::V1beta::ListAuthTokensRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1beta::ListAuthTokensRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_auth_tokens(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_auth_tokens` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent to list auth tokens from. + # Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/tokenAuthUsers/\\{token_auth_user} + # @param page_size [::Integer] + # Optional. The maximum number of items to return. The maximum value is 1000; + # values above 1000 will be coerced to 1000. + # + # If not specified, a default value of 1000 will be used by the service. + # Regardless of the page_size value, the response may include a partial list + # and a caller should only rely on response's + # `next_page_token` + # to determine if there are more auth tokens left to be queried. + # @param page_token [::String] + # Optional. The `next_page_token` value returned from a previous + # `ListAuthTokens` request, if any. + # @param filter [::String] + # Optional. Expression for filtering results. + # @param order_by [::String] + # Optional. Sort results by a defined order. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Memorystore::V1beta::AuthToken>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Memorystore::V1beta::AuthToken>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/memorystore/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Memorystore::V1beta::Memorystore::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Memorystore::V1beta::ListAuthTokensRequest.new + # + # # Call the list_auth_tokens method. + # result = client.list_auth_tokens request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Memorystore::V1beta::AuthToken. + # p item + # end + # + def list_auth_tokens request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1beta::ListAuthTokensRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_auth_tokens.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Memorystore::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_auth_tokens.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_auth_tokens.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @memorystore_stub.call_rpc :list_auth_tokens, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @memorystore_stub, :list_auth_tokens, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a token based auth enabled instance's auth token for a given user. + # + # @overload get_auth_token(request, options = nil) + # Pass arguments to `get_auth_token` via a request object, either of type + # {::Google::Cloud::Memorystore::V1beta::GetAuthTokenRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1beta::GetAuthTokenRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_auth_token(name: nil) + # Pass arguments to `get_auth_token` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of token auth user for a token auth enabled instance. + # Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/tokenAuthUsers/\\{token_auth_user}/authTokens/\\{auth_token} + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Memorystore::V1beta::AuthToken] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Memorystore::V1beta::AuthToken] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/memorystore/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Memorystore::V1beta::Memorystore::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Memorystore::V1beta::GetAuthTokenRequest.new + # + # # Call the get_auth_token method. + # result = client.get_auth_token request + # + # # The returned object is of type Google::Cloud::Memorystore::V1beta::AuthToken. + # p result + # + def get_auth_token request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1beta::GetAuthTokenRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_auth_token.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Memorystore::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_auth_token.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_auth_token.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @memorystore_stub.call_rpc :get_auth_token, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Adds a token auth user for a token based auth enabled instance. + # + # @overload add_token_auth_user(request, options = nil) + # Pass arguments to `add_token_auth_user` via a request object, either of type + # {::Google::Cloud::Memorystore::V1beta::AddTokenAuthUserRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1beta::AddTokenAuthUserRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload add_token_auth_user(instance: nil, token_auth_user: nil) + # Pass arguments to `add_token_auth_user` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param instance [::String] + # Required. The instance resource that this token auth user will be added + # for. Format: projects/\\{project}/locations/\\{location}/instances/\\{instance} + # @param token_auth_user [::String] + # Required. The name of the token auth user to add. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/memorystore/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Memorystore::V1beta::Memorystore::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Memorystore::V1beta::AddTokenAuthUserRequest.new + # + # # Call the add_token_auth_user method. + # result = client.add_token_auth_user request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def add_token_auth_user request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1beta::AddTokenAuthUserRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.add_token_auth_user.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Memorystore::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.instance + header_params["instance"] = request.instance + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.add_token_auth_user.timeout, + metadata: metadata, + retry_policy: @config.rpcs.add_token_auth_user.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @memorystore_stub.call_rpc :add_token_auth_user, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a token auth user for a token based auth enabled instance. + # + # @overload delete_token_auth_user(request, options = nil) + # Pass arguments to `delete_token_auth_user` via a request object, either of type + # {::Google::Cloud::Memorystore::V1beta::DeleteTokenAuthUserRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1beta::DeleteTokenAuthUserRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_token_auth_user(name: nil, request_id: nil, force: nil) + # Pass arguments to `delete_token_auth_user` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the token auth user to delete. + # Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/tokenAuthUsers/\\{token_auth_user} + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param force [::Boolean] + # Optional. If set to true, any auth tokens from this user will also be + # deleted. Otherwise, the request will only work if the user has no auth + # tokens. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/memorystore/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Memorystore::V1beta::Memorystore::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Memorystore::V1beta::DeleteTokenAuthUserRequest.new + # + # # Call the delete_token_auth_user method. + # result = client.delete_token_auth_user request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_token_auth_user request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1beta::DeleteTokenAuthUserRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_token_auth_user.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Memorystore::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_token_auth_user.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_token_auth_user.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @memorystore_stub.call_rpc :delete_token_auth_user, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Adds a token for a user of a token based auth enabled instance. + # + # @overload add_auth_token(request, options = nil) + # Pass arguments to `add_auth_token` via a request object, either of type + # {::Google::Cloud::Memorystore::V1beta::AddAuthTokenRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1beta::AddAuthTokenRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload add_auth_token(token_auth_user: nil, auth_token: nil) + # Pass arguments to `add_auth_token` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param token_auth_user [::String] + # Required. The name of the token auth user resource that this token will be + # added for. + # @param auth_token [::Google::Cloud::Memorystore::V1beta::AuthToken, ::Hash] + # Required. The auth token to add. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/memorystore/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Memorystore::V1beta::Memorystore::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Memorystore::V1beta::AddAuthTokenRequest.new + # + # # Call the add_auth_token method. + # result = client.add_auth_token request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def add_auth_token request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1beta::AddAuthTokenRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.add_auth_token.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Memorystore::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.token_auth_user + header_params["token_auth_user"] = request.token_auth_user + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.add_auth_token.timeout, + metadata: metadata, + retry_policy: @config.rpcs.add_auth_token.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @memorystore_stub.call_rpc :add_auth_token, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a token for a user of a token based auth enabled instance. + # + # @overload delete_auth_token(request, options = nil) + # Pass arguments to `delete_auth_token` via a request object, either of type + # {::Google::Cloud::Memorystore::V1beta::DeleteAuthTokenRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1beta::DeleteAuthTokenRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_auth_token(name: nil) + # Pass arguments to `delete_auth_token` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the token auth user resource that this token will be + # deleted from. Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/tokenAuthUsers/\\{token_auth_user}/authTokens/\\{name} + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/memorystore/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Memorystore::V1beta::Memorystore::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Memorystore::V1beta::DeleteAuthTokenRequest.new + # + # # Call the delete_auth_token method. + # result = client.delete_auth_token request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_auth_token request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1beta::DeleteAuthTokenRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_auth_token.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Memorystore::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_auth_token.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_auth_token.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @memorystore_stub.call_rpc :delete_auth_token, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + ## # Configuration class for the Memorystore API. # @@ -1159,6 +2954,96 @@ class Rpcs # @return [::Gapic::Config::Method] # attr_reader :get_shared_regional_certificate_authority + ## + # RPC-specific configuration for `reschedule_maintenance` + # @return [::Gapic::Config::Method] + # + attr_reader :reschedule_maintenance + ## + # RPC-specific configuration for `list_backup_collections` + # @return [::Gapic::Config::Method] + # + attr_reader :list_backup_collections + ## + # RPC-specific configuration for `get_backup_collection` + # @return [::Gapic::Config::Method] + # + attr_reader :get_backup_collection + ## + # RPC-specific configuration for `list_backups` + # @return [::Gapic::Config::Method] + # + attr_reader :list_backups + ## + # RPC-specific configuration for `get_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :get_backup + ## + # RPC-specific configuration for `delete_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_backup + ## + # RPC-specific configuration for `export_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :export_backup + ## + # RPC-specific configuration for `backup_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :backup_instance + ## + # RPC-specific configuration for `start_migration` + # @return [::Gapic::Config::Method] + # + attr_reader :start_migration + ## + # RPC-specific configuration for `finish_migration` + # @return [::Gapic::Config::Method] + # + attr_reader :finish_migration + ## + # RPC-specific configuration for `list_token_auth_users` + # @return [::Gapic::Config::Method] + # + attr_reader :list_token_auth_users + ## + # RPC-specific configuration for `get_token_auth_user` + # @return [::Gapic::Config::Method] + # + attr_reader :get_token_auth_user + ## + # RPC-specific configuration for `list_auth_tokens` + # @return [::Gapic::Config::Method] + # + attr_reader :list_auth_tokens + ## + # RPC-specific configuration for `get_auth_token` + # @return [::Gapic::Config::Method] + # + attr_reader :get_auth_token + ## + # RPC-specific configuration for `add_token_auth_user` + # @return [::Gapic::Config::Method] + # + attr_reader :add_token_auth_user + ## + # RPC-specific configuration for `delete_token_auth_user` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_token_auth_user + ## + # RPC-specific configuration for `add_auth_token` + # @return [::Gapic::Config::Method] + # + attr_reader :add_auth_token + ## + # RPC-specific configuration for `delete_auth_token` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_auth_token # @private def initialize parent_rpcs = nil @@ -1176,6 +3061,42 @@ def initialize parent_rpcs = nil @get_certificate_authority = ::Gapic::Config::Method.new get_certificate_authority_config get_shared_regional_certificate_authority_config = parent_rpcs.get_shared_regional_certificate_authority if parent_rpcs.respond_to? :get_shared_regional_certificate_authority @get_shared_regional_certificate_authority = ::Gapic::Config::Method.new get_shared_regional_certificate_authority_config + reschedule_maintenance_config = parent_rpcs.reschedule_maintenance if parent_rpcs.respond_to? :reschedule_maintenance + @reschedule_maintenance = ::Gapic::Config::Method.new reschedule_maintenance_config + list_backup_collections_config = parent_rpcs.list_backup_collections if parent_rpcs.respond_to? :list_backup_collections + @list_backup_collections = ::Gapic::Config::Method.new list_backup_collections_config + get_backup_collection_config = parent_rpcs.get_backup_collection if parent_rpcs.respond_to? :get_backup_collection + @get_backup_collection = ::Gapic::Config::Method.new get_backup_collection_config + list_backups_config = parent_rpcs.list_backups if parent_rpcs.respond_to? :list_backups + @list_backups = ::Gapic::Config::Method.new list_backups_config + get_backup_config = parent_rpcs.get_backup if parent_rpcs.respond_to? :get_backup + @get_backup = ::Gapic::Config::Method.new get_backup_config + delete_backup_config = parent_rpcs.delete_backup if parent_rpcs.respond_to? :delete_backup + @delete_backup = ::Gapic::Config::Method.new delete_backup_config + export_backup_config = parent_rpcs.export_backup if parent_rpcs.respond_to? :export_backup + @export_backup = ::Gapic::Config::Method.new export_backup_config + backup_instance_config = parent_rpcs.backup_instance if parent_rpcs.respond_to? :backup_instance + @backup_instance = ::Gapic::Config::Method.new backup_instance_config + start_migration_config = parent_rpcs.start_migration if parent_rpcs.respond_to? :start_migration + @start_migration = ::Gapic::Config::Method.new start_migration_config + finish_migration_config = parent_rpcs.finish_migration if parent_rpcs.respond_to? :finish_migration + @finish_migration = ::Gapic::Config::Method.new finish_migration_config + list_token_auth_users_config = parent_rpcs.list_token_auth_users if parent_rpcs.respond_to? :list_token_auth_users + @list_token_auth_users = ::Gapic::Config::Method.new list_token_auth_users_config + get_token_auth_user_config = parent_rpcs.get_token_auth_user if parent_rpcs.respond_to? :get_token_auth_user + @get_token_auth_user = ::Gapic::Config::Method.new get_token_auth_user_config + list_auth_tokens_config = parent_rpcs.list_auth_tokens if parent_rpcs.respond_to? :list_auth_tokens + @list_auth_tokens = ::Gapic::Config::Method.new list_auth_tokens_config + get_auth_token_config = parent_rpcs.get_auth_token if parent_rpcs.respond_to? :get_auth_token + @get_auth_token = ::Gapic::Config::Method.new get_auth_token_config + add_token_auth_user_config = parent_rpcs.add_token_auth_user if parent_rpcs.respond_to? :add_token_auth_user + @add_token_auth_user = ::Gapic::Config::Method.new add_token_auth_user_config + delete_token_auth_user_config = parent_rpcs.delete_token_auth_user if parent_rpcs.respond_to? :delete_token_auth_user + @delete_token_auth_user = ::Gapic::Config::Method.new delete_token_auth_user_config + add_auth_token_config = parent_rpcs.add_auth_token if parent_rpcs.respond_to? :add_auth_token + @add_auth_token = ::Gapic::Config::Method.new add_auth_token_config + delete_auth_token_config = parent_rpcs.delete_auth_token if parent_rpcs.respond_to? :delete_auth_token + @delete_auth_token = ::Gapic::Config::Method.new delete_auth_token_config yield self if block_given? end diff --git a/google-cloud-memorystore-v1beta/lib/google/cloud/memorystore/v1beta/memorystore/credentials.rb b/google-cloud-memorystore-v1beta/lib/google/cloud/memorystore/v1beta/memorystore/credentials.rb index 007bb9f7f5c9..611cf7ecdac0 100644 --- a/google-cloud-memorystore-v1beta/lib/google/cloud/memorystore/v1beta/memorystore/credentials.rb +++ b/google-cloud-memorystore-v1beta/lib/google/cloud/memorystore/v1beta/memorystore/credentials.rb @@ -26,7 +26,9 @@ module Memorystore # Credentials for the Memorystore API. class Credentials < ::Google::Auth::Credentials self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/memorystore.read-only", + "https://www.googleapis.com/auth/memorystore.read-write" ] self.env_vars = [ "GOOGLE_CLOUD_CREDENTIALS", diff --git a/google-cloud-memorystore-v1beta/lib/google/cloud/memorystore/v1beta/memorystore/paths.rb b/google-cloud-memorystore-v1beta/lib/google/cloud/memorystore/v1beta/memorystore/paths.rb index 502d10ae0407..48c32057cdbd 100644 --- a/google-cloud-memorystore-v1beta/lib/google/cloud/memorystore/v1beta/memorystore/paths.rb +++ b/google-cloud-memorystore-v1beta/lib/google/cloud/memorystore/v1beta/memorystore/paths.rb @@ -24,6 +24,69 @@ module V1beta module Memorystore # Path helper methods for the Memorystore API. module Paths + ## + # Create a fully-qualified AuthToken resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/instances/{instance}/tokenAuthUsers/{token_auth_user}/authTokens/{auth_token}` + # + # @param project [String] + # @param location [String] + # @param instance [String] + # @param token_auth_user [String] + # @param auth_token [String] + # + # @return [::String] + def auth_token_path project:, location:, instance:, token_auth_user:, auth_token: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "instance cannot contain /" if instance.to_s.include? "/" + raise ::ArgumentError, "token_auth_user cannot contain /" if token_auth_user.to_s.include? "/" + + "projects/#{project}/locations/#{location}/instances/#{instance}/tokenAuthUsers/#{token_auth_user}/authTokens/#{auth_token}" + end + + ## + # Create a fully-qualified Backup resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/backupCollections/{backup_collection}/backups/{backup}` + # + # @param project [String] + # @param location [String] + # @param backup_collection [String] + # @param backup [String] + # + # @return [::String] + def backup_path project:, location:, backup_collection:, backup: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "backup_collection cannot contain /" if backup_collection.to_s.include? "/" + + "projects/#{project}/locations/#{location}/backupCollections/#{backup_collection}/backups/#{backup}" + end + + ## + # Create a fully-qualified BackupCollection resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/backupCollections/{backup_collection}` + # + # @param project [String] + # @param location [String] + # @param backup_collection [String] + # + # @return [::String] + def backup_collection_path project:, location:, backup_collection: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/backupCollections/#{backup_collection}" + end + ## # Create a fully-qualified CaPool resource string. # @@ -43,6 +106,50 @@ def ca_pool_path project:, location:, ca_pool: "projects/#{project}/locations/#{location}/caPools/#{ca_pool}" end + ## + # Create a fully-qualified CryptoKey resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}` + # + # @param project [String] + # @param location [String] + # @param key_ring [String] + # @param crypto_key [String] + # + # @return [::String] + def crypto_key_path project:, location:, key_ring:, crypto_key: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/" + + "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}" + end + + ## + # Create a fully-qualified CryptoKeyVersion resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}` + # + # @param project [String] + # @param location [String] + # @param key_ring [String] + # @param crypto_key [String] + # @param crypto_key_version [String] + # + # @return [::String] + def crypto_key_version_path project:, location:, key_ring:, crypto_key:, crypto_key_version: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/" + raise ::ArgumentError, "crypto_key cannot contain /" if crypto_key.to_s.include? "/" + + "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}/cryptoKeyVersions/#{crypto_key_version}" + end + ## # Create a fully-qualified ForwardingRule resource string. # @@ -115,6 +222,25 @@ def network_path project:, network: "projects/#{project}/global/networks/#{network}" end + ## + # Create a fully-qualified NetworkAttachment resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/regions/{region}/networkAttachments/{network_attachment}` + # + # @param project [String] + # @param region [String] + # @param network_attachment [String] + # + # @return [::String] + def network_attachment_path project:, region:, network_attachment: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "region cannot contain /" if region.to_s.include? "/" + + "projects/#{project}/regions/#{region}/networkAttachments/#{network_attachment}" + end + ## # Create a fully-qualified ServiceAttachment resource string. # @@ -151,6 +277,27 @@ def shared_regional_certificate_authority_path project:, location: "projects/#{project}/locations/#{location}/sharedRegionalCertificateAuthority" end + ## + # Create a fully-qualified TokenAuthUser resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/instances/{instance}/tokenAuthUsers/{token_auth_user}` + # + # @param project [String] + # @param location [String] + # @param instance [String] + # @param token_auth_user [String] + # + # @return [::String] + def token_auth_user_path project:, location:, instance:, token_auth_user: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "instance cannot contain /" if instance.to_s.include? "/" + + "projects/#{project}/locations/#{location}/instances/#{instance}/tokenAuthUsers/#{token_auth_user}" + end + extend self end end diff --git a/google-cloud-memorystore-v1beta/lib/google/cloud/memorystore/v1beta/memorystore/rest/client.rb b/google-cloud-memorystore-v1beta/lib/google/cloud/memorystore/v1beta/memorystore/rest/client.rb index e33486e91171..692f36ed54a1 100644 --- a/google-cloud-memorystore-v1beta/lib/google/cloud/memorystore/v1beta/memorystore/rest/client.rb +++ b/google-cloud-memorystore-v1beta/lib/google/cloud/memorystore/v1beta/memorystore/rest/client.rb @@ -884,6 +884,1675 @@ def get_shared_regional_certificate_authority request, options = nil raise ::Google::Cloud::Error.from_error(e) end + ## + # Reschedules upcoming maintenance event. + # + # @overload reschedule_maintenance(request, options = nil) + # Pass arguments to `reschedule_maintenance` via a request object, either of type + # {::Google::Cloud::Memorystore::V1beta::RescheduleMaintenanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1beta::RescheduleMaintenanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload reschedule_maintenance(name: nil, reschedule_type: nil, schedule_time: nil) + # Pass arguments to `reschedule_maintenance` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the instance to reschedule maintenance for: + # `projects/{project}/locations/{location_id}/instances/{instance}` + # @param reschedule_type [::Google::Cloud::Memorystore::V1beta::RescheduleMaintenanceRequest::RescheduleType] + # Required. If reschedule type is SPECIFIC_TIME, schedule_time must be set. + # @param schedule_time [::Google::Protobuf::Timestamp, ::Hash] + # Optional. Timestamp when the maintenance shall be rescheduled to if + # reschedule_type=SPECIFIC_TIME, in RFC 3339 format. + # Example: `2012-11-15T16:19:00.094Z`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/memorystore/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Memorystore::V1beta::Memorystore::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Memorystore::V1beta::RescheduleMaintenanceRequest.new + # + # # Call the reschedule_maintenance method. + # result = client.reschedule_maintenance request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def reschedule_maintenance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1beta::RescheduleMaintenanceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.reschedule_maintenance.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Memorystore::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.reschedule_maintenance.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.reschedule_maintenance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @memorystore_stub.reschedule_maintenance request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all backup collections owned by a consumer project in either the + # specified location (region) or all locations. + # + # If `location_id` is specified as `-` (wildcard), then all regions + # available to the project are queried, and the results are aggregated. + # + # @overload list_backup_collections(request, options = nil) + # Pass arguments to `list_backup_collections` via a request object, either of type + # {::Google::Cloud::Memorystore::V1beta::ListBackupCollectionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1beta::ListBackupCollectionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_backup_collections(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_backup_collections` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the backupCollection location using the + # form: + # `projects/{project_id}/locations/{location_id}` + # where `location_id` refers to a Google Cloud region. + # @param page_size [::Integer] + # Optional. The maximum number of items to return. + # + # If not specified, a default value of 1000 will be used by the service. + # Regardless of the page_size value, the response may include a partial list + # and a caller should only rely on response's + # `next_page_token` + # to determine if there are more clusters left to be queried. + # @param page_token [::String] + # Optional. The `next_page_token` value returned from a previous + # `ListBackupCollections` request, if any. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Memorystore::V1beta::BackupCollection>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Memorystore::V1beta::BackupCollection>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/memorystore/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Memorystore::V1beta::Memorystore::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Memorystore::V1beta::ListBackupCollectionsRequest.new + # + # # Call the list_backup_collections method. + # result = client.list_backup_collections request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Memorystore::V1beta::BackupCollection. + # p item + # end + # + def list_backup_collections request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1beta::ListBackupCollectionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_backup_collections.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Memorystore::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_backup_collections.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_backup_collections.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @memorystore_stub.list_backup_collections request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @memorystore_stub, :list_backup_collections, "backup_collections", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Get a backup collection. + # + # @overload get_backup_collection(request, options = nil) + # Pass arguments to `get_backup_collection` via a request object, either of type + # {::Google::Cloud::Memorystore::V1beta::GetBackupCollectionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1beta::GetBackupCollectionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_backup_collection(name: nil) + # Pass arguments to `get_backup_collection` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Instance backupCollection resource name using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}` + # where `location_id` refers to a Google Cloud region. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Memorystore::V1beta::BackupCollection] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Memorystore::V1beta::BackupCollection] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/memorystore/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Memorystore::V1beta::Memorystore::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Memorystore::V1beta::GetBackupCollectionRequest.new + # + # # Call the get_backup_collection method. + # result = client.get_backup_collection request + # + # # The returned object is of type Google::Cloud::Memorystore::V1beta::BackupCollection. + # p result + # + def get_backup_collection request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1beta::GetBackupCollectionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_backup_collection.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Memorystore::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_backup_collection.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_backup_collection.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @memorystore_stub.get_backup_collection request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all backups owned by a backup collection. + # + # @overload list_backups(request, options = nil) + # Pass arguments to `list_backups` via a request object, either of type + # {::Google::Cloud::Memorystore::V1beta::ListBackupsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1beta::ListBackupsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_backups(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_backups` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the backupCollection using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}` + # @param page_size [::Integer] + # Optional. The maximum number of items to return. + # + # If not specified, a default value of 1000 will be used by the service. + # Regardless of the page_size value, the response may include a partial list + # and a caller should only rely on response's + # `next_page_token` + # to determine if there are more clusters left to be queried. + # @param page_token [::String] + # Optional. The `next_page_token` value returned from a previous + # `ListBackupCollections` request, if any. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Memorystore::V1beta::Backup>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Memorystore::V1beta::Backup>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/memorystore/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Memorystore::V1beta::Memorystore::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Memorystore::V1beta::ListBackupsRequest.new + # + # # Call the list_backups method. + # result = client.list_backups request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Memorystore::V1beta::Backup. + # p item + # end + # + def list_backups request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1beta::ListBackupsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_backups.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Memorystore::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_backups.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_backups.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @memorystore_stub.list_backups request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @memorystore_stub, :list_backups, "backups", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the details of a specific backup. + # + # @overload get_backup(request, options = nil) + # Pass arguments to `get_backup` via a request object, either of type + # {::Google::Cloud::Memorystore::V1beta::GetBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1beta::GetBackupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_backup(name: nil) + # Pass arguments to `get_backup` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Instance backup resource name using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Memorystore::V1beta::Backup] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Memorystore::V1beta::Backup] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/memorystore/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Memorystore::V1beta::Memorystore::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Memorystore::V1beta::GetBackupRequest.new + # + # # Call the get_backup method. + # result = client.get_backup request + # + # # The returned object is of type Google::Cloud::Memorystore::V1beta::Backup. + # p result + # + def get_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1beta::GetBackupRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_backup.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Memorystore::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_backup.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_backup.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @memorystore_stub.get_backup request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a specific backup. + # + # @overload delete_backup(request, options = nil) + # Pass arguments to `delete_backup` via a request object, either of type + # {::Google::Cloud::Memorystore::V1beta::DeleteBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1beta::DeleteBackupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_backup(name: nil, request_id: nil) + # Pass arguments to `delete_backup` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Instance backup resource name using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` + # @param request_id [::String] + # Optional. Idempotent request UUID. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/memorystore/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Memorystore::V1beta::Memorystore::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Memorystore::V1beta::DeleteBackupRequest.new + # + # # Call the delete_backup method. + # result = client.delete_backup request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1beta::DeleteBackupRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_backup.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Memorystore::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_backup.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_backup.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @memorystore_stub.delete_backup request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Exports a specific backup to a customer target Cloud Storage URI. + # + # @overload export_backup(request, options = nil) + # Pass arguments to `export_backup` via a request object, either of type + # {::Google::Cloud::Memorystore::V1beta::ExportBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1beta::ExportBackupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload export_backup(gcs_bucket: nil, name: nil) + # Pass arguments to `export_backup` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param gcs_bucket [::String] + # Google Cloud Storage bucket, like "my-bucket". + # @param name [::String] + # Required. Instance backup resource name using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/memorystore/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Memorystore::V1beta::Memorystore::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Memorystore::V1beta::ExportBackupRequest.new + # + # # Call the export_backup method. + # result = client.export_backup request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def export_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1beta::ExportBackupRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.export_backup.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Memorystore::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.export_backup.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.export_backup.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @memorystore_stub.export_backup request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Backup Instance. + # If this is the first time a backup is being created, a backup collection + # will be created at the backend, and this backup belongs to this collection. + # Both collection and backup will have a resource name. Backup will be + # executed for each shard. A replica (primary if nonHA) will be selected to + # perform the execution. Backup call will be rejected if there is an ongoing + # backup or update operation. Be aware that during preview, if the instance's + # internal software version is too old, critical update will be performed + # before actual backup. Once the internal software version is updated to the + # minimum version required by the backup feature, subsequent backups will not + # require critical update. After preview, there will be no critical update + # needed for backup. + # + # @overload backup_instance(request, options = nil) + # Pass arguments to `backup_instance` via a request object, either of type + # {::Google::Cloud::Memorystore::V1beta::BackupInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1beta::BackupInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload backup_instance(name: nil, ttl: nil, backup_id: nil) + # Pass arguments to `backup_instance` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a Google Cloud region. + # @param ttl [::Google::Protobuf::Duration, ::Hash] + # Optional. TTL for the backup to expire. Value range is 1 day to 100 years. + # If not specified, the default value is 100 years. + # @param backup_id [::String] + # Optional. The id of the backup to be created. If not specified, the + # default value ([YYYYMMDDHHMMSS]_[Shortened Instance UID] is used. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/memorystore/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Memorystore::V1beta::Memorystore::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Memorystore::V1beta::BackupInstanceRequest.new + # + # # Call the backup_instance method. + # result = client.backup_instance request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def backup_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1beta::BackupInstanceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.backup_instance.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Memorystore::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.backup_instance.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.backup_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @memorystore_stub.backup_instance request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Initiates the migration of a source instance to the target Memorystore + # instance. + # + # After the successful completion of this operation, the target instance + # will: + # 1. Set up replication with the source instance and replicate any writes to + # the source instance. + # 2. Only allow reads. + # + # @overload start_migration(request, options = nil) + # Pass arguments to `start_migration` via a request object, either of type + # {::Google::Cloud::Memorystore::V1beta::StartMigrationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1beta::StartMigrationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload start_migration(self_managed_source: nil, name: nil) + # Pass arguments to `start_migration` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param self_managed_source [::Google::Cloud::Memorystore::V1beta::SelfManagedSource, ::Hash] + # Required. Configuration for migrating from a self-managed Valkey/Redis + # instance + # @param name [::String] + # Required. The resource name of the instance to start migration on. + # Format: projects/\\{project}/locations/\\{location}/instances/\\{instance} + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/memorystore/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Memorystore::V1beta::Memorystore::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Memorystore::V1beta::StartMigrationRequest.new + # + # # Call the start_migration method. + # result = client.start_migration request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def start_migration request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1beta::StartMigrationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.start_migration.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Memorystore::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.start_migration.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.start_migration.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @memorystore_stub.start_migration request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Finalizes the migration process. + # + # After the successful completion of this operation, the target instance + # will: + # 1. Stop replicating from the source instance. + # 2. Allow both reads and writes. + # + # @overload finish_migration(request, options = nil) + # Pass arguments to `finish_migration` via a request object, either of type + # {::Google::Cloud::Memorystore::V1beta::FinishMigrationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1beta::FinishMigrationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload finish_migration(name: nil, force: nil) + # Pass arguments to `finish_migration` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the instance to finalize migration on. + # Format: projects/\\{project}/locations/\\{location}/instances/\\{instance} + # @param force [::Boolean] + # Optional. By default, the `FinishMigration` operation ensures the target + # replication offset to catch up to the source offset as of the time of the + # call. Set this field to `true` to bypass this offset verification check. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/memorystore/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Memorystore::V1beta::Memorystore::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Memorystore::V1beta::FinishMigrationRequest.new + # + # # Call the finish_migration method. + # result = client.finish_migration request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def finish_migration request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1beta::FinishMigrationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.finish_migration.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Memorystore::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.finish_migration.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.finish_migration.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @memorystore_stub.finish_migration request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all the token auth users for a token based auth enabled instance. + # + # @overload list_token_auth_users(request, options = nil) + # Pass arguments to `list_token_auth_users` via a request object, either of type + # {::Google::Cloud::Memorystore::V1beta::ListTokenAuthUsersRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1beta::ListTokenAuthUsersRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_token_auth_users(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_token_auth_users` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent to list token auth users from. + # Format: projects/\\{project}/locations/\\{location}/instances/\\{instance} + # @param page_size [::Integer] + # Optional. The maximum number of items to return. The maximum value is 1000; + # values above 1000 will be coerced to 1000. If not specified, a default + # value of 1000 will be used by the service. Regardless of the page_size + # value, the response may include a partial list and a caller should only + # rely on response's `next_page_token` to determine if there are more token + # auth users left to be queried. + # @param page_token [::String] + # Optional. The `next_page_token` value returned from a previous + # `ListTokenAuthUsers` request, if any. + # @param filter [::String] + # Optional. Expression for filtering results. + # @param order_by [::String] + # Optional. Sort results by a defined order. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Memorystore::V1beta::TokenAuthUser>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Memorystore::V1beta::TokenAuthUser>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/memorystore/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Memorystore::V1beta::Memorystore::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Memorystore::V1beta::ListTokenAuthUsersRequest.new + # + # # Call the list_token_auth_users method. + # result = client.list_token_auth_users request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Memorystore::V1beta::TokenAuthUser. + # p item + # end + # + def list_token_auth_users request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1beta::ListTokenAuthUsersRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_token_auth_users.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Memorystore::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_token_auth_users.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_token_auth_users.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @memorystore_stub.list_token_auth_users request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @memorystore_stub, :list_token_auth_users, "token_auth_users", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a specific token auth user for a token based auth enabled instance. + # + # @overload get_token_auth_user(request, options = nil) + # Pass arguments to `get_token_auth_user` via a request object, either of type + # {::Google::Cloud::Memorystore::V1beta::GetTokenAuthUserRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1beta::GetTokenAuthUserRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_token_auth_user(name: nil) + # Pass arguments to `get_token_auth_user` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of token auth user for a basic auth enabled instance. + # Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/tokenAuthUsers/\\{token_auth_user} + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Memorystore::V1beta::TokenAuthUser] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Memorystore::V1beta::TokenAuthUser] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/memorystore/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Memorystore::V1beta::Memorystore::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Memorystore::V1beta::GetTokenAuthUserRequest.new + # + # # Call the get_token_auth_user method. + # result = client.get_token_auth_user request + # + # # The returned object is of type Google::Cloud::Memorystore::V1beta::TokenAuthUser. + # p result + # + def get_token_auth_user request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1beta::GetTokenAuthUserRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_token_auth_user.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Memorystore::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_token_auth_user.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_token_auth_user.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @memorystore_stub.get_token_auth_user request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all the auth tokens for a specific token auth user. + # + # @overload list_auth_tokens(request, options = nil) + # Pass arguments to `list_auth_tokens` via a request object, either of type + # {::Google::Cloud::Memorystore::V1beta::ListAuthTokensRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1beta::ListAuthTokensRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_auth_tokens(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_auth_tokens` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent to list auth tokens from. + # Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/tokenAuthUsers/\\{token_auth_user} + # @param page_size [::Integer] + # Optional. The maximum number of items to return. The maximum value is 1000; + # values above 1000 will be coerced to 1000. + # + # If not specified, a default value of 1000 will be used by the service. + # Regardless of the page_size value, the response may include a partial list + # and a caller should only rely on response's + # `next_page_token` + # to determine if there are more auth tokens left to be queried. + # @param page_token [::String] + # Optional. The `next_page_token` value returned from a previous + # `ListAuthTokens` request, if any. + # @param filter [::String] + # Optional. Expression for filtering results. + # @param order_by [::String] + # Optional. Sort results by a defined order. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Memorystore::V1beta::AuthToken>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Memorystore::V1beta::AuthToken>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/memorystore/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Memorystore::V1beta::Memorystore::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Memorystore::V1beta::ListAuthTokensRequest.new + # + # # Call the list_auth_tokens method. + # result = client.list_auth_tokens request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Memorystore::V1beta::AuthToken. + # p item + # end + # + def list_auth_tokens request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1beta::ListAuthTokensRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_auth_tokens.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Memorystore::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_auth_tokens.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_auth_tokens.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @memorystore_stub.list_auth_tokens request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @memorystore_stub, :list_auth_tokens, "auth_tokens", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a token based auth enabled instance's auth token for a given user. + # + # @overload get_auth_token(request, options = nil) + # Pass arguments to `get_auth_token` via a request object, either of type + # {::Google::Cloud::Memorystore::V1beta::GetAuthTokenRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1beta::GetAuthTokenRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_auth_token(name: nil) + # Pass arguments to `get_auth_token` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of token auth user for a token auth enabled instance. + # Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/tokenAuthUsers/\\{token_auth_user}/authTokens/\\{auth_token} + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Memorystore::V1beta::AuthToken] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Memorystore::V1beta::AuthToken] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/memorystore/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Memorystore::V1beta::Memorystore::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Memorystore::V1beta::GetAuthTokenRequest.new + # + # # Call the get_auth_token method. + # result = client.get_auth_token request + # + # # The returned object is of type Google::Cloud::Memorystore::V1beta::AuthToken. + # p result + # + def get_auth_token request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1beta::GetAuthTokenRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_auth_token.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Memorystore::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_auth_token.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_auth_token.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @memorystore_stub.get_auth_token request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Adds a token auth user for a token based auth enabled instance. + # + # @overload add_token_auth_user(request, options = nil) + # Pass arguments to `add_token_auth_user` via a request object, either of type + # {::Google::Cloud::Memorystore::V1beta::AddTokenAuthUserRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1beta::AddTokenAuthUserRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload add_token_auth_user(instance: nil, token_auth_user: nil) + # Pass arguments to `add_token_auth_user` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param instance [::String] + # Required. The instance resource that this token auth user will be added + # for. Format: projects/\\{project}/locations/\\{location}/instances/\\{instance} + # @param token_auth_user [::String] + # Required. The name of the token auth user to add. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/memorystore/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Memorystore::V1beta::Memorystore::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Memorystore::V1beta::AddTokenAuthUserRequest.new + # + # # Call the add_token_auth_user method. + # result = client.add_token_auth_user request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def add_token_auth_user request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1beta::AddTokenAuthUserRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.add_token_auth_user.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Memorystore::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.add_token_auth_user.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.add_token_auth_user.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @memorystore_stub.add_token_auth_user request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a token auth user for a token based auth enabled instance. + # + # @overload delete_token_auth_user(request, options = nil) + # Pass arguments to `delete_token_auth_user` via a request object, either of type + # {::Google::Cloud::Memorystore::V1beta::DeleteTokenAuthUserRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1beta::DeleteTokenAuthUserRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_token_auth_user(name: nil, request_id: nil, force: nil) + # Pass arguments to `delete_token_auth_user` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the token auth user to delete. + # Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/tokenAuthUsers/\\{token_auth_user} + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param force [::Boolean] + # Optional. If set to true, any auth tokens from this user will also be + # deleted. Otherwise, the request will only work if the user has no auth + # tokens. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/memorystore/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Memorystore::V1beta::Memorystore::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Memorystore::V1beta::DeleteTokenAuthUserRequest.new + # + # # Call the delete_token_auth_user method. + # result = client.delete_token_auth_user request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_token_auth_user request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1beta::DeleteTokenAuthUserRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_token_auth_user.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Memorystore::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_token_auth_user.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_token_auth_user.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @memorystore_stub.delete_token_auth_user request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Adds a token for a user of a token based auth enabled instance. + # + # @overload add_auth_token(request, options = nil) + # Pass arguments to `add_auth_token` via a request object, either of type + # {::Google::Cloud::Memorystore::V1beta::AddAuthTokenRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1beta::AddAuthTokenRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload add_auth_token(token_auth_user: nil, auth_token: nil) + # Pass arguments to `add_auth_token` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param token_auth_user [::String] + # Required. The name of the token auth user resource that this token will be + # added for. + # @param auth_token [::Google::Cloud::Memorystore::V1beta::AuthToken, ::Hash] + # Required. The auth token to add. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/memorystore/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Memorystore::V1beta::Memorystore::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Memorystore::V1beta::AddAuthTokenRequest.new + # + # # Call the add_auth_token method. + # result = client.add_auth_token request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def add_auth_token request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1beta::AddAuthTokenRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.add_auth_token.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Memorystore::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.add_auth_token.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.add_auth_token.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @memorystore_stub.add_auth_token request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a token for a user of a token based auth enabled instance. + # + # @overload delete_auth_token(request, options = nil) + # Pass arguments to `delete_auth_token` via a request object, either of type + # {::Google::Cloud::Memorystore::V1beta::DeleteAuthTokenRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1beta::DeleteAuthTokenRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_auth_token(name: nil) + # Pass arguments to `delete_auth_token` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the token auth user resource that this token will be + # deleted from. Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/tokenAuthUsers/\\{token_auth_user}/authTokens/\\{name} + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/memorystore/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Memorystore::V1beta::Memorystore::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Memorystore::V1beta::DeleteAuthTokenRequest.new + # + # # Call the delete_auth_token method. + # result = client.delete_auth_token request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_auth_token request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1beta::DeleteAuthTokenRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_auth_token.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Memorystore::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_auth_token.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_auth_token.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @memorystore_stub.delete_auth_token request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + ## # Configuration class for the Memorystore REST API. # @@ -1074,6 +2743,96 @@ class Rpcs # @return [::Gapic::Config::Method] # attr_reader :get_shared_regional_certificate_authority + ## + # RPC-specific configuration for `reschedule_maintenance` + # @return [::Gapic::Config::Method] + # + attr_reader :reschedule_maintenance + ## + # RPC-specific configuration for `list_backup_collections` + # @return [::Gapic::Config::Method] + # + attr_reader :list_backup_collections + ## + # RPC-specific configuration for `get_backup_collection` + # @return [::Gapic::Config::Method] + # + attr_reader :get_backup_collection + ## + # RPC-specific configuration for `list_backups` + # @return [::Gapic::Config::Method] + # + attr_reader :list_backups + ## + # RPC-specific configuration for `get_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :get_backup + ## + # RPC-specific configuration for `delete_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_backup + ## + # RPC-specific configuration for `export_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :export_backup + ## + # RPC-specific configuration for `backup_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :backup_instance + ## + # RPC-specific configuration for `start_migration` + # @return [::Gapic::Config::Method] + # + attr_reader :start_migration + ## + # RPC-specific configuration for `finish_migration` + # @return [::Gapic::Config::Method] + # + attr_reader :finish_migration + ## + # RPC-specific configuration for `list_token_auth_users` + # @return [::Gapic::Config::Method] + # + attr_reader :list_token_auth_users + ## + # RPC-specific configuration for `get_token_auth_user` + # @return [::Gapic::Config::Method] + # + attr_reader :get_token_auth_user + ## + # RPC-specific configuration for `list_auth_tokens` + # @return [::Gapic::Config::Method] + # + attr_reader :list_auth_tokens + ## + # RPC-specific configuration for `get_auth_token` + # @return [::Gapic::Config::Method] + # + attr_reader :get_auth_token + ## + # RPC-specific configuration for `add_token_auth_user` + # @return [::Gapic::Config::Method] + # + attr_reader :add_token_auth_user + ## + # RPC-specific configuration for `delete_token_auth_user` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_token_auth_user + ## + # RPC-specific configuration for `add_auth_token` + # @return [::Gapic::Config::Method] + # + attr_reader :add_auth_token + ## + # RPC-specific configuration for `delete_auth_token` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_auth_token # @private def initialize parent_rpcs = nil @@ -1091,6 +2850,42 @@ def initialize parent_rpcs = nil @get_certificate_authority = ::Gapic::Config::Method.new get_certificate_authority_config get_shared_regional_certificate_authority_config = parent_rpcs.get_shared_regional_certificate_authority if parent_rpcs.respond_to? :get_shared_regional_certificate_authority @get_shared_regional_certificate_authority = ::Gapic::Config::Method.new get_shared_regional_certificate_authority_config + reschedule_maintenance_config = parent_rpcs.reschedule_maintenance if parent_rpcs.respond_to? :reschedule_maintenance + @reschedule_maintenance = ::Gapic::Config::Method.new reschedule_maintenance_config + list_backup_collections_config = parent_rpcs.list_backup_collections if parent_rpcs.respond_to? :list_backup_collections + @list_backup_collections = ::Gapic::Config::Method.new list_backup_collections_config + get_backup_collection_config = parent_rpcs.get_backup_collection if parent_rpcs.respond_to? :get_backup_collection + @get_backup_collection = ::Gapic::Config::Method.new get_backup_collection_config + list_backups_config = parent_rpcs.list_backups if parent_rpcs.respond_to? :list_backups + @list_backups = ::Gapic::Config::Method.new list_backups_config + get_backup_config = parent_rpcs.get_backup if parent_rpcs.respond_to? :get_backup + @get_backup = ::Gapic::Config::Method.new get_backup_config + delete_backup_config = parent_rpcs.delete_backup if parent_rpcs.respond_to? :delete_backup + @delete_backup = ::Gapic::Config::Method.new delete_backup_config + export_backup_config = parent_rpcs.export_backup if parent_rpcs.respond_to? :export_backup + @export_backup = ::Gapic::Config::Method.new export_backup_config + backup_instance_config = parent_rpcs.backup_instance if parent_rpcs.respond_to? :backup_instance + @backup_instance = ::Gapic::Config::Method.new backup_instance_config + start_migration_config = parent_rpcs.start_migration if parent_rpcs.respond_to? :start_migration + @start_migration = ::Gapic::Config::Method.new start_migration_config + finish_migration_config = parent_rpcs.finish_migration if parent_rpcs.respond_to? :finish_migration + @finish_migration = ::Gapic::Config::Method.new finish_migration_config + list_token_auth_users_config = parent_rpcs.list_token_auth_users if parent_rpcs.respond_to? :list_token_auth_users + @list_token_auth_users = ::Gapic::Config::Method.new list_token_auth_users_config + get_token_auth_user_config = parent_rpcs.get_token_auth_user if parent_rpcs.respond_to? :get_token_auth_user + @get_token_auth_user = ::Gapic::Config::Method.new get_token_auth_user_config + list_auth_tokens_config = parent_rpcs.list_auth_tokens if parent_rpcs.respond_to? :list_auth_tokens + @list_auth_tokens = ::Gapic::Config::Method.new list_auth_tokens_config + get_auth_token_config = parent_rpcs.get_auth_token if parent_rpcs.respond_to? :get_auth_token + @get_auth_token = ::Gapic::Config::Method.new get_auth_token_config + add_token_auth_user_config = parent_rpcs.add_token_auth_user if parent_rpcs.respond_to? :add_token_auth_user + @add_token_auth_user = ::Gapic::Config::Method.new add_token_auth_user_config + delete_token_auth_user_config = parent_rpcs.delete_token_auth_user if parent_rpcs.respond_to? :delete_token_auth_user + @delete_token_auth_user = ::Gapic::Config::Method.new delete_token_auth_user_config + add_auth_token_config = parent_rpcs.add_auth_token if parent_rpcs.respond_to? :add_auth_token + @add_auth_token = ::Gapic::Config::Method.new add_auth_token_config + delete_auth_token_config = parent_rpcs.delete_auth_token if parent_rpcs.respond_to? :delete_auth_token + @delete_auth_token = ::Gapic::Config::Method.new delete_auth_token_config yield self if block_given? end diff --git a/google-cloud-memorystore-v1beta/lib/google/cloud/memorystore/v1beta/memorystore/rest/service_stub.rb b/google-cloud-memorystore-v1beta/lib/google/cloud/memorystore/v1beta/memorystore/rest/service_stub.rb index 6dce7d069b4d..04923e0bc7f7 100644 --- a/google-cloud-memorystore-v1beta/lib/google/cloud/memorystore/v1beta/memorystore/rest/service_stub.rb +++ b/google-cloud-memorystore-v1beta/lib/google/cloud/memorystore/v1beta/memorystore/rest/service_stub.rb @@ -353,20 +353,911 @@ def get_shared_regional_certificate_authority request_pb, options = nil end end + ## + # Baseline implementation for the reschedule_maintenance REST call + # + # @param request_pb [::Google::Cloud::Memorystore::V1beta::RescheduleMaintenanceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def reschedule_maintenance request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_reschedule_maintenance_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "reschedule_maintenance", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_backup_collections REST call + # + # @param request_pb [::Google::Cloud::Memorystore::V1beta::ListBackupCollectionsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Memorystore::V1beta::ListBackupCollectionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Memorystore::V1beta::ListBackupCollectionsResponse] + # A result object deserialized from the server's reply + def list_backup_collections request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_backup_collections_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_backup_collections", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Memorystore::V1beta::ListBackupCollectionsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_backup_collection REST call + # + # @param request_pb [::Google::Cloud::Memorystore::V1beta::GetBackupCollectionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Memorystore::V1beta::BackupCollection] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Memorystore::V1beta::BackupCollection] + # A result object deserialized from the server's reply + def get_backup_collection request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_backup_collection_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_backup_collection", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Memorystore::V1beta::BackupCollection.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_backups REST call + # + # @param request_pb [::Google::Cloud::Memorystore::V1beta::ListBackupsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Memorystore::V1beta::ListBackupsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Memorystore::V1beta::ListBackupsResponse] + # A result object deserialized from the server's reply + def list_backups request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_backups_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_backups", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Memorystore::V1beta::ListBackupsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_backup REST call + # + # @param request_pb [::Google::Cloud::Memorystore::V1beta::GetBackupRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Memorystore::V1beta::Backup] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Memorystore::V1beta::Backup] + # A result object deserialized from the server's reply + def get_backup request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_backup_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_backup", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Memorystore::V1beta::Backup.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_backup REST call + # + # @param request_pb [::Google::Cloud::Memorystore::V1beta::DeleteBackupRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def delete_backup request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_backup_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_backup", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the export_backup REST call + # + # @param request_pb [::Google::Cloud::Memorystore::V1beta::ExportBackupRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def export_backup request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_export_backup_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "export_backup", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the backup_instance REST call + # + # @param request_pb [::Google::Cloud::Memorystore::V1beta::BackupInstanceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def backup_instance request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_backup_instance_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "backup_instance", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the start_migration REST call + # + # @param request_pb [::Google::Cloud::Memorystore::V1beta::StartMigrationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def start_migration request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_start_migration_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "start_migration", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the finish_migration REST call + # + # @param request_pb [::Google::Cloud::Memorystore::V1beta::FinishMigrationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def finish_migration request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_finish_migration_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "finish_migration", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_token_auth_users REST call + # + # @param request_pb [::Google::Cloud::Memorystore::V1beta::ListTokenAuthUsersRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Memorystore::V1beta::ListTokenAuthUsersResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Memorystore::V1beta::ListTokenAuthUsersResponse] + # A result object deserialized from the server's reply + def list_token_auth_users request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_token_auth_users_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_token_auth_users", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Memorystore::V1beta::ListTokenAuthUsersResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_token_auth_user REST call + # + # @param request_pb [::Google::Cloud::Memorystore::V1beta::GetTokenAuthUserRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Memorystore::V1beta::TokenAuthUser] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Memorystore::V1beta::TokenAuthUser] + # A result object deserialized from the server's reply + def get_token_auth_user request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_token_auth_user_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_token_auth_user", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Memorystore::V1beta::TokenAuthUser.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_auth_tokens REST call + # + # @param request_pb [::Google::Cloud::Memorystore::V1beta::ListAuthTokensRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Memorystore::V1beta::ListAuthTokensResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Memorystore::V1beta::ListAuthTokensResponse] + # A result object deserialized from the server's reply + def list_auth_tokens request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_auth_tokens_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_auth_tokens", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Memorystore::V1beta::ListAuthTokensResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_auth_token REST call + # + # @param request_pb [::Google::Cloud::Memorystore::V1beta::GetAuthTokenRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Memorystore::V1beta::AuthToken] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Memorystore::V1beta::AuthToken] + # A result object deserialized from the server's reply + def get_auth_token request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_auth_token_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_auth_token", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Memorystore::V1beta::AuthToken.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the add_token_auth_user REST call + # + # @param request_pb [::Google::Cloud::Memorystore::V1beta::AddTokenAuthUserRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def add_token_auth_user request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_add_token_auth_user_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "add_token_auth_user", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_token_auth_user REST call + # + # @param request_pb [::Google::Cloud::Memorystore::V1beta::DeleteTokenAuthUserRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def delete_token_auth_user request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_token_auth_user_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_token_auth_user", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the add_auth_token REST call + # + # @param request_pb [::Google::Cloud::Memorystore::V1beta::AddAuthTokenRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def add_auth_token request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_add_auth_token_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "add_auth_token", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_auth_token REST call + # + # @param request_pb [::Google::Cloud::Memorystore::V1beta::DeleteAuthTokenRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def delete_auth_token request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_auth_token_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_auth_token", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_instances REST call + # + # @param request_pb [::Google::Cloud::Memorystore::V1beta::ListInstancesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_instances_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{parent}/instances", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_instance REST call + # + # @param request_pb [::Google::Cloud::Memorystore::V1beta::GetInstanceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_instance_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_instance REST call + # + # @param request_pb [::Google::Cloud::Memorystore::V1beta::CreateInstanceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_instance_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta/{parent}/instances", + body: "instance", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_instance REST call + # + # @param request_pb [::Google::Cloud::Memorystore::V1beta::UpdateInstanceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_instance_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1beta/{instance.name}", + body: "instance", + matches: [ + ["instance.name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_instance REST call + # + # @param request_pb [::Google::Cloud::Memorystore::V1beta::DeleteInstanceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_instance_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_certificate_authority REST call + # + # @param request_pb [::Google::Cloud::Memorystore::V1beta::GetCertificateAuthorityRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_certificate_authority_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{name}/certificateAuthority", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + ## # @private # - # GRPC transcoding helper method for the list_instances REST call + # GRPC transcoding helper method for the get_shared_regional_certificate_authority REST call # - # @param request_pb [::Google::Cloud::Memorystore::V1beta::ListInstancesRequest] + # @param request_pb [::Google::Cloud::Memorystore::V1beta::GetSharedRegionalCertificateAuthorityRequest] # A request object representing the call parameters. Required. # @return [Array(String, [String, nil], Hash{String => String})] # Uri, Body, Query string parameters - def self.transcode_list_instances_request request_pb + def self.transcode_get_shared_regional_certificate_authority_request request_pb transcoder = Gapic::Rest::GrpcTranscoder.new .with_bindings( uri_method: :get, - uri_template: "/v1beta/{parent}/instances", + uri_template: "/v1beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/sharedRegionalCertificateAuthority/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the reschedule_maintenance REST call + # + # @param request_pb [::Google::Cloud::Memorystore::V1beta::RescheduleMaintenanceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_reschedule_maintenance_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta/{name}:rescheduleMaintenance", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_backup_collections REST call + # + # @param request_pb [::Google::Cloud::Memorystore::V1beta::ListBackupCollectionsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_backup_collections_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{parent}/backupCollections", matches: [ ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] ] @@ -377,19 +1268,19 @@ def self.transcode_list_instances_request request_pb ## # @private # - # GRPC transcoding helper method for the get_instance REST call + # GRPC transcoding helper method for the get_backup_collection REST call # - # @param request_pb [::Google::Cloud::Memorystore::V1beta::GetInstanceRequest] + # @param request_pb [::Google::Cloud::Memorystore::V1beta::GetBackupCollectionRequest] # A request object representing the call parameters. Required. # @return [Array(String, [String, nil], Hash{String => String})] # Uri, Body, Query string parameters - def self.transcode_get_instance_request request_pb + def self.transcode_get_backup_collection_request request_pb transcoder = Gapic::Rest::GrpcTranscoder.new .with_bindings( uri_method: :get, uri_template: "/v1beta/{name}", matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] + ["name", %r{^projects/[^/]+/locations/[^/]+/backupCollections/[^/]+/?$}, false] ] ) transcoder.transcode request_pb @@ -398,20 +1289,19 @@ def self.transcode_get_instance_request request_pb ## # @private # - # GRPC transcoding helper method for the create_instance REST call + # GRPC transcoding helper method for the list_backups REST call # - # @param request_pb [::Google::Cloud::Memorystore::V1beta::CreateInstanceRequest] + # @param request_pb [::Google::Cloud::Memorystore::V1beta::ListBackupsRequest] # A request object representing the call parameters. Required. # @return [Array(String, [String, nil], Hash{String => String})] # Uri, Body, Query string parameters - def self.transcode_create_instance_request request_pb + def self.transcode_list_backups_request request_pb transcoder = Gapic::Rest::GrpcTranscoder.new .with_bindings( - uri_method: :post, - uri_template: "/v1beta/{parent}/instances", - body: "instance", + uri_method: :get, + uri_template: "/v1beta/{parent}/backups", matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ["parent", %r{^projects/[^/]+/locations/[^/]+/backupCollections/[^/]+/?$}, false] ] ) transcoder.transcode request_pb @@ -420,20 +1310,19 @@ def self.transcode_create_instance_request request_pb ## # @private # - # GRPC transcoding helper method for the update_instance REST call + # GRPC transcoding helper method for the get_backup REST call # - # @param request_pb [::Google::Cloud::Memorystore::V1beta::UpdateInstanceRequest] + # @param request_pb [::Google::Cloud::Memorystore::V1beta::GetBackupRequest] # A request object representing the call parameters. Required. # @return [Array(String, [String, nil], Hash{String => String})] # Uri, Body, Query string parameters - def self.transcode_update_instance_request request_pb + def self.transcode_get_backup_request request_pb transcoder = Gapic::Rest::GrpcTranscoder.new .with_bindings( - uri_method: :patch, - uri_template: "/v1beta/{instance.name}", - body: "instance", + uri_method: :get, + uri_template: "/v1beta/{name}", matches: [ - ["instance.name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] + ["name", %r{^projects/[^/]+/locations/[^/]+/backupCollections/[^/]+/backups/[^/]+/?$}, false] ] ) transcoder.transcode request_pb @@ -442,17 +1331,61 @@ def self.transcode_update_instance_request request_pb ## # @private # - # GRPC transcoding helper method for the delete_instance REST call + # GRPC transcoding helper method for the delete_backup REST call # - # @param request_pb [::Google::Cloud::Memorystore::V1beta::DeleteInstanceRequest] + # @param request_pb [::Google::Cloud::Memorystore::V1beta::DeleteBackupRequest] # A request object representing the call parameters. Required. # @return [Array(String, [String, nil], Hash{String => String})] # Uri, Body, Query string parameters - def self.transcode_delete_instance_request request_pb + def self.transcode_delete_backup_request request_pb transcoder = Gapic::Rest::GrpcTranscoder.new .with_bindings( uri_method: :delete, uri_template: "/v1beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/backupCollections/[^/]+/backups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the export_backup REST call + # + # @param request_pb [::Google::Cloud::Memorystore::V1beta::ExportBackupRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_export_backup_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta/{name}:export", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/backupCollections/[^/]+/backups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the backup_instance REST call + # + # @param request_pb [::Google::Cloud::Memorystore::V1beta::BackupInstanceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_backup_instance_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta/{name}:backup", + body: "*", matches: [ ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] ] @@ -463,17 +1396,18 @@ def self.transcode_delete_instance_request request_pb ## # @private # - # GRPC transcoding helper method for the get_certificate_authority REST call + # GRPC transcoding helper method for the start_migration REST call # - # @param request_pb [::Google::Cloud::Memorystore::V1beta::GetCertificateAuthorityRequest] + # @param request_pb [::Google::Cloud::Memorystore::V1beta::StartMigrationRequest] # A request object representing the call parameters. Required. # @return [Array(String, [String, nil], Hash{String => String})] # Uri, Body, Query string parameters - def self.transcode_get_certificate_authority_request request_pb + def self.transcode_start_migration_request request_pb transcoder = Gapic::Rest::GrpcTranscoder.new .with_bindings( - uri_method: :get, - uri_template: "/v1beta/{name}/certificateAuthority", + uri_method: :post, + uri_template: "/v1beta/{name}:startMigration", + body: "*", matches: [ ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] ] @@ -484,19 +1418,190 @@ def self.transcode_get_certificate_authority_request request_pb ## # @private # - # GRPC transcoding helper method for the get_shared_regional_certificate_authority REST call + # GRPC transcoding helper method for the finish_migration REST call # - # @param request_pb [::Google::Cloud::Memorystore::V1beta::GetSharedRegionalCertificateAuthorityRequest] + # @param request_pb [::Google::Cloud::Memorystore::V1beta::FinishMigrationRequest] # A request object representing the call parameters. Required. # @return [Array(String, [String, nil], Hash{String => String})] # Uri, Body, Query string parameters - def self.transcode_get_shared_regional_certificate_authority_request request_pb + def self.transcode_finish_migration_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta/{name}:finishMigration", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_token_auth_users REST call + # + # @param request_pb [::Google::Cloud::Memorystore::V1beta::ListTokenAuthUsersRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_token_auth_users_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{parent}/tokenAuthUsers", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_token_auth_user REST call + # + # @param request_pb [::Google::Cloud::Memorystore::V1beta::GetTokenAuthUserRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_token_auth_user_request request_pb transcoder = Gapic::Rest::GrpcTranscoder.new .with_bindings( uri_method: :get, uri_template: "/v1beta/{name}", matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/sharedRegionalCertificateAuthority/?$}, false] + ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/tokenAuthUsers/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_auth_tokens REST call + # + # @param request_pb [::Google::Cloud::Memorystore::V1beta::ListAuthTokensRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_auth_tokens_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{parent}/authTokens", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/tokenAuthUsers/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_auth_token REST call + # + # @param request_pb [::Google::Cloud::Memorystore::V1beta::GetAuthTokenRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_auth_token_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/tokenAuthUsers/[^/]+/authTokens/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the add_token_auth_user REST call + # + # @param request_pb [::Google::Cloud::Memorystore::V1beta::AddTokenAuthUserRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_add_token_auth_user_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta/{instance}:addTokenAuthUser", + body: "*", + matches: [ + ["instance", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_token_auth_user REST call + # + # @param request_pb [::Google::Cloud::Memorystore::V1beta::DeleteTokenAuthUserRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_token_auth_user_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/tokenAuthUsers/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the add_auth_token REST call + # + # @param request_pb [::Google::Cloud::Memorystore::V1beta::AddAuthTokenRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_add_auth_token_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta/{token_auth_user}:addAuthToken", + body: "*", + matches: [ + ["token_auth_user", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/tokenAuthUsers/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_auth_token REST call + # + # @param request_pb [::Google::Cloud::Memorystore::V1beta::DeleteAuthTokenRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_auth_token_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/tokenAuthUsers/[^/]+/authTokens/[^/]+/?$}, false] ] ) transcoder.transcode request_pb diff --git a/google-cloud-memorystore-v1beta/lib/google/cloud/memorystore/v1beta/memorystore_pb.rb b/google-cloud-memorystore-v1beta/lib/google/cloud/memorystore/v1beta/memorystore_pb.rb index 26916553dc74..664cd5fe574f 100644 --- a/google-cloud-memorystore-v1beta/lib/google/cloud/memorystore/v1beta/memorystore_pb.rb +++ b/google-cloud-memorystore-v1beta/lib/google/cloud/memorystore/v1beta/memorystore_pb.rb @@ -10,12 +10,15 @@ require 'google/api/field_info_pb' require 'google/api/resource_pb' require 'google/longrunning/operations_pb' +require 'google/protobuf/duration_pb' require 'google/protobuf/empty_pb' require 'google/protobuf/field_mask_pb' require 'google/protobuf/timestamp_pb' +require 'google/type/dayofweek_pb' +require 'google/type/timeofday_pb' -descriptor_data = "\n1google/cloud/memorystore/v1beta/memorystore.proto\x12\x1fgoogle.cloud.memorystore.v1beta\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/api/field_info.proto\x1a\x19google/api/resource.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb8\x1b\n\x08Instance\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12J\n\x06labels\x18\x04 \x03(\x0b\x32\x35.google.cloud.memorystore.v1beta.Instance.LabelsEntryB\x03\xe0\x41\x01\x12\x43\n\x05state\x18\x05 \x01(\x0e\x32/.google.cloud.memorystore.v1beta.Instance.StateB\x03\xe0\x41\x03\x12L\n\nstate_info\x18\x06 \x01(\x0b\x32\x33.google.cloud.memorystore.v1beta.Instance.StateInfoB\x03\xe0\x41\x03\x12\x18\n\x03uid\x18\x07 \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\x1f\n\rreplica_count\x18\x08 \x01(\x05\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x12_\n\x12\x61uthorization_mode\x18\t \x01(\x0e\x32;.google.cloud.memorystore.v1beta.Instance.AuthorizationModeB\x06\xe0\x41\x01\xe0\x41\x05\x12h\n\x17transit_encryption_mode\x18\n \x01(\x0e\x32?.google.cloud.memorystore.v1beta.Instance.TransitEncryptionModeB\x06\xe0\x41\x01\xe0\x41\x05\x12\x18\n\x0bshard_count\x18\x0b \x01(\x05\x42\x03\xe0\x41\x01\x12T\n\x13\x64iscovery_endpoints\x18\x0c \x03(\x0b\x32\x32.google.cloud.memorystore.v1beta.DiscoveryEndpointB\x03\xe0\x41\x03\x12M\n\tnode_type\x18\r \x01(\x0e\x32\x32.google.cloud.memorystore.v1beta.Instance.NodeTypeB\x06\xe0\x41\x01\xe0\x41\x05\x12S\n\x12persistence_config\x18\x0e \x01(\x0b\x32\x32.google.cloud.memorystore.v1beta.PersistenceConfigB\x03\xe0\x41\x01\x12\x1e\n\x0e\x65ngine_version\x18\x0f \x01(\tB\x06\xe0\x41\x01\xe0\x41\x05\x12Y\n\x0e\x65ngine_configs\x18\x10 \x03(\x0b\x32<.google.cloud.memorystore.v1beta.Instance.EngineConfigsEntryB\x03\xe0\x41\x01\x12\x45\n\x0bnode_config\x18\x11 \x01(\x0b\x32+.google.cloud.memorystore.v1beta.NodeConfigB\x03\xe0\x41\x03\x12\x61\n\x18zone_distribution_config\x18\x12 \x01(\x0b\x32\x37.google.cloud.memorystore.v1beta.ZoneDistributionConfigB\x06\xe0\x41\x01\xe0\x41\x05\x12-\n\x1b\x64\x65letion_protection_enabled\x18\x13 \x01(\x08\x42\x03\xe0\x41\x01H\x01\x88\x01\x01\x12X\n\x14psc_auto_connections\x18\x14 \x03(\x0b\x32\x32.google.cloud.memorystore.v1beta.PscAutoConnectionB\x06\xe0\x41\x02\xe0\x41\x05\x12R\n\tendpoints\x18\x19 \x03(\x0b\x32:.google.cloud.memorystore.v1beta.Instance.InstanceEndpointB\x03\xe0\x41\x01\x12\x41\n\x04mode\x18\x1a \x01(\x0e\x32..google.cloud.memorystore.v1beta.Instance.ModeB\x03\xe0\x41\x01\x12[\n\x0eserver_ca_mode\x18\x38 \x01(\x0e\x32\x36.google.cloud.memorystore.v1beta.Instance.ServerCaModeB\x06\xe0\x41\x01\xe0\x41\x05H\x02\x88\x01\x01\x12G\n\x0eserver_ca_pool\x18\x39 \x01(\tB*\xe0\x41\x01\xe0\x41\x05\xfa\x41!\n\x1fprivateca.googleapis.com/CaPoolH\x03\x88\x01\x01\x12.\n\x19rotate_server_certificate\x18: \x01(\x08\x42\x06\xe0\x41\x01\xe0\x41\x04H\x04\x88\x01\x01\x1a\xfc\x01\n\tStateInfo\x12Z\n\x0bupdate_info\x18\x01 \x01(\x0b\x32>.google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfoB\x03\xe0\x41\x03H\x00\x1a\x8a\x01\n\nUpdateInfo\x12$\n\x12target_shard_count\x18\x01 \x01(\x05\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12&\n\x14target_replica_count\x18\x02 \x01(\x05\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x42\x15\n\x13_target_shard_countB\x17\n\x15_target_replica_countB\x06\n\x04info\x1ah\n\x10InstanceEndpoint\x12T\n\x0b\x63onnections\x18\x01 \x03(\x0b\x32:.google.cloud.memorystore.v1beta.Instance.ConnectionDetailB\x03\xe0\x41\x01\x1a\xbd\x01\n\x10\x43onnectionDetail\x12Q\n\x13psc_auto_connection\x18\x01 \x01(\x0b\x32\x32.google.cloud.memorystore.v1beta.PscAutoConnectionH\x00\x12H\n\x0epsc_connection\x18\x02 \x01(\x0b\x32..google.cloud.memorystore.v1beta.PscConnectionH\x00\x42\x0c\n\nconnection\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x34\n\x12\x45ngineConfigsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"T\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0c\n\x08UPDATING\x10\x03\x12\x0c\n\x08\x44\x45LETING\x10\x04\"X\n\x11\x41uthorizationMode\x12\"\n\x1e\x41UTHORIZATION_MODE_UNSPECIFIED\x10\x00\x12\x11\n\rAUTH_DISABLED\x10\x01\x12\x0c\n\x08IAM_AUTH\x10\x02\"|\n\x15TransitEncryptionMode\x12\'\n#TRANSIT_ENCRYPTION_MODE_UNSPECIFIED\x10\x00\x12\x1f\n\x1bTRANSIT_ENCRYPTION_DISABLED\x10\x01\x12\x19\n\x15SERVER_AUTHENTICATION\x10\x02\"\xe8\x01\n\x08NodeType\x12\x19\n\x15NODE_TYPE_UNSPECIFIED\x10\x00\x12\x14\n\x10SHARED_CORE_NANO\x10\x01\x12\x12\n\x0eHIGHMEM_MEDIUM\x10\x02\x12\x12\n\x0eHIGHMEM_XLARGE\x10\x03\x12\x12\n\x0eSTANDARD_SMALL\x10\x04\x12\x10\n\x0c\x43USTOM_MICRO\x10\x05\x12\x0f\n\x0b\x43USTOM_MINI\x10\x06\x12\x12\n\x0eHIGHCPU_MEDIUM\x10\x07\x12\x12\n\x0eSTANDARD_LARGE\x10\x08\x12\x13\n\x0fHIGHMEM_2XLARGE\x10\t\x12\x0f\n\x0b\x43USTOM_PICO\x10\n\"S\n\x04Mode\x12\x14\n\x10MODE_UNSPECIFIED\x10\x00\x12\x12\n\nSTANDALONE\x10\x01\x1a\x02\x08\x01\x12\x0b\n\x07\x43LUSTER\x10\x02\x12\x14\n\x10\x43LUSTER_DISABLED\x10\x04\"\xa9\x02\n\x0cServerCaMode\x12\x1e\n\x1aSERVER_CA_MODE_UNSPECIFIED\x10\x00\x12\"\n\x1eGOOGLE_MANAGED_PER_INSTANCE_CA\x10\x01\x12\x1c\n\x18GOOGLE_MANAGED_SHARED_CA\x10\x02\x12\x1b\n\x17\x43USTOMER_MANAGED_CAS_CA\x10\x03\x12\x35\n-SERVER_CA_MODE_GOOGLE_MANAGED_PER_INSTANCE_CA\x10\x01\x1a\x02\x08\x01\x12/\n\'SERVER_CA_MODE_GOOGLE_MANAGED_SHARED_CA\x10\x02\x1a\x02\x08\x01\x12.\n&SERVER_CA_MODE_CUSTOMER_MANAGED_CAS_CA\x10\x03\x1a\x02\x08\x01\x1a\x02\x10\x01:{\xea\x41x\n#memorystore.googleapis.com/Instance\x12.google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfoB\x03\xe0\x41\x03H\x00\x1a\xba\x02\n\nUpdateInfo\x12$\n\x12target_shard_count\x18\x01 \x01(\x05\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12&\n\x14target_replica_count\x18\x02 \x01(\x05\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x12\'\n\x15target_engine_version\x18\x03 \x01(\tB\x03\xe0\x41\x03H\x02\x88\x01\x01\x12V\n\x10target_node_type\x18\x04 \x01(\x0e\x32\x32.google.cloud.memorystore.v1beta.Instance.NodeTypeB\x03\xe0\x41\x03H\x03\x88\x01\x01\x42\x15\n\x13_target_shard_countB\x17\n\x15_target_replica_countB\x18\n\x16_target_engine_versionB\x13\n\x11_target_node_typeB\x06\n\x04info\x1a$\n\x0fGcsBackupSource\x12\x11\n\x04uris\x18\x01 \x03(\tB\x03\xe0\x41\x01\x1a*\n\x13ManagedBackupSource\x12\x13\n\x06\x62\x61\x63kup\x18\x01 \x01(\tB\x03\xe0\x41\x01\x1ah\n\x10InstanceEndpoint\x12T\n\x0b\x63onnections\x18\x01 \x03(\x0b\x32:.google.cloud.memorystore.v1beta.Instance.ConnectionDetailB\x03\xe0\x41\x01\x1a\xc2\x01\n\x10\x43onnectionDetail\x12V\n\x13psc_auto_connection\x18\x01 \x01(\x0b\x32\x32.google.cloud.memorystore.v1beta.PscAutoConnectionB\x03\xe0\x41\x05H\x00\x12H\n\x0epsc_connection\x18\x02 \x01(\x0b\x32..google.cloud.memorystore.v1beta.PscConnectionH\x00\x42\x0c\n\nconnection\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x34\n\x12\x45ngineConfigsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"c\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0c\n\x08UPDATING\x10\x03\x12\x0c\n\x08\x44\x45LETING\x10\x04\x12\r\n\tMIGRATING\x10\x06\"h\n\x11\x41uthorizationMode\x12\"\n\x1e\x41UTHORIZATION_MODE_UNSPECIFIED\x10\x00\x12\x11\n\rAUTH_DISABLED\x10\x01\x12\x0c\n\x08IAM_AUTH\x10\x02\x12\x0e\n\nTOKEN_AUTH\x10\x03\"|\n\x15TransitEncryptionMode\x12\'\n#TRANSIT_ENCRYPTION_MODE_UNSPECIFIED\x10\x00\x12\x1f\n\x1bTRANSIT_ENCRYPTION_DISABLED\x10\x01\x12\x19\n\x15SERVER_AUTHENTICATION\x10\x02\"\xe8\x01\n\x08NodeType\x12\x19\n\x15NODE_TYPE_UNSPECIFIED\x10\x00\x12\x14\n\x10SHARED_CORE_NANO\x10\x01\x12\x12\n\x0eHIGHMEM_MEDIUM\x10\x02\x12\x12\n\x0eHIGHMEM_XLARGE\x10\x03\x12\x12\n\x0eSTANDARD_SMALL\x10\x04\x12\x10\n\x0c\x43USTOM_MICRO\x10\x05\x12\x0f\n\x0b\x43USTOM_MINI\x10\x06\x12\x12\n\x0eHIGHCPU_MEDIUM\x10\x07\x12\x12\n\x0eSTANDARD_LARGE\x10\x08\x12\x13\n\x0fHIGHMEM_2XLARGE\x10\t\x12\x0f\n\x0b\x43USTOM_PICO\x10\n\"S\n\x04Mode\x12\x14\n\x10MODE_UNSPECIFIED\x10\x00\x12\x12\n\nSTANDALONE\x10\x01\x1a\x02\x08\x01\x12\x0b\n\x07\x43LUSTER\x10\x02\x12\x14\n\x10\x43LUSTER_DISABLED\x10\x04\"\xa9\x02\n\x0cServerCaMode\x12\x1e\n\x1aSERVER_CA_MODE_UNSPECIFIED\x10\x00\x12\"\n\x1eGOOGLE_MANAGED_PER_INSTANCE_CA\x10\x01\x12\x1c\n\x18GOOGLE_MANAGED_SHARED_CA\x10\x02\x12\x1b\n\x17\x43USTOMER_MANAGED_CAS_CA\x10\x03\x12\x35\n-SERVER_CA_MODE_GOOGLE_MANAGED_PER_INSTANCE_CA\x10\x01\x1a\x02\x08\x01\x12/\n\'SERVER_CA_MODE_GOOGLE_MANAGED_SHARED_CA\x10\x02\x1a\x02\x08\x01\x12.\n&SERVER_CA_MODE_CUSTOMER_MANAGED_CAS_CA\x10\x03\x1a\x02\x08\x01\x1a\x02\x10\x01:{\xea\x41x\n#memorystore.googleapis.com/Instance\x12\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(memorystore.googleapis.com/TokenAuthUser\"\xb2\x01\n\x15ListAuthTokensRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$memorystore.googleapis.com/AuthToken\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\x8c\x01\n\x16ListAuthTokensResponse\x12?\n\x0b\x61uth_tokens\x18\x01 \x03(\x0b\x32*.google.cloud.memorystore.v1beta.AuthToken\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x18\n\x0bunreachable\x18\x03 \x03(\tB\x03\xe0\x41\x06\"Q\n\x13GetAuthTokenRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$memorystore.googleapis.com/AuthToken\"v\n\x17\x41\x64\x64TokenAuthUserRequest\x12=\n\x08instance\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#memorystore.googleapis.com/Instance\x12\x1c\n\x0ftoken_auth_user\x18\x02 \x01(\tB\x03\xe0\x41\x02\"\x91\x01\n\x1a\x44\x65leteTokenAuthUserRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(memorystore.googleapis.com/TokenAuthUser\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\x12\n\x05\x66orce\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"\xa5\x01\n\x13\x41\x64\x64\x41uthTokenRequest\x12I\n\x0ftoken_auth_user\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(memorystore.googleapis.com/TokenAuthUser\x12\x43\n\nauth_token\x18\x02 \x01(\x0b\x32*.google.cloud.memorystore.v1beta.AuthTokenB\x03\xe0\x41\x02\"T\n\x16\x44\x65leteAuthTokenRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$memorystore.googleapis.com/AuthToken\"\x91\x04\n\x14\x43\x65rtificateAuthority\x12n\n\x11managed_server_ca\x18\x02 \x01(\x0b\x32Q.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthorityH\x00\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x1a\xaf\x01\n\x1bManagedCertificateAuthority\x12m\n\x08\x63\x61_certs\x18\x01 \x03(\x0b\x32[.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority.CertChain\x1a!\n\tCertChain\x12\x14\n\x0c\x63\x65rtificates\x18\x01 \x03(\t:\xb6\x01\xea\x41\xb2\x01\n/memorystore.googleapis.com/CertificateAuthority\x12Qprojects/{project}/locations/{location}/instances/{instance}/certificateAuthority*\x16\x63\x65rtificateAuthorities2\x14\x63\x65rtificateAuthorityB\x0b\n\tserver_ca\"\x88\x05\n\"SharedRegionalCertificateAuthority\x12\x84\x01\n\x11managed_server_ca\x18\x02 \x01(\x0b\x32g.google.cloud.memorystore.v1beta.SharedRegionalCertificateAuthority.RegionalManagedCertificateAuthorityH\x00\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x1a\xde\x01\n#RegionalManagedCertificateAuthority\x12\x8b\x01\n\x08\x63\x61_certs\x18\x01 \x03(\x0b\x32y.google.cloud.memorystore.v1beta.SharedRegionalCertificateAuthority.RegionalManagedCertificateAuthority.RegionalCertChain\x1a)\n\x11RegionalCertChain\x12\x14\n\x0c\x63\x65rtificates\x18\x01 \x03(\t:\xd9\x01\xea\x41\xd5\x01\n=memorystore.googleapis.com/SharedRegionalCertificateAuthority\x12Jprojects/{project}/locations/{location}/sharedRegionalCertificateAuthority*$sharedRegionalCertificateAuthorities2\"sharedRegionalCertificateAuthorityB\x0b\n\tserver_ca\"\x83\x01\n,GetSharedRegionalCertificateAuthorityRequest\x12S\n\x04name\x18\x01 \x01(\tBE\xe0\x41\x02\xfa\x41?\n=memorystore.googleapis.com/SharedRegionalCertificateAuthority\"\x80\x02\n\x11OperationMetadata\x12\x34\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x13\n\x06target\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04verb\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x1b\n\x0estatus_message\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12#\n\x16requested_cancellation\x18\x06 \x01(\x08\x42\x03\xe0\x41\x03\x12\x18\n\x0b\x61pi_version\x18\x07 \x01(\tB\x03\xe0\x41\x03\"\xfe\x04\n\x0e\x45ncryptionInfo\x12R\n\x0f\x65ncryption_type\x18\x01 \x01(\x0e\x32\x34.google.cloud.memorystore.v1beta.EncryptionInfo.TypeB\x03\xe0\x41\x03\x12J\n\x10kms_key_versions\x18\x02 \x03(\tB0\xe0\x41\x03\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x12_\n\x15kms_key_primary_state\x18\x03 \x01(\x0e\x32;.google.cloud.memorystore.v1beta.EncryptionInfo.KmsKeyStateB\x03\xe0\x41\x03\x12\x39\n\x10last_update_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"\\\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x1d\n\x19GOOGLE_DEFAULT_ENCRYPTION\x10\x01\x12\x1f\n\x1b\x43USTOMER_MANAGED_ENCRYPTION\x10\x02\"\xd1\x01\n\x0bKmsKeyState\x12\x1d\n\x19KMS_KEY_STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x15\n\x11PERMISSION_DENIED\x10\x02\x12\x0c\n\x08\x44ISABLED\x10\x03\x12\r\n\tDESTROYED\x10\x04\x12\x15\n\x11\x44\x45STROY_SCHEDULED\x10\x05\x12 \n\x1c\x45KM_KEY_UNREACHABLE_DETECTED\x10\x06\x12\x14\n\x10\x42ILLING_DISABLED\x10\x07\x12\x13\n\x0fUNKNOWN_FAILURE\x10\x08*W\n\x13PscConnectionStatus\x12%\n!PSC_CONNECTION_STATUS_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\r\n\tNOT_FOUND\x10\x02*\x89\x01\n\x0e\x43onnectionType\x12\x1f\n\x1b\x43ONNECTION_TYPE_UNSPECIFIED\x10\x00\x12\x1d\n\x19\x43ONNECTION_TYPE_DISCOVERY\x10\x01\x12\x1b\n\x17\x43ONNECTION_TYPE_PRIMARY\x10\x02\x12\x1a\n\x16\x43ONNECTION_TYPE_READER\x10\x03\x32\x95.\n\x0bMemorystore\x12\xc2\x01\n\rListInstances\x12\x35.google.cloud.memorystore.v1beta.ListInstancesRequest\x1a\x36.google.cloud.memorystore.v1beta.ListInstancesResponse\"B\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x33\x12\x31/v1beta/{parent=projects/*/locations/*}/instances\x12\xaf\x01\n\x0bGetInstance\x12\x33.google.cloud.memorystore.v1beta.GetInstanceRequest\x1a).google.cloud.memorystore.v1beta.Instance\"@\xda\x41\x04name\x82\xd3\xe4\x93\x02\x33\x12\x31/v1beta/{name=projects/*/locations/*/instances/*}\x12\xeb\x01\n\x0e\x43reateInstance\x12\x36.google.cloud.memorystore.v1beta.CreateInstanceRequest\x1a\x1d.google.longrunning.Operation\"\x81\x01\xca\x41\x1d\n\x08Instance\x12\x11OperationMetadata\xda\x41\x1bparent,instance,instance_id\x82\xd3\xe4\x93\x02=\"1/v1beta/{parent=projects/*/locations/*}/instances:\x08instance\x12\xed\x01\n\x0eUpdateInstance\x12\x36.google.cloud.memorystore.v1beta.UpdateInstanceRequest\x1a\x1d.google.longrunning.Operation\"\x83\x01\xca\x41\x1d\n\x08Instance\x12\x11OperationMetadata\xda\x41\x14instance,update_mask\x82\xd3\xe4\x93\x02\x46\x32:/v1beta/{instance.name=projects/*/locations/*/instances/*}:\x08instance\x12\xd6\x01\n\x0e\x44\x65leteInstance\x12\x36.google.cloud.memorystore.v1beta.DeleteInstanceRequest\x1a\x1d.google.longrunning.Operation\"m\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x33*1/v1beta/{name=projects/*/locations/*/instances/*}\x12\xe8\x01\n\x17GetCertificateAuthority\x12?.google.cloud.memorystore.v1beta.GetCertificateAuthorityRequest\x1a\x35.google.cloud.memorystore.v1beta.CertificateAuthority\"U\xda\x41\x04name\x82\xd3\xe4\x93\x02H\x12\x46/v1beta/{name=projects/*/locations/*/instances/*}/certificateAuthority\x12\x94\x02\n%GetSharedRegionalCertificateAuthority\x12M.google.cloud.memorystore.v1beta.GetSharedRegionalCertificateAuthorityRequest\x1a\x43.google.cloud.memorystore.v1beta.SharedRegionalCertificateAuthority\"W\xda\x41\x04name\x82\xd3\xe4\x93\x02J\x12H/v1beta/{name=projects/*/locations/*/sharedRegionalCertificateAuthority}\x12\x8f\x02\n\x15RescheduleMaintenance\x12=.google.cloud.memorystore.v1beta.RescheduleMaintenanceRequest\x1a\x1d.google.longrunning.Operation\"\x97\x01\xca\x41\x1d\n\x08Instance\x12\x11OperationMetadata\xda\x41\"name,reschedule_type,schedule_time\x82\xd3\xe4\x93\x02L\"G/v1beta/{name=projects/*/locations/*/instances/*}:rescheduleMaintenance:\x01*\x12\xe2\x01\n\x15ListBackupCollections\x12=.google.cloud.memorystore.v1beta.ListBackupCollectionsRequest\x1a>.google.cloud.memorystore.v1beta.ListBackupCollectionsResponse\"J\xda\x41\x06parent\x82\xd3\xe4\x93\x02;\x12\x39/v1beta/{parent=projects/*/locations/*}/backupCollections\x12\xcf\x01\n\x13GetBackupCollection\x12;.google.cloud.memorystore.v1beta.GetBackupCollectionRequest\x1a\x31.google.cloud.memorystore.v1beta.BackupCollection\"H\xda\x41\x04name\x82\xd3\xe4\x93\x02;\x12\x39/v1beta/{name=projects/*/locations/*/backupCollections/*}\x12\xce\x01\n\x0bListBackups\x12\x33.google.cloud.memorystore.v1beta.ListBackupsRequest\x1a\x34.google.cloud.memorystore.v1beta.ListBackupsResponse\"T\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x45\x12\x43/v1beta/{parent=projects/*/locations/*/backupCollections/*}/backups\x12\xbb\x01\n\tGetBackup\x12\x31.google.cloud.memorystore.v1beta.GetBackupRequest\x1a\'.google.cloud.memorystore.v1beta.Backup\"R\xda\x41\x04name\x82\xd3\xe4\x93\x02\x45\x12\x43/v1beta/{name=projects/*/locations/*/backupCollections/*/backups/*}\x12\xe4\x01\n\x0c\x44\x65leteBackup\x12\x34.google.cloud.memorystore.v1beta.DeleteBackupRequest\x1a\x1d.google.longrunning.Operation\"\x7f\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x45*C/v1beta/{name=projects/*/locations/*/backupCollections/*/backups/*}\x12\xd8\x01\n\x0c\x45xportBackup\x12\x34.google.cloud.memorystore.v1beta.ExportBackupRequest\x1a\x1d.google.longrunning.Operation\"s\xca\x41\x1b\n\x06\x42\x61\x63kup\x12\x11OperationMetadata\x82\xd3\xe4\x93\x02O\"J/v1beta/{name=projects/*/locations/*/backupCollections/*/backups/*}:export:\x01*\x12\xd3\x01\n\x0e\x42\x61\x63kupInstance\x12\x36.google.cloud.memorystore.v1beta.BackupInstanceRequest\x1a\x1d.google.longrunning.Operation\"j\xca\x41\x1d\n\x08Instance\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02=\"8/v1beta/{name=projects/*/locations/*/instances/*}:backup:\x01*\x12\xd4\x01\n\x0eStartMigration\x12\x36.google.cloud.memorystore.v1beta.StartMigrationRequest\x1a\x1d.google.longrunning.Operation\"k\xca\x41\x1d\n\x08Instance\x12\x11OperationMetadata\x82\xd3\xe4\x93\x02\x45\"@/v1beta/{name=projects/*/locations/*/instances/*}:startMigration:\x01*\x12\xe4\x01\n\x0f\x46inishMigration\x12\x37.google.cloud.memorystore.v1beta.FinishMigrationRequest\x1a\x1d.google.longrunning.Operation\"y\xca\x41\x1d\n\x08Instance\x12\x11OperationMetadata\xda\x41\nname,force\x82\xd3\xe4\x93\x02\x46\"A/v1beta/{name=projects/*/locations/*/instances/*}:finishMigration:\x01*\x12\xe2\x01\n\x12ListTokenAuthUsers\x12:.google.cloud.memorystore.v1beta.ListTokenAuthUsersRequest\x1a;.google.cloud.memorystore.v1beta.ListTokenAuthUsersResponse\"S\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x44\x12\x42/v1beta/{parent=projects/*/locations/*/instances/*}/tokenAuthUsers\x12\xcf\x01\n\x10GetTokenAuthUser\x12\x38.google.cloud.memorystore.v1beta.GetTokenAuthUserRequest\x1a..google.cloud.memorystore.v1beta.TokenAuthUser\"Q\xda\x41\x04name\x82\xd3\xe4\x93\x02\x44\x12\x42/v1beta/{name=projects/*/locations/*/instances/*/tokenAuthUsers/*}\x12\xe3\x01\n\x0eListAuthTokens\x12\x36.google.cloud.memorystore.v1beta.ListAuthTokensRequest\x1a\x37.google.cloud.memorystore.v1beta.ListAuthTokensResponse\"`\xda\x41\x06parent\x82\xd3\xe4\x93\x02Q\x12O/v1beta/{parent=projects/*/locations/*/instances/*/tokenAuthUsers/*}/authTokens\x12\xd0\x01\n\x0cGetAuthToken\x12\x34.google.cloud.memorystore.v1beta.GetAuthTokenRequest\x1a*.google.cloud.memorystore.v1beta.AuthToken\"^\xda\x41\x04name\x82\xd3\xe4\x93\x02Q\x12O/v1beta/{name=projects/*/locations/*/instances/*/tokenAuthUsers/*/authTokens/*}\x12\xfa\x01\n\x10\x41\x64\x64TokenAuthUser\x12\x38.google.cloud.memorystore.v1beta.AddTokenAuthUserRequest\x1a\x1d.google.longrunning.Operation\"\x8c\x01\xca\x41\x1d\n\x08Instance\x12\x11OperationMetadata\xda\x41\x18instance,token_auth_user\x82\xd3\xe4\x93\x02K\"F/v1beta/{instance=projects/*/locations/*/instances/*}:addTokenAuthUser:\x01*\x12\xf1\x01\n\x13\x44\x65leteTokenAuthUser\x12;.google.cloud.memorystore.v1beta.DeleteTokenAuthUserRequest\x1a\x1d.google.longrunning.Operation\"~\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x44*B/v1beta/{name=projects/*/locations/*/instances/*/tokenAuthUsers/*}\x12\x8d\x02\n\x0c\x41\x64\x64\x41uthToken\x12\x34.google.cloud.memorystore.v1beta.AddAuthTokenRequest\x1a\x1d.google.longrunning.Operation\"\xa7\x01\xca\x41\"\n\rTokenAuthUser\x12\x11OperationMetadata\xda\x41\x1atoken_auth_user,auth_token\x82\xd3\xe4\x93\x02_\"Z/v1beta/{token_auth_user=projects/*/locations/*/instances/*/tokenAuthUsers/*}:addAuthToken:\x01*\x12\xf7\x01\n\x0f\x44\x65leteAuthToken\x12\x37.google.cloud.memorystore.v1beta.DeleteAuthTokenRequest\x1a\x1d.google.longrunning.Operation\"\x8b\x01\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02Q*O/v1beta/{name=projects/*/locations/*/instances/*/tokenAuthUsers/*/authTokens/*}\x1a\xbc\x01\xca\x41\x1amemorystore.googleapis.com\xd2\x41\x9b\x01https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/memorystore.read-only,https://www.googleapis.com/auth/memorystore.read-writeB\x9e\x08\n#com.google.cloud.memorystore.v1betaB\x0bV1mainProtoP\x01ZEcloud.google.com/go/memorystore/apiv1beta/memorystorepb;memorystorepb\xaa\x02\x1fGoogle.Cloud.Memorystore.V1Beta\xca\x02\x1fGoogle\\Cloud\\Memorystore\\V1beta\xea\x02\"Google::Cloud::Memorystore::V1beta\xea\x41n\n%compute.googleapis.com/ForwardingRule\x12\x45projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}\xea\x41N\n\x1e\x63ompute.googleapis.com/Network\x12,projects/{project}/global/networks/{network}\xea\x41w\n(compute.googleapis.com/ServiceAttachment\x12Kprojects/{project}/regions/{region}/serviceAttachments/{service_attachment}\xea\x41x\n!cloudkms.googleapis.com/CryptoKey\x12Sprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}\xea\x41\xa6\x01\n(cloudkms.googleapis.com/CryptoKeyVersion\x12zprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}\xea\x41\\\n\x1fprivateca.googleapis.com/CaPool\x12\x39projects/{project}/locations/{location}/caPools/{ca_pool}\xea\x41w\n(compute.googleapis.com/NetworkAttachment\x12Kprojects/{project}/regions/{region}/networkAttachments/{network_attachment}b\x06proto3" pool = ::Google::Protobuf::DescriptorPool.generated_pool pool.add_serialized_file(descriptor_data) @@ -27,6 +30,8 @@ module V1beta Instance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.Instance").msgclass Instance::StateInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.Instance.StateInfo").msgclass Instance::StateInfo::UpdateInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo").msgclass + Instance::GcsBackupSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.Instance.GcsBackupSource").msgclass + Instance::ManagedBackupSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.Instance.ManagedBackupSource").msgclass Instance::InstanceEndpoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.Instance.InstanceEndpoint").msgclass Instance::ConnectionDetail = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.Instance.ConnectionDetail").msgclass Instance::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.Instance.State").enummodule @@ -35,6 +40,31 @@ module V1beta Instance::NodeType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.Instance.NodeType").enummodule Instance::Mode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.Instance.Mode").enummodule Instance::ServerCaMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.Instance.ServerCaMode").enummodule + StartMigrationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.StartMigrationRequest").msgclass + FinishMigrationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.FinishMigrationRequest").msgclass + SelfManagedSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.SelfManagedSource").msgclass + MigrationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.MigrationConfig").msgclass + MigrationConfig::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.MigrationConfig.State").enummodule + AutomatedBackupConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.AutomatedBackupConfig").msgclass + AutomatedBackupConfig::FixedFrequencySchedule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.AutomatedBackupConfig.FixedFrequencySchedule").msgclass + AutomatedBackupConfig::AutomatedBackupMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.AutomatedBackupConfig.AutomatedBackupMode").enummodule + BackupCollection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.BackupCollection").msgclass + Backup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.Backup").msgclass + Backup::BackupType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.Backup.BackupType").enummodule + Backup::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.Backup.State").enummodule + BackupFile = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.BackupFile").msgclass + CrossInstanceReplicationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.CrossInstanceReplicationConfig").msgclass + CrossInstanceReplicationConfig::RemoteInstance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.CrossInstanceReplicationConfig.RemoteInstance").msgclass + CrossInstanceReplicationConfig::Membership = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.CrossInstanceReplicationConfig.Membership").msgclass + CrossInstanceReplicationConfig::InstanceRole = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.CrossInstanceReplicationConfig.InstanceRole").enummodule + TokenAuthUser = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.TokenAuthUser").msgclass + TokenAuthUser::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.TokenAuthUser.State").enummodule + AuthToken = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.AuthToken").msgclass + AuthToken::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.AuthToken.State").enummodule + MaintenancePolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.MaintenancePolicy").msgclass + WeeklyMaintenanceWindow = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.WeeklyMaintenanceWindow").msgclass + MaintenanceSchedule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.MaintenanceSchedule").msgclass + PscAttachmentDetail = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.PscAttachmentDetail").msgclass PscAutoConnection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.PscAutoConnection").msgclass PscConnection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.PscConnection").msgclass DiscoveryEndpoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.DiscoveryEndpoint").msgclass @@ -47,13 +77,34 @@ module V1beta NodeConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.NodeConfig").msgclass ZoneDistributionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.ZoneDistributionConfig").msgclass ZoneDistributionConfig::ZoneDistributionMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.ZoneDistributionConfig.ZoneDistributionMode").enummodule + RescheduleMaintenanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.RescheduleMaintenanceRequest").msgclass + RescheduleMaintenanceRequest::RescheduleType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.RescheduleMaintenanceRequest.RescheduleType").enummodule ListInstancesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.ListInstancesRequest").msgclass ListInstancesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.ListInstancesResponse").msgclass GetInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.GetInstanceRequest").msgclass CreateInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.CreateInstanceRequest").msgclass UpdateInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.UpdateInstanceRequest").msgclass DeleteInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.DeleteInstanceRequest").msgclass + ListBackupCollectionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.ListBackupCollectionsRequest").msgclass + ListBackupCollectionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.ListBackupCollectionsResponse").msgclass + GetBackupCollectionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.GetBackupCollectionRequest").msgclass + ListBackupsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.ListBackupsRequest").msgclass + ListBackupsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.ListBackupsResponse").msgclass + GetBackupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.GetBackupRequest").msgclass + DeleteBackupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.DeleteBackupRequest").msgclass + ExportBackupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.ExportBackupRequest").msgclass + BackupInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.BackupInstanceRequest").msgclass GetCertificateAuthorityRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.GetCertificateAuthorityRequest").msgclass + ListTokenAuthUsersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.ListTokenAuthUsersRequest").msgclass + ListTokenAuthUsersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.ListTokenAuthUsersResponse").msgclass + GetTokenAuthUserRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.GetTokenAuthUserRequest").msgclass + ListAuthTokensRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.ListAuthTokensRequest").msgclass + ListAuthTokensResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.ListAuthTokensResponse").msgclass + GetAuthTokenRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.GetAuthTokenRequest").msgclass + AddTokenAuthUserRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.AddTokenAuthUserRequest").msgclass + DeleteTokenAuthUserRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.DeleteTokenAuthUserRequest").msgclass + AddAuthTokenRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.AddAuthTokenRequest").msgclass + DeleteAuthTokenRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.DeleteAuthTokenRequest").msgclass CertificateAuthority = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.CertificateAuthority").msgclass CertificateAuthority::ManagedCertificateAuthority = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority").msgclass CertificateAuthority::ManagedCertificateAuthority::CertChain = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority.CertChain").msgclass @@ -62,6 +113,9 @@ module V1beta SharedRegionalCertificateAuthority::RegionalManagedCertificateAuthority::RegionalCertChain = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.SharedRegionalCertificateAuthority.RegionalManagedCertificateAuthority.RegionalCertChain").msgclass GetSharedRegionalCertificateAuthorityRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.GetSharedRegionalCertificateAuthorityRequest").msgclass OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.OperationMetadata").msgclass + EncryptionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.EncryptionInfo").msgclass + EncryptionInfo::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.EncryptionInfo.Type").enummodule + EncryptionInfo::KmsKeyState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.EncryptionInfo.KmsKeyState").enummodule PscConnectionStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.PscConnectionStatus").enummodule ConnectionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memorystore.v1beta.ConnectionType").enummodule end diff --git a/google-cloud-memorystore-v1beta/lib/google/cloud/memorystore/v1beta/memorystore_services_pb.rb b/google-cloud-memorystore-v1beta/lib/google/cloud/memorystore/v1beta/memorystore_services_pb.rb index 1e97f8bcbda3..7834c4964599 100644 --- a/google-cloud-memorystore-v1beta/lib/google/cloud/memorystore/v1beta/memorystore_services_pb.rb +++ b/google-cloud-memorystore-v1beta/lib/google/cloud/memorystore/v1beta/memorystore_services_pb.rb @@ -48,6 +48,69 @@ class Service # Gets the details of shared regional certificate authority information for # Memorystore instance. rpc :GetSharedRegionalCertificateAuthority, ::Google::Cloud::Memorystore::V1beta::GetSharedRegionalCertificateAuthorityRequest, ::Google::Cloud::Memorystore::V1beta::SharedRegionalCertificateAuthority + # Reschedules upcoming maintenance event. + rpc :RescheduleMaintenance, ::Google::Cloud::Memorystore::V1beta::RescheduleMaintenanceRequest, ::Google::Longrunning::Operation + # Lists all backup collections owned by a consumer project in either the + # specified location (region) or all locations. + # + # If `location_id` is specified as `-` (wildcard), then all regions + # available to the project are queried, and the results are aggregated. + rpc :ListBackupCollections, ::Google::Cloud::Memorystore::V1beta::ListBackupCollectionsRequest, ::Google::Cloud::Memorystore::V1beta::ListBackupCollectionsResponse + # Get a backup collection. + rpc :GetBackupCollection, ::Google::Cloud::Memorystore::V1beta::GetBackupCollectionRequest, ::Google::Cloud::Memorystore::V1beta::BackupCollection + # Lists all backups owned by a backup collection. + rpc :ListBackups, ::Google::Cloud::Memorystore::V1beta::ListBackupsRequest, ::Google::Cloud::Memorystore::V1beta::ListBackupsResponse + # Gets the details of a specific backup. + rpc :GetBackup, ::Google::Cloud::Memorystore::V1beta::GetBackupRequest, ::Google::Cloud::Memorystore::V1beta::Backup + # Deletes a specific backup. + rpc :DeleteBackup, ::Google::Cloud::Memorystore::V1beta::DeleteBackupRequest, ::Google::Longrunning::Operation + # Exports a specific backup to a customer target Cloud Storage URI. + rpc :ExportBackup, ::Google::Cloud::Memorystore::V1beta::ExportBackupRequest, ::Google::Longrunning::Operation + # Backup Instance. + # If this is the first time a backup is being created, a backup collection + # will be created at the backend, and this backup belongs to this collection. + # Both collection and backup will have a resource name. Backup will be + # executed for each shard. A replica (primary if nonHA) will be selected to + # perform the execution. Backup call will be rejected if there is an ongoing + # backup or update operation. Be aware that during preview, if the instance's + # internal software version is too old, critical update will be performed + # before actual backup. Once the internal software version is updated to the + # minimum version required by the backup feature, subsequent backups will not + # require critical update. After preview, there will be no critical update + # needed for backup. + rpc :BackupInstance, ::Google::Cloud::Memorystore::V1beta::BackupInstanceRequest, ::Google::Longrunning::Operation + # Initiates the migration of a source instance to the target Memorystore + # instance. + # + # After the successful completion of this operation, the target instance + # will: + # 1. Set up replication with the source instance and replicate any writes to + # the source instance. + # 2. Only allow reads. + rpc :StartMigration, ::Google::Cloud::Memorystore::V1beta::StartMigrationRequest, ::Google::Longrunning::Operation + # Finalizes the migration process. + # + # After the successful completion of this operation, the target instance + # will: + # 1. Stop replicating from the source instance. + # 2. Allow both reads and writes. + rpc :FinishMigration, ::Google::Cloud::Memorystore::V1beta::FinishMigrationRequest, ::Google::Longrunning::Operation + # Lists all the token auth users for a token based auth enabled instance. + rpc :ListTokenAuthUsers, ::Google::Cloud::Memorystore::V1beta::ListTokenAuthUsersRequest, ::Google::Cloud::Memorystore::V1beta::ListTokenAuthUsersResponse + # Gets a specific token auth user for a token based auth enabled instance. + rpc :GetTokenAuthUser, ::Google::Cloud::Memorystore::V1beta::GetTokenAuthUserRequest, ::Google::Cloud::Memorystore::V1beta::TokenAuthUser + # Lists all the auth tokens for a specific token auth user. + rpc :ListAuthTokens, ::Google::Cloud::Memorystore::V1beta::ListAuthTokensRequest, ::Google::Cloud::Memorystore::V1beta::ListAuthTokensResponse + # Gets a token based auth enabled instance's auth token for a given user. + rpc :GetAuthToken, ::Google::Cloud::Memorystore::V1beta::GetAuthTokenRequest, ::Google::Cloud::Memorystore::V1beta::AuthToken + # Adds a token auth user for a token based auth enabled instance. + rpc :AddTokenAuthUser, ::Google::Cloud::Memorystore::V1beta::AddTokenAuthUserRequest, ::Google::Longrunning::Operation + # Deletes a token auth user for a token based auth enabled instance. + rpc :DeleteTokenAuthUser, ::Google::Cloud::Memorystore::V1beta::DeleteTokenAuthUserRequest, ::Google::Longrunning::Operation + # Adds a token for a user of a token based auth enabled instance. + rpc :AddAuthToken, ::Google::Cloud::Memorystore::V1beta::AddAuthTokenRequest, ::Google::Longrunning::Operation + # Deletes a token for a user of a token based auth enabled instance. + rpc :DeleteAuthToken, ::Google::Cloud::Memorystore::V1beta::DeleteAuthTokenRequest, ::Google::Longrunning::Operation end Stub = Service.rpc_stub_class diff --git a/google-cloud-memorystore-v1beta/proto_docs/google/cloud/memorystore/v1beta/memorystore.rb b/google-cloud-memorystore-v1beta/proto_docs/google/cloud/memorystore/v1beta/memorystore.rb index 133b2173d68d..77089159c2bb 100644 --- a/google-cloud-memorystore-v1beta/proto_docs/google/cloud/memorystore/v1beta/memorystore.rb +++ b/google-cloud-memorystore-v1beta/proto_docs/google/cloud/memorystore/v1beta/memorystore.rb @@ -22,6 +22,20 @@ module Cloud module Memorystore module V1beta # A Memorystore instance. + # @!attribute [rw] gcs_source + # @return [::Google::Cloud::Memorystore::V1beta::Instance::GcsBackupSource] + # Optional. Immutable. Backups that stored in Cloud Storage buckets. + # The Cloud Storage buckets need to be the same region as the instances. + # Read permission is required to import from the provided Cloud Storage + # Objects. + # + # Note: The following fields are mutually exclusive: `gcs_source`, `managed_backup_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] managed_backup_source + # @return [::Google::Cloud::Memorystore::V1beta::Instance::ManagedBackupSource] + # Optional. Immutable. Backups that generated and managed by memorystore + # service. + # + # Note: The following fields are mutually exclusive: `managed_backup_source`, `gcs_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. # @!attribute [rw] name # @return [::String] # Identifier. Unique name of the instance. @@ -58,18 +72,23 @@ module V1beta # @return [::Integer] # Optional. Number of shards for the instance. # @!attribute [r] discovery_endpoints + # @deprecated This field is deprecated and may be removed in the next major version update. # @return [::Array<::Google::Cloud::Memorystore::V1beta::DiscoveryEndpoint>] - # Output only. Endpoints clients can connect to the instance through. - # Currently only one discovery endpoint is supported. + # Output only. Deprecated: The discovery_endpoints parameter is deprecated. + # As a result, it will not be populated if the connections are created using + # endpoints parameter. Instead of this parameter, for discovery, use + # endpoints.connections.pscConnection and + # endpoints.connections.pscAutoConnection + # with connectionType CONNECTION_TYPE_DISCOVERY. # @!attribute [rw] node_type # @return [::Google::Cloud::Memorystore::V1beta::Instance::NodeType] - # Optional. Immutable. Machine type for individual nodes of the instance. + # Optional. Machine type for individual nodes of the instance. # @!attribute [rw] persistence_config # @return [::Google::Cloud::Memorystore::V1beta::PersistenceConfig] # Optional. Persistence configuration of the instance. # @!attribute [rw] engine_version # @return [::String] - # Optional. Immutable. Engine version of the instance. + # Optional. Engine version of the instance. # @!attribute [rw] engine_configs # @return [::Google::Protobuf::Map{::String => ::String}] # Optional. User-provided engine configurations for the instance. @@ -84,15 +103,79 @@ module V1beta # @return [::Boolean] # Optional. If set to true deletion of the instance will fail. # @!attribute [rw] psc_auto_connections + # @deprecated This field is deprecated and may be removed in the next major version update. # @return [::Array<::Google::Cloud::Memorystore::V1beta::PscAutoConnection>] - # Required. Immutable. User inputs and resource details of the auto-created - # PSC connections. + # Optional. Immutable. Deprecated: Use the + # endpoints.connections.psc_auto_connection value instead. + # @!attribute [r] psc_attachment_details + # @return [::Array<::Google::Cloud::Memorystore::V1beta::PscAttachmentDetail>] + # Output only. Service attachment details to configure PSC connections. # @!attribute [rw] endpoints # @return [::Array<::Google::Cloud::Memorystore::V1beta::Instance::InstanceEndpoint>] # Optional. Endpoints for the instance. # @!attribute [rw] mode # @return [::Google::Cloud::Memorystore::V1beta::Instance::Mode] - # Optional. The mode config for the instance. + # Optional. Immutable. The mode config for the instance. + # @!attribute [rw] simulate_maintenance_event + # @return [::Boolean] + # Optional. Input only. Simulate a maintenance event. + # @!attribute [rw] ondemand_maintenance + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Boolean] + # Optional. Input only. Ondemand maintenance for the instance. + # @!attribute [r] satisfies_pzs + # @return [::Boolean] + # Optional. Output only. Reserved for future use. + # @!attribute [r] satisfies_pzi + # @return [::Boolean] + # Optional. Output only. Reserved for future use. + # @!attribute [rw] maintenance_policy + # @return [::Google::Cloud::Memorystore::V1beta::MaintenancePolicy] + # Optional. The maintenance policy for the instance. If not provided, + # the maintenance event will be performed based on Memorystore + # internal rollout schedule. + # @!attribute [r] maintenance_schedule + # @return [::Google::Cloud::Memorystore::V1beta::MaintenanceSchedule] + # Output only. Published maintenance schedule. + # @!attribute [rw] cross_instance_replication_config + # @return [::Google::Cloud::Memorystore::V1beta::CrossInstanceReplicationConfig] + # Optional. The config for cross instance replication. + # @!attribute [rw] async_instance_endpoints_deletion_enabled + # @return [::Boolean] + # Optional. If true, instance endpoints that are created and registered by + # customers can be deleted asynchronously. That is, such an instance endpoint + # can be de-registered before the forwarding rules in the instance endpoint + # are deleted. + # @!attribute [rw] kms_key + # @return [::String] + # Optional. The KMS key used to encrypt the at-rest data of the cluster. + # @!attribute [r] encryption_info + # @return [::Google::Cloud::Memorystore::V1beta::EncryptionInfo] + # Output only. Encryption information of the data at rest of the cluster. + # @!attribute [r] backup_collection + # @return [::String] + # Output only. The backup collection full resource name. Example: + # projects/\\{project}/locations/\\{location}/backupCollections/\\{collection} + # @!attribute [rw] automated_backup_config + # @return [::Google::Cloud::Memorystore::V1beta::AutomatedBackupConfig] + # Optional. The automated backup config for the instance. + # @!attribute [rw] maintenance_version + # @return [::String] + # Optional. This field can be used to trigger self service update to indicate + # the desired maintenance version. The input to this field can be determined + # by the available_maintenance_versions field. + # @!attribute [r] effective_maintenance_version + # @return [::String] + # Output only. This field represents the actual maintenance version of the + # instance. + # @!attribute [r] available_maintenance_versions + # @return [::Array<::String>] + # Output only. This field is used to determine the available maintenance + # versions for the self service update. + # @!attribute [rw] allow_fewer_zones_deployment + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Boolean] + # Optional. Immutable. Deprecated, do not use. # @!attribute [rw] server_ca_mode # @return [::Google::Cloud::Memorystore::V1beta::Instance::ServerCaMode] # Optional. Immutable. The Server CA mode for the instance. @@ -104,6 +187,9 @@ module V1beta # @!attribute [rw] rotate_server_certificate # @return [::Boolean] # Optional. Input only. Rotate the server certificates. + # @!attribute [r] migration_config + # @return [::Google::Cloud::Memorystore::V1beta::MigrationConfig] + # Output only. Migration config for the instance. class Instance include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -123,12 +209,42 @@ class StateInfo # @!attribute [r] target_replica_count # @return [::Integer] # Output only. Target number of replica nodes per shard for the instance. + # @!attribute [r] target_engine_version + # @return [::String] + # Output only. Target engine version for the instance. + # @!attribute [r] target_node_type + # @return [::Google::Cloud::Memorystore::V1beta::Instance::NodeType] + # Output only. Target node type for the instance. class UpdateInfo include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end + # Backups that stored in Cloud Storage buckets. + # The Cloud Storage buckets need to be the same region as the instances. + # @!attribute [rw] uris + # @return [::Array<::String>] + # Optional. Example: gs://bucket1/object1, gs://bucket2/folder2/object2 + class GcsBackupSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Backups that generated and managed by memorystore. + # @!attribute [rw] backup + # @return [::String] + # Optional. Example: + # //memorystore.googleapis.com/projects/\\{project}/locations/\\{location}/backupCollections/\\{collection}/backups/\\{backup} + # A shorter version (without the prefix) of the backup name is also + # supported, like + # projects/\\{project}/locations/\\{location}/backupCollections/\\{collection}/backups/\\{backup_id} + # In this case, it assumes the backup is under memorystore.googleapis.com. + class ManagedBackupSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # InstanceEndpoint consists of PSC connections that are created # as a group in each VPC network for accessing the instance. In each group, # there shall be one connection for each service attachment in the cluster. @@ -144,8 +260,8 @@ class InstanceEndpoint # Information of each PSC connection. # @!attribute [rw] psc_auto_connection # @return [::Google::Cloud::Memorystore::V1beta::PscAutoConnection] - # Detailed information of a PSC connection that is created through - # service connectivity automation. + # Immutable. Detailed information of a PSC connection that is created + # through service connectivity automation. # # Note: The following fields are mutually exclusive: `psc_auto_connection`, `psc_connection`. If a field in that set is populated, all other fields in the set will automatically be cleared. # @!attribute [rw] psc_connection @@ -192,6 +308,9 @@ module State # Instance is being deleted. DELETING = 4 + + # Instance is being migrated. + MIGRATING = 6 end # Possible authorization modes of the instance. @@ -204,6 +323,9 @@ module AuthorizationMode # IAM basic authorization. IAM_AUTH = 2 + + # Token based authorization. + TOKEN_AUTH = 3 end # Possible in-transit encryption modes of the instance. @@ -296,11 +418,496 @@ module ServerCaMode end end + # Request for `StartMigration`. + # @!attribute [rw] self_managed_source + # @return [::Google::Cloud::Memorystore::V1beta::SelfManagedSource] + # Required. Configuration for migrating from a self-managed Valkey/Redis + # instance + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the instance to start migration on. + # Format: projects/\\{project}/locations/\\{location}/instances/\\{instance} + class StartMigrationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for `FinishMigration`. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the instance to finalize migration on. + # Format: projects/\\{project}/locations/\\{location}/instances/\\{instance} + # @!attribute [rw] force + # @return [::Boolean] + # Optional. By default, the `FinishMigration` operation ensures the target + # replication offset to catch up to the source offset as of the time of the + # call. Set this field to `true` to bypass this offset verification check. + class FinishMigrationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details of the self-managed source instance. + # @!attribute [rw] ip_address + # @return [::String] + # Required. The IP address of the source instance. + # This IP address should be a stable IP address that can be accessed by the + # Memorystore instance throughout the migration process. + # @!attribute [rw] port + # @return [::Integer] + # Required. The port of the source instance. + # This port should be a stable port that can be accessed by the Memorystore + # instance throughout the migration process. + # @!attribute [rw] network_attachment + # @return [::String] + # Required. The resource name of the Private Service Connect Network + # Attachment used to establish connectivity to the source instance. This + # network attachment has the following requirements: + # 1. It must be in the same project as the Memorystore instance. + # 2. It must be in the same region as the Memorystore instance. + # 3. The subnet attached to the network attachment must be in the same VPC + # network as the source instance nodes. + # + # Format: + # projects/\\{project}/regions/\\{region}/networkAttachments/\\{network_attachment} + class SelfManagedSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration for the migration of an instance. + # @!attribute [r] self_managed_source + # @return [::Google::Cloud::Memorystore::V1beta::SelfManagedSource] + # Output only. Configuration for migrating from a self-managed Valkey/Redis + # instance + # @!attribute [r] state + # @return [::Google::Cloud::Memorystore::V1beta::MigrationConfig::State] + # Output only. Migration state of the instance. + # @!attribute [r] force_finish_migration + # @return [::Boolean] + # Output only. Represents a boolean flag to force migration finalization + # without offset catch up validation between source and target before + # stopping replication. + class MigrationConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Migration state of the instance. + # New values may be added in the future. + module State + # Instance has no migration related activity. This is the initial state. + STATE_UNSPECIFIED = 0 + + # Instance is not currently migrating. The instance underwent a migration + # attempt that failed, and the subsequent rollback was successful. The + # instance is now ready for a new migration attempt if desired. + ROLLED_BACK = 1 + + # Indicates a previous migration attempt failed. The high-level instance + # state will be `MIGRATING`. The instance is not ready for a new migration + # attempt. Rollback is in progress to restore the instance to its original + # state. The instance will remain in this state until rollback is + # successful. + ROLLING_BACK = 5 + + # Instance is in the process of migration. Instance has established + # successful replication and is ready for cutover. + REPLICATION_ESTABLISHED = 6 + + # Instance is successfully migrated. + MIGRATED = 4 + end + end + + # The automated backup config for an instance. + # @!attribute [rw] fixed_frequency_schedule + # @return [::Google::Cloud::Memorystore::V1beta::AutomatedBackupConfig::FixedFrequencySchedule] + # Optional. Trigger automated backups at a fixed frequency. + # @!attribute [rw] automated_backup_mode + # @return [::Google::Cloud::Memorystore::V1beta::AutomatedBackupConfig::AutomatedBackupMode] + # Optional. The automated backup mode. If the mode is disabled, the other + # fields will be ignored. + # @!attribute [rw] retention + # @return [::Google::Protobuf::Duration] + # Optional. How long to keep automated backups before the backups are + # deleted. The value should be between 1 day and 365 days. If not specified, + # the default value is 35 days. + class AutomatedBackupConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # This schedule allows the backup to be triggered at a fixed frequency + # (currently only daily is supported). + # @!attribute [rw] start_time + # @return [::Google::Type::TimeOfDay] + # Required. The start time of every automated backup in UTC. It must be set + # to the start of an hour. This field is required. + class FixedFrequencySchedule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The automated backup mode. + module AutomatedBackupMode + # Default value. Automated backup config is not specified. + AUTOMATED_BACKUP_MODE_UNSPECIFIED = 0 + + # Automated backup config disabled. + DISABLED = 1 + + # Automated backup config enabled. + ENABLED = 2 + end + end + + # BackupCollection of an instance. + # @!attribute [rw] name + # @return [::String] + # Identifier. Full resource path of the backup collection. + # @!attribute [r] instance_uid + # @return [::String] + # Output only. The instance uid of the backup collection. + # @!attribute [r] instance + # @return [::String] + # Output only. The full resource path of the instance the backup collection + # belongs to. Example: + # projects/\\{project}/locations/\\{location}/instances/\\{instance} + # @!attribute [r] kms_key + # @return [::String] + # Output only. The KMS key used to encrypt the backups under this backup + # collection. + # @!attribute [r] uid + # @return [::String] + # Output only. System assigned unique identifier of the backup collection. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the backup collection was created. + # @!attribute [r] total_backup_size_bytes + # @return [::Integer] + # Output only. Total size of all backups in the backup collection. + # @!attribute [r] total_backup_count + # @return [::Integer] + # Output only. Total number of backups in the backup collection. + # @!attribute [r] last_backup_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The last time a backup was created in the backup collection. + class BackupCollection + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Backup of an instance. + # @!attribute [rw] name + # @return [::String] + # Identifier. Full resource path of the backup. the last part of the name is + # the backup id with the following format: [YYYYMMDDHHMMSS]_[Shorted Instance + # UID] OR customer specified while backup instance. Example: + # 20240515123000_1234 + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the backup was created. + # @!attribute [r] instance + # @return [::String] + # Output only. Instance resource path of this backup. + # @!attribute [r] instance_uid + # @return [::String] + # Output only. Instance uid of this backup. + # @!attribute [r] total_size_bytes + # @return [::Integer] + # Output only. Total size of the backup in bytes. + # @!attribute [r] expire_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the backup will expire. + # @!attribute [r] engine_version + # @return [::String] + # Output only. valkey-7.5/valkey-8.0, etc. + # @!attribute [r] backup_files + # @return [::Array<::Google::Cloud::Memorystore::V1beta::BackupFile>] + # Output only. List of backup files of the backup. + # @!attribute [r] node_type + # @return [::Google::Cloud::Memorystore::V1beta::Instance::NodeType] + # Output only. Node type of the instance. + # @!attribute [r] replica_count + # @return [::Integer] + # Output only. Number of replicas for the instance. + # @!attribute [r] shard_count + # @return [::Integer] + # Output only. Number of shards for the instance. + # @!attribute [r] backup_type + # @return [::Google::Cloud::Memorystore::V1beta::Backup::BackupType] + # Output only. Type of the backup. + # @!attribute [r] state + # @return [::Google::Cloud::Memorystore::V1beta::Backup::State] + # Output only. State of the backup. + # @!attribute [r] encryption_info + # @return [::Google::Cloud::Memorystore::V1beta::EncryptionInfo] + # Output only. Encryption information of the backup. + # @!attribute [r] uid + # @return [::String] + # Output only. System assigned unique identifier of the backup. + class Backup + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Type of the backup. + module BackupType + # The default value, not set. + BACKUP_TYPE_UNSPECIFIED = 0 + + # On-demand backup. + ON_DEMAND = 1 + + # Automated backup. + AUTOMATED = 2 + end + + # State of the backup. + module State + # The default value, not set. + STATE_UNSPECIFIED = 0 + + # The backup is being created. + CREATING = 1 + + # The backup is active to be used. + ACTIVE = 2 + + # The backup is being deleted. + DELETING = 3 + + # The backup is currently suspended due to reasons like project deletion, + # billing account closure, etc. + SUSPENDED = 4 + end + end + + # Backup is consisted of multiple backup files. + # @!attribute [r] file_name + # @return [::String] + # Output only. e.g: .rdb + # @!attribute [r] size_bytes + # @return [::Integer] + # Output only. Size of the backup file in bytes. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the backup file was created. + class BackupFile + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Cross instance replication config. + # @!attribute [rw] instance_role + # @return [::Google::Cloud::Memorystore::V1beta::CrossInstanceReplicationConfig::InstanceRole] + # Required. The role of the instance in cross instance replication. + # @!attribute [rw] primary_instance + # @return [::Google::Cloud::Memorystore::V1beta::CrossInstanceReplicationConfig::RemoteInstance] + # Optional. Details of the primary instance that is used as the replication + # source for this secondary instance. + # + # This field is only set for a secondary instance. + # @!attribute [rw] secondary_instances + # @return [::Array<::Google::Cloud::Memorystore::V1beta::CrossInstanceReplicationConfig::RemoteInstance>] + # Optional. List of secondary instances that are replicating from this + # primary instance. + # + # This field is only set for a primary instance. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The last time cross instance replication config was updated. + # @!attribute [r] membership + # @return [::Google::Cloud::Memorystore::V1beta::CrossInstanceReplicationConfig::Membership] + # Output only. An output only view of all the member instances participating + # in the cross instance replication. This view will be provided by every + # member instance irrespective of its instance role(primary or secondary). + # + # A primary instance can provide information about all the secondary + # instances replicating from it. However, a secondary instance only knows + # about the primary instance from which it is replicating. However, for + # scenarios, where the primary instance is unavailable(e.g. regional outage), + # a Getinstance request can be sent to any other member instance and this + # field will list all the member instances participating in cross instance + # replication. + class CrossInstanceReplicationConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Details of the remote instance associated with this instance in a cross + # instance replication setup. + # @!attribute [rw] instance + # @return [::String] + # Optional. The full resource path of the remote instance in + # the format: projects//locations//instances/ + # @!attribute [r] uid + # @return [::String] + # Output only. The unique identifier of the remote instance. + class RemoteInstance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An output only view of all the member instances participating in the cross + # instance replication. + # @!attribute [r] primary_instance + # @return [::Google::Cloud::Memorystore::V1beta::CrossInstanceReplicationConfig::RemoteInstance] + # Output only. The primary instance that acts as the source of replication + # for the secondary instances. + # @!attribute [r] secondary_instances + # @return [::Array<::Google::Cloud::Memorystore::V1beta::CrossInstanceReplicationConfig::RemoteInstance>] + # Output only. The list of secondary instances replicating from the primary + # instance. + class Membership + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The role of the instance in cross instance replication. + module InstanceRole + # instance role is not set. + # The behavior is equivalent to NONE. + INSTANCE_ROLE_UNSPECIFIED = 0 + + # This instance does not participate in cross instance replication. It is + # an independent instance and does not replicate to or from any other + # instances. + NONE = 1 + + # A instance that allows both reads and writes. Any data written to this + # instance is also replicated to the attached secondary instances. + PRIMARY = 2 + + # A instance that allows only reads and replicates data from a primary + # instance. + SECONDARY = 3 + end + end + + # Token based auth user for the instance. + # @!attribute [rw] name + # @return [::String] + # Identifier. Token based auth user name. + # @!attribute [r] state + # @return [::Google::Cloud::Memorystore::V1beta::TokenAuthUser::State] + # Output only. The state of the token based auth user. + class TokenAuthUser + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents the different states of a token based auth user. + # New values may be added in the future. + module State + # Not set. + STATE_UNSPECIFIED = 0 + + # The auth user is active. + ACTIVE = 1 + + # The auth user is being created. + CREATING = 2 + + # The auth user is being updated. + UPDATING = 3 + + # The auth user is being deleted. + DELETING = 4 + end + end + + # Auth token for the instance. + # @!attribute [rw] name + # @return [::String] + # Identifier. Name of the auth token. + # @!attribute [r] token + # @return [::String] + # Output only. The auth token. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Create time of the auth token. + # @!attribute [r] state + # @return [::Google::Cloud::Memorystore::V1beta::AuthToken::State] + # Output only. The state of the auth token. + class AuthToken + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents the different states of an auth token. + # New values may be added in the future. + module State + # Not set. + STATE_UNSPECIFIED = 0 + + # The auth token is active. + ACTIVE = 1 + + # The auth token is being created. + CREATING = 2 + + # The auth token is being deleted. + DELETING = 3 + end + end + + # Maintenance policy per instance. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the policy was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the policy was updated. + # @!attribute [rw] weekly_maintenance_window + # @return [::Array<::Google::Cloud::Memorystore::V1beta::WeeklyMaintenanceWindow>] + # Optional. Maintenance window that is applied to resources covered by this + # policy. Minimum 1. For the current version, the maximum number of + # weekly_window is expected to be one. + class MaintenancePolicy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Time window specified for weekly operations. + # @!attribute [rw] day + # @return [::Google::Type::DayOfWeek] + # Optional. Allows to define schedule that runs specified day of the week. + # @!attribute [rw] start_time + # @return [::Google::Type::TimeOfDay] + # Optional. Start time of the window in UTC. + class WeeklyMaintenanceWindow + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Upcoming maintenance schedule. + # @!attribute [r] start_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The start time of any upcoming scheduled maintenance for this + # instance. + # @!attribute [r] end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The end time of any upcoming scheduled maintenance for this + # instance. + class MaintenanceSchedule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration of a service attachment of the cluster, for creating PSC + # connections. + # @!attribute [r] service_attachment + # @return [::String] + # Output only. Service attachment URI which your self-created PscConnection + # should use as target. + # @!attribute [r] connection_type + # @return [::Google::Cloud::Memorystore::V1beta::ConnectionType] + # Output only. Type of Psc endpoint. + class PscAttachmentDetail + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # Details of consumer resources in a PSC connection. - # @!attribute [r] port + # @!attribute [rw] port # @return [::Integer] - # Optional. Output only. port will only be set for Primary/Reader or - # Discovery endpoint. + # Optional. port will only be set for Primary/Reader or Discovery endpoint. # @!attribute [r] psc_connection_id # @return [::String] # Output only. The PSC connection id of the forwarding rule connected to the @@ -321,7 +928,7 @@ module ServerCaMode # @!attribute [rw] network # @return [::String] # Required. The network where the PSC endpoints are created, in the form of - # projects/\\{project_id}/global/networks/\\{network_id}. + # projects/\\{project_id}/global/networks/\\{network_name}. # @!attribute [r] service_attachment # @return [::String] # Output only. The service attachment which is the target of the PSC @@ -342,9 +949,12 @@ class PscAutoConnection end # User created Psc connection configuration. - # @!attribute [r] psc_connection_id + # @!attribute [rw] port + # @return [::Integer] + # Optional. port will only be set for Primary/Reader or Discovery endpoint. + # @!attribute [rw] psc_connection_id # @return [::String] - # Output only. The PSC connection id of the forwarding rule connected to the + # Required. The PSC connection id of the forwarding rule connected to the # service attachment. # @!attribute [rw] ip_address # @return [::String] @@ -362,7 +972,7 @@ class PscAutoConnection # @!attribute [rw] network # @return [::String] # Required. The consumer network where the IP address resides, in the form of - # projects/\\{project_id}/global/networks/\\{network_id}. + # projects/\\{project_id}/global/networks/\\{network_name}. # @!attribute [rw] service_attachment # @return [::String] # Required. The service attachment which is the target of the PSC connection, @@ -393,7 +1003,7 @@ class PscConnection # @return [::String] # Output only. The network where the IP address of the discovery endpoint # will be reserved, in the form of - # projects/\\{network_project}/global/networks/\\{network_id}. + # projects/\\{network_project}/global/networks/\\{network_name}. class DiscoveryEndpoint include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -523,7 +1133,37 @@ module ZoneDistributionMode end end - # Request message for [ListInstances][]. + # Request for rescheduling instance maintenance. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the instance to reschedule maintenance for: + # `projects/{project}/locations/{location_id}/instances/{instance}` + # @!attribute [rw] reschedule_type + # @return [::Google::Cloud::Memorystore::V1beta::RescheduleMaintenanceRequest::RescheduleType] + # Required. If reschedule type is SPECIFIC_TIME, schedule_time must be set. + # @!attribute [rw] schedule_time + # @return [::Google::Protobuf::Timestamp] + # Optional. Timestamp when the maintenance shall be rescheduled to if + # reschedule_type=SPECIFIC_TIME, in RFC 3339 format. + # Example: `2012-11-15T16:19:00.094Z`. + class RescheduleMaintenanceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Reschedule options. + module RescheduleType + # Not set. + RESCHEDULE_TYPE_UNSPECIFIED = 0 + + # If the user wants to schedule the maintenance to happen now. + IMMEDIATE = 1 + + # If the user wants to reschedule the maintenance to a specific time. + SPECIFIC_TIME = 3 + end + end + + # Request message for `ListInstances`. # @!attribute [rw] parent # @return [::String] # Required. The parent to list instances from. @@ -547,7 +1187,7 @@ class ListInstancesRequest extend ::Google::Protobuf::MessageExts::ClassMethods end - # Response message for [ListInstances][]. + # Response message for `ListInstances`. # @!attribute [rw] instances # @return [::Array<::Google::Cloud::Memorystore::V1beta::Instance>] # If the \\{location} requested was "-" the response contains a list of @@ -565,7 +1205,7 @@ class ListInstancesResponse extend ::Google::Protobuf::MessageExts::ClassMethods end - # Request message for [GetInstance][]. + # Request message for `GetInstance`. # @!attribute [rw] name # @return [::String] # Required. The name of the instance to retrieve. @@ -668,7 +1308,162 @@ class DeleteInstanceRequest extend ::Google::Protobuf::MessageExts::ClassMethods end - # Request message for [GetCertificateAuthority][]. + # Request for `ListBackupCollections`. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the backupCollection location using the + # form: + # `projects/{project_id}/locations/{location_id}` + # where `location_id` refers to a Google Cloud region. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of items to return. + # + # If not specified, a default value of 1000 will be used by the service. + # Regardless of the page_size value, the response may include a partial list + # and a caller should only rely on response's + # `next_page_token` + # to determine if there are more clusters left to be queried. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The `next_page_token` value returned from a previous + # `ListBackupCollections` request, if any. + class ListBackupCollectionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for `ListBackupCollections`. + # @!attribute [rw] backup_collections + # @return [::Array<::Google::Cloud::Memorystore::V1beta::BackupCollection>] + # A list of backupCollections in the project. + # + # If the `location_id` in the parent field of the request is "-", all regions + # available to the project are queried, and the results aggregated. + # If in such an aggregated query a location is unavailable, a placeholder + # backupCollection entry is included in the response with the `name` field + # set to a value of the form + # `projects/{project_id}/locations/{location_id}/backupCollections/`- and the + # `status` field set to ERROR and `status_message` field set to "location not + # available for ListBackupCollections". + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results in the list. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListBackupCollectionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for `GetBackupCollection`. + # @!attribute [rw] name + # @return [::String] + # Required. Instance backupCollection resource name using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}` + # where `location_id` refers to a Google Cloud region. + class GetBackupCollectionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for `ListBackups`. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the backupCollection using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of items to return. + # + # If not specified, a default value of 1000 will be used by the service. + # Regardless of the page_size value, the response may include a partial list + # and a caller should only rely on response's + # `next_page_token` + # to determine if there are more clusters left to be queried. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The `next_page_token` value returned from a previous + # `ListBackupCollections` request, if any. + class ListBackupsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for `ListBackups`. + # @!attribute [rw] backups + # @return [::Array<::Google::Cloud::Memorystore::V1beta::Backup>] + # A list of backups in the project. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results in the list. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Backups that could not be reached. + class ListBackupsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for `GetBackup`. + # @!attribute [rw] name + # @return [::String] + # Required. Instance backup resource name using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` + class GetBackupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for `DeleteBackup`. + # @!attribute [rw] name + # @return [::String] + # Required. Instance backup resource name using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` + # @!attribute [rw] request_id + # @return [::String] + # Optional. Idempotent request UUID. + class DeleteBackupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for `ExportBackup`. + # @!attribute [rw] gcs_bucket + # @return [::String] + # Google Cloud Storage bucket, like "my-bucket". + # @!attribute [rw] name + # @return [::String] + # Required. Instance backup resource name using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` + class ExportBackupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for `BackupInstance`. + # @!attribute [rw] name + # @return [::String] + # Required. Instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a Google Cloud region. + # @!attribute [rw] ttl + # @return [::Google::Protobuf::Duration] + # Optional. TTL for the backup to expire. Value range is 1 day to 100 years. + # If not specified, the default value is 100 years. + # @!attribute [rw] backup_id + # @return [::String] + # Optional. The id of the backup to be created. If not specified, the + # default value ([YYYYMMDDHHMMSS]_[Shortened Instance UID] is used. + class BackupInstanceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `GetCertificateAuthority`. # @!attribute [rw] name # @return [::String] # Required. The name of the certificate authority. @@ -679,6 +1474,187 @@ class GetCertificateAuthorityRequest extend ::Google::Protobuf::MessageExts::ClassMethods end + # Request message for `ListTokenAuthUsers`. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent to list token auth users from. + # Format: projects/\\{project}/locations/\\{location}/instances/\\{instance} + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of items to return. The maximum value is 1000; + # values above 1000 will be coerced to 1000. If not specified, a default + # value of 1000 will be used by the service. Regardless of the page_size + # value, the response may include a partial list and a caller should only + # rely on response's `next_page_token` to determine if there are more token + # auth users left to be queried. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The `next_page_token` value returned from a previous + # `ListTokenAuthUsers` request, if any. + # @!attribute [rw] filter + # @return [::String] + # Optional. Expression for filtering results. + # @!attribute [rw] order_by + # @return [::String] + # Optional. Sort results by a defined order. + class ListTokenAuthUsersRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for `ListTokenAuthUsers`. + # @!attribute [rw] token_auth_users + # @return [::Array<::Google::Cloud::Memorystore::V1beta::TokenAuthUser>] + # A list of token auth users in the project. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results in the list. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Unordered list. Token auth users that could not be reached. + class ListTokenAuthUsersResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `GetTokenAuthUser`. + # @!attribute [rw] name + # @return [::String] + # Required. The name of token auth user for a basic auth enabled instance. + # Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/tokenAuthUsers/\\{token_auth_user} + class GetTokenAuthUserRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `ListAuthTokens`. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent to list auth tokens from. + # Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/tokenAuthUsers/\\{token_auth_user} + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of items to return. The maximum value is 1000; + # values above 1000 will be coerced to 1000. + # + # If not specified, a default value of 1000 will be used by the service. + # Regardless of the page_size value, the response may include a partial list + # and a caller should only rely on response's + # `next_page_token` + # to determine if there are more auth tokens left to be queried. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The `next_page_token` value returned from a previous + # `ListAuthTokens` request, if any. + # @!attribute [rw] filter + # @return [::String] + # Optional. Expression for filtering results. + # @!attribute [rw] order_by + # @return [::String] + # Optional. Sort results by a defined order. + class ListAuthTokensRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for `ListAuthTokens`. + # @!attribute [rw] auth_tokens + # @return [::Array<::Google::Cloud::Memorystore::V1beta::AuthToken>] + # A list of auth tokens in the project. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results in the list. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Unordered list. Auth tokens that could not be reached. + class ListAuthTokensResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `GetAuthToken`. + # @!attribute [rw] name + # @return [::String] + # Required. The name of token auth user for a token auth enabled instance. + # Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/tokenAuthUsers/\\{token_auth_user}/authTokens/\\{auth_token} + class GetAuthTokenRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `AddTokenAuthUser`. + # @!attribute [rw] instance + # @return [::String] + # Required. The instance resource that this token auth user will be added + # for. Format: projects/\\{project}/locations/\\{location}/instances/\\{instance} + # @!attribute [rw] token_auth_user + # @return [::String] + # Required. The name of the token auth user to add. + class AddTokenAuthUserRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `DeleteTokenAuthUser`. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the token auth user to delete. + # Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/tokenAuthUsers/\\{token_auth_user} + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] force + # @return [::Boolean] + # Optional. If set to true, any auth tokens from this user will also be + # deleted. Otherwise, the request will only work if the user has no auth + # tokens. + class DeleteTokenAuthUserRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `AddAuthToken`. + # @!attribute [rw] token_auth_user + # @return [::String] + # Required. The name of the token auth user resource that this token will be + # added for. + # @!attribute [rw] auth_token + # @return [::Google::Cloud::Memorystore::V1beta::AuthToken] + # Required. The auth token to add. + class AddAuthTokenRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `DeleteAuthToken`. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the token auth user resource that this token will be + # deleted from. Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/tokenAuthUsers/\\{token_auth_user}/authTokens/\\{name} + class DeleteAuthTokenRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # A certificate authority for an instance. # @!attribute [rw] managed_server_ca # @return [::Google::Cloud::Memorystore::V1beta::CertificateAuthority::ManagedCertificateAuthority] @@ -744,8 +1720,7 @@ class RegionalCertChain end end - # Request for - # {::Google::Cloud::Memorystore::V1beta::Memorystore::Client#get_shared_regional_certificate_authority GetSharedRegionalCertificateAuthority}. + # Request for `GetSharedRegionalCertificateAuthority`. # @!attribute [rw] name # @return [::String] # Required. Regional certificate authority resource name using the form: @@ -787,6 +1762,71 @@ class OperationMetadata extend ::Google::Protobuf::MessageExts::ClassMethods end + # EncryptionInfo describes the encryption information of a cluster. + # @!attribute [r] encryption_type + # @return [::Google::Cloud::Memorystore::V1beta::EncryptionInfo::Type] + # Output only. Type of encryption. + # @!attribute [r] kms_key_versions + # @return [::Array<::String>] + # Output only. KMS key versions that are being used to protect the data + # at-rest. + # @!attribute [r] kms_key_primary_state + # @return [::Google::Cloud::Memorystore::V1beta::EncryptionInfo::KmsKeyState] + # Output only. The state of the primary version of the KMS key perceived by + # the system. This field is not populated in backups. + # @!attribute [r] last_update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The most recent time when the encryption info was updated. + class EncryptionInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Possible encryption types. + module Type + # Encryption type not specified. Defaults to GOOGLE_DEFAULT_ENCRYPTION. + TYPE_UNSPECIFIED = 0 + + # The data is encrypted at rest with a key that is fully managed by Google. + # No key version will be populated. This is the default state. + GOOGLE_DEFAULT_ENCRYPTION = 1 + + # The data is encrypted at rest with a key that is managed by the customer. + # KMS key versions will be populated. + CUSTOMER_MANAGED_ENCRYPTION = 2 + end + + # The state of the KMS key perceived by the system. Refer to the public + # documentation for the impact of each state. + module KmsKeyState + # The default value. This value is unused. + KMS_KEY_STATE_UNSPECIFIED = 0 + + # The KMS key is enabled and correctly configured. + ENABLED = 1 + + # Permission denied on the KMS key. + PERMISSION_DENIED = 2 + + # The KMS key is disabled. + DISABLED = 3 + + # The KMS key is destroyed. + DESTROYED = 4 + + # The KMS key is scheduled to be destroyed. + DESTROY_SCHEDULED = 5 + + # The EKM key is unreachable. + EKM_KEY_UNREACHABLE_DETECTED = 6 + + # Billing is disabled for the project. + BILLING_DISABLED = 7 + + # All other unknown failures. + UNKNOWN_FAILURE = 8 + end + end + # Status of the PSC connection. module PscConnectionStatus # PSC connection status is not specified. diff --git a/google-cloud-memorystore-v1beta/proto_docs/google/type/dayofweek.rb b/google-cloud-memorystore-v1beta/proto_docs/google/type/dayofweek.rb new file mode 100644 index 000000000000..973211b9ffe7 --- /dev/null +++ b/google-cloud-memorystore-v1beta/proto_docs/google/type/dayofweek.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents a day of the week. + module DayOfWeek + # The day of the week is unspecified. + DAY_OF_WEEK_UNSPECIFIED = 0 + + # Monday + MONDAY = 1 + + # Tuesday + TUESDAY = 2 + + # Wednesday + WEDNESDAY = 3 + + # Thursday + THURSDAY = 4 + + # Friday + FRIDAY = 5 + + # Saturday + SATURDAY = 6 + + # Sunday + SUNDAY = 7 + end + end +end diff --git a/google-cloud-memorystore-v1beta/proto_docs/google/type/timeofday.rb b/google-cloud-memorystore-v1beta/proto_docs/google/type/timeofday.rb new file mode 100644 index 000000000000..ae79b2f8dceb --- /dev/null +++ b/google-cloud-memorystore-v1beta/proto_docs/google/type/timeofday.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents a time of day. The date and time zone are either not significant + # or are specified elsewhere. An API may choose to allow leap seconds. Related + # types are [google.type.Date][google.type.Date] and + # `google.protobuf.Timestamp`. + # @!attribute [rw] hours + # @return [::Integer] + # Hours of a day in 24 hour format. Must be greater than or equal to 0 and + # typically must be less than or equal to 23. An API may choose to allow the + # value "24:00:00" for scenarios like business closing time. + # @!attribute [rw] minutes + # @return [::Integer] + # Minutes of an hour. Must be greater than or equal to 0 and less than or + # equal to 59. + # @!attribute [rw] seconds + # @return [::Integer] + # Seconds of a minute. Must be greater than or equal to 0 and typically must + # be less than or equal to 59. An API may allow the value 60 if it allows + # leap-seconds. + # @!attribute [rw] nanos + # @return [::Integer] + # Fractions of seconds, in nanoseconds. Must be greater than or equal to 0 + # and less than or equal to 999,999,999. + class TimeOfDay + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-memorystore-v1beta/snippets/memorystore/add_auth_token.rb b/google-cloud-memorystore-v1beta/snippets/memorystore/add_auth_token.rb new file mode 100644 index 000000000000..74b999afcd04 --- /dev/null +++ b/google-cloud-memorystore-v1beta/snippets/memorystore/add_auth_token.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START memorystore_v1beta_generated_Memorystore_AddAuthToken_sync] +require "google/cloud/memorystore/v1beta" + +## +# Snippet for the add_auth_token call in the Memorystore service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Memorystore::V1beta::Memorystore::Client#add_auth_token. +# +def add_auth_token + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Memorystore::V1beta::Memorystore::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Memorystore::V1beta::AddAuthTokenRequest.new + + # Call the add_auth_token method. + result = client.add_auth_token request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END memorystore_v1beta_generated_Memorystore_AddAuthToken_sync] diff --git a/google-cloud-memorystore-v1beta/snippets/memorystore/add_token_auth_user.rb b/google-cloud-memorystore-v1beta/snippets/memorystore/add_token_auth_user.rb new file mode 100644 index 000000000000..f3c3f4282ff2 --- /dev/null +++ b/google-cloud-memorystore-v1beta/snippets/memorystore/add_token_auth_user.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START memorystore_v1beta_generated_Memorystore_AddTokenAuthUser_sync] +require "google/cloud/memorystore/v1beta" + +## +# Snippet for the add_token_auth_user call in the Memorystore service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Memorystore::V1beta::Memorystore::Client#add_token_auth_user. +# +def add_token_auth_user + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Memorystore::V1beta::Memorystore::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Memorystore::V1beta::AddTokenAuthUserRequest.new + + # Call the add_token_auth_user method. + result = client.add_token_auth_user request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END memorystore_v1beta_generated_Memorystore_AddTokenAuthUser_sync] diff --git a/google-cloud-memorystore-v1beta/snippets/memorystore/backup_instance.rb b/google-cloud-memorystore-v1beta/snippets/memorystore/backup_instance.rb new file mode 100644 index 000000000000..445de1c1c889 --- /dev/null +++ b/google-cloud-memorystore-v1beta/snippets/memorystore/backup_instance.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START memorystore_v1beta_generated_Memorystore_BackupInstance_sync] +require "google/cloud/memorystore/v1beta" + +## +# Snippet for the backup_instance call in the Memorystore service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Memorystore::V1beta::Memorystore::Client#backup_instance. +# +def backup_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Memorystore::V1beta::Memorystore::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Memorystore::V1beta::BackupInstanceRequest.new + + # Call the backup_instance method. + result = client.backup_instance request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END memorystore_v1beta_generated_Memorystore_BackupInstance_sync] diff --git a/google-cloud-memorystore-v1beta/snippets/memorystore/delete_auth_token.rb b/google-cloud-memorystore-v1beta/snippets/memorystore/delete_auth_token.rb new file mode 100644 index 000000000000..7e24559f9d4d --- /dev/null +++ b/google-cloud-memorystore-v1beta/snippets/memorystore/delete_auth_token.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START memorystore_v1beta_generated_Memorystore_DeleteAuthToken_sync] +require "google/cloud/memorystore/v1beta" + +## +# Snippet for the delete_auth_token call in the Memorystore service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Memorystore::V1beta::Memorystore::Client#delete_auth_token. +# +def delete_auth_token + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Memorystore::V1beta::Memorystore::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Memorystore::V1beta::DeleteAuthTokenRequest.new + + # Call the delete_auth_token method. + result = client.delete_auth_token request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END memorystore_v1beta_generated_Memorystore_DeleteAuthToken_sync] diff --git a/google-cloud-memorystore-v1beta/snippets/memorystore/delete_backup.rb b/google-cloud-memorystore-v1beta/snippets/memorystore/delete_backup.rb new file mode 100644 index 000000000000..b50e5ac826bc --- /dev/null +++ b/google-cloud-memorystore-v1beta/snippets/memorystore/delete_backup.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START memorystore_v1beta_generated_Memorystore_DeleteBackup_sync] +require "google/cloud/memorystore/v1beta" + +## +# Snippet for the delete_backup call in the Memorystore service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Memorystore::V1beta::Memorystore::Client#delete_backup. +# +def delete_backup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Memorystore::V1beta::Memorystore::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Memorystore::V1beta::DeleteBackupRequest.new + + # Call the delete_backup method. + result = client.delete_backup request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END memorystore_v1beta_generated_Memorystore_DeleteBackup_sync] diff --git a/google-cloud-memorystore-v1beta/snippets/memorystore/delete_token_auth_user.rb b/google-cloud-memorystore-v1beta/snippets/memorystore/delete_token_auth_user.rb new file mode 100644 index 000000000000..77c54188fe50 --- /dev/null +++ b/google-cloud-memorystore-v1beta/snippets/memorystore/delete_token_auth_user.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START memorystore_v1beta_generated_Memorystore_DeleteTokenAuthUser_sync] +require "google/cloud/memorystore/v1beta" + +## +# Snippet for the delete_token_auth_user call in the Memorystore service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Memorystore::V1beta::Memorystore::Client#delete_token_auth_user. +# +def delete_token_auth_user + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Memorystore::V1beta::Memorystore::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Memorystore::V1beta::DeleteTokenAuthUserRequest.new + + # Call the delete_token_auth_user method. + result = client.delete_token_auth_user request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END memorystore_v1beta_generated_Memorystore_DeleteTokenAuthUser_sync] diff --git a/google-cloud-memorystore-v1beta/snippets/memorystore/export_backup.rb b/google-cloud-memorystore-v1beta/snippets/memorystore/export_backup.rb new file mode 100644 index 000000000000..fbca48c61f0d --- /dev/null +++ b/google-cloud-memorystore-v1beta/snippets/memorystore/export_backup.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START memorystore_v1beta_generated_Memorystore_ExportBackup_sync] +require "google/cloud/memorystore/v1beta" + +## +# Snippet for the export_backup call in the Memorystore service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Memorystore::V1beta::Memorystore::Client#export_backup. +# +def export_backup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Memorystore::V1beta::Memorystore::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Memorystore::V1beta::ExportBackupRequest.new + + # Call the export_backup method. + result = client.export_backup request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END memorystore_v1beta_generated_Memorystore_ExportBackup_sync] diff --git a/google-cloud-memorystore-v1beta/snippets/memorystore/finish_migration.rb b/google-cloud-memorystore-v1beta/snippets/memorystore/finish_migration.rb new file mode 100644 index 000000000000..217beb688a23 --- /dev/null +++ b/google-cloud-memorystore-v1beta/snippets/memorystore/finish_migration.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START memorystore_v1beta_generated_Memorystore_FinishMigration_sync] +require "google/cloud/memorystore/v1beta" + +## +# Snippet for the finish_migration call in the Memorystore service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Memorystore::V1beta::Memorystore::Client#finish_migration. +# +def finish_migration + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Memorystore::V1beta::Memorystore::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Memorystore::V1beta::FinishMigrationRequest.new + + # Call the finish_migration method. + result = client.finish_migration request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END memorystore_v1beta_generated_Memorystore_FinishMigration_sync] diff --git a/google-cloud-memorystore-v1beta/snippets/memorystore/get_auth_token.rb b/google-cloud-memorystore-v1beta/snippets/memorystore/get_auth_token.rb new file mode 100644 index 000000000000..d324e97116f2 --- /dev/null +++ b/google-cloud-memorystore-v1beta/snippets/memorystore/get_auth_token.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START memorystore_v1beta_generated_Memorystore_GetAuthToken_sync] +require "google/cloud/memorystore/v1beta" + +## +# Snippet for the get_auth_token call in the Memorystore service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Memorystore::V1beta::Memorystore::Client#get_auth_token. +# +def get_auth_token + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Memorystore::V1beta::Memorystore::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Memorystore::V1beta::GetAuthTokenRequest.new + + # Call the get_auth_token method. + result = client.get_auth_token request + + # The returned object is of type Google::Cloud::Memorystore::V1beta::AuthToken. + p result +end +# [END memorystore_v1beta_generated_Memorystore_GetAuthToken_sync] diff --git a/google-cloud-memorystore-v1beta/snippets/memorystore/get_backup.rb b/google-cloud-memorystore-v1beta/snippets/memorystore/get_backup.rb new file mode 100644 index 000000000000..b85004e10ca6 --- /dev/null +++ b/google-cloud-memorystore-v1beta/snippets/memorystore/get_backup.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START memorystore_v1beta_generated_Memorystore_GetBackup_sync] +require "google/cloud/memorystore/v1beta" + +## +# Snippet for the get_backup call in the Memorystore service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Memorystore::V1beta::Memorystore::Client#get_backup. +# +def get_backup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Memorystore::V1beta::Memorystore::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Memorystore::V1beta::GetBackupRequest.new + + # Call the get_backup method. + result = client.get_backup request + + # The returned object is of type Google::Cloud::Memorystore::V1beta::Backup. + p result +end +# [END memorystore_v1beta_generated_Memorystore_GetBackup_sync] diff --git a/google-cloud-memorystore-v1beta/snippets/memorystore/get_backup_collection.rb b/google-cloud-memorystore-v1beta/snippets/memorystore/get_backup_collection.rb new file mode 100644 index 000000000000..6d8cf5168991 --- /dev/null +++ b/google-cloud-memorystore-v1beta/snippets/memorystore/get_backup_collection.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START memorystore_v1beta_generated_Memorystore_GetBackupCollection_sync] +require "google/cloud/memorystore/v1beta" + +## +# Snippet for the get_backup_collection call in the Memorystore service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Memorystore::V1beta::Memorystore::Client#get_backup_collection. +# +def get_backup_collection + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Memorystore::V1beta::Memorystore::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Memorystore::V1beta::GetBackupCollectionRequest.new + + # Call the get_backup_collection method. + result = client.get_backup_collection request + + # The returned object is of type Google::Cloud::Memorystore::V1beta::BackupCollection. + p result +end +# [END memorystore_v1beta_generated_Memorystore_GetBackupCollection_sync] diff --git a/google-cloud-memorystore-v1beta/snippets/memorystore/get_token_auth_user.rb b/google-cloud-memorystore-v1beta/snippets/memorystore/get_token_auth_user.rb new file mode 100644 index 000000000000..7f2df41b0959 --- /dev/null +++ b/google-cloud-memorystore-v1beta/snippets/memorystore/get_token_auth_user.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START memorystore_v1beta_generated_Memorystore_GetTokenAuthUser_sync] +require "google/cloud/memorystore/v1beta" + +## +# Snippet for the get_token_auth_user call in the Memorystore service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Memorystore::V1beta::Memorystore::Client#get_token_auth_user. +# +def get_token_auth_user + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Memorystore::V1beta::Memorystore::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Memorystore::V1beta::GetTokenAuthUserRequest.new + + # Call the get_token_auth_user method. + result = client.get_token_auth_user request + + # The returned object is of type Google::Cloud::Memorystore::V1beta::TokenAuthUser. + p result +end +# [END memorystore_v1beta_generated_Memorystore_GetTokenAuthUser_sync] diff --git a/google-cloud-memorystore-v1beta/snippets/memorystore/list_auth_tokens.rb b/google-cloud-memorystore-v1beta/snippets/memorystore/list_auth_tokens.rb new file mode 100644 index 000000000000..5e508dc526c2 --- /dev/null +++ b/google-cloud-memorystore-v1beta/snippets/memorystore/list_auth_tokens.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START memorystore_v1beta_generated_Memorystore_ListAuthTokens_sync] +require "google/cloud/memorystore/v1beta" + +## +# Snippet for the list_auth_tokens call in the Memorystore service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Memorystore::V1beta::Memorystore::Client#list_auth_tokens. +# +def list_auth_tokens + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Memorystore::V1beta::Memorystore::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Memorystore::V1beta::ListAuthTokensRequest.new + + # Call the list_auth_tokens method. + result = client.list_auth_tokens request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Memorystore::V1beta::AuthToken. + p item + end +end +# [END memorystore_v1beta_generated_Memorystore_ListAuthTokens_sync] diff --git a/google-cloud-memorystore-v1beta/snippets/memorystore/list_backup_collections.rb b/google-cloud-memorystore-v1beta/snippets/memorystore/list_backup_collections.rb new file mode 100644 index 000000000000..8b9992452abf --- /dev/null +++ b/google-cloud-memorystore-v1beta/snippets/memorystore/list_backup_collections.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START memorystore_v1beta_generated_Memorystore_ListBackupCollections_sync] +require "google/cloud/memorystore/v1beta" + +## +# Snippet for the list_backup_collections call in the Memorystore service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Memorystore::V1beta::Memorystore::Client#list_backup_collections. +# +def list_backup_collections + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Memorystore::V1beta::Memorystore::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Memorystore::V1beta::ListBackupCollectionsRequest.new + + # Call the list_backup_collections method. + result = client.list_backup_collections request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Memorystore::V1beta::BackupCollection. + p item + end +end +# [END memorystore_v1beta_generated_Memorystore_ListBackupCollections_sync] diff --git a/google-cloud-memorystore-v1beta/snippets/memorystore/list_backups.rb b/google-cloud-memorystore-v1beta/snippets/memorystore/list_backups.rb new file mode 100644 index 000000000000..6bc2cd4c9e3c --- /dev/null +++ b/google-cloud-memorystore-v1beta/snippets/memorystore/list_backups.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START memorystore_v1beta_generated_Memorystore_ListBackups_sync] +require "google/cloud/memorystore/v1beta" + +## +# Snippet for the list_backups call in the Memorystore service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Memorystore::V1beta::Memorystore::Client#list_backups. +# +def list_backups + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Memorystore::V1beta::Memorystore::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Memorystore::V1beta::ListBackupsRequest.new + + # Call the list_backups method. + result = client.list_backups request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Memorystore::V1beta::Backup. + p item + end +end +# [END memorystore_v1beta_generated_Memorystore_ListBackups_sync] diff --git a/google-cloud-memorystore-v1beta/snippets/memorystore/list_token_auth_users.rb b/google-cloud-memorystore-v1beta/snippets/memorystore/list_token_auth_users.rb new file mode 100644 index 000000000000..4d711ca1d3d6 --- /dev/null +++ b/google-cloud-memorystore-v1beta/snippets/memorystore/list_token_auth_users.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START memorystore_v1beta_generated_Memorystore_ListTokenAuthUsers_sync] +require "google/cloud/memorystore/v1beta" + +## +# Snippet for the list_token_auth_users call in the Memorystore service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Memorystore::V1beta::Memorystore::Client#list_token_auth_users. +# +def list_token_auth_users + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Memorystore::V1beta::Memorystore::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Memorystore::V1beta::ListTokenAuthUsersRequest.new + + # Call the list_token_auth_users method. + result = client.list_token_auth_users request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Memorystore::V1beta::TokenAuthUser. + p item + end +end +# [END memorystore_v1beta_generated_Memorystore_ListTokenAuthUsers_sync] diff --git a/google-cloud-memorystore-v1beta/snippets/memorystore/reschedule_maintenance.rb b/google-cloud-memorystore-v1beta/snippets/memorystore/reschedule_maintenance.rb new file mode 100644 index 000000000000..4ec2dee58d91 --- /dev/null +++ b/google-cloud-memorystore-v1beta/snippets/memorystore/reschedule_maintenance.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START memorystore_v1beta_generated_Memorystore_RescheduleMaintenance_sync] +require "google/cloud/memorystore/v1beta" + +## +# Snippet for the reschedule_maintenance call in the Memorystore service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Memorystore::V1beta::Memorystore::Client#reschedule_maintenance. +# +def reschedule_maintenance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Memorystore::V1beta::Memorystore::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Memorystore::V1beta::RescheduleMaintenanceRequest.new + + # Call the reschedule_maintenance method. + result = client.reschedule_maintenance request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END memorystore_v1beta_generated_Memorystore_RescheduleMaintenance_sync] diff --git a/google-cloud-memorystore-v1beta/snippets/memorystore/start_migration.rb b/google-cloud-memorystore-v1beta/snippets/memorystore/start_migration.rb new file mode 100644 index 000000000000..205bedaa45ed --- /dev/null +++ b/google-cloud-memorystore-v1beta/snippets/memorystore/start_migration.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START memorystore_v1beta_generated_Memorystore_StartMigration_sync] +require "google/cloud/memorystore/v1beta" + +## +# Snippet for the start_migration call in the Memorystore service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Memorystore::V1beta::Memorystore::Client#start_migration. +# +def start_migration + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Memorystore::V1beta::Memorystore::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Memorystore::V1beta::StartMigrationRequest.new + + # Call the start_migration method. + result = client.start_migration request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END memorystore_v1beta_generated_Memorystore_StartMigration_sync] diff --git a/google-cloud-memorystore-v1beta/snippets/snippet_metadata_google.cloud.memorystore.v1beta.json b/google-cloud-memorystore-v1beta/snippets/snippet_metadata_google.cloud.memorystore.v1beta.json index 514b885a6367..711300068435 100644 --- a/google-cloud-memorystore-v1beta/snippets/snippet_metadata_google.cloud.memorystore.v1beta.json +++ b/google-cloud-memorystore-v1beta/snippets/snippet_metadata_google.cloud.memorystore.v1beta.json @@ -290,6 +290,726 @@ "type": "FULL" } ] + }, + { + "region_tag": "memorystore_v1beta_generated_Memorystore_RescheduleMaintenance_sync", + "title": "Snippet for the reschedule_maintenance call in the Memorystore service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Memorystore::V1beta::Memorystore::Client#reschedule_maintenance.", + "file": "memorystore/reschedule_maintenance.rb", + "language": "RUBY", + "client_method": { + "short_name": "reschedule_maintenance", + "full_name": "::Google::Cloud::Memorystore::V1beta::Memorystore::Client#reschedule_maintenance", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Memorystore::V1beta::RescheduleMaintenanceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Memorystore::Client", + "full_name": "::Google::Cloud::Memorystore::V1beta::Memorystore::Client" + }, + "method": { + "short_name": "RescheduleMaintenance", + "full_name": "google.cloud.memorystore.v1beta.Memorystore.RescheduleMaintenance", + "service": { + "short_name": "Memorystore", + "full_name": "google.cloud.memorystore.v1beta.Memorystore" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "memorystore_v1beta_generated_Memorystore_ListBackupCollections_sync", + "title": "Snippet for the list_backup_collections call in the Memorystore service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Memorystore::V1beta::Memorystore::Client#list_backup_collections.", + "file": "memorystore/list_backup_collections.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_backup_collections", + "full_name": "::Google::Cloud::Memorystore::V1beta::Memorystore::Client#list_backup_collections", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Memorystore::V1beta::ListBackupCollectionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Memorystore::V1beta::ListBackupCollectionsResponse", + "client": { + "short_name": "Memorystore::Client", + "full_name": "::Google::Cloud::Memorystore::V1beta::Memorystore::Client" + }, + "method": { + "short_name": "ListBackupCollections", + "full_name": "google.cloud.memorystore.v1beta.Memorystore.ListBackupCollections", + "service": { + "short_name": "Memorystore", + "full_name": "google.cloud.memorystore.v1beta.Memorystore" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "memorystore_v1beta_generated_Memorystore_GetBackupCollection_sync", + "title": "Snippet for the get_backup_collection call in the Memorystore service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Memorystore::V1beta::Memorystore::Client#get_backup_collection.", + "file": "memorystore/get_backup_collection.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_backup_collection", + "full_name": "::Google::Cloud::Memorystore::V1beta::Memorystore::Client#get_backup_collection", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Memorystore::V1beta::GetBackupCollectionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Memorystore::V1beta::BackupCollection", + "client": { + "short_name": "Memorystore::Client", + "full_name": "::Google::Cloud::Memorystore::V1beta::Memorystore::Client" + }, + "method": { + "short_name": "GetBackupCollection", + "full_name": "google.cloud.memorystore.v1beta.Memorystore.GetBackupCollection", + "service": { + "short_name": "Memorystore", + "full_name": "google.cloud.memorystore.v1beta.Memorystore" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "memorystore_v1beta_generated_Memorystore_ListBackups_sync", + "title": "Snippet for the list_backups call in the Memorystore service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Memorystore::V1beta::Memorystore::Client#list_backups.", + "file": "memorystore/list_backups.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_backups", + "full_name": "::Google::Cloud::Memorystore::V1beta::Memorystore::Client#list_backups", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Memorystore::V1beta::ListBackupsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Memorystore::V1beta::ListBackupsResponse", + "client": { + "short_name": "Memorystore::Client", + "full_name": "::Google::Cloud::Memorystore::V1beta::Memorystore::Client" + }, + "method": { + "short_name": "ListBackups", + "full_name": "google.cloud.memorystore.v1beta.Memorystore.ListBackups", + "service": { + "short_name": "Memorystore", + "full_name": "google.cloud.memorystore.v1beta.Memorystore" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "memorystore_v1beta_generated_Memorystore_GetBackup_sync", + "title": "Snippet for the get_backup call in the Memorystore service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Memorystore::V1beta::Memorystore::Client#get_backup.", + "file": "memorystore/get_backup.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_backup", + "full_name": "::Google::Cloud::Memorystore::V1beta::Memorystore::Client#get_backup", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Memorystore::V1beta::GetBackupRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Memorystore::V1beta::Backup", + "client": { + "short_name": "Memorystore::Client", + "full_name": "::Google::Cloud::Memorystore::V1beta::Memorystore::Client" + }, + "method": { + "short_name": "GetBackup", + "full_name": "google.cloud.memorystore.v1beta.Memorystore.GetBackup", + "service": { + "short_name": "Memorystore", + "full_name": "google.cloud.memorystore.v1beta.Memorystore" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "memorystore_v1beta_generated_Memorystore_DeleteBackup_sync", + "title": "Snippet for the delete_backup call in the Memorystore service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Memorystore::V1beta::Memorystore::Client#delete_backup.", + "file": "memorystore/delete_backup.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_backup", + "full_name": "::Google::Cloud::Memorystore::V1beta::Memorystore::Client#delete_backup", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Memorystore::V1beta::DeleteBackupRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Memorystore::Client", + "full_name": "::Google::Cloud::Memorystore::V1beta::Memorystore::Client" + }, + "method": { + "short_name": "DeleteBackup", + "full_name": "google.cloud.memorystore.v1beta.Memorystore.DeleteBackup", + "service": { + "short_name": "Memorystore", + "full_name": "google.cloud.memorystore.v1beta.Memorystore" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "memorystore_v1beta_generated_Memorystore_ExportBackup_sync", + "title": "Snippet for the export_backup call in the Memorystore service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Memorystore::V1beta::Memorystore::Client#export_backup.", + "file": "memorystore/export_backup.rb", + "language": "RUBY", + "client_method": { + "short_name": "export_backup", + "full_name": "::Google::Cloud::Memorystore::V1beta::Memorystore::Client#export_backup", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Memorystore::V1beta::ExportBackupRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Memorystore::Client", + "full_name": "::Google::Cloud::Memorystore::V1beta::Memorystore::Client" + }, + "method": { + "short_name": "ExportBackup", + "full_name": "google.cloud.memorystore.v1beta.Memorystore.ExportBackup", + "service": { + "short_name": "Memorystore", + "full_name": "google.cloud.memorystore.v1beta.Memorystore" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "memorystore_v1beta_generated_Memorystore_BackupInstance_sync", + "title": "Snippet for the backup_instance call in the Memorystore service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Memorystore::V1beta::Memorystore::Client#backup_instance.", + "file": "memorystore/backup_instance.rb", + "language": "RUBY", + "client_method": { + "short_name": "backup_instance", + "full_name": "::Google::Cloud::Memorystore::V1beta::Memorystore::Client#backup_instance", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Memorystore::V1beta::BackupInstanceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Memorystore::Client", + "full_name": "::Google::Cloud::Memorystore::V1beta::Memorystore::Client" + }, + "method": { + "short_name": "BackupInstance", + "full_name": "google.cloud.memorystore.v1beta.Memorystore.BackupInstance", + "service": { + "short_name": "Memorystore", + "full_name": "google.cloud.memorystore.v1beta.Memorystore" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "memorystore_v1beta_generated_Memorystore_StartMigration_sync", + "title": "Snippet for the start_migration call in the Memorystore service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Memorystore::V1beta::Memorystore::Client#start_migration.", + "file": "memorystore/start_migration.rb", + "language": "RUBY", + "client_method": { + "short_name": "start_migration", + "full_name": "::Google::Cloud::Memorystore::V1beta::Memorystore::Client#start_migration", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Memorystore::V1beta::StartMigrationRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Memorystore::Client", + "full_name": "::Google::Cloud::Memorystore::V1beta::Memorystore::Client" + }, + "method": { + "short_name": "StartMigration", + "full_name": "google.cloud.memorystore.v1beta.Memorystore.StartMigration", + "service": { + "short_name": "Memorystore", + "full_name": "google.cloud.memorystore.v1beta.Memorystore" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "memorystore_v1beta_generated_Memorystore_FinishMigration_sync", + "title": "Snippet for the finish_migration call in the Memorystore service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Memorystore::V1beta::Memorystore::Client#finish_migration.", + "file": "memorystore/finish_migration.rb", + "language": "RUBY", + "client_method": { + "short_name": "finish_migration", + "full_name": "::Google::Cloud::Memorystore::V1beta::Memorystore::Client#finish_migration", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Memorystore::V1beta::FinishMigrationRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Memorystore::Client", + "full_name": "::Google::Cloud::Memorystore::V1beta::Memorystore::Client" + }, + "method": { + "short_name": "FinishMigration", + "full_name": "google.cloud.memorystore.v1beta.Memorystore.FinishMigration", + "service": { + "short_name": "Memorystore", + "full_name": "google.cloud.memorystore.v1beta.Memorystore" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "memorystore_v1beta_generated_Memorystore_ListTokenAuthUsers_sync", + "title": "Snippet for the list_token_auth_users call in the Memorystore service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Memorystore::V1beta::Memorystore::Client#list_token_auth_users.", + "file": "memorystore/list_token_auth_users.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_token_auth_users", + "full_name": "::Google::Cloud::Memorystore::V1beta::Memorystore::Client#list_token_auth_users", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Memorystore::V1beta::ListTokenAuthUsersRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Memorystore::V1beta::ListTokenAuthUsersResponse", + "client": { + "short_name": "Memorystore::Client", + "full_name": "::Google::Cloud::Memorystore::V1beta::Memorystore::Client" + }, + "method": { + "short_name": "ListTokenAuthUsers", + "full_name": "google.cloud.memorystore.v1beta.Memorystore.ListTokenAuthUsers", + "service": { + "short_name": "Memorystore", + "full_name": "google.cloud.memorystore.v1beta.Memorystore" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "memorystore_v1beta_generated_Memorystore_GetTokenAuthUser_sync", + "title": "Snippet for the get_token_auth_user call in the Memorystore service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Memorystore::V1beta::Memorystore::Client#get_token_auth_user.", + "file": "memorystore/get_token_auth_user.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_token_auth_user", + "full_name": "::Google::Cloud::Memorystore::V1beta::Memorystore::Client#get_token_auth_user", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Memorystore::V1beta::GetTokenAuthUserRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Memorystore::V1beta::TokenAuthUser", + "client": { + "short_name": "Memorystore::Client", + "full_name": "::Google::Cloud::Memorystore::V1beta::Memorystore::Client" + }, + "method": { + "short_name": "GetTokenAuthUser", + "full_name": "google.cloud.memorystore.v1beta.Memorystore.GetTokenAuthUser", + "service": { + "short_name": "Memorystore", + "full_name": "google.cloud.memorystore.v1beta.Memorystore" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "memorystore_v1beta_generated_Memorystore_ListAuthTokens_sync", + "title": "Snippet for the list_auth_tokens call in the Memorystore service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Memorystore::V1beta::Memorystore::Client#list_auth_tokens.", + "file": "memorystore/list_auth_tokens.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_auth_tokens", + "full_name": "::Google::Cloud::Memorystore::V1beta::Memorystore::Client#list_auth_tokens", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Memorystore::V1beta::ListAuthTokensRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Memorystore::V1beta::ListAuthTokensResponse", + "client": { + "short_name": "Memorystore::Client", + "full_name": "::Google::Cloud::Memorystore::V1beta::Memorystore::Client" + }, + "method": { + "short_name": "ListAuthTokens", + "full_name": "google.cloud.memorystore.v1beta.Memorystore.ListAuthTokens", + "service": { + "short_name": "Memorystore", + "full_name": "google.cloud.memorystore.v1beta.Memorystore" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "memorystore_v1beta_generated_Memorystore_GetAuthToken_sync", + "title": "Snippet for the get_auth_token call in the Memorystore service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Memorystore::V1beta::Memorystore::Client#get_auth_token.", + "file": "memorystore/get_auth_token.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_auth_token", + "full_name": "::Google::Cloud::Memorystore::V1beta::Memorystore::Client#get_auth_token", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Memorystore::V1beta::GetAuthTokenRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Memorystore::V1beta::AuthToken", + "client": { + "short_name": "Memorystore::Client", + "full_name": "::Google::Cloud::Memorystore::V1beta::Memorystore::Client" + }, + "method": { + "short_name": "GetAuthToken", + "full_name": "google.cloud.memorystore.v1beta.Memorystore.GetAuthToken", + "service": { + "short_name": "Memorystore", + "full_name": "google.cloud.memorystore.v1beta.Memorystore" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "memorystore_v1beta_generated_Memorystore_AddTokenAuthUser_sync", + "title": "Snippet for the add_token_auth_user call in the Memorystore service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Memorystore::V1beta::Memorystore::Client#add_token_auth_user.", + "file": "memorystore/add_token_auth_user.rb", + "language": "RUBY", + "client_method": { + "short_name": "add_token_auth_user", + "full_name": "::Google::Cloud::Memorystore::V1beta::Memorystore::Client#add_token_auth_user", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Memorystore::V1beta::AddTokenAuthUserRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Memorystore::Client", + "full_name": "::Google::Cloud::Memorystore::V1beta::Memorystore::Client" + }, + "method": { + "short_name": "AddTokenAuthUser", + "full_name": "google.cloud.memorystore.v1beta.Memorystore.AddTokenAuthUser", + "service": { + "short_name": "Memorystore", + "full_name": "google.cloud.memorystore.v1beta.Memorystore" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "memorystore_v1beta_generated_Memorystore_DeleteTokenAuthUser_sync", + "title": "Snippet for the delete_token_auth_user call in the Memorystore service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Memorystore::V1beta::Memorystore::Client#delete_token_auth_user.", + "file": "memorystore/delete_token_auth_user.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_token_auth_user", + "full_name": "::Google::Cloud::Memorystore::V1beta::Memorystore::Client#delete_token_auth_user", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Memorystore::V1beta::DeleteTokenAuthUserRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Memorystore::Client", + "full_name": "::Google::Cloud::Memorystore::V1beta::Memorystore::Client" + }, + "method": { + "short_name": "DeleteTokenAuthUser", + "full_name": "google.cloud.memorystore.v1beta.Memorystore.DeleteTokenAuthUser", + "service": { + "short_name": "Memorystore", + "full_name": "google.cloud.memorystore.v1beta.Memorystore" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "memorystore_v1beta_generated_Memorystore_AddAuthToken_sync", + "title": "Snippet for the add_auth_token call in the Memorystore service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Memorystore::V1beta::Memorystore::Client#add_auth_token.", + "file": "memorystore/add_auth_token.rb", + "language": "RUBY", + "client_method": { + "short_name": "add_auth_token", + "full_name": "::Google::Cloud::Memorystore::V1beta::Memorystore::Client#add_auth_token", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Memorystore::V1beta::AddAuthTokenRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Memorystore::Client", + "full_name": "::Google::Cloud::Memorystore::V1beta::Memorystore::Client" + }, + "method": { + "short_name": "AddAuthToken", + "full_name": "google.cloud.memorystore.v1beta.Memorystore.AddAuthToken", + "service": { + "short_name": "Memorystore", + "full_name": "google.cloud.memorystore.v1beta.Memorystore" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "memorystore_v1beta_generated_Memorystore_DeleteAuthToken_sync", + "title": "Snippet for the delete_auth_token call in the Memorystore service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Memorystore::V1beta::Memorystore::Client#delete_auth_token.", + "file": "memorystore/delete_auth_token.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_auth_token", + "full_name": "::Google::Cloud::Memorystore::V1beta::Memorystore::Client#delete_auth_token", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Memorystore::V1beta::DeleteAuthTokenRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Memorystore::Client", + "full_name": "::Google::Cloud::Memorystore::V1beta::Memorystore::Client" + }, + "method": { + "short_name": "DeleteAuthToken", + "full_name": "google.cloud.memorystore.v1beta.Memorystore.DeleteAuthToken", + "service": { + "short_name": "Memorystore", + "full_name": "google.cloud.memorystore.v1beta.Memorystore" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] } ] } \ No newline at end of file diff --git a/google-cloud-memorystore-v1beta/test/google/cloud/memorystore/v1beta/memorystore_paths_test.rb b/google-cloud-memorystore-v1beta/test/google/cloud/memorystore/v1beta/memorystore_paths_test.rb index 037d9a65d0d2..b30f3455dbc0 100644 --- a/google-cloud-memorystore-v1beta/test/google/cloud/memorystore/v1beta/memorystore_paths_test.rb +++ b/google-cloud-memorystore-v1beta/test/google/cloud/memorystore/v1beta/memorystore_paths_test.rb @@ -41,6 +41,42 @@ def logger end end + def test_auth_token_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Memorystore::V1beta::Memorystore::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.auth_token_path project: "value0", location: "value1", instance: "value2", token_auth_user: "value3", auth_token: "value4" + assert_equal "projects/value0/locations/value1/instances/value2/tokenAuthUsers/value3/authTokens/value4", path + end + end + + def test_backup_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Memorystore::V1beta::Memorystore::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.backup_path project: "value0", location: "value1", backup_collection: "value2", backup: "value3" + assert_equal "projects/value0/locations/value1/backupCollections/value2/backups/value3", path + end + end + + def test_backup_collection_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Memorystore::V1beta::Memorystore::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.backup_collection_path project: "value0", location: "value1", backup_collection: "value2" + assert_equal "projects/value0/locations/value1/backupCollections/value2", path + end + end + def test_ca_pool_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure ::Gapic::ServiceStub.stub :new, DummyStub.new do @@ -53,6 +89,30 @@ def test_ca_pool_path end end + def test_crypto_key_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Memorystore::V1beta::Memorystore::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.crypto_key_path project: "value0", location: "value1", key_ring: "value2", crypto_key: "value3" + assert_equal "projects/value0/locations/value1/keyRings/value2/cryptoKeys/value3", path + end + end + + def test_crypto_key_version_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Memorystore::V1beta::Memorystore::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.crypto_key_version_path project: "value0", location: "value1", key_ring: "value2", crypto_key: "value3", crypto_key_version: "value4" + assert_equal "projects/value0/locations/value1/keyRings/value2/cryptoKeys/value3/cryptoKeyVersions/value4", path + end + end + def test_forwarding_rule_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure ::Gapic::ServiceStub.stub :new, DummyStub.new do @@ -101,6 +161,18 @@ def test_network_path end end + def test_network_attachment_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Memorystore::V1beta::Memorystore::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.network_attachment_path project: "value0", region: "value1", network_attachment: "value2" + assert_equal "projects/value0/regions/value1/networkAttachments/value2", path + end + end + def test_service_attachment_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure ::Gapic::ServiceStub.stub :new, DummyStub.new do @@ -124,4 +196,16 @@ def test_shared_regional_certificate_authority_path assert_equal "projects/value0/locations/value1/sharedRegionalCertificateAuthority", path end end + + def test_token_auth_user_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Memorystore::V1beta::Memorystore::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.token_auth_user_path project: "value0", location: "value1", instance: "value2", token_auth_user: "value3" + assert_equal "projects/value0/locations/value1/instances/value2/tokenAuthUsers/value3", path + end + end end diff --git a/google-cloud-memorystore-v1beta/test/google/cloud/memorystore/v1beta/memorystore_rest_test.rb b/google-cloud-memorystore-v1beta/test/google/cloud/memorystore/v1beta/memorystore_rest_test.rb index dc37d124a476..e2d8a0c8f9dc 100644 --- a/google-cloud-memorystore-v1beta/test/google/cloud/memorystore/v1beta/memorystore_rest_test.rb +++ b/google-cloud-memorystore-v1beta/test/google/cloud/memorystore/v1beta/memorystore_rest_test.rb @@ -466,6 +466,1002 @@ def test_get_shared_regional_certificate_authority end end + def test_reschedule_maintenance + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + reschedule_type = :RESCHEDULE_TYPE_UNSPECIFIED + schedule_time = {} + + reschedule_maintenance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Memorystore::V1beta::Memorystore::Rest::ServiceStub.stub :transcode_reschedule_maintenance_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, reschedule_maintenance_client_stub do + # Create client + c = ::Google::Cloud::Memorystore::V1beta::Memorystore::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.reschedule_maintenance({ name: name, reschedule_type: reschedule_type, schedule_time: schedule_time }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.reschedule_maintenance name: name, reschedule_type: reschedule_type, schedule_time: schedule_time do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.reschedule_maintenance ::Google::Cloud::Memorystore::V1beta::RescheduleMaintenanceRequest.new(name: name, reschedule_type: reschedule_type, schedule_time: schedule_time) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.reschedule_maintenance({ name: name, reschedule_type: reschedule_type, schedule_time: schedule_time }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.reschedule_maintenance(::Google::Cloud::Memorystore::V1beta::RescheduleMaintenanceRequest.new(name: name, reschedule_type: reschedule_type, schedule_time: schedule_time), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, reschedule_maintenance_client_stub.call_count + end + end + end + + def test_list_backup_collections + # Create test objects. + client_result = ::Google::Cloud::Memorystore::V1beta::ListBackupCollectionsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_backup_collections_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Memorystore::V1beta::Memorystore::Rest::ServiceStub.stub :transcode_list_backup_collections_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_backup_collections_client_stub do + # Create client + c = ::Google::Cloud::Memorystore::V1beta::Memorystore::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.list_backup_collections({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.list_backup_collections parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.list_backup_collections ::Google::Cloud::Memorystore::V1beta::ListBackupCollectionsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.list_backup_collections({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.list_backup_collections(::Google::Cloud::Memorystore::V1beta::ListBackupCollectionsRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_backup_collections_client_stub.call_count + end + end + end + + def test_get_backup_collection + # Create test objects. + client_result = ::Google::Cloud::Memorystore::V1beta::BackupCollection.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_backup_collection_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Memorystore::V1beta::Memorystore::Rest::ServiceStub.stub :transcode_get_backup_collection_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_backup_collection_client_stub do + # Create client + c = ::Google::Cloud::Memorystore::V1beta::Memorystore::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.get_backup_collection({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.get_backup_collection name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.get_backup_collection ::Google::Cloud::Memorystore::V1beta::GetBackupCollectionRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.get_backup_collection({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.get_backup_collection(::Google::Cloud::Memorystore::V1beta::GetBackupCollectionRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_backup_collection_client_stub.call_count + end + end + end + + def test_list_backups + # Create test objects. + client_result = ::Google::Cloud::Memorystore::V1beta::ListBackupsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_backups_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Memorystore::V1beta::Memorystore::Rest::ServiceStub.stub :transcode_list_backups_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_backups_client_stub do + # Create client + c = ::Google::Cloud::Memorystore::V1beta::Memorystore::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.list_backups({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.list_backups parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.list_backups ::Google::Cloud::Memorystore::V1beta::ListBackupsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.list_backups({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.list_backups(::Google::Cloud::Memorystore::V1beta::ListBackupsRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_backups_client_stub.call_count + end + end + end + + def test_get_backup + # Create test objects. + client_result = ::Google::Cloud::Memorystore::V1beta::Backup.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_backup_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Memorystore::V1beta::Memorystore::Rest::ServiceStub.stub :transcode_get_backup_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_backup_client_stub do + # Create client + c = ::Google::Cloud::Memorystore::V1beta::Memorystore::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.get_backup({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.get_backup name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.get_backup ::Google::Cloud::Memorystore::V1beta::GetBackupRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.get_backup({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.get_backup(::Google::Cloud::Memorystore::V1beta::GetBackupRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_backup_client_stub.call_count + end + end + end + + def test_delete_backup + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + request_id = "hello world" + + delete_backup_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Memorystore::V1beta::Memorystore::Rest::ServiceStub.stub :transcode_delete_backup_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_backup_client_stub do + # Create client + c = ::Google::Cloud::Memorystore::V1beta::Memorystore::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.delete_backup({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.delete_backup name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.delete_backup ::Google::Cloud::Memorystore::V1beta::DeleteBackupRequest.new(name: name, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.delete_backup({ name: name, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.delete_backup(::Google::Cloud::Memorystore::V1beta::DeleteBackupRequest.new(name: name, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_backup_client_stub.call_count + end + end + end + + def test_export_backup + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + gcs_bucket = "hello world" + name = "hello world" + + export_backup_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Memorystore::V1beta::Memorystore::Rest::ServiceStub.stub :transcode_export_backup_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, export_backup_client_stub do + # Create client + c = ::Google::Cloud::Memorystore::V1beta::Memorystore::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.export_backup({ gcs_bucket: gcs_bucket, name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.export_backup gcs_bucket: gcs_bucket, name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.export_backup ::Google::Cloud::Memorystore::V1beta::ExportBackupRequest.new(gcs_bucket: gcs_bucket, name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.export_backup({ gcs_bucket: gcs_bucket, name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.export_backup(::Google::Cloud::Memorystore::V1beta::ExportBackupRequest.new(gcs_bucket: gcs_bucket, name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, export_backup_client_stub.call_count + end + end + end + + def test_backup_instance + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + ttl = {} + backup_id = "hello world" + + backup_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Memorystore::V1beta::Memorystore::Rest::ServiceStub.stub :transcode_backup_instance_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, backup_instance_client_stub do + # Create client + c = ::Google::Cloud::Memorystore::V1beta::Memorystore::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.backup_instance({ name: name, ttl: ttl, backup_id: backup_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.backup_instance name: name, ttl: ttl, backup_id: backup_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.backup_instance ::Google::Cloud::Memorystore::V1beta::BackupInstanceRequest.new(name: name, ttl: ttl, backup_id: backup_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.backup_instance({ name: name, ttl: ttl, backup_id: backup_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.backup_instance(::Google::Cloud::Memorystore::V1beta::BackupInstanceRequest.new(name: name, ttl: ttl, backup_id: backup_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, backup_instance_client_stub.call_count + end + end + end + + def test_start_migration + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + self_managed_source = {} + name = "hello world" + + start_migration_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Memorystore::V1beta::Memorystore::Rest::ServiceStub.stub :transcode_start_migration_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, start_migration_client_stub do + # Create client + c = ::Google::Cloud::Memorystore::V1beta::Memorystore::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.start_migration({ self_managed_source: self_managed_source, name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.start_migration self_managed_source: self_managed_source, name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.start_migration ::Google::Cloud::Memorystore::V1beta::StartMigrationRequest.new(self_managed_source: self_managed_source, name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.start_migration({ self_managed_source: self_managed_source, name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.start_migration(::Google::Cloud::Memorystore::V1beta::StartMigrationRequest.new(self_managed_source: self_managed_source, name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, start_migration_client_stub.call_count + end + end + end + + def test_finish_migration + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + force = true + + finish_migration_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Memorystore::V1beta::Memorystore::Rest::ServiceStub.stub :transcode_finish_migration_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, finish_migration_client_stub do + # Create client + c = ::Google::Cloud::Memorystore::V1beta::Memorystore::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.finish_migration({ name: name, force: force }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.finish_migration name: name, force: force do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.finish_migration ::Google::Cloud::Memorystore::V1beta::FinishMigrationRequest.new(name: name, force: force) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.finish_migration({ name: name, force: force }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.finish_migration(::Google::Cloud::Memorystore::V1beta::FinishMigrationRequest.new(name: name, force: force), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, finish_migration_client_stub.call_count + end + end + end + + def test_list_token_auth_users + # Create test objects. + client_result = ::Google::Cloud::Memorystore::V1beta::ListTokenAuthUsersResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + list_token_auth_users_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Memorystore::V1beta::Memorystore::Rest::ServiceStub.stub :transcode_list_token_auth_users_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_token_auth_users_client_stub do + # Create client + c = ::Google::Cloud::Memorystore::V1beta::Memorystore::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.list_token_auth_users({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.list_token_auth_users parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.list_token_auth_users ::Google::Cloud::Memorystore::V1beta::ListTokenAuthUsersRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.list_token_auth_users({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.list_token_auth_users(::Google::Cloud::Memorystore::V1beta::ListTokenAuthUsersRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_token_auth_users_client_stub.call_count + end + end + end + + def test_get_token_auth_user + # Create test objects. + client_result = ::Google::Cloud::Memorystore::V1beta::TokenAuthUser.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_token_auth_user_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Memorystore::V1beta::Memorystore::Rest::ServiceStub.stub :transcode_get_token_auth_user_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_token_auth_user_client_stub do + # Create client + c = ::Google::Cloud::Memorystore::V1beta::Memorystore::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.get_token_auth_user({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.get_token_auth_user name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.get_token_auth_user ::Google::Cloud::Memorystore::V1beta::GetTokenAuthUserRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.get_token_auth_user({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.get_token_auth_user(::Google::Cloud::Memorystore::V1beta::GetTokenAuthUserRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_token_auth_user_client_stub.call_count + end + end + end + + def test_list_auth_tokens + # Create test objects. + client_result = ::Google::Cloud::Memorystore::V1beta::ListAuthTokensResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + list_auth_tokens_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Memorystore::V1beta::Memorystore::Rest::ServiceStub.stub :transcode_list_auth_tokens_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_auth_tokens_client_stub do + # Create client + c = ::Google::Cloud::Memorystore::V1beta::Memorystore::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.list_auth_tokens({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.list_auth_tokens parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.list_auth_tokens ::Google::Cloud::Memorystore::V1beta::ListAuthTokensRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.list_auth_tokens({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.list_auth_tokens(::Google::Cloud::Memorystore::V1beta::ListAuthTokensRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_auth_tokens_client_stub.call_count + end + end + end + + def test_get_auth_token + # Create test objects. + client_result = ::Google::Cloud::Memorystore::V1beta::AuthToken.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_auth_token_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Memorystore::V1beta::Memorystore::Rest::ServiceStub.stub :transcode_get_auth_token_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_auth_token_client_stub do + # Create client + c = ::Google::Cloud::Memorystore::V1beta::Memorystore::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.get_auth_token({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.get_auth_token name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.get_auth_token ::Google::Cloud::Memorystore::V1beta::GetAuthTokenRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.get_auth_token({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.get_auth_token(::Google::Cloud::Memorystore::V1beta::GetAuthTokenRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_auth_token_client_stub.call_count + end + end + end + + def test_add_token_auth_user + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + instance = "hello world" + token_auth_user = "hello world" + + add_token_auth_user_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Memorystore::V1beta::Memorystore::Rest::ServiceStub.stub :transcode_add_token_auth_user_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, add_token_auth_user_client_stub do + # Create client + c = ::Google::Cloud::Memorystore::V1beta::Memorystore::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.add_token_auth_user({ instance: instance, token_auth_user: token_auth_user }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.add_token_auth_user instance: instance, token_auth_user: token_auth_user do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.add_token_auth_user ::Google::Cloud::Memorystore::V1beta::AddTokenAuthUserRequest.new(instance: instance, token_auth_user: token_auth_user) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.add_token_auth_user({ instance: instance, token_auth_user: token_auth_user }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.add_token_auth_user(::Google::Cloud::Memorystore::V1beta::AddTokenAuthUserRequest.new(instance: instance, token_auth_user: token_auth_user), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, add_token_auth_user_client_stub.call_count + end + end + end + + def test_delete_token_auth_user + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + request_id = "hello world" + force = true + + delete_token_auth_user_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Memorystore::V1beta::Memorystore::Rest::ServiceStub.stub :transcode_delete_token_auth_user_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_token_auth_user_client_stub do + # Create client + c = ::Google::Cloud::Memorystore::V1beta::Memorystore::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.delete_token_auth_user({ name: name, request_id: request_id, force: force }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.delete_token_auth_user name: name, request_id: request_id, force: force do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.delete_token_auth_user ::Google::Cloud::Memorystore::V1beta::DeleteTokenAuthUserRequest.new(name: name, request_id: request_id, force: force) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.delete_token_auth_user({ name: name, request_id: request_id, force: force }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.delete_token_auth_user(::Google::Cloud::Memorystore::V1beta::DeleteTokenAuthUserRequest.new(name: name, request_id: request_id, force: force), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_token_auth_user_client_stub.call_count + end + end + end + + def test_add_auth_token + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + token_auth_user = "hello world" + auth_token = {} + + add_auth_token_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Memorystore::V1beta::Memorystore::Rest::ServiceStub.stub :transcode_add_auth_token_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, add_auth_token_client_stub do + # Create client + c = ::Google::Cloud::Memorystore::V1beta::Memorystore::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.add_auth_token({ token_auth_user: token_auth_user, auth_token: auth_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.add_auth_token token_auth_user: token_auth_user, auth_token: auth_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.add_auth_token ::Google::Cloud::Memorystore::V1beta::AddAuthTokenRequest.new(token_auth_user: token_auth_user, auth_token: auth_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.add_auth_token({ token_auth_user: token_auth_user, auth_token: auth_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.add_auth_token(::Google::Cloud::Memorystore::V1beta::AddAuthTokenRequest.new(token_auth_user: token_auth_user, auth_token: auth_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, add_auth_token_client_stub.call_count + end + end + end + + def test_delete_auth_token + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_auth_token_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Memorystore::V1beta::Memorystore::Rest::ServiceStub.stub :transcode_delete_auth_token_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_auth_token_client_stub do + # Create client + c = ::Google::Cloud::Memorystore::V1beta::Memorystore::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.delete_auth_token({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.delete_auth_token name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.delete_auth_token ::Google::Cloud::Memorystore::V1beta::DeleteAuthTokenRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.delete_auth_token({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.delete_auth_token(::Google::Cloud::Memorystore::V1beta::DeleteAuthTokenRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_auth_token_client_stub.call_count + end + end + end + def test_configure credentials_token = :dummy_value diff --git a/google-cloud-memorystore-v1beta/test/google/cloud/memorystore/v1beta/memorystore_test.rb b/google-cloud-memorystore-v1beta/test/google/cloud/memorystore/v1beta/memorystore_test.rb index 1b0334b5c417..986721558275 100644 --- a/google-cloud-memorystore-v1beta/test/google/cloud/memorystore/v1beta/memorystore_test.rb +++ b/google-cloud-memorystore-v1beta/test/google/cloud/memorystore/v1beta/memorystore_test.rb @@ -509,6 +509,1171 @@ def test_get_shared_regional_certificate_authority end end + def test_reschedule_maintenance + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + reschedule_type = :RESCHEDULE_TYPE_UNSPECIFIED + schedule_time = {} + + reschedule_maintenance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :reschedule_maintenance, name + assert_kind_of ::Google::Cloud::Memorystore::V1beta::RescheduleMaintenanceRequest, request + assert_equal "hello world", request["name"] + assert_equal :RESCHEDULE_TYPE_UNSPECIFIED, request["reschedule_type"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["schedule_time"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, reschedule_maintenance_client_stub do + # Create client + c = ::Google::Cloud::Memorystore::V1beta::Memorystore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.reschedule_maintenance({ name: name, reschedule_type: reschedule_type, schedule_time: schedule_time }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + c.reschedule_maintenance name: name, reschedule_type: reschedule_type, schedule_time: schedule_time do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.reschedule_maintenance ::Google::Cloud::Memorystore::V1beta::RescheduleMaintenanceRequest.new(name: name, reschedule_type: reschedule_type, schedule_time: schedule_time) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.reschedule_maintenance({ name: name, reschedule_type: reschedule_type, schedule_time: schedule_time }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.reschedule_maintenance(::Google::Cloud::Memorystore::V1beta::RescheduleMaintenanceRequest.new(name: name, reschedule_type: reschedule_type, schedule_time: schedule_time), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, reschedule_maintenance_client_stub.call_rpc_count + end + end + + def test_list_backup_collections + # Create GRPC objects. + grpc_response = ::Google::Cloud::Memorystore::V1beta::ListBackupCollectionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_backup_collections_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_backup_collections, name + assert_kind_of ::Google::Cloud::Memorystore::V1beta::ListBackupCollectionsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_backup_collections_client_stub do + # Create client + c = ::Google::Cloud::Memorystore::V1beta::Memorystore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.list_backup_collections({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.list_backup_collections parent: parent, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.list_backup_collections ::Google::Cloud::Memorystore::V1beta::ListBackupCollectionsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.list_backup_collections({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.list_backup_collections(::Google::Cloud::Memorystore::V1beta::ListBackupCollectionsRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_backup_collections_client_stub.call_rpc_count + end + end + + def test_get_backup_collection + # Create GRPC objects. + grpc_response = ::Google::Cloud::Memorystore::V1beta::BackupCollection.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_backup_collection_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_backup_collection, name + assert_kind_of ::Google::Cloud::Memorystore::V1beta::GetBackupCollectionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_backup_collection_client_stub do + # Create client + c = ::Google::Cloud::Memorystore::V1beta::Memorystore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.get_backup_collection({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.get_backup_collection name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.get_backup_collection ::Google::Cloud::Memorystore::V1beta::GetBackupCollectionRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.get_backup_collection({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.get_backup_collection(::Google::Cloud::Memorystore::V1beta::GetBackupCollectionRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_backup_collection_client_stub.call_rpc_count + end + end + + def test_list_backups + # Create GRPC objects. + grpc_response = ::Google::Cloud::Memorystore::V1beta::ListBackupsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_backups_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_backups, name + assert_kind_of ::Google::Cloud::Memorystore::V1beta::ListBackupsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_backups_client_stub do + # Create client + c = ::Google::Cloud::Memorystore::V1beta::Memorystore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.list_backups({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.list_backups parent: parent, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.list_backups ::Google::Cloud::Memorystore::V1beta::ListBackupsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.list_backups({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.list_backups(::Google::Cloud::Memorystore::V1beta::ListBackupsRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_backups_client_stub.call_rpc_count + end + end + + def test_get_backup + # Create GRPC objects. + grpc_response = ::Google::Cloud::Memorystore::V1beta::Backup.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_backup_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_backup, name + assert_kind_of ::Google::Cloud::Memorystore::V1beta::GetBackupRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_backup_client_stub do + # Create client + c = ::Google::Cloud::Memorystore::V1beta::Memorystore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.get_backup({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.get_backup name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.get_backup ::Google::Cloud::Memorystore::V1beta::GetBackupRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.get_backup({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.get_backup(::Google::Cloud::Memorystore::V1beta::GetBackupRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_backup_client_stub.call_rpc_count + end + end + + def test_delete_backup + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + request_id = "hello world" + + delete_backup_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_backup, name + assert_kind_of ::Google::Cloud::Memorystore::V1beta::DeleteBackupRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_backup_client_stub do + # Create client + c = ::Google::Cloud::Memorystore::V1beta::Memorystore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.delete_backup({ name: name, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + c.delete_backup name: name, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.delete_backup ::Google::Cloud::Memorystore::V1beta::DeleteBackupRequest.new(name: name, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.delete_backup({ name: name, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.delete_backup(::Google::Cloud::Memorystore::V1beta::DeleteBackupRequest.new(name: name, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_backup_client_stub.call_rpc_count + end + end + + def test_export_backup + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + gcs_bucket = "hello world" + name = "hello world" + + export_backup_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :export_backup, name + assert_kind_of ::Google::Cloud::Memorystore::V1beta::ExportBackupRequest, request + assert_equal "hello world", request["gcs_bucket"] + assert_equal :gcs_bucket, request.destination + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, export_backup_client_stub do + # Create client + c = ::Google::Cloud::Memorystore::V1beta::Memorystore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.export_backup({ gcs_bucket: gcs_bucket, name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + c.export_backup gcs_bucket: gcs_bucket, name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.export_backup ::Google::Cloud::Memorystore::V1beta::ExportBackupRequest.new(gcs_bucket: gcs_bucket, name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.export_backup({ gcs_bucket: gcs_bucket, name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.export_backup(::Google::Cloud::Memorystore::V1beta::ExportBackupRequest.new(gcs_bucket: gcs_bucket, name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, export_backup_client_stub.call_rpc_count + end + end + + def test_backup_instance + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + ttl = {} + backup_id = "hello world" + + backup_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :backup_instance, name + assert_kind_of ::Google::Cloud::Memorystore::V1beta::BackupInstanceRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["ttl"] + assert_equal "hello world", request["backup_id"] + assert request.has_backup_id? + refute_nil options + end + + Gapic::ServiceStub.stub :new, backup_instance_client_stub do + # Create client + c = ::Google::Cloud::Memorystore::V1beta::Memorystore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.backup_instance({ name: name, ttl: ttl, backup_id: backup_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + c.backup_instance name: name, ttl: ttl, backup_id: backup_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.backup_instance ::Google::Cloud::Memorystore::V1beta::BackupInstanceRequest.new(name: name, ttl: ttl, backup_id: backup_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.backup_instance({ name: name, ttl: ttl, backup_id: backup_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.backup_instance(::Google::Cloud::Memorystore::V1beta::BackupInstanceRequest.new(name: name, ttl: ttl, backup_id: backup_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, backup_instance_client_stub.call_rpc_count + end + end + + def test_start_migration + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + self_managed_source = {} + name = "hello world" + + start_migration_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :start_migration, name + assert_kind_of ::Google::Cloud::Memorystore::V1beta::StartMigrationRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Memorystore::V1beta::SelfManagedSource), request["self_managed_source"] + assert_equal :self_managed_source, request.source + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, start_migration_client_stub do + # Create client + c = ::Google::Cloud::Memorystore::V1beta::Memorystore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.start_migration({ self_managed_source: self_managed_source, name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + c.start_migration self_managed_source: self_managed_source, name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.start_migration ::Google::Cloud::Memorystore::V1beta::StartMigrationRequest.new(self_managed_source: self_managed_source, name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.start_migration({ self_managed_source: self_managed_source, name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.start_migration(::Google::Cloud::Memorystore::V1beta::StartMigrationRequest.new(self_managed_source: self_managed_source, name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, start_migration_client_stub.call_rpc_count + end + end + + def test_finish_migration + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + force = true + + finish_migration_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :finish_migration, name + assert_kind_of ::Google::Cloud::Memorystore::V1beta::FinishMigrationRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["force"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, finish_migration_client_stub do + # Create client + c = ::Google::Cloud::Memorystore::V1beta::Memorystore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.finish_migration({ name: name, force: force }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + c.finish_migration name: name, force: force do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.finish_migration ::Google::Cloud::Memorystore::V1beta::FinishMigrationRequest.new(name: name, force: force) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.finish_migration({ name: name, force: force }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.finish_migration(::Google::Cloud::Memorystore::V1beta::FinishMigrationRequest.new(name: name, force: force), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, finish_migration_client_stub.call_rpc_count + end + end + + def test_list_token_auth_users + # Create GRPC objects. + grpc_response = ::Google::Cloud::Memorystore::V1beta::ListTokenAuthUsersResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + list_token_auth_users_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_token_auth_users, name + assert_kind_of ::Google::Cloud::Memorystore::V1beta::ListTokenAuthUsersRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["order_by"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_token_auth_users_client_stub do + # Create client + c = ::Google::Cloud::Memorystore::V1beta::Memorystore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.list_token_auth_users({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.list_token_auth_users parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.list_token_auth_users ::Google::Cloud::Memorystore::V1beta::ListTokenAuthUsersRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.list_token_auth_users({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.list_token_auth_users(::Google::Cloud::Memorystore::V1beta::ListTokenAuthUsersRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_token_auth_users_client_stub.call_rpc_count + end + end + + def test_get_token_auth_user + # Create GRPC objects. + grpc_response = ::Google::Cloud::Memorystore::V1beta::TokenAuthUser.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_token_auth_user_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_token_auth_user, name + assert_kind_of ::Google::Cloud::Memorystore::V1beta::GetTokenAuthUserRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_token_auth_user_client_stub do + # Create client + c = ::Google::Cloud::Memorystore::V1beta::Memorystore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.get_token_auth_user({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.get_token_auth_user name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.get_token_auth_user ::Google::Cloud::Memorystore::V1beta::GetTokenAuthUserRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.get_token_auth_user({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.get_token_auth_user(::Google::Cloud::Memorystore::V1beta::GetTokenAuthUserRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_token_auth_user_client_stub.call_rpc_count + end + end + + def test_list_auth_tokens + # Create GRPC objects. + grpc_response = ::Google::Cloud::Memorystore::V1beta::ListAuthTokensResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + list_auth_tokens_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_auth_tokens, name + assert_kind_of ::Google::Cloud::Memorystore::V1beta::ListAuthTokensRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["order_by"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_auth_tokens_client_stub do + # Create client + c = ::Google::Cloud::Memorystore::V1beta::Memorystore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.list_auth_tokens({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.list_auth_tokens parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.list_auth_tokens ::Google::Cloud::Memorystore::V1beta::ListAuthTokensRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.list_auth_tokens({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.list_auth_tokens(::Google::Cloud::Memorystore::V1beta::ListAuthTokensRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_auth_tokens_client_stub.call_rpc_count + end + end + + def test_get_auth_token + # Create GRPC objects. + grpc_response = ::Google::Cloud::Memorystore::V1beta::AuthToken.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_auth_token_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_auth_token, name + assert_kind_of ::Google::Cloud::Memorystore::V1beta::GetAuthTokenRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_auth_token_client_stub do + # Create client + c = ::Google::Cloud::Memorystore::V1beta::Memorystore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.get_auth_token({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.get_auth_token name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.get_auth_token ::Google::Cloud::Memorystore::V1beta::GetAuthTokenRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.get_auth_token({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.get_auth_token(::Google::Cloud::Memorystore::V1beta::GetAuthTokenRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_auth_token_client_stub.call_rpc_count + end + end + + def test_add_token_auth_user + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + instance = "hello world" + token_auth_user = "hello world" + + add_token_auth_user_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :add_token_auth_user, name + assert_kind_of ::Google::Cloud::Memorystore::V1beta::AddTokenAuthUserRequest, request + assert_equal "hello world", request["instance"] + assert_equal "hello world", request["token_auth_user"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, add_token_auth_user_client_stub do + # Create client + c = ::Google::Cloud::Memorystore::V1beta::Memorystore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.add_token_auth_user({ instance: instance, token_auth_user: token_auth_user }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + c.add_token_auth_user instance: instance, token_auth_user: token_auth_user do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.add_token_auth_user ::Google::Cloud::Memorystore::V1beta::AddTokenAuthUserRequest.new(instance: instance, token_auth_user: token_auth_user) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.add_token_auth_user({ instance: instance, token_auth_user: token_auth_user }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.add_token_auth_user(::Google::Cloud::Memorystore::V1beta::AddTokenAuthUserRequest.new(instance: instance, token_auth_user: token_auth_user), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, add_token_auth_user_client_stub.call_rpc_count + end + end + + def test_delete_token_auth_user + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + request_id = "hello world" + force = true + + delete_token_auth_user_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_token_auth_user, name + assert_kind_of ::Google::Cloud::Memorystore::V1beta::DeleteTokenAuthUserRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + assert_equal true, request["force"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_token_auth_user_client_stub do + # Create client + c = ::Google::Cloud::Memorystore::V1beta::Memorystore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.delete_token_auth_user({ name: name, request_id: request_id, force: force }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + c.delete_token_auth_user name: name, request_id: request_id, force: force do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.delete_token_auth_user ::Google::Cloud::Memorystore::V1beta::DeleteTokenAuthUserRequest.new(name: name, request_id: request_id, force: force) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.delete_token_auth_user({ name: name, request_id: request_id, force: force }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.delete_token_auth_user(::Google::Cloud::Memorystore::V1beta::DeleteTokenAuthUserRequest.new(name: name, request_id: request_id, force: force), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_token_auth_user_client_stub.call_rpc_count + end + end + + def test_add_auth_token + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + token_auth_user = "hello world" + auth_token = {} + + add_auth_token_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :add_auth_token, name + assert_kind_of ::Google::Cloud::Memorystore::V1beta::AddAuthTokenRequest, request + assert_equal "hello world", request["token_auth_user"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Memorystore::V1beta::AuthToken), request["auth_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, add_auth_token_client_stub do + # Create client + c = ::Google::Cloud::Memorystore::V1beta::Memorystore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.add_auth_token({ token_auth_user: token_auth_user, auth_token: auth_token }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + c.add_auth_token token_auth_user: token_auth_user, auth_token: auth_token do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.add_auth_token ::Google::Cloud::Memorystore::V1beta::AddAuthTokenRequest.new(token_auth_user: token_auth_user, auth_token: auth_token) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.add_auth_token({ token_auth_user: token_auth_user, auth_token: auth_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.add_auth_token(::Google::Cloud::Memorystore::V1beta::AddAuthTokenRequest.new(token_auth_user: token_auth_user, auth_token: auth_token), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, add_auth_token_client_stub.call_rpc_count + end + end + + def test_delete_auth_token + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_auth_token_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_auth_token, name + assert_kind_of ::Google::Cloud::Memorystore::V1beta::DeleteAuthTokenRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_auth_token_client_stub do + # Create client + c = ::Google::Cloud::Memorystore::V1beta::Memorystore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.delete_auth_token({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + c.delete_auth_token name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.delete_auth_token ::Google::Cloud::Memorystore::V1beta::DeleteAuthTokenRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.delete_auth_token({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.delete_auth_token(::Google::Cloud::Memorystore::V1beta::DeleteAuthTokenRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_auth_token_client_stub.call_rpc_count + end + end + def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure