Class: Google::Cloud::ParameterManager::V1::ParameterManager::Rest::Client

Inherits:
Object
  • Object
show all
Includes:
Paths
Defined in:
lib/google/cloud/parameter_manager/v1/parameter_manager/rest/client.rb

Overview

REST client for the ParameterManager service.

Service describing handlers for resources

Defined Under Namespace

Classes: Configuration

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Paths

#crypto_key_path, #location_path, #parameter_path, #parameter_version_path

Constructor Details

#initialize {|config| ... } ⇒ Client

Create a new ParameterManager REST client object.

Examples:


# Create a client using the default configuration
client = ::Google::Cloud::ParameterManager::V1::ParameterManager::Rest::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::ParameterManager::V1::ParameterManager::Rest::Client.new do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the ParameterManager client.

Yield Parameters:



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
# File 'lib/google/cloud/parameter_manager/v1/parameter_manager/rest/client.rb', line 164

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

  @parameter_manager_stub = ::Google::Cloud::ParameterManager::V1::ParameterManager::Rest::ServiceStub.new(
    endpoint: @config.endpoint,
    endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
    universe_domain: @config.universe_domain,
    credentials: credentials,
    logger: @config.logger
  )

  @parameter_manager_stub.logger(stub: true)&.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::Rest::Client.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @parameter_manager_stub.endpoint
    config.universe_domain = @parameter_manager_stub.universe_domain
    config.bindings_override = @config.bindings_override
    config.logger = @parameter_manager_stub.logger if config.respond_to? :logger=
  end
end

Instance Attribute Details

#location_clientGoogle::Cloud::Location::Locations::Rest::Client (readonly)

Get the associated client for mix-in of the Locations.

Returns:

  • (Google::Cloud::Location::Locations::Rest::Client)


220
221
222
# File 'lib/google/cloud/parameter_manager/v1/parameter_manager/rest/client.rb', line 220

def location_client
  @location_client
end

Class Method Details

.configure {|config| ... } ⇒ Client::Configuration

Configure the ParameterManager Client class.

See Configuration for a description of the configuration fields.

Examples:


# Modify the configuration for all ParameterManager clients
::Google::Cloud::ParameterManager::V1::ParameterManager::Rest::Client.configure do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



65
66
67
68
69
70
71
72
73
74
75
76
77
78
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
113
114
115
116
117
# File 'lib/google/cloud/parameter_manager/v1/parameter_manager/rest/client.rb', line 65

