diff --git a/google-cloud-memorystore-v1/.owlbot-manifest.json b/google-cloud-memorystore-v1/.owlbot-manifest.json index 8394ae1fe412..6412fa01df2c 100644 --- a/google-cloud-memorystore-v1/.owlbot-manifest.json +++ b/google-cloud-memorystore-v1/.owlbot-manifest.json @@ -17,7 +17,9 @@ "lib/google/cloud/memorystore/v1.rb", "lib/google/cloud/memorystore/v1/bindings_override.rb", "lib/google/cloud/memorystore/v1/memorystore.rb", + "lib/google/cloud/memorystore/v1/memorystore/client.rb", "lib/google/cloud/memorystore/v1/memorystore/credentials.rb", + "lib/google/cloud/memorystore/v1/memorystore/operations.rb", "lib/google/cloud/memorystore/v1/memorystore/paths.rb", "lib/google/cloud/memorystore/v1/memorystore/rest.rb", "lib/google/cloud/memorystore/v1/memorystore/rest/client.rb", @@ -60,7 +62,10 @@ "snippets/memorystore/reschedule_maintenance.rb", "snippets/memorystore/update_instance.rb", "snippets/snippet_metadata_google.cloud.memorystore.v1.json", + "test/google/cloud/memorystore/v1/memorystore_operations_test.rb", + "test/google/cloud/memorystore/v1/memorystore_paths_test.rb", "test/google/cloud/memorystore/v1/memorystore_rest_test.rb", + "test/google/cloud/memorystore/v1/memorystore_test.rb", "test/helper.rb" ], "static": [ diff --git a/google-cloud-memorystore-v1/AUTHENTICATION.md b/google-cloud-memorystore-v1/AUTHENTICATION.md index 557b1fbb3672..dda30193cc09 100644 --- a/google-cloud-memorystore-v1/AUTHENTICATION.md +++ b/google-cloud-memorystore-v1/AUTHENTICATION.md @@ -56,7 +56,7 @@ To configure a credentials file for an individual client initialization: ```ruby require "google/cloud/memorystore/v1" -client = ::Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new do |config| +client = ::Google::Cloud::Memorystore::V1::Memorystore::Client.new do |config| config.credentials = "path/to/credentialfile.json" end ``` @@ -66,11 +66,11 @@ To configure a credentials file globally for all clients: ```ruby require "google/cloud/memorystore/v1" -::Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.configure do |config| +::Google::Cloud::Memorystore::V1::Memorystore::Client.configure do |config| config.credentials = "path/to/credentialfile.json" end -client = ::Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new +client = ::Google::Cloud::Memorystore::V1::Memorystore::Client.new ``` ### Environment Variables @@ -100,7 +100,7 @@ require "google/cloud/memorystore/v1" ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" -client = ::Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new +client = ::Google::Cloud::Memorystore::V1::Memorystore::Client.new ``` ### Local ADC file diff --git a/google-cloud-memorystore-v1/README.md b/google-cloud-memorystore-v1/README.md index c3231ee7bbe2..12f847db8bae 100644 --- a/google-cloud-memorystore-v1/README.md +++ b/google-cloud-memorystore-v1/README.md @@ -32,7 +32,7 @@ In order to use this library, you first need to go through the following steps: ```ruby require "google/cloud/memorystore/v1" -client = ::Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new +client = ::Google::Cloud::Memorystore::V1::Memorystore::Client.new request = ::Google::Cloud::Memorystore::V1::ListInstancesRequest.new # (request fields as keyword arguments...) response = client.list_instances request ``` @@ -75,7 +75,7 @@ constructing a client object. For example: require "google/cloud/memorystore/v1" require "logger" -client = ::Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new do |config| +client = ::Google::Cloud::Memorystore::V1::Memorystore::Client.new do |config| config.logger = Logger.new "my-app.log" end ``` diff --git a/google-cloud-memorystore-v1/lib/google/cloud/memorystore/v1.rb b/google-cloud-memorystore-v1/lib/google/cloud/memorystore/v1.rb index 2d24dc9a995e..c300ea7ad7bc 100644 --- a/google-cloud-memorystore-v1/lib/google/cloud/memorystore/v1.rb +++ b/google-cloud-memorystore-v1/lib/google/cloud/memorystore/v1.rb @@ -25,6 +25,11 @@ module Memorystore ## # API client module. # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/memorystore/v1" + # client = ::Google::Cloud::Memorystore::V1::Memorystore::Client.new + # # @example Load this package, including all its services, and instantiate a REST client # # require "google/cloud/memorystore/v1" diff --git a/google-cloud-memorystore-v1/lib/google/cloud/memorystore/v1/memorystore.rb b/google-cloud-memorystore-v1/lib/google/cloud/memorystore/v1/memorystore.rb index c039573a027e..0ec65cee678b 100644 --- a/google-cloud-memorystore-v1/lib/google/cloud/memorystore/v1/memorystore.rb +++ b/google-cloud-memorystore-v1/lib/google/cloud/memorystore/v1/memorystore.rb @@ -16,6 +16,7 @@ # Auto-generated by gapic-generator-ruby. DO NOT EDIT! +require "gapic/common" require "gapic/config" require "gapic/config/method" @@ -23,6 +24,8 @@ require "google/cloud/memorystore/v1/memorystore/credentials" require "google/cloud/memorystore/v1/memorystore/paths" +require "google/cloud/memorystore/v1/memorystore/operations" +require "google/cloud/memorystore/v1/memorystore/client" require "google/cloud/memorystore/v1/memorystore/rest" module Google @@ -32,6 +35,11 @@ module V1 ## # Service describing handlers for resources # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/memorystore/v1/memorystore" + # client = ::Google::Cloud::Memorystore::V1::Memorystore::Client.new + # # @example Load this service and instantiate a REST client # # require "google/cloud/memorystore/v1/memorystore/rest" 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 new file mode 100644 index 000000000000..343c229a1db8 --- /dev/null +++ b/google-cloud-memorystore-v1/lib/google/cloud/memorystore/v1/memorystore/client.rb @@ -0,0 +1,2036 @@ +# 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! + +require "google/cloud/errors" +require "google/cloud/memorystore/v1/memorystore_pb" +require "google/cloud/location" + +module Google + module Cloud + module Memorystore + module V1 + module Memorystore + ## + # Client for the Memorystore service. + # + # Service describing handlers for resources + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "memorystore.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :memorystore_stub + + ## + # Configure the Memorystore Client class. + # + # See {::Google::Cloud::Memorystore::V1::Memorystore::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Memorystore clients + # ::Google::Cloud::Memorystore::V1::Memorystore::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Memorystore", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.list_instances.timeout = 60.0 + default_config.rpcs.list_instances.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_instance.timeout = 60.0 + default_config.rpcs.get_instance.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_instance.timeout = 600.0 + + default_config.rpcs.update_instance.timeout = 600.0 + + default_config.rpcs.delete_instance.timeout = 600.0 + + default_config.rpcs.get_certificate_authority.timeout = 60.0 + default_config.rpcs.get_certificate_authority.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Memorystore Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Memorystore::V1::Memorystore::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @memorystore_stub.universe_domain + end + + ## + # Create a new Memorystore client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Memorystore::V1::Memorystore::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Memorystore::V1::Memorystore::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Memorystore client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/memorystore/v1/memorystore_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @memorystore_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Memorystore::V1::Memorystore::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool, + logger: @config.logger + ) + + @memorystore_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @memorystore_stub.endpoint + config.universe_domain = @memorystore_stub.universe_domain + config.logger = @memorystore_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Memorystore::V1::Memorystore::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @memorystore_stub.logger + end + + # Service calls + + ## + # Lists Instances in a given project and location. + # + # @overload list_instances(request, options = nil) + # Pass arguments to `list_instances` via a request object, either of type + # {::Google::Cloud::Memorystore::V1::ListInstancesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1::ListInstancesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_instances(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_instances` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent to list instances from. + # Format: projects/\\{project}/locations/\\{location} + # @param page_size [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # @param filter [::String] + # Optional. Expression for filtering results. + # @param order_by [::String] + # Optional. Sort results by a defined order. Supported values: "name", + # "create_time". + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Memorystore::V1::Instance>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Memorystore::V1::Instance>] + # + # @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::ListInstancesRequest.new + # + # # Call the list_instances method. + # result = client.list_instances request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Memorystore::V1::Instance. + # p item + # end + # + def list_instances request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1::ListInstancesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_instances.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.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_instances.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_instances.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @memorystore_stub.call_rpc :list_instances, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @memorystore_stub, :list_instances, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets details of a single Instance. + # + # @overload get_instance(request, options = nil) + # Pass arguments to `get_instance` via a request object, either of type + # {::Google::Cloud::Memorystore::V1::GetInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1::GetInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_instance(name: nil) + # Pass arguments to `get_instance` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the instance to retrieve. + # Format: projects/\\{project}/locations/\\{location}/instances/\\{instance} + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Memorystore::V1::Instance] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Memorystore::V1::Instance] + # + # @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::GetInstanceRequest.new + # + # # Call the get_instance method. + # result = client.get_instance request + # + # # The returned object is of type Google::Cloud::Memorystore::V1::Instance. + # p result + # + def get_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1::GetInstanceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_instance.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Memorystore::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.get_instance.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @memorystore_stub.call_rpc :get_instance, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new Instance in a given project and location. + # + # @overload create_instance(request, options = nil) + # Pass arguments to `create_instance` via a request object, either of type + # {::Google::Cloud::Memorystore::V1::CreateInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1::CreateInstanceRequest, ::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 create_instance(parent: nil, instance_id: nil, instance: nil, request_id: nil) + # Pass arguments to `create_instance` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource where this instance will be created. + # Format: projects/\\{project}/locations/\\{location} + # @param instance_id [::String] + # Required. The ID to use for the instance, which will become the final + # component of the instance's resource name. + # + # This value is subject to the following restrictions: + # + # * Must be 4-63 characters in length + # * Must begin with a letter or digit + # * Must contain only lowercase letters, digits, and hyphens + # * Must not end with a hyphen + # * Must be unique within a location + # @param instance [::Google::Cloud::Memorystore::V1::Instance, ::Hash] + # Required. The instance to create. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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::CreateInstanceRequest.new + # + # # Call the create_instance method. + # result = client.create_instance request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1::CreateInstanceRequest + + # 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.create_instance.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Memorystore::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.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_instance.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @memorystore_stub.call_rpc :create_instance, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the parameters of a single Instance. + # + # @overload update_instance(request, options = nil) + # Pass arguments to `update_instance` via a request object, either of type + # {::Google::Cloud::Memorystore::V1::UpdateInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1::UpdateInstanceRequest, ::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 update_instance(update_mask: nil, instance: nil, request_id: nil) + # Pass arguments to `update_instance` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. The list of fields to be updated on the instance. At least one + # field must be specified. + # @param instance [::Google::Cloud::Memorystore::V1::Instance, ::Hash] + # Required. The instance to update. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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::UpdateInstanceRequest.new + # + # # Call the update_instance method. + # result = client.update_instance request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1::UpdateInstanceRequest + + # 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.update_instance.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Memorystore::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.instance&.name + header_params["instance.name"] = request.instance.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.update_instance.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @memorystore_stub.call_rpc :update_instance, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a single Instance. + # + # @overload delete_instance(request, options = nil) + # Pass arguments to `delete_instance` via a request object, either of type + # {::Google::Cloud::Memorystore::V1::DeleteInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1::DeleteInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_instance(name: nil, request_id: nil) + # Pass arguments to `delete_instance` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the instance to delete. + # Format: projects/\\{project}/locations/\\{location}/instances/\\{instance} + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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::DeleteInstanceRequest.new + # + # # Call the delete_instance method. + # result = client.delete_instance request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1::DeleteInstanceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_instance.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Memorystore::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.delete_instance.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @memorystore_stub.call_rpc :delete_instance, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets details about the certificate authority for an Instance. + # + # @overload get_certificate_authority(request, options = nil) + # Pass arguments to `get_certificate_authority` via a request object, either of type + # {::Google::Cloud::Memorystore::V1::GetCertificateAuthorityRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1::GetCertificateAuthorityRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_certificate_authority(name: nil) + # Pass arguments to `get_certificate_authority` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the certificate authority. + # Format: + # projects/\\{project}/locations/\\{location}/instances/\\{instance}/certificateAuthority + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Memorystore::V1::CertificateAuthority] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Memorystore::V1::CertificateAuthority] + # + # @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::GetCertificateAuthorityRequest.new + # + # # Call the get_certificate_authority method. + # result = client.get_certificate_authority request + # + # # The returned object is of type Google::Cloud::Memorystore::V1::CertificateAuthority. + # p result + # + def get_certificate_authority request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1::GetCertificateAuthorityRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_certificate_authority.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.get_certificate_authority.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_certificate_authority.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @memorystore_stub.call_rpc :get_certificate_authority, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the details of shared regional certificate authority information for + # Memorystore instance. + # + # @overload get_shared_regional_certificate_authority(request, options = nil) + # Pass arguments to `get_shared_regional_certificate_authority` via a request object, either of type + # {::Google::Cloud::Memorystore::V1::GetSharedRegionalCertificateAuthorityRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1::GetSharedRegionalCertificateAuthorityRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_shared_regional_certificate_authority(name: nil) + # Pass arguments to `get_shared_regional_certificate_authority` 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. Regional certificate authority resource name using the form: + # `projects/{project}/locations/{location}/sharedRegionalCertificateAuthority` + # where `location_id` refers to a Google Cloud region. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Memorystore::V1::SharedRegionalCertificateAuthority] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Memorystore::V1::SharedRegionalCertificateAuthority] + # + # @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::GetSharedRegionalCertificateAuthorityRequest.new + # + # # Call the get_shared_regional_certificate_authority method. + # result = client.get_shared_regional_certificate_authority request + # + # # The returned object is of type Google::Cloud::Memorystore::V1::SharedRegionalCertificateAuthority. + # p result + # + def get_shared_regional_certificate_authority request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1::GetSharedRegionalCertificateAuthorityRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_shared_regional_certificate_authority.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.get_shared_regional_certificate_authority.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_shared_regional_certificate_authority.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @memorystore_stub.call_rpc :get_shared_regional_certificate_authority, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Reschedules upcoming maintenance event. + # + # @overload reschedule_maintenance(request, options = nil) + # Pass arguments to `reschedule_maintenance` via a request object, either of type + # {::Google::Cloud::Memorystore::V1::RescheduleMaintenanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1::RescheduleMaintenanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload reschedule_maintenance(name: nil, reschedule_type: nil, schedule_time: nil) + # Pass arguments to `reschedule_maintenance` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the instance to reschedule maintenance for: + # `projects/{project}/locations/{location_id}/instances/{instance}` + # @param reschedule_type [::Google::Cloud::Memorystore::V1::RescheduleMaintenanceRequest::RescheduleType] + # Required. If reschedule type is SPECIFIC_TIME, schedule_time must be set. + # @param schedule_time [::Google::Protobuf::Timestamp, ::Hash] + # Optional. Timestamp when the maintenance shall be rescheduled to if + # reschedule_type=SPECIFIC_TIME, in RFC 3339 format. + # Example: `2012-11-15T16:19:00.094Z`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/memorystore/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::RescheduleMaintenanceRequest.new + # + # # Call the reschedule_maintenance method. + # result = client.reschedule_maintenance request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def reschedule_maintenance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1::RescheduleMaintenanceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.reschedule_maintenance.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Memorystore::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.reschedule_maintenance.timeout, + metadata: metadata, + retry_policy: @config.rpcs.reschedule_maintenance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @memorystore_stub.call_rpc :reschedule_maintenance, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all backup collections owned by a consumer project in either the + # specified location (region) or all locations. + # + # If `location_id` is specified as `-` (wildcard), then all regions + # available to the project are queried, and the results are aggregated. + # + # @overload list_backup_collections(request, options = nil) + # Pass arguments to `list_backup_collections` via a request object, either of type + # {::Google::Cloud::Memorystore::V1::ListBackupCollectionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1::ListBackupCollectionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_backup_collections(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_backup_collections` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the backupCollection location using the + # form: + # `projects/{project_id}/locations/{location_id}` + # where `location_id` refers to a Google Cloud region. + # @param page_size [::Integer] + # Optional. The maximum number of items to return. + # + # If not specified, a default value of 1000 will be used by the service. + # Regardless of the page_size value, the response may include a partial list + # and a caller should only rely on response's + # {::Google::Cloud::Memorystore::V1::ListBackupCollectionsResponse#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. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Memorystore::V1::BackupCollection>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Memorystore::V1::BackupCollection>] + # + # @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::ListBackupCollectionsRequest.new + # + # # Call the list_backup_collections method. + # result = client.list_backup_collections request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Memorystore::V1::BackupCollection. + # p item + # end + # + def list_backup_collections request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1::ListBackupCollectionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_backup_collections.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Memorystore::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.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_backup_collections.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_backup_collections.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @memorystore_stub.call_rpc :list_backup_collections, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @memorystore_stub, :list_backup_collections, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Get a backup collection. + # + # @overload get_backup_collection(request, options = nil) + # Pass arguments to `get_backup_collection` via a request object, either of type + # {::Google::Cloud::Memorystore::V1::GetBackupCollectionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1::GetBackupCollectionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_backup_collection(name: nil) + # Pass arguments to `get_backup_collection` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Instance backupCollection resource name using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}` + # where `location_id` refers to a Google Cloud region. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Memorystore::V1::BackupCollection] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Memorystore::V1::BackupCollection] + # + # @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::GetBackupCollectionRequest.new + # + # # Call the get_backup_collection method. + # result = client.get_backup_collection request + # + # # The returned object is of type Google::Cloud::Memorystore::V1::BackupCollection. + # p result + # + def get_backup_collection request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1::GetBackupCollectionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_backup_collection.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Memorystore::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.get_backup_collection.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_backup_collection.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @memorystore_stub.call_rpc :get_backup_collection, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all backups owned by a backup collection. + # + # @overload list_backups(request, options = nil) + # Pass arguments to `list_backups` via a request object, either of type + # {::Google::Cloud::Memorystore::V1::ListBackupsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1::ListBackupsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_backups(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_backups` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the backupCollection using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}` + # @param page_size [::Integer] + # Optional. The maximum number of items to return. + # + # If not specified, a default value of 1000 will be used by the service. + # Regardless of the page_size value, the response may include a partial list + # and a caller should only rely on response's + # {::Google::Cloud::Memorystore::V1::ListBackupsResponse#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. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Memorystore::V1::Backup>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Memorystore::V1::Backup>] + # + # @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::ListBackupsRequest.new + # + # # Call the list_backups method. + # result = client.list_backups request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Memorystore::V1::Backup. + # p item + # end + # + def list_backups request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1::ListBackupsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_backups.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Memorystore::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.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_backups.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_backups.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @memorystore_stub.call_rpc :list_backups, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @memorystore_stub, :list_backups, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the details of a specific backup. + # + # @overload get_backup(request, options = nil) + # Pass arguments to `get_backup` via a request object, either of type + # {::Google::Cloud::Memorystore::V1::GetBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1::GetBackupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_backup(name: nil) + # Pass arguments to `get_backup` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Instance backup resource name using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Memorystore::V1::Backup] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Memorystore::V1::Backup] + # + # @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::GetBackupRequest.new + # + # # Call the get_backup method. + # result = client.get_backup request + # + # # The returned object is of type Google::Cloud::Memorystore::V1::Backup. + # p result + # + def get_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1::GetBackupRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_backup.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Memorystore::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.get_backup.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_backup.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @memorystore_stub.call_rpc :get_backup, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a specific backup. + # + # @overload delete_backup(request, options = nil) + # Pass arguments to `delete_backup` via a request object, either of type + # {::Google::Cloud::Memorystore::V1::DeleteBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1::DeleteBackupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_backup(name: nil, request_id: nil) + # Pass arguments to `delete_backup` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Instance backup resource name using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` + # @param request_id [::String] + # Optional. Idempotent request UUID. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/memorystore/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::DeleteBackupRequest.new + # + # # Call the delete_backup method. + # result = client.delete_backup request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1::DeleteBackupRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_backup.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Memorystore::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.delete_backup.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_backup.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @memorystore_stub.call_rpc :delete_backup, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Exports a specific backup to a customer target Cloud Storage URI. + # + # @overload export_backup(request, options = nil) + # Pass arguments to `export_backup` via a request object, either of type + # {::Google::Cloud::Memorystore::V1::ExportBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1::ExportBackupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload export_backup(gcs_bucket: nil, name: nil) + # Pass arguments to `export_backup` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param gcs_bucket [::String] + # Google Cloud Storage bucket, like "my-bucket". + # @param name [::String] + # Required. Instance backup resource name using the form: + # `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/memorystore/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::ExportBackupRequest.new + # + # # Call the export_backup method. + # result = client.export_backup request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def export_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1::ExportBackupRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.export_backup.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Memorystore::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.export_backup.timeout, + metadata: metadata, + retry_policy: @config.rpcs.export_backup.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @memorystore_stub.call_rpc :export_backup, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Backup Instance. + # If this is the first time a backup is being created, a backup collection + # will be created at the backend, and this backup belongs to this collection. + # Both collection and backup will have a resource name. Backup will be + # executed for each shard. A replica (primary if nonHA) will be selected to + # perform the execution. Backup call will be rejected if there is an ongoing + # backup or update operation. Be aware that during preview, if the instance's + # internal software version is too old, critical update will be performed + # before actual backup. Once the internal software version is updated to the + # minimum version required by the backup feature, subsequent backups will not + # require critical update. After preview, there will be no critical update + # needed for backup. + # + # @overload backup_instance(request, options = nil) + # Pass arguments to `backup_instance` via a request object, either of type + # {::Google::Cloud::Memorystore::V1::BackupInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memorystore::V1::BackupInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload backup_instance(name: nil, ttl: nil, backup_id: nil) + # Pass arguments to `backup_instance` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a Google Cloud region. + # @param ttl [::Google::Protobuf::Duration, ::Hash] + # Optional. TTL for the backup to expire. Value range is 1 day to 100 years. + # If not specified, the default value is 100 years. + # @param backup_id [::String] + # Optional. The id of the backup to be created. If not specified, the + # default value ([YYYYMMDDHHMMSS]_[Shortened Instance UID] is used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/memorystore/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::BackupInstanceRequest.new + # + # # Call the backup_instance method. + # result = client.backup_instance request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def backup_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1::BackupInstanceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.backup_instance.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Memorystore::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.backup_instance.timeout, + metadata: metadata, + retry_policy: @config.rpcs.backup_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @memorystore_stub.call_rpc :backup_instance, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Memorystore API. + # + # This class represents the configuration for Memorystore, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Memorystore::V1::Memorystore::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_instances to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Memorystore::V1::Memorystore::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_instances.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Memorystore::V1::Memorystore::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_instances.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Memorystore::V1::Memorystore::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "memorystore.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Memorystore API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_instances` + # @return [::Gapic::Config::Method] + # + attr_reader :list_instances + ## + # RPC-specific configuration for `get_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :get_instance + ## + # RPC-specific configuration for `create_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :create_instance + ## + # RPC-specific configuration for `update_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :update_instance + ## + # RPC-specific configuration for `delete_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_instance + ## + # RPC-specific configuration for `get_certificate_authority` + # @return [::Gapic::Config::Method] + # + attr_reader :get_certificate_authority + ## + # RPC-specific configuration for `get_shared_regional_certificate_authority` + # @return [::Gapic::Config::Method] + # + attr_reader :get_shared_regional_certificate_authority + ## + # RPC-specific configuration for `reschedule_maintenance` + # @return [::Gapic::Config::Method] + # + attr_reader :reschedule_maintenance + ## + # RPC-specific configuration for `list_backup_collections` + # @return [::Gapic::Config::Method] + # + attr_reader :list_backup_collections + ## + # RPC-specific configuration for `get_backup_collection` + # @return [::Gapic::Config::Method] + # + attr_reader :get_backup_collection + ## + # RPC-specific configuration for `list_backups` + # @return [::Gapic::Config::Method] + # + attr_reader :list_backups + ## + # RPC-specific configuration for `get_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :get_backup + ## + # RPC-specific configuration for `delete_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_backup + ## + # RPC-specific configuration for `export_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :export_backup + ## + # RPC-specific configuration for `backup_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :backup_instance + + # @private + def initialize parent_rpcs = nil + list_instances_config = parent_rpcs.list_instances if parent_rpcs.respond_to? :list_instances + @list_instances = ::Gapic::Config::Method.new list_instances_config + get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance + @get_instance = ::Gapic::Config::Method.new get_instance_config + create_instance_config = parent_rpcs.create_instance if parent_rpcs.respond_to? :create_instance + @create_instance = ::Gapic::Config::Method.new create_instance_config + update_instance_config = parent_rpcs.update_instance if parent_rpcs.respond_to? :update_instance + @update_instance = ::Gapic::Config::Method.new update_instance_config + delete_instance_config = parent_rpcs.delete_instance if parent_rpcs.respond_to? :delete_instance + @delete_instance = ::Gapic::Config::Method.new delete_instance_config + get_certificate_authority_config = parent_rpcs.get_certificate_authority if parent_rpcs.respond_to? :get_certificate_authority + @get_certificate_authority = ::Gapic::Config::Method.new get_certificate_authority_config + get_shared_regional_certificate_authority_config = parent_rpcs.get_shared_regional_certificate_authority if parent_rpcs.respond_to? :get_shared_regional_certificate_authority + @get_shared_regional_certificate_authority = ::Gapic::Config::Method.new get_shared_regional_certificate_authority_config + reschedule_maintenance_config = parent_rpcs.reschedule_maintenance if parent_rpcs.respond_to? :reschedule_maintenance + @reschedule_maintenance = ::Gapic::Config::Method.new reschedule_maintenance_config + list_backup_collections_config = parent_rpcs.list_backup_collections if parent_rpcs.respond_to? :list_backup_collections + @list_backup_collections = ::Gapic::Config::Method.new list_backup_collections_config + get_backup_collection_config = parent_rpcs.get_backup_collection if parent_rpcs.respond_to? :get_backup_collection + @get_backup_collection = ::Gapic::Config::Method.new get_backup_collection_config + list_backups_config = parent_rpcs.list_backups if parent_rpcs.respond_to? :list_backups + @list_backups = ::Gapic::Config::Method.new list_backups_config + get_backup_config = parent_rpcs.get_backup if parent_rpcs.respond_to? :get_backup + @get_backup = ::Gapic::Config::Method.new get_backup_config + delete_backup_config = parent_rpcs.delete_backup if parent_rpcs.respond_to? :delete_backup + @delete_backup = ::Gapic::Config::Method.new delete_backup_config + export_backup_config = parent_rpcs.export_backup if parent_rpcs.respond_to? :export_backup + @export_backup = ::Gapic::Config::Method.new export_backup_config + backup_instance_config = parent_rpcs.backup_instance if parent_rpcs.respond_to? :backup_instance + @backup_instance = ::Gapic::Config::Method.new backup_instance_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/google-cloud-memorystore-v1/lib/google/cloud/memorystore/v1/memorystore/operations.rb b/google-cloud-memorystore-v1/lib/google/cloud/memorystore/v1/memorystore/operations.rb new file mode 100644 index 000000000000..c48c0773b69a --- /dev/null +++ b/google-cloud-memorystore-v1/lib/google/cloud/memorystore/v1/memorystore/operations.rb @@ -0,0 +1,841 @@ +# 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! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module Memorystore + module V1 + module Memorystore + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "memorystore.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the Memorystore Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the Memorystore Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) + # Pass arguments to `list_operations` 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] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.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.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` 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] + # The name of the operation resource. + # + # @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/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation 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 get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.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.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` 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] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.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.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::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 cancel_operation(name: nil) + # Pass arguments to `cancel_operation` 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] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # 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.cancel_operation.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.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::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 wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` 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] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation 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 wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # 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.wait_operation.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 + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, 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 Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "memorystore.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + 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 e556abc53ee6..4be46c6ec581 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\"\xe9\'\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\"w\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\"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\"\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" pool = ::Google::Protobuf::DescriptorPool.generated_pool pool.add_serialized_file(descriptor_data) diff --git a/google-cloud-memorystore-v1/proto_docs/google/api/client.rb b/google-cloud-memorystore-v1/proto_docs/google/api/client.rb index a8b1b06d1cad..c58739e32368 100644 --- a/google-cloud-memorystore-v1/proto_docs/google/api/client.rb +++ b/google-cloud-memorystore-v1/proto_docs/google/api/client.rb @@ -31,6 +31,8 @@ module Api # @!attribute [rw] selective_gapic_generation # @return [::Google::Api::SelectiveGapicGeneration] # Configuration for which RPCs should be generated in the GAPIC client. + # + # Note: This field should not be used in most cases. class CommonLanguageSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -441,6 +443,8 @@ class LongRunning # This message is used to configure the generation of a subset of the RPCs in # a service for client libraries. + # + # Note: This feature should not be used in most cases. # @!attribute [rw] methods # @return [::Array<::String>] # An allowlist of the fully qualified names of RPCs that should be included diff --git a/google-cloud-memorystore-v1/proto_docs/google/cloud/memorystore/v1/memorystore.rb b/google-cloud-memorystore-v1/proto_docs/google/cloud/memorystore/v1/memorystore.rb index 44b2dc3aa075..01ef7603c95e 100644 --- a/google-cloud-memorystore-v1/proto_docs/google/cloud/memorystore/v1/memorystore.rb +++ b/google-cloud-memorystore-v1/proto_docs/google/cloud/memorystore/v1/memorystore.rb @@ -349,6 +349,24 @@ module NodeType # Standard small. STANDARD_SMALL = 4 + + # Custom micro. + CUSTOM_MICRO = 5 + + # Custom mini. + CUSTOM_MINI = 6 + + # High cpu medium. + HIGHCPU_MEDIUM = 7 + + # Standard large. + STANDARD_LARGE = 8 + + # High memory 2x large. + HIGHMEM_2XLARGE = 9 + + # Custom pico. + CUSTOM_PICO = 10 end # The mode config, which is used to enable/disable cluster mode. @@ -1347,7 +1365,7 @@ class RegionalCertChain end # Request for - # {::Google::Cloud::Memorystore::V1::Memorystore::Rest::Client#get_shared_regional_certificate_authority GetSharedRegionalCertificateAuthority}. + # {::Google::Cloud::Memorystore::V1::Memorystore::Client#get_shared_regional_certificate_authority GetSharedRegionalCertificateAuthority}. # @!attribute [rw] name # @return [::String] # Required. Regional certificate authority resource name using the form: diff --git a/google-cloud-memorystore-v1/snippets/memorystore/backup_instance.rb b/google-cloud-memorystore-v1/snippets/memorystore/backup_instance.rb index 71a4b014803c..ddeba7c5a2ab 100644 --- a/google-cloud-memorystore-v1/snippets/memorystore/backup_instance.rb +++ b/google-cloud-memorystore-v1/snippets/memorystore/backup_instance.rb @@ -29,11 +29,11 @@ # 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::Rest::Client#backup_instance. +# Google::Cloud::Memorystore::V1::Memorystore::Client#backup_instance. # def backup_instance # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new + client = Google::Cloud::Memorystore::V1::Memorystore::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Memorystore::V1::BackupInstanceRequest.new diff --git a/google-cloud-memorystore-v1/snippets/memorystore/create_instance.rb b/google-cloud-memorystore-v1/snippets/memorystore/create_instance.rb index 9b4430cbaf96..ccfcf986755b 100644 --- a/google-cloud-memorystore-v1/snippets/memorystore/create_instance.rb +++ b/google-cloud-memorystore-v1/snippets/memorystore/create_instance.rb @@ -29,11 +29,11 @@ # 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::Rest::Client#create_instance. +# Google::Cloud::Memorystore::V1::Memorystore::Client#create_instance. # def create_instance # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new + client = Google::Cloud::Memorystore::V1::Memorystore::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Memorystore::V1::CreateInstanceRequest.new diff --git a/google-cloud-memorystore-v1/snippets/memorystore/delete_backup.rb b/google-cloud-memorystore-v1/snippets/memorystore/delete_backup.rb index c635d34349d9..b1afa4629570 100644 --- a/google-cloud-memorystore-v1/snippets/memorystore/delete_backup.rb +++ b/google-cloud-memorystore-v1/snippets/memorystore/delete_backup.rb @@ -29,11 +29,11 @@ # 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::Rest::Client#delete_backup. +# Google::Cloud::Memorystore::V1::Memorystore::Client#delete_backup. # def delete_backup # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new + client = Google::Cloud::Memorystore::V1::Memorystore::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Memorystore::V1::DeleteBackupRequest.new diff --git a/google-cloud-memorystore-v1/snippets/memorystore/delete_instance.rb b/google-cloud-memorystore-v1/snippets/memorystore/delete_instance.rb index 73e554eddd38..1357d9fc0908 100644 --- a/google-cloud-memorystore-v1/snippets/memorystore/delete_instance.rb +++ b/google-cloud-memorystore-v1/snippets/memorystore/delete_instance.rb @@ -29,11 +29,11 @@ # 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::Rest::Client#delete_instance. +# Google::Cloud::Memorystore::V1::Memorystore::Client#delete_instance. # def delete_instance # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new + client = Google::Cloud::Memorystore::V1::Memorystore::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Memorystore::V1::DeleteInstanceRequest.new diff --git a/google-cloud-memorystore-v1/snippets/memorystore/export_backup.rb b/google-cloud-memorystore-v1/snippets/memorystore/export_backup.rb index d7063b5acd27..b0f9e8a4e3e8 100644 --- a/google-cloud-memorystore-v1/snippets/memorystore/export_backup.rb +++ b/google-cloud-memorystore-v1/snippets/memorystore/export_backup.rb @@ -29,11 +29,11 @@ # 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::Rest::Client#export_backup. +# Google::Cloud::Memorystore::V1::Memorystore::Client#export_backup. # def export_backup # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new + client = Google::Cloud::Memorystore::V1::Memorystore::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Memorystore::V1::ExportBackupRequest.new diff --git a/google-cloud-memorystore-v1/snippets/memorystore/get_backup.rb b/google-cloud-memorystore-v1/snippets/memorystore/get_backup.rb index a1b1f71319ff..2e6ab99c689d 100644 --- a/google-cloud-memorystore-v1/snippets/memorystore/get_backup.rb +++ b/google-cloud-memorystore-v1/snippets/memorystore/get_backup.rb @@ -29,11 +29,11 @@ # 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::Rest::Client#get_backup. +# Google::Cloud::Memorystore::V1::Memorystore::Client#get_backup. # def get_backup # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new + client = Google::Cloud::Memorystore::V1::Memorystore::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Memorystore::V1::GetBackupRequest.new diff --git a/google-cloud-memorystore-v1/snippets/memorystore/get_backup_collection.rb b/google-cloud-memorystore-v1/snippets/memorystore/get_backup_collection.rb index f32b0334c2c4..86a3e0fcdaff 100644 --- a/google-cloud-memorystore-v1/snippets/memorystore/get_backup_collection.rb +++ b/google-cloud-memorystore-v1/snippets/memorystore/get_backup_collection.rb @@ -29,11 +29,11 @@ # 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::Rest::Client#get_backup_collection. +# Google::Cloud::Memorystore::V1::Memorystore::Client#get_backup_collection. # def get_backup_collection # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new + client = Google::Cloud::Memorystore::V1::Memorystore::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Memorystore::V1::GetBackupCollectionRequest.new diff --git a/google-cloud-memorystore-v1/snippets/memorystore/get_certificate_authority.rb b/google-cloud-memorystore-v1/snippets/memorystore/get_certificate_authority.rb index f6d9b00a38d4..490cbd5d7212 100644 --- a/google-cloud-memorystore-v1/snippets/memorystore/get_certificate_authority.rb +++ b/google-cloud-memorystore-v1/snippets/memorystore/get_certificate_authority.rb @@ -29,11 +29,11 @@ # 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::Rest::Client#get_certificate_authority. +# Google::Cloud::Memorystore::V1::Memorystore::Client#get_certificate_authority. # def get_certificate_authority # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new + client = Google::Cloud::Memorystore::V1::Memorystore::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Memorystore::V1::GetCertificateAuthorityRequest.new diff --git a/google-cloud-memorystore-v1/snippets/memorystore/get_instance.rb b/google-cloud-memorystore-v1/snippets/memorystore/get_instance.rb index d51d10e6bd4b..bf0c09cb9f0c 100644 --- a/google-cloud-memorystore-v1/snippets/memorystore/get_instance.rb +++ b/google-cloud-memorystore-v1/snippets/memorystore/get_instance.rb @@ -29,11 +29,11 @@ # 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::Rest::Client#get_instance. +# Google::Cloud::Memorystore::V1::Memorystore::Client#get_instance. # def get_instance # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new + client = Google::Cloud::Memorystore::V1::Memorystore::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Memorystore::V1::GetInstanceRequest.new diff --git a/google-cloud-memorystore-v1/snippets/memorystore/get_shared_regional_certificate_authority.rb b/google-cloud-memorystore-v1/snippets/memorystore/get_shared_regional_certificate_authority.rb index 12874c3e2d45..51b745132e2a 100644 --- a/google-cloud-memorystore-v1/snippets/memorystore/get_shared_regional_certificate_authority.rb +++ b/google-cloud-memorystore-v1/snippets/memorystore/get_shared_regional_certificate_authority.rb @@ -29,11 +29,11 @@ # 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::Rest::Client#get_shared_regional_certificate_authority. +# Google::Cloud::Memorystore::V1::Memorystore::Client#get_shared_regional_certificate_authority. # def get_shared_regional_certificate_authority # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new + client = Google::Cloud::Memorystore::V1::Memorystore::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Memorystore::V1::GetSharedRegionalCertificateAuthorityRequest.new diff --git a/google-cloud-memorystore-v1/snippets/memorystore/list_backup_collections.rb b/google-cloud-memorystore-v1/snippets/memorystore/list_backup_collections.rb index 0ef2ee4e631b..5e193db17857 100644 --- a/google-cloud-memorystore-v1/snippets/memorystore/list_backup_collections.rb +++ b/google-cloud-memorystore-v1/snippets/memorystore/list_backup_collections.rb @@ -29,11 +29,11 @@ # 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::Rest::Client#list_backup_collections. +# Google::Cloud::Memorystore::V1::Memorystore::Client#list_backup_collections. # def list_backup_collections # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new + client = Google::Cloud::Memorystore::V1::Memorystore::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Memorystore::V1::ListBackupCollectionsRequest.new diff --git a/google-cloud-memorystore-v1/snippets/memorystore/list_backups.rb b/google-cloud-memorystore-v1/snippets/memorystore/list_backups.rb index b6542756e547..43ded86c53ad 100644 --- a/google-cloud-memorystore-v1/snippets/memorystore/list_backups.rb +++ b/google-cloud-memorystore-v1/snippets/memorystore/list_backups.rb @@ -29,11 +29,11 @@ # 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::Rest::Client#list_backups. +# Google::Cloud::Memorystore::V1::Memorystore::Client#list_backups. # def list_backups # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new + client = Google::Cloud::Memorystore::V1::Memorystore::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Memorystore::V1::ListBackupsRequest.new diff --git a/google-cloud-memorystore-v1/snippets/memorystore/list_instances.rb b/google-cloud-memorystore-v1/snippets/memorystore/list_instances.rb index b90d3047ee64..884d851fe1bf 100644 --- a/google-cloud-memorystore-v1/snippets/memorystore/list_instances.rb +++ b/google-cloud-memorystore-v1/snippets/memorystore/list_instances.rb @@ -29,11 +29,11 @@ # 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::Rest::Client#list_instances. +# Google::Cloud::Memorystore::V1::Memorystore::Client#list_instances. # def list_instances # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new + client = Google::Cloud::Memorystore::V1::Memorystore::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Memorystore::V1::ListInstancesRequest.new diff --git a/google-cloud-memorystore-v1/snippets/memorystore/reschedule_maintenance.rb b/google-cloud-memorystore-v1/snippets/memorystore/reschedule_maintenance.rb index e3c1e03192df..34e5f57523aa 100644 --- a/google-cloud-memorystore-v1/snippets/memorystore/reschedule_maintenance.rb +++ b/google-cloud-memorystore-v1/snippets/memorystore/reschedule_maintenance.rb @@ -29,11 +29,11 @@ # 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::Rest::Client#reschedule_maintenance. +# Google::Cloud::Memorystore::V1::Memorystore::Client#reschedule_maintenance. # def reschedule_maintenance # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new + client = Google::Cloud::Memorystore::V1::Memorystore::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Memorystore::V1::RescheduleMaintenanceRequest.new diff --git a/google-cloud-memorystore-v1/snippets/memorystore/update_instance.rb b/google-cloud-memorystore-v1/snippets/memorystore/update_instance.rb index 97a9bdb0a219..ba828f468e92 100644 --- a/google-cloud-memorystore-v1/snippets/memorystore/update_instance.rb +++ b/google-cloud-memorystore-v1/snippets/memorystore/update_instance.rb @@ -29,11 +29,11 @@ # 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::Rest::Client#update_instance. +# Google::Cloud::Memorystore::V1::Memorystore::Client#update_instance. # def update_instance # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new + client = Google::Cloud::Memorystore::V1::Memorystore::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Memorystore::V1::UpdateInstanceRequest.new 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 e9da1b2560ee..77fa356e651f 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 @@ -14,12 +14,12 @@ { "region_tag": "memorystore_v1_generated_Memorystore_ListInstances_sync", "title": "Snippet for the list_instances call in the Memorystore service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Memorystore::V1::Memorystore::Rest::Client#list_instances.", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Memorystore::V1::Memorystore::Client#list_instances.", "file": "memorystore/list_instances.rb", "language": "RUBY", "client_method": { "short_name": "list_instances", - "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Rest::Client#list_instances", + "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Client#list_instances", "async": false, "parameters": [ { @@ -29,8 +29,8 @@ ], "result_type": "::Google::Cloud::Memorystore::V1::ListInstancesResponse", "client": { - "short_name": "Memorystore::Rest::Client", - "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Rest::Client" + "short_name": "Memorystore::Client", + "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Client" }, "method": { "short_name": "ListInstances", @@ -54,12 +54,12 @@ { "region_tag": "memorystore_v1_generated_Memorystore_GetInstance_sync", "title": "Snippet for the get_instance call in the Memorystore service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Memorystore::V1::Memorystore::Rest::Client#get_instance.", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Memorystore::V1::Memorystore::Client#get_instance.", "file": "memorystore/get_instance.rb", "language": "RUBY", "client_method": { "short_name": "get_instance", - "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Rest::Client#get_instance", + "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Client#get_instance", "async": false, "parameters": [ { @@ -69,8 +69,8 @@ ], "result_type": "::Google::Cloud::Memorystore::V1::Instance", "client": { - "short_name": "Memorystore::Rest::Client", - "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Rest::Client" + "short_name": "Memorystore::Client", + "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Client" }, "method": { "short_name": "GetInstance", @@ -94,12 +94,12 @@ { "region_tag": "memorystore_v1_generated_Memorystore_CreateInstance_sync", "title": "Snippet for the create_instance call in the Memorystore service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Memorystore::V1::Memorystore::Rest::Client#create_instance.", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Memorystore::V1::Memorystore::Client#create_instance.", "file": "memorystore/create_instance.rb", "language": "RUBY", "client_method": { "short_name": "create_instance", - "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Rest::Client#create_instance", + "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Client#create_instance", "async": false, "parameters": [ { @@ -109,8 +109,8 @@ ], "result_type": "::Google::Longrunning::Operation", "client": { - "short_name": "Memorystore::Rest::Client", - "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Rest::Client" + "short_name": "Memorystore::Client", + "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Client" }, "method": { "short_name": "CreateInstance", @@ -134,12 +134,12 @@ { "region_tag": "memorystore_v1_generated_Memorystore_UpdateInstance_sync", "title": "Snippet for the update_instance call in the Memorystore service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Memorystore::V1::Memorystore::Rest::Client#update_instance.", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Memorystore::V1::Memorystore::Client#update_instance.", "file": "memorystore/update_instance.rb", "language": "RUBY", "client_method": { "short_name": "update_instance", - "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Rest::Client#update_instance", + "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Client#update_instance", "async": false, "parameters": [ { @@ -149,8 +149,8 @@ ], "result_type": "::Google::Longrunning::Operation", "client": { - "short_name": "Memorystore::Rest::Client", - "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Rest::Client" + "short_name": "Memorystore::Client", + "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Client" }, "method": { "short_name": "UpdateInstance", @@ -174,12 +174,12 @@ { "region_tag": "memorystore_v1_generated_Memorystore_DeleteInstance_sync", "title": "Snippet for the delete_instance call in the Memorystore service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Memorystore::V1::Memorystore::Rest::Client#delete_instance.", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Memorystore::V1::Memorystore::Client#delete_instance.", "file": "memorystore/delete_instance.rb", "language": "RUBY", "client_method": { "short_name": "delete_instance", - "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Rest::Client#delete_instance", + "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Client#delete_instance", "async": false, "parameters": [ { @@ -189,8 +189,8 @@ ], "result_type": "::Google::Longrunning::Operation", "client": { - "short_name": "Memorystore::Rest::Client", - "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Rest::Client" + "short_name": "Memorystore::Client", + "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Client" }, "method": { "short_name": "DeleteInstance", @@ -214,12 +214,12 @@ { "region_tag": "memorystore_v1_generated_Memorystore_GetCertificateAuthority_sync", "title": "Snippet for the get_certificate_authority call in the Memorystore service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Memorystore::V1::Memorystore::Rest::Client#get_certificate_authority.", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Memorystore::V1::Memorystore::Client#get_certificate_authority.", "file": "memorystore/get_certificate_authority.rb", "language": "RUBY", "client_method": { "short_name": "get_certificate_authority", - "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Rest::Client#get_certificate_authority", + "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Client#get_certificate_authority", "async": false, "parameters": [ { @@ -229,8 +229,8 @@ ], "result_type": "::Google::Cloud::Memorystore::V1::CertificateAuthority", "client": { - "short_name": "Memorystore::Rest::Client", - "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Rest::Client" + "short_name": "Memorystore::Client", + "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Client" }, "method": { "short_name": "GetCertificateAuthority", @@ -254,12 +254,12 @@ { "region_tag": "memorystore_v1_generated_Memorystore_GetSharedRegionalCertificateAuthority_sync", "title": "Snippet for the get_shared_regional_certificate_authority call in the Memorystore service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Memorystore::V1::Memorystore::Rest::Client#get_shared_regional_certificate_authority.", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Memorystore::V1::Memorystore::Client#get_shared_regional_certificate_authority.", "file": "memorystore/get_shared_regional_certificate_authority.rb", "language": "RUBY", "client_method": { "short_name": "get_shared_regional_certificate_authority", - "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Rest::Client#get_shared_regional_certificate_authority", + "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Client#get_shared_regional_certificate_authority", "async": false, "parameters": [ { @@ -269,8 +269,8 @@ ], "result_type": "::Google::Cloud::Memorystore::V1::SharedRegionalCertificateAuthority", "client": { - "short_name": "Memorystore::Rest::Client", - "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Rest::Client" + "short_name": "Memorystore::Client", + "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Client" }, "method": { "short_name": "GetSharedRegionalCertificateAuthority", @@ -294,12 +294,12 @@ { "region_tag": "memorystore_v1_generated_Memorystore_RescheduleMaintenance_sync", "title": "Snippet for the reschedule_maintenance call in the Memorystore service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Memorystore::V1::Memorystore::Rest::Client#reschedule_maintenance.", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Memorystore::V1::Memorystore::Client#reschedule_maintenance.", "file": "memorystore/reschedule_maintenance.rb", "language": "RUBY", "client_method": { "short_name": "reschedule_maintenance", - "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Rest::Client#reschedule_maintenance", + "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Client#reschedule_maintenance", "async": false, "parameters": [ { @@ -309,8 +309,8 @@ ], "result_type": "::Google::Longrunning::Operation", "client": { - "short_name": "Memorystore::Rest::Client", - "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Rest::Client" + "short_name": "Memorystore::Client", + "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Client" }, "method": { "short_name": "RescheduleMaintenance", @@ -334,12 +334,12 @@ { "region_tag": "memorystore_v1_generated_Memorystore_ListBackupCollections_sync", "title": "Snippet for the list_backup_collections call in the Memorystore service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Memorystore::V1::Memorystore::Rest::Client#list_backup_collections.", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Memorystore::V1::Memorystore::Client#list_backup_collections.", "file": "memorystore/list_backup_collections.rb", "language": "RUBY", "client_method": { "short_name": "list_backup_collections", - "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Rest::Client#list_backup_collections", + "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Client#list_backup_collections", "async": false, "parameters": [ { @@ -349,8 +349,8 @@ ], "result_type": "::Google::Cloud::Memorystore::V1::ListBackupCollectionsResponse", "client": { - "short_name": "Memorystore::Rest::Client", - "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Rest::Client" + "short_name": "Memorystore::Client", + "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Client" }, "method": { "short_name": "ListBackupCollections", @@ -374,12 +374,12 @@ { "region_tag": "memorystore_v1_generated_Memorystore_GetBackupCollection_sync", "title": "Snippet for the get_backup_collection call in the Memorystore service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Memorystore::V1::Memorystore::Rest::Client#get_backup_collection.", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Memorystore::V1::Memorystore::Client#get_backup_collection.", "file": "memorystore/get_backup_collection.rb", "language": "RUBY", "client_method": { "short_name": "get_backup_collection", - "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Rest::Client#get_backup_collection", + "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Client#get_backup_collection", "async": false, "parameters": [ { @@ -389,8 +389,8 @@ ], "result_type": "::Google::Cloud::Memorystore::V1::BackupCollection", "client": { - "short_name": "Memorystore::Rest::Client", - "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Rest::Client" + "short_name": "Memorystore::Client", + "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Client" }, "method": { "short_name": "GetBackupCollection", @@ -414,12 +414,12 @@ { "region_tag": "memorystore_v1_generated_Memorystore_ListBackups_sync", "title": "Snippet for the list_backups call in the Memorystore service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Memorystore::V1::Memorystore::Rest::Client#list_backups.", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Memorystore::V1::Memorystore::Client#list_backups.", "file": "memorystore/list_backups.rb", "language": "RUBY", "client_method": { "short_name": "list_backups", - "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Rest::Client#list_backups", + "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Client#list_backups", "async": false, "parameters": [ { @@ -429,8 +429,8 @@ ], "result_type": "::Google::Cloud::Memorystore::V1::ListBackupsResponse", "client": { - "short_name": "Memorystore::Rest::Client", - "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Rest::Client" + "short_name": "Memorystore::Client", + "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Client" }, "method": { "short_name": "ListBackups", @@ -454,12 +454,12 @@ { "region_tag": "memorystore_v1_generated_Memorystore_GetBackup_sync", "title": "Snippet for the get_backup call in the Memorystore service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Memorystore::V1::Memorystore::Rest::Client#get_backup.", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Memorystore::V1::Memorystore::Client#get_backup.", "file": "memorystore/get_backup.rb", "language": "RUBY", "client_method": { "short_name": "get_backup", - "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Rest::Client#get_backup", + "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Client#get_backup", "async": false, "parameters": [ { @@ -469,8 +469,8 @@ ], "result_type": "::Google::Cloud::Memorystore::V1::Backup", "client": { - "short_name": "Memorystore::Rest::Client", - "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Rest::Client" + "short_name": "Memorystore::Client", + "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Client" }, "method": { "short_name": "GetBackup", @@ -494,12 +494,12 @@ { "region_tag": "memorystore_v1_generated_Memorystore_DeleteBackup_sync", "title": "Snippet for the delete_backup call in the Memorystore service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Memorystore::V1::Memorystore::Rest::Client#delete_backup.", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Memorystore::V1::Memorystore::Client#delete_backup.", "file": "memorystore/delete_backup.rb", "language": "RUBY", "client_method": { "short_name": "delete_backup", - "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Rest::Client#delete_backup", + "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Client#delete_backup", "async": false, "parameters": [ { @@ -509,8 +509,8 @@ ], "result_type": "::Google::Longrunning::Operation", "client": { - "short_name": "Memorystore::Rest::Client", - "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Rest::Client" + "short_name": "Memorystore::Client", + "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Client" }, "method": { "short_name": "DeleteBackup", @@ -534,12 +534,12 @@ { "region_tag": "memorystore_v1_generated_Memorystore_ExportBackup_sync", "title": "Snippet for the export_backup call in the Memorystore service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Memorystore::V1::Memorystore::Rest::Client#export_backup.", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Memorystore::V1::Memorystore::Client#export_backup.", "file": "memorystore/export_backup.rb", "language": "RUBY", "client_method": { "short_name": "export_backup", - "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Rest::Client#export_backup", + "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Client#export_backup", "async": false, "parameters": [ { @@ -549,8 +549,8 @@ ], "result_type": "::Google::Longrunning::Operation", "client": { - "short_name": "Memorystore::Rest::Client", - "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Rest::Client" + "short_name": "Memorystore::Client", + "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Client" }, "method": { "short_name": "ExportBackup", @@ -574,12 +574,12 @@ { "region_tag": "memorystore_v1_generated_Memorystore_BackupInstance_sync", "title": "Snippet for the backup_instance call in the Memorystore service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Memorystore::V1::Memorystore::Rest::Client#backup_instance.", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Memorystore::V1::Memorystore::Client#backup_instance.", "file": "memorystore/backup_instance.rb", "language": "RUBY", "client_method": { "short_name": "backup_instance", - "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Rest::Client#backup_instance", + "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Client#backup_instance", "async": false, "parameters": [ { @@ -589,8 +589,8 @@ ], "result_type": "::Google::Longrunning::Operation", "client": { - "short_name": "Memorystore::Rest::Client", - "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Rest::Client" + "short_name": "Memorystore::Client", + "full_name": "::Google::Cloud::Memorystore::V1::Memorystore::Client" }, "method": { "short_name": "BackupInstance", diff --git a/google-cloud-memorystore-v1/test/google/cloud/memorystore/v1/memorystore_operations_test.rb b/google-cloud-memorystore-v1/test/google/cloud/memorystore/v1/memorystore_operations_test.rb new file mode 100644 index 000000000000..3fd923ecf421 --- /dev/null +++ b/google-cloud-memorystore-v1/test/google/cloud/memorystore/v1/memorystore_operations_test.rb @@ -0,0 +1,400 @@ +# 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! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/memorystore/v1/memorystore_pb" +require "google/cloud/memorystore/v1/memorystore_services_pb" +require "google/cloud/memorystore/v1/memorystore" + +class ::Google::Cloud::Memorystore::V1::Memorystore::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.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" + filter = "hello world" + page_size = 42 + page_token = "hello world" + return_partial_success = true + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::Memorystore::V1::Memorystore::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # 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" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::Memorystore::V1::Memorystore::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ 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 + client.get_operation 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 + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ 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 + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::Memorystore::V1::Memorystore::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.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" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::Memorystore::V1::Memorystore::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # 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" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::Memorystore::V1::Memorystore::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) 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 + client.wait_operation name: name, timeout: timeout 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 + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) 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 + client.wait_operation({ name: name, timeout: timeout }, 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 + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), 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, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Memorystore::V1::Memorystore::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Memorystore::V1::Memorystore::Operations::Configuration, config + end +end 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 new file mode 100644 index 000000000000..32d904c82b4f --- /dev/null +++ b/google-cloud-memorystore-v1/test/google/cloud/memorystore/v1/memorystore_paths_test.rb @@ -0,0 +1,175 @@ +# 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! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/memorystore/v1/memorystore" + +class ::Google::Cloud::Memorystore::V1::Memorystore::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_backup_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Memorystore::V1::Memorystore::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.backup_path project: "value0", location: "value1", backup_collection: "value2", backup: "value3" + assert_equal "projects/value0/locations/value1/backupCollections/value2/backups/value3", path + end + end + + def test_backup_collection_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Memorystore::V1::Memorystore::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.backup_collection_path project: "value0", location: "value1", backup_collection: "value2" + assert_equal "projects/value0/locations/value1/backupCollections/value2", path + end + end + + def test_ca_pool_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Memorystore::V1::Memorystore::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.ca_pool_path project: "value0", location: "value1", ca_pool: "value2" + assert_equal "projects/value0/locations/value1/caPools/value2", path + end + end + + def test_crypto_key_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Memorystore::V1::Memorystore::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.crypto_key_path project: "value0", location: "value1", key_ring: "value2", crypto_key: "value3" + assert_equal "projects/value0/locations/value1/keyRings/value2/cryptoKeys/value3", path + end + end + + def test_crypto_key_version_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Memorystore::V1::Memorystore::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.crypto_key_version_path project: "value0", location: "value1", key_ring: "value2", crypto_key: "value3", crypto_key_version: "value4" + assert_equal "projects/value0/locations/value1/keyRings/value2/cryptoKeys/value3/cryptoKeyVersions/value4", path + end + end + + def test_forwarding_rule_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Memorystore::V1::Memorystore::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.forwarding_rule_path project: "value0", region: "value1", forwarding_rule: "value2" + assert_equal "projects/value0/regions/value1/forwardingRules/value2", path + end + end + + def test_instance_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.instance_path project: "value0", location: "value1", instance: "value2" + assert_equal "projects/value0/locations/value1/instances/value2", path + end + end + + def test_location_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.location_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1", path + end + end + + def test_network_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_path project: "value0", network: "value1" + assert_equal "projects/value0/global/networks/value1", 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 + client = ::Google::Cloud::Memorystore::V1::Memorystore::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.service_attachment_path project: "value0", region: "value1", service_attachment: "value2" + assert_equal "projects/value0/regions/value1/serviceAttachments/value2", path + end + end + + def test_shared_regional_certificate_authority_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.shared_regional_certificate_authority_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1/sharedRegionalCertificateAuthority", path + end + end +end 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 new file mode 100644 index 000000000000..6e962bd554d5 --- /dev/null +++ b/google-cloud-memorystore-v1/test/google/cloud/memorystore/v1/memorystore_test.rb @@ -0,0 +1,1080 @@ +# 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! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/memorystore/v1/memorystore_pb" +require "google/cloud/memorystore/v1/memorystore" + +class ::Google::Cloud::Memorystore::V1::Memorystore::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_instances + # Create GRPC objects. + grpc_response = ::Google::Cloud::Memorystore::V1::ListInstancesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + list_instances_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_instances, name + assert_kind_of ::Google::Cloud::Memorystore::V1::ListInstancesRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["order_by"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_instances_client_stub do + # Create client + client = ::Google::Cloud::Memorystore::V1::Memorystore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_instances({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_instances parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_instances ::Google::Cloud::Memorystore::V1::ListInstancesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_instances({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_instances(::Google::Cloud::Memorystore::V1::ListInstancesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_instances_client_stub.call_rpc_count + end + end + + def test_get_instance + # Create GRPC objects. + grpc_response = ::Google::Cloud::Memorystore::V1::Instance.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_instance, name + assert_kind_of ::Google::Cloud::Memorystore::V1::GetInstanceRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_instance_client_stub do + # Create client + client = ::Google::Cloud::Memorystore::V1::Memorystore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_instance({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_instance name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_instance ::Google::Cloud::Memorystore::V1::GetInstanceRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_instance({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_instance(::Google::Cloud::Memorystore::V1::GetInstanceRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_instance_client_stub.call_rpc_count + end + end + + def test_create_instance + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + instance_id = "hello world" + instance = {} + request_id = "hello world" + + create_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_instance, name + assert_kind_of ::Google::Cloud::Memorystore::V1::CreateInstanceRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["instance_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Memorystore::V1::Instance), request["instance"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_instance_client_stub do + # Create client + client = ::Google::Cloud::Memorystore::V1::Memorystore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_instance({ parent: parent, instance_id: instance_id, instance: instance, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_instance parent: parent, instance_id: instance_id, instance: instance, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_instance ::Google::Cloud::Memorystore::V1::CreateInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_instance({ parent: parent, instance_id: instance_id, instance: instance, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_instance(::Google::Cloud::Memorystore::V1::CreateInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_instance_client_stub.call_rpc_count + end + end + + def test_update_instance + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + update_mask = {} + instance = {} + request_id = "hello world" + + update_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_instance, name + assert_kind_of ::Google::Cloud::Memorystore::V1::UpdateInstanceRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Memorystore::V1::Instance), request["instance"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_instance_client_stub do + # Create client + client = ::Google::Cloud::Memorystore::V1::Memorystore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_instance({ update_mask: update_mask, instance: instance, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_instance update_mask: update_mask, instance: instance, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_instance ::Google::Cloud::Memorystore::V1::UpdateInstanceRequest.new(update_mask: update_mask, instance: instance, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_instance({ update_mask: update_mask, instance: instance, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_instance(::Google::Cloud::Memorystore::V1::UpdateInstanceRequest.new(update_mask: update_mask, instance: instance, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_instance_client_stub.call_rpc_count + end + end + + def test_delete_instance + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + request_id = "hello world" + + delete_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_instance, name + assert_kind_of ::Google::Cloud::Memorystore::V1::DeleteInstanceRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_instance_client_stub do + # Create client + client = ::Google::Cloud::Memorystore::V1::Memorystore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_instance({ name: name, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_instance name: name, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_instance ::Google::Cloud::Memorystore::V1::DeleteInstanceRequest.new(name: name, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_instance({ name: name, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_instance(::Google::Cloud::Memorystore::V1::DeleteInstanceRequest.new(name: name, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_instance_client_stub.call_rpc_count + end + end + + def test_get_certificate_authority + # Create GRPC objects. + grpc_response = ::Google::Cloud::Memorystore::V1::CertificateAuthority.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_certificate_authority_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_certificate_authority, name + assert_kind_of ::Google::Cloud::Memorystore::V1::GetCertificateAuthorityRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_certificate_authority_client_stub do + # Create client + client = ::Google::Cloud::Memorystore::V1::Memorystore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_certificate_authority({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_certificate_authority name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_certificate_authority ::Google::Cloud::Memorystore::V1::GetCertificateAuthorityRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_certificate_authority({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_certificate_authority(::Google::Cloud::Memorystore::V1::GetCertificateAuthorityRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_certificate_authority_client_stub.call_rpc_count + end + end + + def test_get_shared_regional_certificate_authority + # Create GRPC objects. + grpc_response = ::Google::Cloud::Memorystore::V1::SharedRegionalCertificateAuthority.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_shared_regional_certificate_authority_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_shared_regional_certificate_authority, name + assert_kind_of ::Google::Cloud::Memorystore::V1::GetSharedRegionalCertificateAuthorityRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_shared_regional_certificate_authority_client_stub do + # Create client + client = ::Google::Cloud::Memorystore::V1::Memorystore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_shared_regional_certificate_authority({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_shared_regional_certificate_authority name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_shared_regional_certificate_authority ::Google::Cloud::Memorystore::V1::GetSharedRegionalCertificateAuthorityRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_shared_regional_certificate_authority({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_shared_regional_certificate_authority(::Google::Cloud::Memorystore::V1::GetSharedRegionalCertificateAuthorityRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_shared_regional_certificate_authority_client_stub.call_rpc_count + end + end + + def test_reschedule_maintenance + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + reschedule_type = :RESCHEDULE_TYPE_UNSPECIFIED + schedule_time = {} + + reschedule_maintenance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :reschedule_maintenance, name + assert_kind_of ::Google::Cloud::Memorystore::V1::RescheduleMaintenanceRequest, request + assert_equal "hello world", request["name"] + assert_equal :RESCHEDULE_TYPE_UNSPECIFIED, request["reschedule_type"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["schedule_time"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, reschedule_maintenance_client_stub do + # Create client + client = ::Google::Cloud::Memorystore::V1::Memorystore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.reschedule_maintenance({ name: name, reschedule_type: reschedule_type, schedule_time: schedule_time }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.reschedule_maintenance name: name, reschedule_type: reschedule_type, schedule_time: schedule_time do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.reschedule_maintenance ::Google::Cloud::Memorystore::V1::RescheduleMaintenanceRequest.new(name: name, reschedule_type: reschedule_type, schedule_time: schedule_time) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.reschedule_maintenance({ name: name, reschedule_type: reschedule_type, schedule_time: schedule_time }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.reschedule_maintenance(::Google::Cloud::Memorystore::V1::RescheduleMaintenanceRequest.new(name: name, reschedule_type: reschedule_type, schedule_time: schedule_time), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, reschedule_maintenance_client_stub.call_rpc_count + end + end + + def test_list_backup_collections + # Create GRPC objects. + grpc_response = ::Google::Cloud::Memorystore::V1::ListBackupCollectionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_backup_collections_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_backup_collections, name + assert_kind_of ::Google::Cloud::Memorystore::V1::ListBackupCollectionsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_backup_collections_client_stub do + # Create client + client = ::Google::Cloud::Memorystore::V1::Memorystore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_backup_collections({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_backup_collections parent: parent, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_backup_collections ::Google::Cloud::Memorystore::V1::ListBackupCollectionsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_backup_collections({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_backup_collections(::Google::Cloud::Memorystore::V1::ListBackupCollectionsRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_backup_collections_client_stub.call_rpc_count + end + end + + def test_get_backup_collection + # Create GRPC objects. + grpc_response = ::Google::Cloud::Memorystore::V1::BackupCollection.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_backup_collection_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_backup_collection, name + assert_kind_of ::Google::Cloud::Memorystore::V1::GetBackupCollectionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_backup_collection_client_stub do + # Create client + client = ::Google::Cloud::Memorystore::V1::Memorystore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_backup_collection({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_backup_collection name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_backup_collection ::Google::Cloud::Memorystore::V1::GetBackupCollectionRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_backup_collection({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_backup_collection(::Google::Cloud::Memorystore::V1::GetBackupCollectionRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_backup_collection_client_stub.call_rpc_count + end + end + + def test_list_backups + # Create GRPC objects. + grpc_response = ::Google::Cloud::Memorystore::V1::ListBackupsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_backups_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_backups, name + assert_kind_of ::Google::Cloud::Memorystore::V1::ListBackupsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_backups_client_stub do + # Create client + client = ::Google::Cloud::Memorystore::V1::Memorystore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_backups({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_backups parent: parent, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_backups ::Google::Cloud::Memorystore::V1::ListBackupsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_backups({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_backups(::Google::Cloud::Memorystore::V1::ListBackupsRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_backups_client_stub.call_rpc_count + end + end + + def test_get_backup + # Create GRPC objects. + grpc_response = ::Google::Cloud::Memorystore::V1::Backup.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_backup_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_backup, name + assert_kind_of ::Google::Cloud::Memorystore::V1::GetBackupRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_backup_client_stub do + # Create client + client = ::Google::Cloud::Memorystore::V1::Memorystore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_backup({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_backup name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_backup ::Google::Cloud::Memorystore::V1::GetBackupRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_backup({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_backup(::Google::Cloud::Memorystore::V1::GetBackupRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_backup_client_stub.call_rpc_count + end + end + + def test_delete_backup + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + request_id = "hello world" + + delete_backup_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_backup, name + assert_kind_of ::Google::Cloud::Memorystore::V1::DeleteBackupRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_backup_client_stub do + # Create client + client = ::Google::Cloud::Memorystore::V1::Memorystore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_backup({ name: name, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_backup name: name, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_backup ::Google::Cloud::Memorystore::V1::DeleteBackupRequest.new(name: name, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_backup({ name: name, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_backup(::Google::Cloud::Memorystore::V1::DeleteBackupRequest.new(name: name, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_backup_client_stub.call_rpc_count + end + end + + def test_export_backup + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + gcs_bucket = "hello world" + name = "hello world" + + export_backup_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :export_backup, name + assert_kind_of ::Google::Cloud::Memorystore::V1::ExportBackupRequest, request + assert_equal "hello world", request["gcs_bucket"] + assert_equal :gcs_bucket, request.destination + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, export_backup_client_stub do + # Create client + client = ::Google::Cloud::Memorystore::V1::Memorystore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.export_backup({ gcs_bucket: gcs_bucket, name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.export_backup gcs_bucket: gcs_bucket, name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.export_backup ::Google::Cloud::Memorystore::V1::ExportBackupRequest.new(gcs_bucket: gcs_bucket, name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.export_backup({ gcs_bucket: gcs_bucket, name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.export_backup(::Google::Cloud::Memorystore::V1::ExportBackupRequest.new(gcs_bucket: gcs_bucket, name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, export_backup_client_stub.call_rpc_count + end + end + + def test_backup_instance + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + ttl = {} + backup_id = "hello world" + + backup_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :backup_instance, name + assert_kind_of ::Google::Cloud::Memorystore::V1::BackupInstanceRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["ttl"] + assert_equal "hello world", request["backup_id"] + assert request.has_backup_id? + refute_nil options + end + + Gapic::ServiceStub.stub :new, backup_instance_client_stub do + # Create client + client = ::Google::Cloud::Memorystore::V1::Memorystore::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.backup_instance({ name: name, ttl: ttl, backup_id: backup_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.backup_instance name: name, ttl: ttl, backup_id: backup_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.backup_instance ::Google::Cloud::Memorystore::V1::BackupInstanceRequest.new(name: name, ttl: ttl, backup_id: backup_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.backup_instance({ name: name, ttl: ttl, backup_id: backup_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.backup_instance(::Google::Cloud::Memorystore::V1::BackupInstanceRequest.new(name: name, ttl: ttl, backup_id: backup_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, backup_instance_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Memorystore::V1::Memorystore::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Memorystore::V1::Memorystore::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Memorystore::V1::Memorystore::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Memorystore::V1::Memorystore::Client, client + assert_equal creds, client.configure.credentials + end + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Memorystore::V1::Memorystore::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Memorystore::V1::Memorystore::Operations, client.operations_client + end +end