Method: Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client#get_application

Defined in:
lib/google/cloud/vision_ai/v1/app_platform/rest/client.rb

#get_application(request, options = nil) ⇒ ::Google::Cloud::VisionAI::V1::Application #get_application(name: nil) ⇒ ::Google::Cloud::VisionAI::V1::Application

Gets details of a single Application.

Examples:

Basic example

require "google/cloud/vision_ai/v1"

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

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

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

# The returned object is of type Google::Cloud::VisionAI::V1::Application.
p result

Overloads:

  • #get_application(request, options = nil) ⇒ ::Google::Cloud::VisionAI::V1::Application

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

    Parameters:

    • request (::Google::Cloud::VisionAI::V1::GetApplicationRequest, ::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_application(name: nil) ⇒ ::Google::Cloud::VisionAI::V1::Application

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

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
# File 'lib/google/cloud/vision_ai/v1/app_platform/rest/client.rb', line 359

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetApplicationRequest

  # 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_application..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::VisionAI::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_application.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_application.retry_policy

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

  @app_platform_stub.get_application 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