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.
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.
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.
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.
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.
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.
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.
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.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Grafeas V1 API - Class Grafeas::V1::SourceContext (v1.4.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.4.0 (latest)](/ruby/docs/reference/grafeas-v1/latest/Grafeas-V1-SourceContext)\n- [1.3.1](/ruby/docs/reference/grafeas-v1/1.3.1/Grafeas-V1-SourceContext)\n- [1.2.0](/ruby/docs/reference/grafeas-v1/1.2.0/Grafeas-V1-SourceContext)\n- [1.1.1](/ruby/docs/reference/grafeas-v1/1.1.1/Grafeas-V1-SourceContext)\n- [1.0.0](/ruby/docs/reference/grafeas-v1/1.0.0/Grafeas-V1-SourceContext)\n- [0.16.1](/ruby/docs/reference/grafeas-v1/0.16.1/Grafeas-V1-SourceContext)\n- [0.15.0](/ruby/docs/reference/grafeas-v1/0.15.0/Grafeas-V1-SourceContext)\n- [0.14.2](/ruby/docs/reference/grafeas-v1/0.14.2/Grafeas-V1-SourceContext)\n- [0.13.0](/ruby/docs/reference/grafeas-v1/0.13.0/Grafeas-V1-SourceContext)\n- [0.12.1](/ruby/docs/reference/grafeas-v1/0.12.1/Grafeas-V1-SourceContext)\n- [0.11.0](/ruby/docs/reference/grafeas-v1/0.11.0/Grafeas-V1-SourceContext)\n- [0.10.0](/ruby/docs/reference/grafeas-v1/0.10.0/Grafeas-V1-SourceContext)\n- [0.9.0](/ruby/docs/reference/grafeas-v1/0.9.0/Grafeas-V1-SourceContext)\n- [0.8.0](/ruby/docs/reference/grafeas-v1/0.8.0/Grafeas-V1-SourceContext)\n- [0.7.0](/ruby/docs/reference/grafeas-v1/0.7.0/Grafeas-V1-SourceContext)\n- [0.6.1](/ruby/docs/reference/grafeas-v1/0.6.1/Grafeas-V1-SourceContext)\n- [0.5.0](/ruby/docs/reference/grafeas-v1/0.5.0/Grafeas-V1-SourceContext)\n- [0.4.0](/ruby/docs/reference/grafeas-v1/0.4.0/Grafeas-V1-SourceContext)\n- [0.3.1](/ruby/docs/reference/grafeas-v1/0.3.1/Grafeas-V1-SourceContext) \nReference documentation and code samples for the Grafeas V1 API class Grafeas::V1::SourceContext.\n\nA SourceContext is a reference to a tree of files. A SourceContext together\nwith a path point to a unique revision of a single file or directory. \n\nInherits\n--------\n\n- Object \n\nExtended By\n-----------\n\n- Google::Protobuf::MessageExts::ClassMethods \n\nIncludes\n--------\n\n- Google::Protobuf::MessageExts\n\nMethods\n-------\n\n### #cloud_repo\n\n def cloud_repo() -\u003e ::Grafeas::V1::CloudRepoSourceContext\n\n**Returns**\n\n- ([::Grafeas::V1::CloudRepoSourceContext](./Grafeas-V1-CloudRepoSourceContext)) --- A SourceContext referring to a revision in a Google Cloud Source Repo.\n\n\n 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.\n\n### #cloud_repo=\n\n def cloud_repo=(value) -\u003e ::Grafeas::V1::CloudRepoSourceContext\n\n**Parameter**\n\n- **value** ([::Grafeas::V1::CloudRepoSourceContext](./Grafeas-V1-CloudRepoSourceContext)) --- A SourceContext referring to a revision in a Google Cloud Source Repo.\n\n\nNote: 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. \n**Returns**\n\n- ([::Grafeas::V1::CloudRepoSourceContext](./Grafeas-V1-CloudRepoSourceContext)) --- A SourceContext referring to a revision in a Google Cloud Source Repo.\n\n\n 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.\n\n### #gerrit\n\n def gerrit() -\u003e ::Grafeas::V1::GerritSourceContext\n\n**Returns**\n\n- ([::Grafeas::V1::GerritSourceContext](./Grafeas-V1-GerritSourceContext)) --- A SourceContext referring to a Gerrit project.\n\n\n 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.\n\n### #gerrit=\n\n def gerrit=(value) -\u003e ::Grafeas::V1::GerritSourceContext\n\n**Parameter**\n\n- **value** ([::Grafeas::V1::GerritSourceContext](./Grafeas-V1-GerritSourceContext)) --- A SourceContext referring to a Gerrit project.\n\n\nNote: 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. \n**Returns**\n\n- ([::Grafeas::V1::GerritSourceContext](./Grafeas-V1-GerritSourceContext)) --- A SourceContext referring to a Gerrit project.\n\n\n 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.\n\n### #git\n\n def git() -\u003e ::Grafeas::V1::GitSourceContext\n\n**Returns**\n\n- ([::Grafeas::V1::GitSourceContext](./Grafeas-V1-GitSourceContext)) --- A SourceContext referring to any third party Git repo (e.g., GitHub).\n\n\n 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.\n\n### #git=\n\n def git=(value) -\u003e ::Grafeas::V1::GitSourceContext\n\n**Parameter**\n\n- **value** ([::Grafeas::V1::GitSourceContext](./Grafeas-V1-GitSourceContext)) --- A SourceContext referring to any third party Git repo (e.g., GitHub).\n\n\nNote: 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. \n**Returns**\n\n- ([::Grafeas::V1::GitSourceContext](./Grafeas-V1-GitSourceContext)) --- A SourceContext referring to any third party Git repo (e.g., GitHub).\n\n\n 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.\n\n### #labels\n\n def labels() -\u003e ::Google::Protobuf::Map{::String =\u003e ::String}\n\n**Returns**\n\n- (::Google::Protobuf::Map{::String =\\\u003e ::String}) --- Labels with user defined metadata.\n\n### #labels=\n\n def labels=(value) -\u003e ::Google::Protobuf::Map{::String =\u003e ::String}\n\n**Parameter**\n\n- **value** (::Google::Protobuf::Map{::String =\\\u003e ::String}) --- Labels with user defined metadata. \n**Returns**\n\n- (::Google::Protobuf::Map{::String =\\\u003e ::String}) --- Labels with user defined metadata."]]