Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions google-cloud-memorystore-v1/.owlbot-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"snippets/memorystore/get_backup_collection.rb",
"snippets/memorystore/get_certificate_authority.rb",
"snippets/memorystore/get_instance.rb",
"snippets/memorystore/get_shared_regional_certificate_authority.rb",
"snippets/memorystore/list_backup_collections.rb",
"snippets/memorystore/list_backups.rb",
"snippets/memorystore/list_instances.rb",
Expand Down
5 changes: 5 additions & 0 deletions google-cloud-memorystore-v1/gapic_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@
"get_certificate_authority"
]
},
"GetSharedRegionalCertificateAuthority": {
"methods": [
"get_shared_regional_certificate_authority"
]
},
"RescheduleMaintenance": {
"methods": [
"reschedule_maintenance"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,25 @@ def backup_collection_path project:, location:, backup_collection:
"projects/#{project}/locations/#{location}/backupCollections/#{backup_collection}"
end

##
# Create a fully-qualified CaPool resource string.
#
# The resource will be in the following format:
#
# `projects/{project}/locations/{location}/caPools/{ca_pool}`
#
# @param project [String]
# @param location [String]
# @param ca_pool [String]
#
# @return [::String]
def ca_pool_path project:, location:, ca_pool:
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"

"projects/#{project}/locations/#{location}/caPools/#{ca_pool}"
end

##
# Create a fully-qualified CryptoKey resource string.
#
Expand Down Expand Up @@ -199,6 +218,23 @@ def service_attachment_path project:, region:, service_attachment:
"projects/#{project}/regions/#{region}/serviceAttachments/#{service_attachment}"
end

##
# Create a fully-qualified SharedRegionalCertificateAuthority resource string.
#
# The resource will be in the following format:
#
# `projects/{project}/locations/{location}/sharedRegionalCertificateAuthority`
#
# @param project [String]
# @param location [String]
#
# @return [::String]
def shared_regional_certificate_authority_path project:, location:
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"

"projects/#{project}/locations/#{location}/sharedRegionalCertificateAuthority"
end

extend self
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,87 @@ def get_certificate_authority request, options = nil
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 [result, operation] Access the result along with the TransportOperation object
# @yieldparam result [::Google::Cloud::Memorystore::V1::SharedRegionalCertificateAuthority]
# @yieldparam operation [::Gapic::Rest::TransportOperation]
#
# @return [::Google::Cloud::Memorystore::V1::SharedRegionalCertificateAuthority]
#
# @raise [::Google::Cloud::Error] if the REST call is aborted.
#
# @example Basic example
# require "google/cloud/memorystore/v1"
#
# # Create a client object. The client can be reused for multiple calls.
# client = Google::Cloud::Memorystore::V1::Memorystore::Rest::Client.new
#
# # Create a request. To set request fields, pass in keyword arguments.
# request = Google::Cloud::Memorystore::V1::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
call_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
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
lib_name: @config.lib_name, lib_version: @config.lib_version,
gapic_version: ::Google::Cloud::Memorystore::V1::VERSION,
transports_version_send: [:rest]

call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

options.apply_defaults timeout: @config.rpcs.get_shared_regional_certificate_authority.timeout,
metadata: call_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.get_shared_regional_certificate_authority request, options do |result, operation|
yield result, operation if block_given?
end
rescue ::Gapic::Rest::Error => e
raise ::Google::Cloud::Error.from_error(e)
end

##
# Reschedules upcoming maintenance event.
#
Expand Down Expand Up @@ -1724,6 +1805,11 @@ class Rpcs
#
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]
#
Expand Down Expand Up @@ -1778,6 +1864,8 @@ def initialize parent_rpcs = nil
@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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,46 @@ def get_certificate_authority request_pb, options = nil
end
end

##
# Baseline implementation for the get_shared_regional_certificate_authority REST call
#
# @param request_pb [::Google::Cloud::Memorystore::V1::GetSharedRegionalCertificateAuthorityRequest]
# A request object representing the call parameters. Required.
# @param options [::Gapic::CallOptions]
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
#
# @yield [result, operation] Access the result along with the TransportOperation object
# @yieldparam result [::Google::Cloud::Memorystore::V1::SharedRegionalCertificateAuthority]
# @yieldparam operation [::Gapic::Rest::TransportOperation]
#
# @return [::Google::Cloud::Memorystore::V1::SharedRegionalCertificateAuthority]
# A result object deserialized from the server's reply
def get_shared_regional_certificate_authority request_pb, options = nil
raise ::ArgumentError, "request must be provided" if request_pb.nil?

verb, uri, query_string_params, body = ServiceStub.transcode_get_shared_regional_certificate_authority_request request_pb
query_string_params = if query_string_params.any?
query_string_params.to_h { |p| p.split "=", 2 }
else
{}
end

response = @client_stub.make_http_request(
verb,
uri: uri,
body: body || "",
params: query_string_params,
method_name: "get_shared_regional_certificate_authority",
options: options
)
operation = ::Gapic::Rest::TransportOperation.new response
result = ::Google::Cloud::Memorystore::V1::SharedRegionalCertificateAuthority.decode_json response.body, ignore_unknown_fields: true
catch :response do
yield result, operation if block_given?
result
end
end

##
# Baseline implementation for the reschedule_maintenance REST call
#
Expand Down Expand Up @@ -761,6 +801,27 @@ def self.transcode_get_certificate_authority_request request_pb
transcoder.transcode request_pb
end

##
# @private
#
# GRPC transcoding helper method for the get_shared_regional_certificate_authority REST call
#
# @param request_pb [::Google::Cloud::Memorystore::V1::GetSharedRegionalCertificateAuthorityRequest]
# A request object representing the call parameters. Required.
# @return [Array(String, [String, nil], Hash{String => String})]
# Uri, Body, Query string parameters
def self.transcode_get_shared_regional_certificate_authority_request request_pb
transcoder = Gapic::Rest::GrpcTranscoder.new
.with_bindings(
uri_method: :get,
uri_template: "/v1/{name}",
matches: [
["name", %r{^projects/[^/]+/locations/[^/]+/sharedRegionalCertificateAuthority/?$}, false]
]
)
transcoder.transcode request_pb
end

##
# @private
#
Expand Down

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading