# Grafeas V1 API - Class Grafeas::V1::SourceContext (v1.9.0)

1.9.0 (latest) 1.8.0 1.7.0 1.6.0 1.5.1 1.4.0 1.3.1 1.2.0 1.1.1 1.0.0 0.16.1 0.15.0 0.14.2 0.13.0 0.12.1 0.11.0 0.10.0 0.9.0 0.8.0 0.7.0 0.6.1 0.5.0 0.4.0 0.3.1 Reference documentation and code samples for the Grafeas V1 API class Grafeas::V1::SourceContext.

A SourceContext is a reference to a tree of files. A SourceContext together
with a path point to a unique revision of a single file or directory.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #cloud_repo

    def cloud_repo() -> ::Grafeas::V1::CloudRepoSourceContext

**Returns**

- ([::Grafeas::V1::CloudRepoSourceContext](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-CloudRepoSourceContext)) --- A SourceContext referring to a revision in a Google Cloud Source Repo.


  Note: The following fields are mutually exclusive: `cloud_repo`, `gerrit`, `git`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #cloud_repo=

    def cloud_repo=(value) -> ::Grafeas::V1::CloudRepoSourceContext

**Parameter**

- **value** ([::Grafeas::V1::CloudRepoSourceContext](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-CloudRepoSourceContext)) --- A SourceContext referring to a revision in a Google Cloud Source Repo.


  Note: The following fields are mutually exclusive: `cloud_repo`, `gerrit`, `git`. If a field in that set is populated, all other fields in the set will automatically be cleared.
**Returns**

- ([::Grafeas::V1::CloudRepoSourceContext](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-CloudRepoSourceContext)) --- A SourceContext referring to a revision in a Google Cloud Source Repo.


  Note: The following fields are mutually exclusive: `cloud_repo`, `gerrit`, `git`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #gerrit

    def gerrit() -> ::Grafeas::V1::GerritSourceContext

**Returns**

- ([::Grafeas::V1::GerritSourceContext](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-GerritSourceContext)) --- A SourceContext referring to a Gerrit project.


  Note: The following fields are mutually exclusive: `gerrit`, `cloud_repo`, `git`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #gerrit=

    def gerrit=(value) -> ::Grafeas::V1::GerritSourceContext

**Parameter**

- **value** ([::Grafeas::V1::GerritSourceContext](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-GerritSourceContext)) --- A SourceContext referring to a Gerrit project.


  Note: The following fields are mutually exclusive: `gerrit`, `cloud_repo`, `git`. If a field in that set is populated, all other fields in the set will automatically be cleared.
**Returns**

- ([::Grafeas::V1::GerritSourceContext](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-GerritSourceContext)) --- A SourceContext referring to a Gerrit project.


  Note: The following fields are mutually exclusive: `gerrit`, `cloud_repo`, `git`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #git

    def git() -> ::Grafeas::V1::GitSourceContext

**Returns**

- ([::Grafeas::V1::GitSourceContext](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-GitSourceContext)) --- A SourceContext referring to any third party Git repo (e.g., GitHub).


  Note: The following fields are mutually exclusive: `git`, `cloud_repo`, `gerrit`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #git=

    def git=(value) -> ::Grafeas::V1::GitSourceContext

**Parameter**

- **value** ([::Grafeas::V1::GitSourceContext](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-GitSourceContext)) --- A SourceContext referring to any third party Git repo (e.g., GitHub).


  Note: The following fields are mutually exclusive: `git`, `cloud_repo`, `gerrit`. If a field in that set is populated, all other fields in the set will automatically be cleared.
**Returns**

- ([::Grafeas::V1::GitSourceContext](https://docs.cloud.google.com/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-GitSourceContext)) --- A SourceContext referring to any third party Git repo (e.g., GitHub).


  Note: The following fields are mutually exclusive: `git`, `cloud_repo`, `gerrit`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #labels

    def labels() -> ::Google::Protobuf::Map{::String => ::String}

**Returns**

- (::Google::Protobuf::Map{::String =\> ::String}) --- Labels with user defined metadata.

### #labels=

    def labels=(value) -> ::Google::Protobuf::Map{::String => ::String}

**Parameter**

- **value** (::Google::Protobuf::Map{::String =\> ::String}) --- Labels with user defined metadata.
**Returns**

- (::Google::Protobuf::Map{::String =\> ::String}) --- Labels with user defined metadata.