<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/ads/googleads/v23/services/asset_generation_service.proto

namespace Google\Ads\GoogleAds\V23\Services;

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

/**
 * The context for which assets are being generated, such as an existing
 * AssetGroup or AdGroupAd.
 *
 * Generated from protobuf message <code>google.ads.googleads.v23.services.AssetGenerationExistingContext</code>
 */
class AssetGenerationExistingContext extends \Google\Protobuf\Internal\Message
{
    protected $existing_context;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $existing_asset_group
     *           Resource name of an existing AssetGroup for which these assets are being
     *           generated.
     *     @type string $existing_ad_group_ad
     *           Resource name of an existing AdGroupAd for which these assets are being
     *           generated.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Ads\GoogleAds\V23\Services\AssetGenerationService::initOnce();
        parent::__construct($data);
    }

    /**
     * Resource name of an existing AssetGroup for which these assets are being
     * generated.
     *
     * Generated from protobuf field <code>string existing_asset_group = 1 [(.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getExistingAssetGroup()
    {
        return $this->readOneof(1);
    }

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

    /**
     * Resource name of an existing AssetGroup for which these assets are being
     * generated.
     *
     * Generated from protobuf field <code>string existing_asset_group = 1 [(.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setExistingAssetGroup($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * Resource name of an existing AdGroupAd for which these assets are being
     * generated.
     *
     * Generated from protobuf field <code>string existing_ad_group_ad = 2 [(.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getExistingAdGroupAd()
    {
        return $this->readOneof(2);
    }

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

    /**
     * Resource name of an existing AdGroupAd for which these assets are being
     * generated.
     *
     * Generated from protobuf field <code>string existing_ad_group_ad = 2 [(.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setExistingAdGroupAd($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(2, $var);

        return $this;
    }

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

}

