<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/devtools/cloudbuild/v1/cloudbuild.proto

namespace Google\Cloud\Build\V1;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * Provenance of the source. Ways to find the original source, or verify that
 * some source was used for this build.
 *
 * Generated from protobuf message <code>google.devtools.cloudbuild.v1.SourceProvenance</code>
 */
class SourceProvenance extends \Google\Protobuf\Internal\Message
{
    /**
     * A copy of the build's `source.storage_source`, if exists, with any
     * generations resolved.
     *
     * Generated from protobuf field <code>.google.devtools.cloudbuild.v1.StorageSource resolved_storage_source = 3;</code>
     */
    private $resolved_storage_source = null;
    /**
     * A copy of the build's `source.repo_source`, if exists, with any
     * revisions resolved.
     *
     * Generated from protobuf field <code>.google.devtools.cloudbuild.v1.RepoSource resolved_repo_source = 6;</code>
     */
    private $resolved_repo_source = null;
    /**
     * A copy of the build's `source.storage_source_manifest`, if exists, with any
     * revisions resolved.
     * This feature is in Preview.
     *
     * Generated from protobuf field <code>.google.devtools.cloudbuild.v1.StorageSourceManifest resolved_storage_source_manifest = 9;</code>
     */
    private $resolved_storage_source_manifest = null;
    /**
     * Output only. Hash(es) of the build source, which can be used to verify that
     * the original source integrity was maintained in the build. Note that
     * `FileHashes` will only be populated if `BuildOptions` has requested a
     * `SourceProvenanceHash`.
     * The keys to this map are file paths used as build source and the values
     * contain the hash values for those files.
     * If the build source came in a single package such as a gzipped tarfile
     * (`.tar.gz`), the `FileHash` will be for the single path to that file.
     *
     * Generated from protobuf field <code>map<string, .google.devtools.cloudbuild.v1.FileHashes> file_hashes = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $file_hashes;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Build\V1\StorageSource $resolved_storage_source
     *           A copy of the build's `source.storage_source`, if exists, with any
     *           generations resolved.
     *     @type \Google\Cloud\Build\V1\RepoSource $resolved_repo_source
     *           A copy of the build's `source.repo_source`, if exists, with any
     *           revisions resolved.
     *     @type \Google\Cloud\Build\V1\StorageSourceManifest $resolved_storage_source_manifest
     *           A copy of the build's `source.storage_source_manifest`, if exists, with any
     *           revisions resolved.
     *           This feature is in Preview.
     *     @type array|\Google\Protobuf\Internal\MapField $file_hashes
     *           Output only. Hash(es) of the build source, which can be used to verify that
     *           the original source integrity was maintained in the build. Note that
     *           `FileHashes` will only be populated if `BuildOptions` has requested a
     *           `SourceProvenanceHash`.
     *           The keys to this map are file paths used as build source and the values
     *           contain the hash values for those files.
     *           If the build source came in a single package such as a gzipped tarfile
     *           (`.tar.gz`), the `FileHash` will be for the single path to that file.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce();
        parent::__construct($data);
    }

    /**
     * A copy of the build's `source.storage_source`, if exists, with any
     * generations resolved.
     *
     * Generated from protobuf field <code>.google.devtools.cloudbuild.v1.StorageSource resolved_storage_source = 3;</code>
     * @return \Google\Cloud\Build\V1\StorageSource|null
     */
    public function getResolvedStorageSource()
    {
        return isset($this->resolved_storage_source) ? $this->resolved_storage_source : null;
    }

    public function hasResolvedStorageSource()
    {
        return isset($this->resolved_storage_source);
    }

    public function clearResolvedStorageSource()
    {
        unset($this->resolved_storage_source);
    }

    /**
     * A copy of the build's `source.storage_source`, if exists, with any
     * generations resolved.
     *
     * Generated from protobuf field <code>.google.devtools.cloudbuild.v1.StorageSource resolved_storage_source = 3;</code>
     * @param \Google\Cloud\Build\V1\StorageSource $var
     * @return $this
     */
    public function setResolvedStorageSource($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\StorageSource::class);
        $this->resolved_storage_source = $var;

