diff --git a/google-cloud-memorystore-v1/.owlbot-manifest.json b/google-cloud-memorystore-v1/.owlbot-manifest.json index 6412fa01df2c..2db2d2a1b172 100644 --- a/google-cloud-memorystore-v1/.owlbot-manifest.json +++ b/google-cloud-memorystore-v1/.owlbot-manifest.json @@ -51,6 +51,7 @@ "snippets/memorystore/delete_backup.rb", "snippets/memorystore/delete_instance.rb", "snippets/memorystore/export_backup.rb", + "snippets/memorystore/finish_migration.rb", "snippets/memorystore/get_backup.rb", "snippets/memorystore/get_backup_collection.rb", "snippets/memorystore/get_certificate_authority.rb", @@ -60,6 +61,7 @@ "snippets/memorystore/list_backups.rb", "snippets/memorystore/list_instances.rb", "snippets/memorystore/reschedule_maintenance.rb", + "snippets/memorystore/start_migration.rb", "snippets/memorystore/update_instance.rb", "snippets/snippet_metadata_google.cloud.memorystore.v1.json", "test/google/cloud/memorystore/v1/memorystore_operations_test.rb", diff --git a/google-cloud-memorystore-v1/gapic_metadata.json b/google-cloud-memorystore-v1/gapic_metadata.json index 87d428ba0d71..97111d81f726 100644 --- a/google-cloud-memorystore-v1/gapic_metadata.json +++ b/google-cloud-memorystore-v1/gapic_metadata.json @@ -84,6 +84,16 @@ "methods": [ "backup_instance" ] + }, + "StartMigration": { + "methods": [ + "start_migration" + ] + }, + "FinishMigration": { + "methods": [ + "finish_migration" + ] } } } diff --git a/google-cloud-memorystore-v1/lib/google/cloud/memorystore/v1/memorystore/client.rb b/google-cloud-memorystore-v1/lib/google/cloud/memorystore/v1/memorystore/client.rb index 67ce0ec6d0af..bd08ea5830f4 100644 --- a/google-cloud-memorystore-v1/lib/google/cloud/memorystore/v1/memorystore/client.rb +++ b/google-cloud-memorystore-v1/lib/google/cloud/memorystore/v1/memorystore/client.rb @@ -1073,11 +1073,11 @@ def reschedule_maintenance request, options = nil # 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 - # {::Google::Cloud::Memorystore::V1::ListBackupCollectionsResponse#next_page_token `next_page_token`} + # `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. + # `ListBackupCollections` request, if any. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Memorystore::V1::BackupCollection>] @@ -1263,11 +1263,11 @@ def get_backup_collection request, options = nil # 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 - # {::Google::Cloud::Memorystore::V1::ListBackupsResponse#next_page_token `next_page_token`} + # `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. + # `ListBackupCollections` request, if any. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Memorystore::V1::Backup>] @@ -1732,6 +1732,215 @@ def backup_instance request, options = nil 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::V1::StartMigrationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1::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::V1::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/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Memorystore::V1::Memorystore::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Memorystore::V1::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::V1::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::V1::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::V1::FinishMigrationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1::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/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Memorystore::V1::Memorystore::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Memorystore::V1::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::V1::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::V1::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 + ## # Configuration class for the Memorystore API. # @@ -1992,6 +2201,16 @@ class Rpcs # @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 # @private def initialize parent_rpcs = nil @@ -2025,6 +2244,10 @@ def initialize parent_rpcs = nil @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 yield self if block_given? end diff --git a/google-cloud-memorystore-v1/lib/google/cloud/memorystore/v1/memorystore/credentials.rb b/google-cloud-memorystore-v1/lib/google/cloud/memorystore/v1/memorystore/credentials.rb index 09a34e8e496e..4a336ded3733 100644 --- a/google-cloud-memorystore-v1/lib/google/cloud/memorystore/v1/memorystore/credentials.rb +++ b/google-cloud-memorystore-v1/lib/google/cloud/memorystore/v1/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-v1/lib/google/cloud/memorystore/v1/memorystore/paths.rb b/google-cloud-memorystore-v1/lib/google/cloud/memorystore/v1/memorystore/paths.rb index 9776e8fde7ee..266eef28f642 100644 --- a/google-cloud-memorystore-v1/lib/google/cloud/memorystore/v1/memorystore/paths.rb +++ b/google-cloud-memorystore-v1/lib/google/cloud/memorystore/v1/memorystore/paths.rb @@ -199,6 +199,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. # diff --git a/google-cloud-memorystore-v1/lib/google/cloud/memorystore/v1/memorystore/rest/client.rb b/google-cloud-memorystore-v1/lib/google/cloud/memorystore/v1/memorystore/rest/client.rb index 50563ea71c36..047a97a08fb8 100644 --- a/google-cloud-memorystore-v1/lib/google/cloud/memorystore/v1/memorystore/rest/client.rb +++ b/google-cloud-memorystore-v1/lib/google/cloud/memorystore/v1/memorystore/rest/client.rb @@ -1011,11 +1011,11 @@ def reschedule_maintenance request, options = nil # 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 - # {::Google::Cloud::Memorystore::V1::ListBackupCollectionsResponse#next_page_token `next_page_token`} + # `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. + # `ListBackupCollections` request, if any. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Memorystore::V1::BackupCollection>] # @yieldparam operation [::Gapic::Rest::TransportOperation] @@ -1187,11 +1187,11 @@ def get_backup_collection request, options = nil # 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 - # {::Google::Cloud::Memorystore::V1::ListBackupsResponse#next_page_token `next_page_token`} + # `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. + # `ListBackupCollections` request, if any. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Memorystore::V1::Backup>] # @yieldparam operation [::Gapic::Rest::TransportOperation] @@ -1621,6 +1621,201 @@ def backup_instance request, options = nil 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::V1::StartMigrationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1::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::V1::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/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Memorystore::V1::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::V1::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::V1::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::V1::FinishMigrationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1::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/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Memorystore::V1::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::V1::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::V1::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 + ## # Configuration class for the Memorystore REST API. # @@ -1851,6 +2046,16 @@ class Rpcs # @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 # @private def initialize parent_rpcs = nil @@ -1884,6 +2089,10 @@ def initialize parent_rpcs = nil @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 yield self if block_given? end diff --git a/google-cloud-memorystore-v1/lib/google/cloud/memorystore/v1/memorystore/rest/service_stub.rb b/google-cloud-memorystore-v1/lib/google/cloud/memorystore/v1/memorystore/rest/service_stub.rb index 701601072960..d22a6e057633 100644 --- a/google-cloud-memorystore-v1/lib/google/cloud/memorystore/v1/memorystore/rest/service_stub.rb +++ b/google-cloud-memorystore-v1/lib/google/cloud/memorystore/v1/memorystore/rest/service_stub.rb @@ -673,6 +673,86 @@ def backup_instance request_pb, options = nil end end + ## + # Baseline implementation for the start_migration REST call + # + # @param request_pb [::Google::Cloud::Memorystore::V1::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::V1::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 + ## # @private # @@ -992,6 +1072,50 @@ def self.transcode_backup_instance_request request_pb ) transcoder.transcode request_pb end + + ## + # @private + # + # GRPC transcoding helper method for the start_migration REST call + # + # @param request_pb [::Google::Cloud::Memorystore::V1::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_start_migration_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:startMigration", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the finish_migration REST call + # + # @param request_pb [::Google::Cloud::Memorystore::V1::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_finish_migration_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:finishMigration", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end end end end diff --git a/google-cloud-memorystore-v1/lib/google/cloud/memorystore/v1/memorystore_pb.rb b/google-cloud-memorystore-v1/lib/google/cloud/memorystore/v1/memorystore_pb.rb index 4be46c6ec581..485774c57d9d 100644 --- a/google-cloud-memorystore-v1/lib/google/cloud/memorystore/v1/memorystore_pb.rb +++ b/google-cloud-memorystore-v1/lib/google/cloud/memorystore/v1/memorystore_pb.rb @@ -18,7 +18,7 @@ require 'google/type/timeofday_pb' -descriptor_data = "\n-google/cloud/memorystore/v1/memorystore.proto\x12\x1bgoogle.cloud.memorystore.v1\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\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1bgoogle/type/dayofweek.proto\x1a\x1bgoogle/type/timeofday.proto\"\xdb(\n\x08Instance\x12S\n\ngcs_source\x18\x17 \x01(\x0b\x32\x35.google.cloud.memorystore.v1.Instance.GcsBackupSourceB\x06\xe0\x41\x01\xe0\x41\x05H\x00\x12\x62\n\x15managed_backup_source\x18\x18 \x01(\x0b\x32\x39.google.cloud.memorystore.v1.Instance.ManagedBackupSourceB\x06\xe0\x41\x01\xe0\x41\x05H\x00\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\x12\x46\n\x06labels\x18\x04 \x03(\x0b\x32\x31.google.cloud.memorystore.v1.Instance.LabelsEntryB\x03\xe0\x41\x01\x12?\n\x05state\x18\x05 \x01(\x0e\x32+.google.cloud.memorystore.v1.Instance.StateB\x03\xe0\x41\x03\x12H\n\nstate_info\x18\x06 \x01(\x0b\x32/.google.cloud.memorystore.v1.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\x01\x88\x01\x01\x12[\n\x12\x61uthorization_mode\x18\t \x01(\x0e\x32\x37.google.cloud.memorystore.v1.Instance.AuthorizationModeB\x06\xe0\x41\x01\xe0\x41\x05\x12\x64\n\x17transit_encryption_mode\x18\n \x01(\x0e\x32;.google.cloud.memorystore.v1.Instance.TransitEncryptionModeB\x06\xe0\x41\x01\xe0\x41\x05\x12\x18\n\x0bshard_count\x18\x0b \x01(\x05\x42\x03\xe0\x41\x01\x12R\n\x13\x64iscovery_endpoints\x18\x0c \x03(\x0b\x32..google.cloud.memorystore.v1.DiscoveryEndpointB\x05\x18\x01\xe0\x41\x03\x12\x46\n\tnode_type\x18\r \x01(\x0e\x32..google.cloud.memorystore.v1.Instance.NodeTypeB\x03\xe0\x41\x01\x12O\n\x12persistence_config\x18\x0e \x01(\x0b\x32..google.cloud.memorystore.v1.PersistenceConfigB\x03\xe0\x41\x01\x12\x1b\n\x0e\x65ngine_version\x18\x0f \x01(\tB\x03\xe0\x41\x01\x12U\n\x0e\x65ngine_configs\x18\x10 \x03(\x0b\x32\x38.google.cloud.memorystore.v1.Instance.EngineConfigsEntryB\x03\xe0\x41\x01\x12\x41\n\x0bnode_config\x18\x11 \x01(\x0b\x32\'.google.cloud.memorystore.v1.NodeConfigB\x03\xe0\x41\x03\x12]\n\x18zone_distribution_config\x18\x12 \x01(\x0b\x32\x33.google.cloud.memorystore.v1.ZoneDistributionConfigB\x06\xe0\x41\x01\xe0\x41\x05\x12-\n\x1b\x64\x65letion_protection_enabled\x18\x13 \x01(\x08\x42\x03\xe0\x41\x01H\x02\x88\x01\x01\x12V\n\x14psc_auto_connections\x18\x14 \x03(\x0b\x32..google.cloud.memorystore.v1.PscAutoConnectionB\x08\x18\x01\xe0\x41\x01\xe0\x41\x05\x12U\n\x16psc_attachment_details\x18\x15 \x03(\x0b\x32\x30.google.cloud.memorystore.v1.PscAttachmentDetailB\x03\xe0\x41\x03\x12N\n\tendpoints\x18\x19 \x03(\x0b\x32\x36.google.cloud.memorystore.v1.Instance.InstanceEndpointB\x03\xe0\x41\x01\x12=\n\x04mode\x18\x1a \x01(\x0e\x32*.google.cloud.memorystore.v1.Instance.ModeB\x03\xe0\x41\x01\x12/\n\x1asimulate_maintenance_event\x18\x1b \x01(\x08\x42\x06\xe0\x41\x01\xe0\x41\x04H\x03\x88\x01\x01\x12+\n\x14ondemand_maintenance\x18\x1c \x01(\x08\x42\x08\x18\x01\xe0\x41\x01\xe0\x41\x04H\x04\x88\x01\x01\x12\"\n\rsatisfies_pzs\x18\x1d \x01(\x08\x42\x06\xe0\x41\x03\xe0\x41\x01H\x05\x88\x01\x01\x12\"\n\rsatisfies_pzi\x18\x1e \x01(\x08\x42\x06\xe0\x41\x03\xe0\x41\x01H\x06\x88\x01\x01\x12O\n\x12maintenance_policy\x18\x1f \x01(\x0b\x32..google.cloud.memorystore.v1.MaintenancePolicyB\x03\xe0\x41\x01\x12S\n\x14maintenance_schedule\x18 \x01(\x0b\x32\x30.google.cloud.memorystore.v1.MaintenanceScheduleB\x03\xe0\x41\x03\x12k\n!cross_instance_replication_config\x18! \x01(\x0b\x32;.google.cloud.memorystore.v1.CrossInstanceReplicationConfigB\x03\xe0\x41\x01\x12;\n)async_instance_endpoints_deletion_enabled\x18, \x01(\x08\x42\x03\xe0\x41\x01H\x07\x88\x01\x01\x12?\n\x07kms_key\x18- \x01(\tB)\xe0\x41\x01\xfa\x41#\n!cloudkms.googleapis.com/CryptoKeyH\x08\x88\x01\x01\x12I\n\x0f\x65ncryption_info\x18. \x01(\x0b\x32+.google.cloud.memorystore.v1.EncryptionInfoB\x03\xe0\x41\x03\x12S\n\x11\x62\x61\x63kup_collection\x18/ \x01(\tB3\xe0\x41\x03\xfa\x41-\n+memorystore.googleapis.com/BackupCollectionH\t\x88\x01\x01\x12X\n\x17\x61utomated_backup_config\x18\x30 \x01(\x0b\x32\x32.google.cloud.memorystore.v1.AutomatedBackupConfigB\x03\xe0\x41\x01\x12%\n\x13maintenance_version\x18\x31 \x01(\tB\x03\xe0\x41\x01H\n\x88\x01\x01\x12/\n\x1d\x65\x66\x66\x65\x63tive_maintenance_version\x18\x32 \x01(\tB\x03\xe0\x41\x03H\x0b\x88\x01\x01\x12+\n\x1e\x61vailable_maintenance_versions\x18\x33 \x03(\tB\x03\xe0\x41\x03\x12.\n\x1c\x61llow_fewer_zones_deployment\x18\x36 \x01(\x08\x42\x08\x18\x01\xe0\x41\x01\xe0\x41\x05\x12W\n\x0eserver_ca_mode\x18\x38 \x01(\x0e\x32\x32.google.cloud.memorystore.v1.Instance.ServerCaModeB\x06\xe0\x41\x01\xe0\x41\x05H\x0c\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\r\x88\x01\x01\x12.\n\x19rotate_server_certificate\x18: \x01(\x08\x42\x06\xe0\x41\x01\xe0\x41\x04H\x0e\x88\x01\x01\x1a\xa4\x03\n\tStateInfo\x12V\n\x0bupdate_info\x18\x01 \x01(\x0b\x32:.google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfoB\x03\xe0\x41\x03H\x00\x1a\xb6\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\x12R\n\x10target_node_type\x18\x04 \x01(\x0e\x32..google.cloud.memorystore.v1.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\x1a\x64\n\x10InstanceEndpoint\x12P\n\x0b\x63onnections\x18\x01 \x03(\x0b\x32\x36.google.cloud.memorystore.v1.Instance.ConnectionDetailB\x03\xe0\x41\x01\x1a\xba\x01\n\x10\x43onnectionDetail\x12R\n\x13psc_auto_connection\x18\x01 \x01(\x0b\x32..google.cloud.memorystore.v1.PscAutoConnectionB\x03\xe0\x41\x05H\x00\x12\x44\n\x0epsc_connection\x18\x02 \x01(\x0b\x32*.google.cloud.memorystore.v1.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.v1.PersistenceConfig.PersistenceModeB\x03\xe0\x41\x01\x12Q\n\nrdb_config\x18\x02 \x01(\x0b\x32\x38.google.cloud.memorystore.v1.PersistenceConfig.RDBConfigB\x03\xe0\x41\x01\x12Q\n\naof_config\x18\x03 \x01(\x0b\x32\x38.google.cloud.memorystore.v1.PersistenceConfig.AOFConfigB\x03\xe0\x41\x01\x1a\xb1\x02\n\tRDBConfig\x12i\n\x13rdb_snapshot_period\x18\x01 \x01(\x0e\x32G.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig.SnapshotPeriodB\x03\xe0\x41\x01\x12@\n\x17rdb_snapshot_start_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\"w\n\x0eSnapshotPeriod\x12\x1f\n\x1bSNAPSHOT_PERIOD_UNSPECIFIED\x10\x00\x12\x0c\n\x08ONE_HOUR\x10\x01\x12\r\n\tSIX_HOURS\x10\x02\x12\x10\n\x0cTWELVE_HOURS\x10\x03\x12\x15\n\x11TWENTY_FOUR_HOURS\x10\x04\x1a\xbf\x01\n\tAOFConfig\x12_\n\x0c\x61ppend_fsync\x18\x01 \x01(\x0e\x32\x44.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig.AppendFsyncB\x03\xe0\x41\x01\"Q\n\x0b\x41ppendFsync\x12\x1c\n\x18\x41PPEND_FSYNC_UNSPECIFIED\x10\x00\x12\t\n\x05NEVER\x10\x01\x12\r\n\tEVERY_SEC\x10\x02\x12\n\n\x06\x41LWAYS\x10\x03\"S\n\x0fPersistenceMode\x12 \n\x1cPERSISTENCE_MODE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\x07\n\x03RDB\x10\x02\x12\x07\n\x03\x41OF\x10\x03\"\"\n\nNodeConfig\x12\x14\n\x07size_gb\x18\x01 \x01(\x01\x42\x03\xe0\x41\x03\"\xe9\x01\n\x16ZoneDistributionConfig\x12\x11\n\x04zone\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12[\n\x04mode\x18\x01 \x01(\x0e\x32H.google.cloud.memorystore.v1.ZoneDistributionConfig.ZoneDistributionModeB\x03\xe0\x41\x01\"_\n\x14ZoneDistributionMode\x12&\n\"ZONE_DISTRIBUTION_MODE_UNSPECIFIED\x10\x00\x12\x0e\n\nMULTI_ZONE\x10\x01\x12\x0f\n\x0bSINGLE_ZONE\x10\x02\"\xce\x02\n\x1cRescheduleMaintenanceRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#memorystore.googleapis.com/Instance\x12\x66\n\x0freschedule_type\x18\x02 \x01(\x0e\x32H.google.cloud.memorystore.v1.RescheduleMaintenanceRequest.RescheduleTypeB\x03\xe0\x41\x02\x12\x36\n\rschedule_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\"S\n\x0eRescheduleType\x12\x1f\n\x1bRESCHEDULE_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tIMMEDIATE\x10\x01\x12\x11\n\rSPECIFIC_TIME\x10\x03\"\xb0\x01\n\x14ListInstancesRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#memorystore.googleapis.com/Instance\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\"\x7f\n\x15ListInstancesResponse\x12\x38\n\tinstances\x18\x01 \x03(\x0b\x32%.google.cloud.memorystore.v1.Instance\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"O\n\x12GetInstanceRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#memorystore.googleapis.com/Instance\"\xcd\x01\n\x15\x43reateInstanceRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#memorystore.googleapis.com/Instance\x12\x18\n\x0binstance_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12<\n\x08instance\x18\x03 \x01(\x0b\x32%.google.cloud.memorystore.v1.InstanceB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x04 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xac\x01\n\x15UpdateInstanceRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\x12<\n\x08instance\x18\x02 \x01(\x0b\x32%.google.cloud.memorystore.v1.InstanceB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"s\n\x15\x44\x65leteInstanceRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#memorystore.googleapis.com/Instance\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\x94\x01\n\x1cListBackupCollectionsRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\x12+memorystore.googleapis.com/BackupCollection\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\"\x98\x01\n\x1dListBackupCollectionsResponse\x12I\n\x12\x62\x61\x63kup_collections\x18\x01 \x03(\x0b\x32-.google.cloud.memorystore.v1.BackupCollection\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"_\n\x1aGetBackupCollectionRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+memorystore.googleapis.com/BackupCollection\"\x80\x01\n\x12ListBackupsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!memorystore.googleapis.com/Backup\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\"y\n\x13ListBackupsResponse\x12\x34\n\x07\x62\x61\x63kups\x18\x01 \x03(\x0b\x32#.google.cloud.memorystore.v1.Backup\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"K\n\x10GetBackupRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!memorystore.googleapis.com/Backup\"o\n\x13\x44\x65leteBackupRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!memorystore.googleapis.com/Backup\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"s\n\x13\x45xportBackupRequest\x12\x14\n\ngcs_bucket\x18\x02 \x01(\tH\x00\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!memorystore.googleapis.com/BackupB\r\n\x0b\x64\x65stination\"\xaa\x01\n\x15\x42\x61\x63kupInstanceRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#memorystore.googleapis.com/Instance\x12+\n\x03ttl\x18\x02 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12\x1b\n\tbackup_id\x18\x03 \x01(\tB\x03\xe0\x41\x01H\x00\x88\x01\x01\x42\x0c\n\n_backup_id\"[\n\x1eGetCertificateAuthorityRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#memorystore.googleapis.com/Instance\"\x89\x04\n\x14\x43\x65rtificateAuthority\x12j\n\x11managed_server_ca\x18\x02 \x01(\x0b\x32M.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthorityH\x00\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x1a\xab\x01\n\x1bManagedCertificateAuthority\x12i\n\x08\x63\x61_certs\x18\x01 \x03(\x0b\x32W.google.cloud.memorystore.v1.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\"\x80\x05\n\"SharedRegionalCertificateAuthority\x12\x80\x01\n\x11managed_server_ca\x18\x02 \x01(\x0b\x32\x63.google.cloud.memorystore.v1.SharedRegionalCertificateAuthority.RegionalManagedCertificateAuthorityH\x00\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x1a\xda\x01\n#RegionalManagedCertificateAuthority\x12\x87\x01\n\x08\x63\x61_certs\x18\x01 \x03(\x0b\x32u.google.cloud.memorystore.v1.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\"\xf6\x04\n\x0e\x45ncryptionInfo\x12N\n\x0f\x65ncryption_type\x18\x01 \x01(\x0e\x32\x30.google.cloud.memorystore.v1.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\x37.google.cloud.memorystore.v1.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\xe3\x19\n\x0bMemorystore\x12\xb6\x01\n\rListInstances\x12\x31.google.cloud.memorystore.v1.ListInstancesRequest\x1a\x32.google.cloud.memorystore.v1.ListInstancesResponse\">\xda\x41\x06parent\x82\xd3\xe4\x93\x02/\x12-/v1/{parent=projects/*/locations/*}/instances\x12\xa3\x01\n\x0bGetInstance\x12/.google.cloud.memorystore.v1.GetInstanceRequest\x1a%.google.cloud.memorystore.v1.Instance\"<\xda\x41\x04name\x82\xd3\xe4\x93\x02/\x12-/v1/{name=projects/*/locations/*/instances/*}\x12\xe2\x01\n\x0e\x43reateInstance\x12\x32.google.cloud.memorystore.v1.CreateInstanceRequest\x1a\x1d.google.longrunning.Operation\"}\xca\x41\x1d\n\x08Instance\x12\x11OperationMetadata\xda\x41\x1bparent,instance,instance_id\x82\xd3\xe4\x93\x02\x39\"-/v1/{parent=projects/*/locations/*}/instances:\x08instance\x12\xe4\x01\n\x0eUpdateInstance\x12\x32.google.cloud.memorystore.v1.UpdateInstanceRequest\x1a\x1d.google.longrunning.Operation\"\x7f\xca\x41\x1d\n\x08Instance\x12\x11OperationMetadata\xda\x41\x14instance,update_mask\x82\xd3\xe4\x93\x02\x42\x32\x36/v1/{instance.name=projects/*/locations/*/instances/*}:\x08instance\x12\xce\x01\n\x0e\x44\x65leteInstance\x12\x32.google.cloud.memorystore.v1.DeleteInstanceRequest\x1a\x1d.google.longrunning.Operation\"i\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02/*-/v1/{name=projects/*/locations/*/instances/*}\x12\xdc\x01\n\x17GetCertificateAuthority\x12;.google.cloud.memorystore.v1.GetCertificateAuthorityRequest\x1a\x31.google.cloud.memorystore.v1.CertificateAuthority\"Q\xda\x41\x04name\x82\xd3\xe4\x93\x02\x44\x12\x42/v1/{name=projects/*/locations/*/instances/*}/certificateAuthority\x12\x88\x02\n%GetSharedRegionalCertificateAuthority\x12I.google.cloud.memorystore.v1.GetSharedRegionalCertificateAuthorityRequest\x1a?.google.cloud.memorystore.v1.SharedRegionalCertificateAuthority\"S\xda\x41\x04name\x82\xd3\xe4\x93\x02\x46\x12\x44/v1/{name=projects/*/locations/*/sharedRegionalCertificateAuthority}\x12\x87\x02\n\x15RescheduleMaintenance\x12\x39.google.cloud.memorystore.v1.RescheduleMaintenanceRequest\x1a\x1d.google.longrunning.Operation\"\x93\x01\xca\x41\x1d\n\x08Instance\x12\x11OperationMetadata\xda\x41\"name,reschedule_type,schedule_time\x82\xd3\xe4\x93\x02H\"C/v1/{name=projects/*/locations/*/instances/*}:rescheduleMaintenance:\x01*\x12\xd6\x01\n\x15ListBackupCollections\x12\x39.google.cloud.memorystore.v1.ListBackupCollectionsRequest\x1a:.google.cloud.memorystore.v1.ListBackupCollectionsResponse\"F\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x37\x12\x35/v1/{parent=projects/*/locations/*}/backupCollections\x12\xc3\x01\n\x13GetBackupCollection\x12\x37.google.cloud.memorystore.v1.GetBackupCollectionRequest\x1a-.google.cloud.memorystore.v1.BackupCollection\"D\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37\x12\x35/v1/{name=projects/*/locations/*/backupCollections/*}\x12\xc2\x01\n\x0bListBackups\x12/.google.cloud.memorystore.v1.ListBackupsRequest\x1a\x30.google.cloud.memorystore.v1.ListBackupsResponse\"P\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x41\x12?/v1/{parent=projects/*/locations/*/backupCollections/*}/backups\x12\xaf\x01\n\tGetBackup\x12-.google.cloud.memorystore.v1.GetBackupRequest\x1a#.google.cloud.memorystore.v1.Backup\"N\xda\x41\x04name\x82\xd3\xe4\x93\x02\x41\x12?/v1/{name=projects/*/locations/*/backupCollections/*/backups/*}\x12\xdc\x01\n\x0c\x44\x65leteBackup\x12\x30.google.cloud.memorystore.v1.DeleteBackupRequest\x1a\x1d.google.longrunning.Operation\"{\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x41*?/v1/{name=projects/*/locations/*/backupCollections/*/backups/*}\x12\xd0\x01\n\x0c\x45xportBackup\x12\x30.google.cloud.memorystore.v1.ExportBackupRequest\x1a\x1d.google.longrunning.Operation\"o\xca\x41\x1b\n\x06\x42\x61\x63kup\x12\x11OperationMetadata\x82\xd3\xe4\x93\x02K\"F/v1/{name=projects/*/locations/*/backupCollections/*/backups/*}:export:\x01*\x12\xcb\x01\n\x0e\x42\x61\x63kupInstance\x12\x32.google.cloud.memorystore.v1.BackupInstanceRequest\x1a\x1d.google.longrunning.Operation\"f\xca\x41\x1d\n\x08Instance\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x39\"4/v1/{name=projects/*/locations/*/instances/*}:backup:\x01*\x1aN\xca\x41\x1amemorystore.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x90\x07\n\x1f\x63om.google.cloud.memorystore.v1B\x0bV1mainProtoP\x01ZAcloud.google.com/go/memorystore/apiv1/memorystorepb;memorystorepb\xaa\x02\x1bGoogle.Cloud.Memorystore.V1\xca\x02\x1bGoogle\\Cloud\\Memorystore\\V1\xea\x02\x1eGoogle::Cloud::Memorystore::V1\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}b\x06proto3" +descriptor_data = "\n-google/cloud/memorystore/v1/memorystore.proto\x12\x1bgoogle.cloud.memorystore.v1\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\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1bgoogle/type/dayofweek.proto\x1a\x1bgoogle/type/timeofday.proto\"\xba)\n\x08Instance\x12S\n\ngcs_source\x18\x17 \x01(\x0b\x32\x35.google.cloud.memorystore.v1.Instance.GcsBackupSourceB\x06\xe0\x41\x01\xe0\x41\x05H\x00\x12\x62\n\x15managed_backup_source\x18\x18 \x01(\x0b\x32\x39.google.cloud.memorystore.v1.Instance.ManagedBackupSourceB\x06\xe0\x41\x01\xe0\x41\x05H\x00\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\x12\x46\n\x06labels\x18\x04 \x03(\x0b\x32\x31.google.cloud.memorystore.v1.Instance.LabelsEntryB\x03\xe0\x41\x01\x12?\n\x05state\x18\x05 \x01(\x0e\x32+.google.cloud.memorystore.v1.Instance.StateB\x03\xe0\x41\x03\x12H\n\nstate_info\x18\x06 \x01(\x0b\x32/.google.cloud.memorystore.v1.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\x01\x88\x01\x01\x12[\n\x12\x61uthorization_mode\x18\t \x01(\x0e\x32\x37.google.cloud.memorystore.v1.Instance.AuthorizationModeB\x06\xe0\x41\x01\xe0\x41\x05\x12\x64\n\x17transit_encryption_mode\x18\n \x01(\x0e\x32;.google.cloud.memorystore.v1.Instance.TransitEncryptionModeB\x06\xe0\x41\x01\xe0\x41\x05\x12\x18\n\x0bshard_count\x18\x0b \x01(\x05\x42\x03\xe0\x41\x01\x12R\n\x13\x64iscovery_endpoints\x18\x0c \x03(\x0b\x32..google.cloud.memorystore.v1.DiscoveryEndpointB\x05\x18\x01\xe0\x41\x03\x12\x46\n\tnode_type\x18\r \x01(\x0e\x32..google.cloud.memorystore.v1.Instance.NodeTypeB\x03\xe0\x41\x01\x12O\n\x12persistence_config\x18\x0e \x01(\x0b\x32..google.cloud.memorystore.v1.PersistenceConfigB\x03\xe0\x41\x01\x12\x1b\n\x0e\x65ngine_version\x18\x0f \x01(\tB\x03\xe0\x41\x01\x12U\n\x0e\x65ngine_configs\x18\x10 \x03(\x0b\x32\x38.google.cloud.memorystore.v1.Instance.EngineConfigsEntryB\x03\xe0\x41\x01\x12\x41\n\x0bnode_config\x18\x11 \x01(\x0b\x32\'.google.cloud.memorystore.v1.NodeConfigB\x03\xe0\x41\x03\x12]\n\x18zone_distribution_config\x18\x12 \x01(\x0b\x32\x33.google.cloud.memorystore.v1.ZoneDistributionConfigB\x06\xe0\x41\x01\xe0\x41\x05\x12-\n\x1b\x64\x65letion_protection_enabled\x18\x13 \x01(\x08\x42\x03\xe0\x41\x01H\x02\x88\x01\x01\x12V\n\x14psc_auto_connections\x18\x14 \x03(\x0b\x32..google.cloud.memorystore.v1.PscAutoConnectionB\x08\x18\x01\xe0\x41\x01\xe0\x41\x05\x12U\n\x16psc_attachment_details\x18\x15 \x03(\x0b\x32\x30.google.cloud.memorystore.v1.PscAttachmentDetailB\x03\xe0\x41\x03\x12N\n\tendpoints\x18\x19 \x03(\x0b\x32\x36.google.cloud.memorystore.v1.Instance.InstanceEndpointB\x03\xe0\x41\x01\x12@\n\x04mode\x18\x1a \x01(\x0e\x32*.google.cloud.memorystore.v1.Instance.ModeB\x06\xe0\x41\x01\xe0\x41\x05\x12/\n\x1asimulate_maintenance_event\x18\x1b \x01(\x08\x42\x06\xe0\x41\x01\xe0\x41\x04H\x03\x88\x01\x01\x12+\n\x14ondemand_maintenance\x18\x1c \x01(\x08\x42\x08\x18\x01\xe0\x41\x01\xe0\x41\x04H\x04\x88\x01\x01\x12\"\n\rsatisfies_pzs\x18\x1d \x01(\x08\x42\x06\xe0\x41\x03\xe0\x41\x01H\x05\x88\x01\x01\x12\"\n\rsatisfies_pzi\x18\x1e \x01(\x08\x42\x06\xe0\x41\x03\xe0\x41\x01H\x06\x88\x01\x01\x12O\n\x12maintenance_policy\x18\x1f \x01(\x0b\x32..google.cloud.memorystore.v1.MaintenancePolicyB\x03\xe0\x41\x01\x12S\n\x14maintenance_schedule\x18 \x01(\x0b\x32\x30.google.cloud.memorystore.v1.MaintenanceScheduleB\x03\xe0\x41\x03\x12k\n!cross_instance_replication_config\x18! \x01(\x0b\x32;.google.cloud.memorystore.v1.CrossInstanceReplicationConfigB\x03\xe0\x41\x01\x12;\n)async_instance_endpoints_deletion_enabled\x18, \x01(\x08\x42\x03\xe0\x41\x01H\x07\x88\x01\x01\x12?\n\x07kms_key\x18- \x01(\tB)\xe0\x41\x01\xfa\x41#\n!cloudkms.googleapis.com/CryptoKeyH\x08\x88\x01\x01\x12I\n\x0f\x65ncryption_info\x18. \x01(\x0b\x32+.google.cloud.memorystore.v1.EncryptionInfoB\x03\xe0\x41\x03\x12S\n\x11\x62\x61\x63kup_collection\x18/ \x01(\tB3\xe0\x41\x03\xfa\x41-\n+memorystore.googleapis.com/BackupCollectionH\t\x88\x01\x01\x12X\n\x17\x61utomated_backup_config\x18\x30 \x01(\x0b\x32\x32.google.cloud.memorystore.v1.AutomatedBackupConfigB\x03\xe0\x41\x01\x12%\n\x13maintenance_version\x18\x31 \x01(\tB\x03\xe0\x41\x01H\n\x88\x01\x01\x12/\n\x1d\x65\x66\x66\x65\x63tive_maintenance_version\x18\x32 \x01(\tB\x03\xe0\x41\x03H\x0b\x88\x01\x01\x12+\n\x1e\x61vailable_maintenance_versions\x18\x33 \x03(\tB\x03\xe0\x41\x03\x12.\n\x1c\x61llow_fewer_zones_deployment\x18\x36 \x01(\x08\x42\x08\x18\x01\xe0\x41\x01\xe0\x41\x05\x12W\n\x0eserver_ca_mode\x18\x38 \x01(\x0e\x32\x32.google.cloud.memorystore.v1.Instance.ServerCaModeB\x06\xe0\x41\x01\xe0\x41\x05H\x0c\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\r\x88\x01\x01\x12.\n\x19rotate_server_certificate\x18: \x01(\x08\x42\x06\xe0\x41\x01\xe0\x41\x04H\x0e\x88\x01\x01\x12K\n\x10migration_config\x18; \x01(\x0b\x32,.google.cloud.memorystore.v1.MigrationConfigB\x03\xe0\x41\x03\x1a\xa4\x03\n\tStateInfo\x12V\n\x0bupdate_info\x18\x01 \x01(\x0b\x32:.google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfoB\x03\xe0\x41\x03H\x00\x1a\xb6\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\x12R\n\x10target_node_type\x18\x04 \x01(\x0e\x32..google.cloud.memorystore.v1.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\x1a\x64\n\x10InstanceEndpoint\x12P\n\x0b\x63onnections\x18\x01 \x03(\x0b\x32\x36.google.cloud.memorystore.v1.Instance.ConnectionDetailB\x03\xe0\x41\x01\x1a\xba\x01\n\x10\x43onnectionDetail\x12R\n\x13psc_auto_connection\x18\x01 \x01(\x0b\x32..google.cloud.memorystore.v1.PscAutoConnectionB\x03\xe0\x41\x05H\x00\x12\x44\n\x0epsc_connection\x18\x02 \x01(\x0b\x32*.google.cloud.memorystore.v1.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\"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.v1.PersistenceConfig.PersistenceModeB\x03\xe0\x41\x01\x12Q\n\nrdb_config\x18\x02 \x01(\x0b\x32\x38.google.cloud.memorystore.v1.PersistenceConfig.RDBConfigB\x03\xe0\x41\x01\x12Q\n\naof_config\x18\x03 \x01(\x0b\x32\x38.google.cloud.memorystore.v1.PersistenceConfig.AOFConfigB\x03\xe0\x41\x01\x1a\xb1\x02\n\tRDBConfig\x12i\n\x13rdb_snapshot_period\x18\x01 \x01(\x0e\x32G.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig.SnapshotPeriodB\x03\xe0\x41\x01\x12@\n\x17rdb_snapshot_start_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\"w\n\x0eSnapshotPeriod\x12\x1f\n\x1bSNAPSHOT_PERIOD_UNSPECIFIED\x10\x00\x12\x0c\n\x08ONE_HOUR\x10\x01\x12\r\n\tSIX_HOURS\x10\x02\x12\x10\n\x0cTWELVE_HOURS\x10\x03\x12\x15\n\x11TWENTY_FOUR_HOURS\x10\x04\x1a\xbf\x01\n\tAOFConfig\x12_\n\x0c\x61ppend_fsync\x18\x01 \x01(\x0e\x32\x44.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig.AppendFsyncB\x03\xe0\x41\x01\"Q\n\x0b\x41ppendFsync\x12\x1c\n\x18\x41PPEND_FSYNC_UNSPECIFIED\x10\x00\x12\t\n\x05NEVER\x10\x01\x12\r\n\tEVERY_SEC\x10\x02\x12\n\n\x06\x41LWAYS\x10\x03\"S\n\x0fPersistenceMode\x12 \n\x1cPERSISTENCE_MODE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\x07\n\x03RDB\x10\x02\x12\x07\n\x03\x41OF\x10\x03\"\"\n\nNodeConfig\x12\x14\n\x07size_gb\x18\x01 \x01(\x01\x42\x03\xe0\x41\x03\"\xe9\x01\n\x16ZoneDistributionConfig\x12\x11\n\x04zone\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12[\n\x04mode\x18\x01 \x01(\x0e\x32H.google.cloud.memorystore.v1.ZoneDistributionConfig.ZoneDistributionModeB\x03\xe0\x41\x01\"_\n\x14ZoneDistributionMode\x12&\n\"ZONE_DISTRIBUTION_MODE_UNSPECIFIED\x10\x00\x12\x0e\n\nMULTI_ZONE\x10\x01\x12\x0f\n\x0bSINGLE_ZONE\x10\x02\"\xce\x02\n\x1cRescheduleMaintenanceRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#memorystore.googleapis.com/Instance\x12\x66\n\x0freschedule_type\x18\x02 \x01(\x0e\x32H.google.cloud.memorystore.v1.RescheduleMaintenanceRequest.RescheduleTypeB\x03\xe0\x41\x02\x12\x36\n\rschedule_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\"S\n\x0eRescheduleType\x12\x1f\n\x1bRESCHEDULE_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tIMMEDIATE\x10\x01\x12\x11\n\rSPECIFIC_TIME\x10\x03\"\xb0\x01\n\x14ListInstancesRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#memorystore.googleapis.com/Instance\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\"\x7f\n\x15ListInstancesResponse\x12\x38\n\tinstances\x18\x01 \x03(\x0b\x32%.google.cloud.memorystore.v1.Instance\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"O\n\x12GetInstanceRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#memorystore.googleapis.com/Instance\"\xcd\x01\n\x15\x43reateInstanceRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#memorystore.googleapis.com/Instance\x12\x18\n\x0binstance_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12<\n\x08instance\x18\x03 \x01(\x0b\x32%.google.cloud.memorystore.v1.InstanceB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x04 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xac\x01\n\x15UpdateInstanceRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\x12<\n\x08instance\x18\x02 \x01(\x0b\x32%.google.cloud.memorystore.v1.InstanceB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"s\n\x15\x44\x65leteInstanceRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#memorystore.googleapis.com/Instance\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\x94\x01\n\x1cListBackupCollectionsRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\x12+memorystore.googleapis.com/BackupCollection\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\"\x98\x01\n\x1dListBackupCollectionsResponse\x12I\n\x12\x62\x61\x63kup_collections\x18\x01 \x03(\x0b\x32-.google.cloud.memorystore.v1.BackupCollection\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"_\n\x1aGetBackupCollectionRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+memorystore.googleapis.com/BackupCollection\"\x80\x01\n\x12ListBackupsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!memorystore.googleapis.com/Backup\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\"y\n\x13ListBackupsResponse\x12\x34\n\x07\x62\x61\x63kups\x18\x01 \x03(\x0b\x32#.google.cloud.memorystore.v1.Backup\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"K\n\x10GetBackupRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!memorystore.googleapis.com/Backup\"o\n\x13\x44\x65leteBackupRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!memorystore.googleapis.com/Backup\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"s\n\x13\x45xportBackupRequest\x12\x14\n\ngcs_bucket\x18\x02 \x01(\tH\x00\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!memorystore.googleapis.com/BackupB\r\n\x0b\x64\x65stination\"\xaa\x01\n\x15\x42\x61\x63kupInstanceRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#memorystore.googleapis.com/Instance\x12+\n\x03ttl\x18\x02 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12\x1b\n\tbackup_id\x18\x03 \x01(\tB\x03\xe0\x41\x01H\x00\x88\x01\x01\x42\x0c\n\n_backup_id\"[\n\x1eGetCertificateAuthorityRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#memorystore.googleapis.com/Instance\"\x89\x04\n\x14\x43\x65rtificateAuthority\x12j\n\x11managed_server_ca\x18\x02 \x01(\x0b\x32M.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthorityH\x00\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x1a\xab\x01\n\x1bManagedCertificateAuthority\x12i\n\x08\x63\x61_certs\x18\x01 \x03(\x0b\x32W.google.cloud.memorystore.v1.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\"\x80\x05\n\"SharedRegionalCertificateAuthority\x12\x80\x01\n\x11managed_server_ca\x18\x02 \x01(\x0b\x32\x63.google.cloud.memorystore.v1.SharedRegionalCertificateAuthority.RegionalManagedCertificateAuthorityH\x00\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x1a\xda\x01\n#RegionalManagedCertificateAuthority\x12\x87\x01\n\x08\x63\x61_certs\x18\x01 \x03(\x0b\x32u.google.cloud.memorystore.v1.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\"\xf6\x04\n\x0e\x45ncryptionInfo\x12N\n\x0f\x65ncryption_type\x18\x01 \x01(\x0e\x32\x30.google.cloud.memorystore.v1.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\x37.google.cloud.memorystore.v1.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\x80\x1e\n\x0bMemorystore\x12\xb6\x01\n\rListInstances\x12\x31.google.cloud.memorystore.v1.ListInstancesRequest\x1a\x32.google.cloud.memorystore.v1.ListInstancesResponse\">\xda\x41\x06parent\x82\xd3\xe4\x93\x02/\x12-/v1/{parent=projects/*/locations/*}/instances\x12\xa3\x01\n\x0bGetInstance\x12/.google.cloud.memorystore.v1.GetInstanceRequest\x1a%.google.cloud.memorystore.v1.Instance\"<\xda\x41\x04name\x82\xd3\xe4\x93\x02/\x12-/v1/{name=projects/*/locations/*/instances/*}\x12\xe2\x01\n\x0e\x43reateInstance\x12\x32.google.cloud.memorystore.v1.CreateInstanceRequest\x1a\x1d.google.longrunning.Operation\"}\xca\x41\x1d\n\x08Instance\x12\x11OperationMetadata\xda\x41\x1bparent,instance,instance_id\x82\xd3\xe4\x93\x02\x39\"-/v1/{parent=projects/*/locations/*}/instances:\x08instance\x12\xe4\x01\n\x0eUpdateInstance\x12\x32.google.cloud.memorystore.v1.UpdateInstanceRequest\x1a\x1d.google.longrunning.Operation\"\x7f\xca\x41\x1d\n\x08Instance\x12\x11OperationMetadata\xda\x41\x14instance,update_mask\x82\xd3\xe4\x93\x02\x42\x32\x36/v1/{instance.name=projects/*/locations/*/instances/*}:\x08instance\x12\xce\x01\n\x0e\x44\x65leteInstance\x12\x32.google.cloud.memorystore.v1.DeleteInstanceRequest\x1a\x1d.google.longrunning.Operation\"i\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02/*-/v1/{name=projects/*/locations/*/instances/*}\x12\xdc\x01\n\x17GetCertificateAuthority\x12;.google.cloud.memorystore.v1.GetCertificateAuthorityRequest\x1a\x31.google.cloud.memorystore.v1.CertificateAuthority\"Q\xda\x41\x04name\x82\xd3\xe4\x93\x02\x44\x12\x42/v1/{name=projects/*/locations/*/instances/*}/certificateAuthority\x12\x88\x02\n%GetSharedRegionalCertificateAuthority\x12I.google.cloud.memorystore.v1.GetSharedRegionalCertificateAuthorityRequest\x1a?.google.cloud.memorystore.v1.SharedRegionalCertificateAuthority\"S\xda\x41\x04name\x82\xd3\xe4\x93\x02\x46\x12\x44/v1/{name=projects/*/locations/*/sharedRegionalCertificateAuthority}\x12\x87\x02\n\x15RescheduleMaintenance\x12\x39.google.cloud.memorystore.v1.RescheduleMaintenanceRequest\x1a\x1d.google.longrunning.Operation\"\x93\x01\xca\x41\x1d\n\x08Instance\x12\x11OperationMetadata\xda\x41\"name,reschedule_type,schedule_time\x82\xd3\xe4\x93\x02H\"C/v1/{name=projects/*/locations/*/instances/*}:rescheduleMaintenance:\x01*\x12\xd6\x01\n\x15ListBackupCollections\x12\x39.google.cloud.memorystore.v1.ListBackupCollectionsRequest\x1a:.google.cloud.memorystore.v1.ListBackupCollectionsResponse\"F\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x37\x12\x35/v1/{parent=projects/*/locations/*}/backupCollections\x12\xc3\x01\n\x13GetBackupCollection\x12\x37.google.cloud.memorystore.v1.GetBackupCollectionRequest\x1a-.google.cloud.memorystore.v1.BackupCollection\"D\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37\x12\x35/v1/{name=projects/*/locations/*/backupCollections/*}\x12\xc2\x01\n\x0bListBackups\x12/.google.cloud.memorystore.v1.ListBackupsRequest\x1a\x30.google.cloud.memorystore.v1.ListBackupsResponse\"P\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x41\x12?/v1/{parent=projects/*/locations/*/backupCollections/*}/backups\x12\xaf\x01\n\tGetBackup\x12-.google.cloud.memorystore.v1.GetBackupRequest\x1a#.google.cloud.memorystore.v1.Backup\"N\xda\x41\x04name\x82\xd3\xe4\x93\x02\x41\x12?/v1/{name=projects/*/locations/*/backupCollections/*/backups/*}\x12\xdc\x01\n\x0c\x44\x65leteBackup\x12\x30.google.cloud.memorystore.v1.DeleteBackupRequest\x1a\x1d.google.longrunning.Operation\"{\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x41*?/v1/{name=projects/*/locations/*/backupCollections/*/backups/*}\x12\xd0\x01\n\x0c\x45xportBackup\x12\x30.google.cloud.memorystore.v1.ExportBackupRequest\x1a\x1d.google.longrunning.Operation\"o\xca\x41\x1b\n\x06\x42\x61\x63kup\x12\x11OperationMetadata\x82\xd3\xe4\x93\x02K\"F/v1/{name=projects/*/locations/*/backupCollections/*/backups/*}:export:\x01*\x12\xcb\x01\n\x0e\x42\x61\x63kupInstance\x12\x32.google.cloud.memorystore.v1.BackupInstanceRequest\x1a\x1d.google.longrunning.Operation\"f\xca\x41\x1d\n\x08Instance\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x39\"4/v1/{name=projects/*/locations/*/instances/*}:backup:\x01*\x12\xcc\x01\n\x0eStartMigration\x12\x32.google.cloud.memorystore.v1.StartMigrationRequest\x1a\x1d.google.longrunning.Operation\"g\xca\x41\x1d\n\x08Instance\x12\x11OperationMetadata\x82\xd3\xe4\x93\x02\x41\"] # If the \\{location} requested was "-" the response contains a list of @@ -1133,7 +1240,7 @@ class DeleteInstanceRequest extend ::Google::Protobuf::MessageExts::ClassMethods end - # Request for [ListBackupCollections] + # Request for `ListBackupCollections`. # @!attribute [rw] parent # @return [::String] # Required. The resource name of the backupCollection location using the @@ -1147,18 +1254,18 @@ class DeleteInstanceRequest # 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 - # {::Google::Cloud::Memorystore::V1::ListBackupCollectionsResponse#next_page_token `next_page_token`} + # `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. + # `ListBackupCollections` request, if any. class ListBackupCollectionsRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end - # Response for [ListBackupCollections]. + # Response for `ListBackupCollections`. # @!attribute [rw] backup_collections # @return [::Array<::Google::Cloud::Memorystore::V1::BackupCollection>] # A list of backupCollections in the project. @@ -1183,7 +1290,7 @@ class ListBackupCollectionsResponse extend ::Google::Protobuf::MessageExts::ClassMethods end - # Request for [GetBackupCollection]. + # Request for `GetBackupCollection`. # @!attribute [rw] name # @return [::String] # Required. Instance backupCollection resource name using the form: @@ -1194,7 +1301,7 @@ class GetBackupCollectionRequest extend ::Google::Protobuf::MessageExts::ClassMethods end - # Request for [ListBackups]. + # Request for `ListBackups`. # @!attribute [rw] parent # @return [::String] # Required. The resource name of the backupCollection using the form: @@ -1206,18 +1313,18 @@ class GetBackupCollectionRequest # 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 - # {::Google::Cloud::Memorystore::V1::ListBackupsResponse#next_page_token `next_page_token`} + # `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. + # `ListBackupCollections` request, if any. class ListBackupsRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end - # Response for [ListBackups]. + # Response for `ListBackups`. # @!attribute [rw] backups # @return [::Array<::Google::Cloud::Memorystore::V1::Backup>] # A list of backups in the project. @@ -1233,7 +1340,7 @@ class ListBackupsResponse extend ::Google::Protobuf::MessageExts::ClassMethods end - # Request for [GetBackup]. + # Request for `GetBackup`. # @!attribute [rw] name # @return [::String] # Required. Instance backup resource name using the form: @@ -1243,7 +1350,7 @@ class GetBackupRequest extend ::Google::Protobuf::MessageExts::ClassMethods end - # Request for [DeleteBackup]. + # Request for `DeleteBackup`. # @!attribute [rw] name # @return [::String] # Required. Instance backup resource name using the form: @@ -1256,7 +1363,7 @@ class DeleteBackupRequest extend ::Google::Protobuf::MessageExts::ClassMethods end - # Request for [ExportBackup]. + # Request for `ExportBackup`. # @!attribute [rw] gcs_bucket # @return [::String] # Google Cloud Storage bucket, like "my-bucket". @@ -1269,7 +1376,7 @@ class ExportBackupRequest extend ::Google::Protobuf::MessageExts::ClassMethods end - # Request for [BackupInstance]. + # Request for `BackupInstance`. # @!attribute [rw] name # @return [::String] # Required. Instance resource name using the form: @@ -1288,7 +1395,7 @@ class BackupInstanceRequest extend ::Google::Protobuf::MessageExts::ClassMethods end - # Request message for [GetCertificateAuthority][]. + # Request message for `GetCertificateAuthority`. # @!attribute [rw] name # @return [::String] # Required. The name of the certificate authority. @@ -1364,8 +1471,7 @@ class RegionalCertChain end end - # Request for - # {::Google::Cloud::Memorystore::V1::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: diff --git a/google-cloud-memorystore-v1/snippets/memorystore/finish_migration.rb b/google-cloud-memorystore-v1/snippets/memorystore/finish_migration.rb new file mode 100644 index 000000000000..e13e9e75b8cb --- /dev/null +++ b/google-cloud-memorystore-v1/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_v1_generated_Memorystore_FinishMigration_sync] +require "google/cloud/memorystore/v1" + +## +# 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::V1::Memorystore::Client#finish_migration. +# +def finish_migration + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Memorystore::V1::Memorystore::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Memorystore::V1::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_v1_generated_Memorystore_FinishMigration_sync] diff --git a/google-cloud-memorystore-v1/snippets/memorystore/start_migration.rb b/google-cloud-memorystore-v1/snippets/memorystore/start_migration.rb new file mode 100644 index 000000000000..1016c641c567 --- /dev/null +++ b/google-cloud-memorystore-v1/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_v1_generated_Memorystore_StartMigration_sync] +require "google/cloud/memorystore/v1" + +## +# 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::V1::Memorystore::Client#start_migration. +# +def start_migration + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Memorystore::V1::Memorystore::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Memorystore::V1::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_v1_generated_Memorystore_StartMigration_sync] diff --git a/google-cloud-memorystore-v1/snippets/snippet_metadata_google.cloud.memorystore.v1.json b/google-cloud-memorystore-v1/snippets/snippet_metadata_google.cloud.memorystore.v1.json index c163b163f454..df80bc69b223 100644 --- a/google-cloud-memorystore-v1/snippets/snippet_metadata_google.cloud.memorystore.v1.json +++ b/google-cloud-memorystore-v1/snippets/snippet_metadata_google.cloud.memorystore.v1.json @@ -610,6 +610,86 @@ "type": "FULL" } ] + }, + { + "region_tag": "memorystore_v1_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::V1::Memorystore::Client#start_migration.", + "file": "memorystore/start_migration.rb", + "language": "RUBY", + "client_method": { + "short_name": "start_migration", + "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Client#start_migration", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Memorystore::V1::StartMigrationRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Memorystore::Client", + "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Client" + }, + "method": { + "short_name": "StartMigration", + "full_name": "google.cloud.memorystore.v1.Memorystore.StartMigration", + "service": { + "short_name": "Memorystore", + "full_name": "google.cloud.memorystore.v1.Memorystore" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "memorystore_v1_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::V1::Memorystore::Client#finish_migration.", + "file": "memorystore/finish_migration.rb", + "language": "RUBY", + "client_method": { + "short_name": "finish_migration", + "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Client#finish_migration", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Memorystore::V1::FinishMigrationRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Memorystore::Client", + "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Client" + }, + "method": { + "short_name": "FinishMigration", + "full_name": "google.cloud.memorystore.v1.Memorystore.FinishMigration", + "service": { + "short_name": "Memorystore", + "full_name": "google.cloud.memorystore.v1.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-v1/test/google/cloud/memorystore/v1/memorystore_paths_test.rb b/google-cloud-memorystore-v1/test/google/cloud/memorystore/v1/memorystore_paths_test.rb index 32d904c82b4f..fdb914b8052e 100644 --- a/google-cloud-memorystore-v1/test/google/cloud/memorystore/v1/memorystore_paths_test.rb +++ b/google-cloud-memorystore-v1/test/google/cloud/memorystore/v1/memorystore_paths_test.rb @@ -149,6 +149,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::V1::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 diff --git a/google-cloud-memorystore-v1/test/google/cloud/memorystore/v1/memorystore_rest_test.rb b/google-cloud-memorystore-v1/test/google/cloud/memorystore/v1/memorystore_rest_test.rb index c56762445e7a..e60e86983054 100644 --- a/google-cloud-memorystore-v1/test/google/cloud/memorystore/v1/memorystore_rest_test.rb +++ b/google-cloud-memorystore-v1/test/google/cloud/memorystore/v1/memorystore_rest_test.rb @@ -908,6 +908,116 @@ def test_backup_instance 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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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_configure credentials_token = :dummy_value diff --git a/google-cloud-memorystore-v1/test/google/cloud/memorystore/v1/memorystore_test.rb b/google-cloud-memorystore-v1/test/google/cloud/memorystore/v1/memorystore_test.rb index 1c75a546bb1e..259179669daa 100644 --- a/google-cloud-memorystore-v1/test/google/cloud/memorystore/v1/memorystore_test.rb +++ b/google-cloud-memorystore-v1/test/google/cloud/memorystore/v1/memorystore_test.rb @@ -1025,6 +1025,137 @@ def test_backup_instance 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::V1::StartMigrationRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Memorystore::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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::V1::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_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure