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

namespace Google\Cloud\OsConfig\V1\OSPolicy\Resource;

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

/**
 * A resource that manages a package repository.
 *
 * Generated from protobuf message <code>google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource</code>
 */
class RepositoryResource extends \Google\Protobuf\Internal\Message
{
    protected $repository;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\OsConfig\V1\OSPolicy\Resource\RepositoryResource\AptRepository $apt
     *           An Apt Repository.
     *     @type \Google\Cloud\OsConfig\V1\OSPolicy\Resource\RepositoryResource\YumRepository $yum
     *           A Yum Repository.
     *     @type \Google\Cloud\OsConfig\V1\OSPolicy\Resource\RepositoryResource\ZypperRepository $zypper
     *           A Zypper Repository.
     *     @type \Google\Cloud\OsConfig\V1\OSPolicy\Resource\RepositoryResource\GooRepository $goo
     *           A Goo Repository.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Osconfig\V1\OsPolicy::initOnce();
        parent::__construct($data);
    }

    /**
     * An Apt Repository.
     *
     * Generated from protobuf field <code>.google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.AptRepository apt = 1;</code>
     * @return \Google\Cloud\OsConfig\V1\OSPolicy\Resource\RepositoryResource\AptRepository|null
     */
    public function getApt()
    {
        return $this->readOneof(1);
    }

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

    /**
     * An Apt Repository.
     *
     * Generated from protobuf field <code>.google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.AptRepository apt = 1;</code>
     * @param \Google\Cloud\OsConfig\V1\OSPolicy\Resource\RepositoryResource\AptRepository $var
     * @return $this
     */
    public function setApt($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\OsConfig\V1\OSPolicy\Resource\RepositoryResource\AptRepository::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * A Yum Repository.
     *
     * Generated from protobuf field <code>.google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.YumRepository yum = 2;</code>
     * @return \Google\Cloud\OsConfig\V1\OSPolicy\Resource\RepositoryResource\YumRepository|null
     */
    public function getYum()
    {
        return $this->readOneof(2);
    }

    public function hasYum()
    {
        return $this->hasOneof(2);
    }

    /**
     * A Yum Repository.
     *
     * Generated from protobuf field <code>.google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.YumRepository yum = 2;</code>
     * @param \Google\Cloud\OsConfig\V1\OSPolicy\Resource\RepositoryResource\YumRepository $var
     * @return $this
     */
    public function setYum($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\OsConfig\V1\OSPolicy\Resource\RepositoryResource\YumRepository::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * A Zypper Repository.
     *
     * Generated from protobuf field <code>.google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.ZypperRepository zypper = 3;</code>
     * @return \Google\Cloud\OsConfig\V1\OSPolicy\Resource\RepositoryResource\ZypperRepository|null
     */
    public function getZypper()
    {
        return $this->readOneof(3);
    }

    public function hasZypper()
    {
        return $this->hasOneof(3);
    }

    /**
     * A Zypper Repository.
     *
     * Generated from protobuf field <code>.google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.ZypperRepository zypper = 3;</code>
     * @param \Google\Cloud\OsConfig\V1\OSPolicy\Resource\RepositoryResource\ZypperRepository $var
     * @return $this
     */
    public function setZypper($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\OsConfig\V1\OSPolicy\Resource\RepositoryResource\ZypperRepository::class);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * A Goo Repository.
     *
     * Generated from protobuf field <code>.google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.GooRepository goo = 4;</code>
     * @return \Google\Cloud\OsConfig\V1\OSPolicy\Resource\RepositoryResource\GooRepository|null
     */
    public function getGoo()
    {
        return $this->readOneof(4);
    }

    public function hasGoo()
    {
        return $this->hasOneof(4);
    }

    /**
     * A Goo Repository.
     *
     * Generated from protobuf field <code>.google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.GooRepository goo = 4;</code>
     * @param \Google\Cloud\OsConfig\V1\OSPolicy\Resource\RepositoryResource\GooRepository $var
     * @return $this
     */
    public function setGoo($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\OsConfig\V1\OSPolicy\Resource\RepositoryResource\GooRepository::class);
        $this->writeOneof(4, $var);

        return $this;
    }

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

}


