module Grafeas

Auto-generated by gapic-generator-ruby. DO NOT EDIT!

Constants

VERSION

Public Class Methods

grafeas(version: :v1, &block) click to toggle source

Create a new client object for Grafeas.

By default, this returns an instance of [Grafeas::V1::Grafeas::Client](googleapis.dev/ruby/grafeas-v1/latest/Grafeas/V1/Grafeas/Client.html) for version V1 of the API. However, you can specify specify a different API version by passing it in the `version` parameter. If the Grafeas service is supported by that API version, and the corresponding gem is available, the appropriate versioned client will be returned.

## About Grafeas

[Grafeas](grafeas.io) API.

Retrieves analysis results of Cloud components such as Docker container images.

Analysis results are stored as a series of occurrences. An `Occurrence` contains information about a specific analysis instance on a resource. An occurrence refers to a `Note`. A note contains details describing the analysis and is generally stored in a separate project, called a `Provider`. Multiple occurrences can refer to the same note.

For example, an SSL vulnerability could affect multiple images. In this case, there would be one note for the vulnerability and an occurrence for each image with the vulnerability referring to that note.

@param version [::String, ::Symbol] The API version to connect to. Optional.

Defaults to `:v1`.

@return [Grafeas::Client] A client object for the specified version.

# File lib/grafeas.rb, line 60
def self.grafeas version: :v1, &block
  require "grafeas/#{version.to_s.downcase}"

  package_name = Grafeas
                 .constants
                 .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
                 .first
  package_module = Grafeas.const_get package_name
  package_module.const_get(:Grafeas).const_get(:Client).new(&block)
end