Class: Google::Cloud::Memcache::V1beta2::CloudMemcache::Rest::Client
- Inherits:
-
Object
- Object
- Google::Cloud::Memcache::V1beta2::CloudMemcache::Rest::Client
- Includes:
- Paths
- Defined in:
- lib/google/cloud/memcache/v1beta2/cloud_memcache/rest/client.rb
Overview
REST client for the CloudMemcache service.
Configures and manages Cloud Memorystore for Memcached instances.
The memcache.googleapis.com
service implements the Google Cloud Memorystore
for Memcached API and defines the following resource model for managing
Memorystore Memcached (also called Memcached below) instances:
- The service works with a collection of cloud projects, named:
/projects/*
- Each project has a collection of available locations, named:
/locations/*
- Each location has a collection of Memcached instances, named:
/instances/*
- As such, Memcached instances are resources of the form:
/projects/{project_id}/locations/{location_id}/instances/{instance_id}
Note that location_id must be a GCP region
; for example:
projects/my-memcached-project/locations/us-central1/instances/my-memcached
Defined Under Namespace
Classes: Configuration
Instance Attribute Summary collapse
-
#location_client ⇒ Google::Cloud::Location::Locations::Rest::Client
readonly
Get the associated client for mix-in of the Locations.
-
#operations_client ⇒ ::Google::Cloud::Memcache::V1beta2::CloudMemcache::Rest::Operations
readonly
Get the associated client for long-running operations.
Class Method Summary collapse
-
.configure {|config| ... } ⇒ Client::Configuration
Configure the CloudMemcache Client class.
Instance Method Summary collapse
-
#apply_parameters(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::Operation
ApplyParameters
restarts the set of specified nodes in order to update them to the current set of parameters for the Memcached Instance. -
#apply_software_update(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::Operation
Updates software on the selected nodes of the Instance.
-
#configure {|config| ... } ⇒ Client::Configuration
Configure the CloudMemcache Client instance.
-
#create_instance(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::Operation
Creates a new Instance in a given location.
-
#delete_instance(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::Operation
Deletes a single Instance.
-
#get_instance(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Memcache::V1beta2::Instance
Gets details of a single Instance.
-
#initialize {|config| ... } ⇒ Client
constructor
Create a new CloudMemcache REST client object.
-
#list_instances(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Memcache::V1beta2::ListInstancesResponse
Lists Instances in a given location.
-
#logger ⇒ Logger
The logger used for request/response debug logging.
-
#reschedule_maintenance(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::Operation
Performs the apply phase of the RescheduleMaintenance verb.
-
#universe_domain ⇒ String
The effective universe domain.
-
#update_instance(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::Operation
Updates an existing Instance in a given project and location.
-
#update_parameters(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::Operation
Updates the defined Memcached parameters for an existing instance.
Methods included from Paths
#instance_path, #location_path
Constructor Details
#initialize {|config| ... } ⇒ Client
Create a new CloudMemcache REST client object.
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 |
# File 'lib/google/cloud/memcache/v1beta2/cloud_memcache/rest/client.rb', line 159 def initialize # 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 = ::Google::Cloud::Memcache::V1beta2::CloudMemcache::Rest::Operations.new do |config| config.credentials = credentials config.quota_project = @quota_project_id config.endpoint = @config.endpoint config.universe_domain = @config.universe_domain end @cloud_memcache_stub = ::Google::Cloud::Memcache::V1beta2::CloudMemcache::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials, logger: @config.logger ) @cloud_memcache_stub.logger(stub: true)&.info do |entry| entry.set_system_name entry.set_service entry. = "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::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id config.endpoint = @cloud_memcache_stub.endpoint config.universe_domain = @cloud_memcache_stub.universe_domain config.bindings_override = @config.bindings_override config.logger = @cloud_memcache_stub.logger if config.respond_to? :logger= end end |
Instance Attribute Details
#location_client ⇒ Google::Cloud::Location::Locations::Rest::Client (readonly)
Get the associated client for mix-in of the Locations.
229 230 231 |
# File 'lib/google/cloud/memcache/v1beta2/cloud_memcache/rest/client.rb', line 229 def location_client @location_client end |
#operations_client ⇒ ::Google::Cloud::Memcache::V1beta2::CloudMemcache::Rest::Operations (readonly)
Get the associated client for long-running operations.
222 223 224 |
# File 'lib/google/cloud/memcache/v1beta2/cloud_memcache/rest/client.rb', line 222 def operations_client @operations_client end |
Class Method Details
.configure {|config| ... } ⇒ Client::Configuration
Configure the CloudMemcache Client class.
See Configuration for a description of the configuration fields.
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/google/cloud/memcache/v1beta2/cloud_memcache/rest/client.rb', line 79 def self.configure @configure ||= begin namespace = ["Google", "Cloud", "Memcache", "V1beta2"] 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 = 1200.0 default_config.rpcs.get_instance.timeout = 1200.0 default_config.rpcs.create_instance.timeout = 1200.0 default_config.rpcs.update_instance.timeout = 1200.0 default_config.rpcs.update_parameters.timeout = 1200.0 default_config.rpcs.delete_instance.timeout = 1200.0 default_config.rpcs.apply_parameters.timeout = 1200.0 default_config.rpcs.apply_software_update.timeout = 1200.0 default_config.rpcs.reschedule_maintenance.timeout = 1200.0 default_config end yield @configure if block_given? @configure end |
Instance Method Details
#apply_parameters(request, options = nil) ⇒ ::Gapic::Operation #apply_parameters(name: nil, node_ids: nil, apply_all: nil) ⇒ ::Gapic::Operation
ApplyParameters
restarts the set of specified nodes in order to update
them to the current set of parameters for the Memcached Instance.
857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 |
# File 'lib/google/cloud/memcache/v1beta2/cloud_memcache/rest/client.rb', line 857 def apply_parameters request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memcache::V1beta2::ApplyParametersRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.apply_parameters..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Memcache::V1beta2::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.apply_parameters.timeout, metadata: , retry_policy: @config.rpcs.apply_parameters.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @cloud_memcache_stub.apply_parameters request, do |result, operation| result = ::Gapic::Operation.new result, @operations_client, options: yield result, operation if block_given? throw :response, result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#apply_software_update(request, options = nil) ⇒ ::Gapic::Operation #apply_software_update(instance: nil, node_ids: nil, apply_all: nil) ⇒ ::Gapic::Operation
Updates software on the selected nodes of the Instance.
952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 |
# File 'lib/google/cloud/memcache/v1beta2/cloud_memcache/rest/client.rb', line 952 def apply_software_update request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memcache::V1beta2::ApplySoftwareUpdateRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.apply_software_update..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Memcache::V1beta2::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.apply_software_update.timeout, metadata: , retry_policy: @config.rpcs.apply_software_update.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @cloud_memcache_stub.apply_software_update request, do |result, operation| result = ::Gapic::Operation.new result, @operations_client, options: yield result, operation if block_given? throw :response, result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#configure {|config| ... } ⇒ Client::Configuration
Configure the CloudMemcache 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 configure.
See Configuration for a description of the configuration fields.
129 130 131 132 |
# File 'lib/google/cloud/memcache/v1beta2/cloud_memcache/rest/client.rb', line 129 def configure yield @config if block_given? @config end |
#create_instance(request, options = nil) ⇒ ::Gapic::Operation #create_instance(parent: nil, instance_id: nil, resource: nil) ⇒ ::Gapic::Operation
Creates a new Instance in a given location.
486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 |
# File 'lib/google/cloud/memcache/v1beta2/cloud_memcache/rest/client.rb', line 486 def create_instance request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memcache::V1beta2::CreateInstanceRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.create_instance..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Memcache::V1beta2::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.create_instance.timeout, metadata: , retry_policy: @config.rpcs.create_instance.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @cloud_memcache_stub.create_instance request, do |result, operation| result = ::Gapic::Operation.new result, @operations_client, options: yield result, operation if block_given? throw :response, result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#delete_instance(request, options = nil) ⇒ ::Gapic::Operation #delete_instance(name: nil) ⇒ ::Gapic::Operation
Deletes a single Instance.
762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 |
# File 'lib/google/cloud/memcache/v1beta2/cloud_memcache/rest/client.rb', line 762 def delete_instance request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memcache::V1beta2::DeleteInstanceRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.delete_instance..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Memcache::V1beta2::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.delete_instance.timeout, metadata: , retry_policy: @config.rpcs.delete_instance.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @cloud_memcache_stub.delete_instance request, do |result, operation| result = ::Gapic::Operation.new result, @operations_client, options: yield result, operation if block_given? throw :response, result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#get_instance(request, options = nil) ⇒ ::Google::Cloud::Memcache::V1beta2::Instance #get_instance(name: nil) ⇒ ::Google::Cloud::Memcache::V1beta2::Instance
Gets details of a single Instance.
386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 |
# File 'lib/google/cloud/memcache/v1beta2/cloud_memcache/rest/client.rb', line 386 def get_instance request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memcache::V1beta2::GetInstanceRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_instance..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Memcache::V1beta2::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.get_instance.timeout, metadata: , retry_policy: @config.rpcs.get_instance.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @cloud_memcache_stub.get_instance request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#list_instances(request, options = nil) ⇒ ::Google::Cloud::Memcache::V1beta2::ListInstancesResponse #list_instances(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Google::Cloud::Memcache::V1beta2::ListInstancesResponse
Lists Instances in a given location.
306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 |
# File 'lib/google/cloud/memcache/v1beta2/cloud_memcache/rest/client.rb', line 306 def list_instances request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memcache::V1beta2::ListInstancesRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_instances..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Memcache::V1beta2::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.list_instances.timeout, metadata: , retry_policy: @config.rpcs.list_instances.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @cloud_memcache_stub.list_instances request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#logger ⇒ Logger
The logger used for request/response debug logging.
236 237 238 |
# File 'lib/google/cloud/memcache/v1beta2/cloud_memcache/rest/client.rb', line 236 def logger @cloud_memcache_stub.logger end |
#reschedule_maintenance(request, options = nil) ⇒ ::Gapic::Operation #reschedule_maintenance(instance: nil, reschedule_type: nil, schedule_time: nil) ⇒ ::Gapic::Operation
Performs the apply phase of the RescheduleMaintenance verb.
1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 |
# File 'lib/google/cloud/memcache/v1beta2/cloud_memcache/rest/client.rb', line 1047 def reschedule_maintenance request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memcache::V1beta2::RescheduleMaintenanceRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.reschedule_maintenance..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Memcache::V1beta2::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.reschedule_maintenance.timeout, metadata: , retry_policy: @config.rpcs.reschedule_maintenance.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @cloud_memcache_stub.reschedule_maintenance request, do |result, operation| result = ::Gapic::Operation.new result, @operations_client, options: yield result, operation if block_given? throw :response, result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#universe_domain ⇒ String
The effective universe domain
139 140 141 |
# File 'lib/google/cloud/memcache/v1beta2/cloud_memcache/rest/client.rb', line 139 def universe_domain @cloud_memcache_stub.universe_domain end |
#update_instance(request, options = nil) ⇒ ::Gapic::Operation #update_instance(update_mask: nil, resource: nil) ⇒ ::Gapic::Operation
Updates an existing Instance in a given project and location.
578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 |
# File 'lib/google/cloud/memcache/v1beta2/cloud_memcache/rest/client.rb', line 578 def update_instance request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memcache::V1beta2::UpdateInstanceRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.update_instance..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Memcache::V1beta2::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.update_instance.timeout, metadata: , retry_policy: @config.rpcs.update_instance.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @cloud_memcache_stub.update_instance request, do |result, operation| result = ::Gapic::Operation.new result, @operations_client, options: yield result, operation if block_given? throw :response, result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#update_parameters(request, options = nil) ⇒ ::Gapic::Operation #update_parameters(name: nil, update_mask: nil, parameters: nil) ⇒ ::Gapic::Operation
Updates the defined Memcached parameters for an existing instance.
This method only stages the parameters, it must be followed by
ApplyParameters
to apply the parameters to nodes of the Memcached
instance.
673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 |
# File 'lib/google/cloud/memcache/v1beta2/cloud_memcache/rest/client.rb', line 673 def update_parameters request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memcache::V1beta2::UpdateParametersRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.update_parameters..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Memcache::V1beta2::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.update_parameters.timeout, metadata: , retry_policy: @config.rpcs.update_parameters.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @cloud_memcache_stub.update_parameters request, do |result, operation| result = ::Gapic::Operation.new result, @operations_client, options: yield result, operation if block_given? throw :response, result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |