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

namespace Google\Cloud\ArtifactRegistry\V1beta2;

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

/**
 * Error information explaining why a package was not imported.
 *
 * Generated from protobuf message <code>google.devtools.artifactregistry.v1beta2.ImportAptArtifactsErrorInfo</code>
 */
class ImportAptArtifactsErrorInfo extends \Google\Protobuf\Internal\Message
{
    /**
     * The detailed error status.
     *
     * Generated from protobuf field <code>.google.rpc.Status error = 2;</code>
     */
    private $error = null;
    protected $source;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\ArtifactRegistry\V1beta2\ImportAptArtifactsGcsSource $gcs_source
     *           Google Cloud Storage location requested.
     *     @type \Google\Rpc\Status $error
     *           The detailed error status.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\AptArtifact::initOnce();
        parent::__construct($data);
    }

    /**
     * Google Cloud Storage location requested.
     *
     * Generated from protobuf field <code>.google.devtools.artifactregistry.v1beta2.ImportAptArtifactsGcsSource gcs_source = 1;</code>
     * @return \Google\Cloud\ArtifactRegistry\V1beta2\ImportAptArtifactsGcsSource|null
     */
    public function getGcsSource()
    {
        return $this->readOneof(1);
    }

    public function hasGcsSource()
    {
        return $this->hasOneof(1);
    }

    /**
     * Google Cloud Storage location requested.
     *
     * Generated from protobuf field <code>.google.devtools.artifactregistry.v1beta2.ImportAptArtifactsGcsSource gcs_source = 1;</code>
     * @param \Google\Cloud\ArtifactRegistry\V1beta2\ImportAptArtifactsGcsSource $var
     * @return $this
     */
    public function setGcsSource($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\ArtifactRegistry\V1beta2\ImportAptArtifactsGcsSource::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * The detailed error status.
     *
     * Generated from protobuf field <code>.google.rpc.Status error = 2;</code>
     * @return \Google\Rpc\Status|null
     */
    public function getError()
    {
        return $this->error;
    }

    public function hasError()
    {
        return isset($this->error);
    }

    public function clearError()
    {
        unset($this->error);
    }

    /**
     * The detailed error status.
     *
     * Generated from protobuf field <code>.google.rpc.Status error = 2;</code>
     * @param \Google\Rpc\Status $var
     * @return $this
     */
    public function setError($var)
    {
        GPBUtil::checkMessage($var, \Google\Rpc\Status::class);
        $this->error = $var;

        return $this;
    }

    /**
     * @return string
     */
    public function getSource()
    {
        return $this->whichOneof("source");
    }

}