        return $this;
    }

    /**
     * A copy of the build's `source.repo_source`, if exists, with any
     * revisions resolved.
     *
     * Generated from protobuf field <code>.google.devtools.cloudbuild.v1.RepoSource resolved_repo_source = 6;</code>
     * @return \Google\Cloud\Build\V1\RepoSource|null
     */
    public function getResolvedRepoSource()
    {
        return isset($this->resolved_repo_source) ? $this->resolved_repo_source : null;
    }

    public function hasResolvedRepoSource()
    {
        return isset($this->resolved_repo_source);
    }

    public function clearResolvedRepoSource()
    {
        unset($this->resolved_repo_source);
    }

    /**
     * A copy of the build's `source.repo_source`, if exists, with any
     * revisions resolved.
     *
     * Generated from protobuf field <code>.google.devtools.cloudbuild.v1.RepoSource resolved_repo_source = 6;</code>
     * @param \Google\Cloud\Build\V1\RepoSource $var
     * @return $this
     */
    public function setResolvedRepoSource($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\RepoSource::class);
        $this->resolved_repo_source = $var;

        return $this;
    }

    /**
     * A copy of the build's `source.storage_source_manifest`, if exists, with any
     * revisions resolved.
     * This feature is in Preview.
     *
     * Generated from protobuf field <code>.google.devtools.cloudbuild.v1.StorageSourceManifest resolved_storage_source_manifest = 9;</code>
     * @return \Google\Cloud\Build\V1\StorageSourceManifest|null
     */
    public function getResolvedStorageSourceManifest()
    {
        return isset($this->resolved_storage_source_manifest) ? $this->resolved_storage_source_manifest : null;
    }

    public function hasResolvedStorageSourceManifest()
    {
        return isset($this->resolved_storage_source_manifest);
    }

    public function clearResolvedStorageSourceManifest()
    {
        unset($this->resolved_storage_source_manifest);
    }

    /**
     * A copy of the build's `source.storage_source_manifest`, if exists, with any
     * revisions resolved.
     * This feature is in Preview.
     *
     * Generated from protobuf field <code>.google.devtools.cloudbuild.v1.StorageSourceManifest resolved_storage_source_manifest = 9;</code>
     * @param \Google\Cloud\Build\V1\StorageSourceManifest $var
     * @return $this
     */
    public function setResolvedStorageSourceManifest($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\StorageSourceManifest::class);
        $this->resolved_storage_source_manifest = $var;

        return $this;
    }

    /**
     * Output only. Hash(es) of the build source, which can be used to verify that
     * the original source integrity was maintained in the build. Note that
     * `FileHashes` will only be populated if `BuildOptions` has requested a
     * `SourceProvenanceHash`.
     * The keys to this map are file paths used as build source and the values
     * contain the hash values for those files.
     * If the build source came in a single package such as a gzipped tarfile
     * (`.tar.gz`), the `FileHash` will be for the single path to that file.
     *
     * Generated from protobuf field <code>map<string, .google.devtools.cloudbuild.v1.FileHashes> file_hashes = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getFileHashes()
    {
        return $this->file_hashes;
    }

    /**
     * Output only. Hash(es) of the build source, which can be used to verify that
     * the original source integrity was maintained in the build. Note that
     * `FileHashes` will only be populated if `BuildOptions` has requested a
     * `SourceProvenanceHash`.
     * The keys to this map are file paths used as build source and the values
     * contain the hash values for those files.
     * If the build source came in a single package such as a gzipped tarfile
     * (`.tar.gz`), the `FileHash` will be for the single path to that file.
     *
     * Generated from protobuf field <code>map<string, .google.devtools.cloudbuild.v1.FileHashes> file_hashes = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setFileHashes($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Build\V1\FileHashes::class);
        $this->file_hashes = $arr;

        return $this;
    }

}