def self.configure
  @configure ||= begin
    namespace = ["Google", "Cloud", "ParameterManager", "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_parameters.timeout = 60.0
    default_config.rpcs.list_parameters.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.get_parameter.timeout = 60.0
    default_config.rpcs.get_parameter.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.create_parameter.timeout = 60.0

    default_config.rpcs.update_parameter.timeout = 60.0

    default_config.rpcs.delete_parameter.timeout = 60.0

    default_config.rpcs.list_parameter_versions.timeout = 60.0
    default_config.rpcs.list_parameter_versions.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.get_parameter_version.timeout = 60.0
    default_config.rpcs.get_parameter_version.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.render_parameter_version.timeout = 60.0
    default_config.rpcs.render_parameter_version.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.create_parameter_version.timeout = 60.0

    default_config.rpcs.update_parameter_version.timeout = 60.0

    default_config.rpcs.delete_parameter_version.timeout = 60.0

    default_config
  end
  yield @configure if block_given?
  @configure
end

Instance Method Details

#configure {|config| ... } ⇒ Client::Configuration

Configure the ParameterManager 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.

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



134
135
136
137
# File 'lib/google/cloud/parameter_manager/v1/parameter_manager/rest/client.rb', line 134

def configure
  yield @config if block_given?
  @config
end

#create_parameter(request, options = nil) ⇒ ::Google::Cloud::ParameterManager::V1::Parameter #create_parameter(parent: nil, parameter_id: nil, parameter: nil, request_id: nil) ⇒ ::Google::Cloud::ParameterManager::V1::Parameter

Creates a new Parameter in a given project and location.

Examples:

Basic example

require "google/cloud/parameter_manager/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ParameterManager::V1::ParameterManager::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ParameterManager::V1::CreateParameterRequest.new

# Call the create_parameter method.
result = client.create_parameter request

# The returned object is of type Google::Cloud::ParameterManager::V1::Parameter.
p result

Overloads:

  • #create_parameter(request, options = nil) ⇒ ::Google::Cloud::ParameterManager::V1::Parameter

    Pass arguments to create_parameter via a request object, either of type CreateParameterRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ParameterManager::V1::CreateParameterRequest, ::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #create_parameter(parent: nil, parameter_id: nil, parameter: nil, request_id: nil) ⇒ ::Google::Cloud::ParameterManager::V1::Parameter

    Pass arguments to create_parameter 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).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. Value for parent in the format projects/*/locations/*.

    • parameter_id (::String) (defaults to: nil)

      Required. Id of the Parameter resource

    • parameter (::Google::Cloud::ParameterManager::V1::Parameter, ::Hash) (defaults to: nil)

      Required. The Parameter resource being created

    • request_id (::String) (defaults to: nil)

      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).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
# File 'lib/google/cloud/parameter_manager/v1/parameter_manager/rest/client.rb', line 468

def create_parameter request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ParameterManager::V1::CreateParameterRequest

  # 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
   = @config.rpcs.create_parameter..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::ParameterManager::V1::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

  options.apply_defaults timeout:      @config.rpcs.create_parameter.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_parameter.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @parameter_manager_stub.create_parameter 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

#create_parameter_version(request, options = nil) ⇒ ::Google::Cloud::ParameterManager::V1::ParameterVersion #create_parameter_version(parent: nil, parameter_version_id: nil, parameter_version: nil, request_id: nil) ⇒ ::Google::Cloud::ParameterManager::V1::ParameterVersion

Creates a new ParameterVersion in a given project, location, and parameter.

Examples:

Basic example

require "google/cloud/parameter_manager/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ParameterManager::V1::ParameterManager::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ParameterManager::V1::CreateParameterVersionRequest.new

# Call the create_parameter_version method.
result = client.create_parameter_version request

# The returned object is of type Google::Cloud::ParameterManager::V1::ParameterVersion.
p result

Overloads:

  • #create_parameter_version(request, options = nil) ⇒ ::Google::Cloud::ParameterManager::V1::ParameterVersion

    Pass arguments to create_parameter_version via a request object, either of type CreateParameterVersionRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ParameterManager::V1::CreateParameterVersionRequest, ::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #create_parameter_version(parent: nil, parameter_version_id: nil, parameter_version: nil, request_id: nil) ⇒ ::Google::Cloud::ParameterManager::V1::ParameterVersion

    Pass arguments to create_parameter_version 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).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. Value for parent in the format projects/*/locations/*/parameters/*.

    • parameter_version_id (::String) (defaults to: nil)

      Required. Id of the ParameterVersion resource

    • parameter_version (::Google::Cloud::ParameterManager::V1::ParameterVersion, ::Hash) (defaults to: nil)

      Required. The ParameterVersion resource being created

    • request_id (::String) (defaults to: nil)

      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).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
# File 'lib/google/cloud/parameter_manager/v1/parameter_manager/rest/client.rb', line 1012

def create_parameter_version request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ParameterManager::V1::CreateParameterVersionRequest

  # 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
   = @config.rpcs.create_parameter_version..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::ParameterManager::V1::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

  options.apply_defaults timeout:      @config.rpcs.create_parameter_version.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_parameter_version.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @parameter_manager_stub.create_parameter_version 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

#delete_parameter(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_parameter(name: nil, request_id: nil) ⇒ ::Google::Protobuf::Empty

Deletes a single Parameter.

Examples:

Basic example

require "google/cloud/parameter_manager/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ParameterManager::V1::ParameterManager::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ParameterManager::V1::DeleteParameterRequest.new

# Call the delete_parameter method.
result = client.delete_parameter request

# The returned object is of type Google::Protobuf::Empty.
p result

Overloads:

  • #delete_parameter(request, options = nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_parameter via a request object, either of type DeleteParameterRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ParameterManager::V1::DeleteParameterRequest, ::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #delete_parameter(name: nil, request_id: nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_parameter 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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Name of the resource in the format projects/*/locations/*/parameters/*.

    • request_id (::String) (defaults to: nil)

      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).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
# File 'lib/google/cloud/parameter_manager/v1/parameter_manager/rest/client.rb', line 660

def delete_parameter request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ParameterManager::V1::DeleteParameterRequest

  # 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
   = @config.rpcs.delete_parameter..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::ParameterManager::V1::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

  options.apply_defaults timeout:      @config.rpcs.delete_parameter.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_parameter.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @parameter_manager_stub.delete_parameter 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

#delete_parameter_version(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_parameter_version(name: nil, request_id: nil) ⇒ ::Google::Protobuf::Empty

Deletes a single ParameterVersion.

Examples:

Basic example

require "google/cloud/parameter_manager/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ParameterManager::V1::ParameterManager::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ParameterManager::V1::DeleteParameterVersionRequest.new

# Call the delete_parameter_version method.
result = client.delete_parameter_version request

# The returned object is of type Google::Protobuf::Empty.
p result

Overloads:

  • #delete_parameter_version(request, options = nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_parameter_version via a request object, either of type DeleteParameterVersionRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ParameterManager::V1::DeleteParameterVersionRequest, ::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #delete_parameter_version(name: nil, request_id: nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_parameter_version 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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Name of the resource in the format projects/*/locations/*/parameters/*/versions/*.

    • request_id (::String) (defaults to: nil)

      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).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
# File 'lib/google/cloud/parameter_manager/v1/parameter_manager/rest/client.rb', line 1204

def delete_parameter_version request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ParameterManager::V1::DeleteParameterVersionRequest

  # 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
   = @config.rpcs.delete_parameter_version..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::ParameterManager::V1::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

  options.apply_defaults timeout:      @config.rpcs.delete_parameter_version.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_parameter_version.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @parameter_manager_stub.delete_parameter_version 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

#get_parameter(request, options = nil) ⇒ ::Google::Cloud::ParameterManager::V1::Parameter #get_parameter(name: nil) ⇒ ::Google::Cloud::ParameterManager::V1::Parameter

Gets details of a single Parameter.

Examples:

Basic example

require "google/cloud/parameter_manager/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ParameterManager::V1::ParameterManager::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ParameterManager::V1::GetParameterRequest.new

# Call the get_parameter method.
result = client.get_parameter request

# The returned object is of type Google::Cloud::ParameterManager::V1::Parameter.
p result

Overloads:

  • #get_parameter(request, options = nil) ⇒ ::Google::Cloud::ParameterManager::V1::Parameter

    Pass arguments to get_parameter via a request object, either of type GetParameterRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ParameterManager::V1::GetParameterRequest, ::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_parameter(name: nil) ⇒ ::Google::Cloud::ParameterManager::V1::Parameter

    Pass arguments to get_parameter 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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Name of the resource in the format projects/*/locations/*/parameters/*.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
# File 'lib/google/cloud/parameter_manager/v1/parameter_manager/rest/client.rb', line 371

def get_parameter request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ParameterManager::V1::GetParameterRequest

  # 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
   = @config.rpcs.get_parameter..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::ParameterManager::V1::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

  options.apply_defaults timeout:      @config.rpcs.get_parameter.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_parameter.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @parameter_manager_stub.get_parameter 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

#get_parameter_version(request, options = nil) ⇒ ::Google::Cloud::ParameterManager::V1::ParameterVersion #get_parameter_version(name: nil, view: nil) ⇒ ::Google::Cloud::ParameterManager::V1::ParameterVersion

Gets details of a single ParameterVersion.

Examples:

Basic example

require "google/cloud/parameter_manager/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ParameterManager::V1::ParameterManager::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ParameterManager::V1::GetParameterVersionRequest.new

# Call the get_parameter_version method.
result = client.get_parameter_version request

# The returned object is of type Google::Cloud::ParameterManager::V1::ParameterVersion.
p result

Overloads:

  • #get_parameter_version(request, options = nil) ⇒ ::Google::Cloud::ParameterManager::V1::ParameterVersion

    Pass arguments to get_parameter_version via a request object, either of type GetParameterVersionRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ParameterManager::V1::GetParameterVersionRequest, ::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_parameter_version(name: nil, view: nil) ⇒ ::Google::Cloud::ParameterManager::V1::ParameterVersion

    Pass arguments to get_parameter_version 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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Name of the resource in the format projects/*/locations/*/parameters/*/versions/*.

    • view (::Google::Cloud::ParameterManager::V1::View) (defaults to: nil)

      Optional. View of the ParameterVersion. In the default FULL view, all metadata & payload associated with the ParameterVersion will be returned.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
# File 'lib/google/cloud/parameter_manager/v1/parameter_manager/rest/client.rb', line 837

def get_parameter_version request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ParameterManager::V1::GetParameterVersionRequest

  # 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
   = @config.rpcs.get_parameter_version..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::ParameterManager::V1::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

  options.apply_defaults timeout:      @config.rpcs.get_parameter_version.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_parameter_version.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @parameter_manager_stub.get_parameter_version 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

#list_parameter_versions(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ParameterManager::V1::ParameterVersion> #list_parameter_versions(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ParameterManager::V1::ParameterVersion>

Lists ParameterVersions in a given project, location, and parameter.

Examples:

Basic example

require "google/cloud/parameter_manager/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ParameterManager::V1::ParameterManager::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ParameterManager::V1::ListParameterVersionsRequest.new

# Call the list_parameter_versions method.
result = client.list_parameter_versions 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::ParameterManager::V1::ParameterVersion.
  p item
end

Overloads:

  • #list_parameter_versions(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ParameterManager::V1::ParameterVersion>

    Pass arguments to list_parameter_versions via a request object, either of type ListParameterVersionsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ParameterManager::V1::ListParameterVersionsRequest, ::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_parameter_versions(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ParameterManager::V1::ParameterVersion>

    Pass arguments to list_parameter_versions 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).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. Parent value for ListParameterVersionsRequest in the format projects/*/locations/*/parameters/*.

    • page_size (::Integer) (defaults to: nil)

      Optional. Requested page size. Server may return fewer items than requested. If unspecified, server will pick an appropriate default.

    • page_token (::String) (defaults to: nil)

      Optional. A token identifying a page of results the server should return.

    • filter (::String) (defaults to: nil)

      Optional. Filtering results

    • order_by (::String) (defaults to: nil)

      Optional. Hint for how to order the results

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



752
753
754
755
756
757
758
759
760
761
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
# File 'lib/google/cloud/parameter_manager/v1/parameter_manager/rest/client.rb', line 752

def list_parameter_versions request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ParameterManager::V1::ListParameterVersionsRequest

  # 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
   = @config.rpcs.list_parameter_versions..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::ParameterManager::V1::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

  options.apply_defaults timeout:      @config.rpcs.list_parameter_versions.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_parameter_versions.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @parameter_manager_stub.list_parameter_versions request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @parameter_manager_stub, :list_parameter_versions, "parameter_versions", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_parameters(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ParameterManager::V1::Parameter> #list_parameters(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ParameterManager::V1::Parameter>

Lists Parameters in a given project and location.

Examples:

Basic example

require "google/cloud/parameter_manager/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ParameterManager::V1::ParameterManager::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ParameterManager::V1::ListParametersRequest.new

# Call the list_parameters method.
result = client.list_parameters 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::ParameterManager::V1::Parameter.
  p item
end

Overloads:

  • #list_parameters(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ParameterManager::V1::Parameter>

    Pass arguments to list_parameters via a request object, either of type ListParametersRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ParameterManager::V1::ListParametersRequest, ::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_parameters(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ParameterManager::V1::Parameter>

    Pass arguments to list_parameters 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).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. Parent value for ListParametersRequest in the format projects/*/locations/*.

    • page_size (::Integer) (defaults to: nil)

      Optional. Requested page size. Server may return fewer items than requested. If unspecified, server will pick an appropriate default.

    • page_token (::String) (defaults to: nil)

      Optional. A token identifying a page of results the server should return.

    • filter (::String) (defaults to: nil)

      Optional. Filtering results

    • order_by (::String) (defaults to: nil)

      Optional. Hint for how to order the results

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
# File 'lib/google/cloud/parameter_manager/v1/parameter_manager/rest/client.rb', line 290

def list_parameters request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ParameterManager::V1::ListParametersRequest

  # 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
   = @config.rpcs.list_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::ParameterManager::V1::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

  options.apply_defaults timeout:      @config.rpcs.list_parameters.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_parameters.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @parameter_manager_stub.list_parameters request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @parameter_manager_stub, :list_parameters, "parameters", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#loggerLogger

The logger used for request/response debug logging.

Returns:

  • (Logger)


227
228
229
# File 'lib/google/cloud/parameter_manager/v1/parameter_manager/rest/client.rb', line 227

def logger
  @parameter_manager_stub.logger
end

#render_parameter_version(request, options = nil) ⇒ ::Google::Cloud::ParameterManager::V1::RenderParameterVersionResponse #render_parameter_version(name: nil) ⇒ ::Google::Cloud::ParameterManager::V1::RenderParameterVersionResponse

Gets rendered version of a ParameterVersion.

Examples:

Basic example

require "google/cloud/parameter_manager/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ParameterManager::V1::ParameterManager::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ParameterManager::V1::RenderParameterVersionRequest.new

# Call the render_parameter_version method.
result = client.render_parameter_version request

# The returned object is of type Google::Cloud::ParameterManager::V1::RenderParameterVersionResponse.
p result

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
# File 'lib/google/cloud/parameter_manager/v1/parameter_manager/rest/client.rb', line 915

def render_parameter_version request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ParameterManager::V1::RenderParameterVersionRequest

  # 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
   = @config.rpcs.render_parameter_version..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::ParameterManager::V1::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

  options.apply_defaults timeout:      @config.rpcs.render_parameter_version.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.render_parameter_version.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @parameter_manager_stub.render_parameter_version 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

#universe_domainString

The effective universe domain

Returns:

  • (String)


144
145
146
# File 'lib/google/cloud/parameter_manager/v1/parameter_manager/rest/client.rb', line 144

def universe_domain
  @parameter_manager_stub.universe_domain
end

#update_parameter(request, options = nil) ⇒ ::Google::Cloud::ParameterManager::V1::Parameter #update_parameter(update_mask: nil, parameter: nil, request_id: nil) ⇒ ::Google::Cloud::ParameterManager::V1::Parameter

Updates a single Parameter.

Examples:

Basic example

require "google/cloud/parameter_manager/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ParameterManager::V1::ParameterManager::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ParameterManager::V1::UpdateParameterRequest.new

# Call the update_parameter method.
result = client.update_parameter request

# The returned object is of type Google::Cloud::ParameterManager::V1::Parameter.
p result

Overloads:

  • #update_parameter(request, options = nil) ⇒ ::Google::Cloud::ParameterManager::V1::Parameter

    Pass arguments to update_parameter via a request object, either of type UpdateParameterRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ParameterManager::V1::UpdateParameterRequest, ::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #update_parameter(update_mask: nil, parameter: nil, request_id: nil) ⇒ ::Google::Cloud::ParameterManager::V1::Parameter

    Pass arguments to update_parameter 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).

    Parameters:

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      Optional. Field mask is used to specify the fields to be overwritten in the Parameter resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A mutable field will be overwritten if it is in the mask. If the user does not provide a mask then all mutable fields present in the request will be overwritten.

    • parameter (::Google::Cloud::ParameterManager::V1::Parameter, ::Hash) (defaults to: nil)

      Required. The Parameter resource being updated

    • request_id (::String) (defaults to: nil)

      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).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
# File 'lib/google/cloud/parameter_manager/v1/parameter_manager/rest/client.rb', line 567

def update_parameter request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ParameterManager::V1::UpdateParameterRequest

  # 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
   = @config.rpcs.update_parameter..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::ParameterManager::V1::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

  options.apply_defaults timeout:      @config.rpcs.update_parameter.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_parameter.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @parameter_manager_stub.update_parameter 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

#update_parameter_version(request, options = nil) ⇒ ::Google::Cloud::ParameterManager::V1::ParameterVersion #update_parameter_version(update_mask: nil, parameter_version: nil, request_id: nil) ⇒ ::Google::Cloud::ParameterManager::V1::ParameterVersion

Updates a single ParameterVersion.

Examples:

Basic example

require "google/cloud/parameter_manager/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ParameterManager::V1::ParameterManager::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ParameterManager::V1::UpdateParameterVersionRequest.new

# Call the update_parameter_version method.
result = client.update_parameter_version request

# The returned object is of type Google::Cloud::ParameterManager::V1::ParameterVersion.
p result

Overloads:

  • #update_parameter_version(request, options = nil) ⇒ ::Google::Cloud::ParameterManager::V1::ParameterVersion

    Pass arguments to update_parameter_version via a request object, either of type UpdateParameterVersionRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ParameterManager::V1::UpdateParameterVersionRequest, ::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #update_parameter_version(update_mask: nil, parameter_version: nil, request_id: nil) ⇒ ::Google::Cloud::ParameterManager::V1::ParameterVersion

    Pass arguments to update_parameter_version 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).

    Parameters:

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      Optional. Field mask is used to specify the fields to be overwritten in the ParameterVersion resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A mutable field will be overwritten if it is in the mask. If the user does not provide a mask then all mutable fields present in the request will be overwritten.

    • parameter_version (::Google::Cloud::ParameterManager::V1::ParameterVersion, ::Hash) (defaults to: nil)

      Required. The ParameterVersion resource being updated

    • request_id (::String) (defaults to: nil)

      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).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
# File 'lib/google/cloud/parameter_manager/v1/parameter_manager/rest/client.rb', line 1111

def update_parameter_version request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ParameterManager::V1::UpdateParameterVersionRequest

  # 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
   = @config.rpcs.update_parameter_version..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::ParameterManager::V1::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

  options.apply_defaults timeout:      @config.rpcs.update_parameter_version.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_parameter_version.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @parameter_manager_stub.update_parameter_version 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