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

namespace Google\Ads\AdManager\V1\CreativeTemplateVariable;

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

/**
 * Represents a url variable defined in a creative template.
 * Use [UrlCreativeTemplateVariableValue][] to specify the value for this
 * variable when creating a [TemplateCreative][] from a
 * [CreativeTemplate][google.ads.admanager.v1.CreativeTemplate].
 *
 * Generated from protobuf message <code>google.ads.admanager.v1.CreativeTemplateVariable.UrlCreativeTemplateVariable</code>
 */
class UrlCreativeTemplateVariable extends \Google\Protobuf\Internal\Message
{
    /**
     * Optional. Default value to be filled in when creating creatives from the
     * creative template.
     *
     * Generated from protobuf field <code>optional string default_value = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $default_value = null;
    /**
     * Optional. Sample value that is used when previewing the template in the
     * UI.
     *
     * Generated from protobuf field <code>optional string sample_value = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $sample_value = null;
    /**
     * Optional. The type of URL that this variable represents. Different types
     * of URLs may be handled differently at rendering time.
     *
     * Generated from protobuf field <code>optional .google.ads.admanager.v1.CreativeTemplateVariableUrlTypeEnum.CreativeTemplateVariableUrlType url_type = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $url_type = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $default_value
     *           Optional. Default value to be filled in when creating creatives from the
     *           creative template.
     *     @type string $sample_value
     *           Optional. Sample value that is used when previewing the template in the
     *           UI.
     *     @type int $url_type
     *           Optional. The type of URL that this variable represents. Different types
     *           of URLs may be handled differently at rendering time.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Ads\Admanager\V1\CreativeTemplateMessages::initOnce();
        parent::__construct($data);
    }

    /**
     * Optional. Default value to be filled in when creating creatives from the
     * creative template.
     *
     * Generated from protobuf field <code>optional string default_value = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getDefaultValue()
    {
        return isset($this->default_value) ? $this->default_value : '';
    }

    public function hasDefaultValue()
    {
        return isset($this->default_value);
    }

    public function clearDefaultValue()
    {
        unset($this->default_value);
    }

    /**
     * Optional. Default value to be filled in when creating creatives from the
     * creative template.
     *
     * Generated from protobuf field <code>optional string default_value = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setDefaultValue($var)
    {
        GPBUtil::checkString($var, True);
        $this->default_value = $var;

        return $this;
    }

    /**
     * Optional. Sample value that is used when previewing the template in the
     * UI.
     *
     * Generated from protobuf field <code>optional string sample_value = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getSampleValue()
    {
        return isset($this->sample_value) ? $this->sample_value : '';
    }

    public function hasSampleValue()
    {
        return isset($this->sample_value);
    }

    public function clearSampleValue()
    {
        unset($this->sample_value);
    }

    /**
     * Optional. Sample value that is used when previewing the template in the
     * UI.
     *
     * Generated from protobuf field <code>optional string sample_value = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setSampleValue($var)
    {
        GPBUtil::checkString($var, True);
        $this->sample_value = $var;

        return $this;
    }

    /**
     * Optional. The type of URL that this variable represents. Different types
     * of URLs may be handled differently at rendering time.
     *
     * Generated from protobuf field <code>optional .google.ads.admanager.v1.CreativeTemplateVariableUrlTypeEnum.CreativeTemplateVariableUrlType url_type = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return int
     */
    public function getUrlType()
    {
        return isset($this->url_type) ? $this->url_type : 0;
    }

    public function hasUrlType()
    {
        return isset($this->url_type);
    }

    public function clearUrlType()
    {
        unset($this->url_type);
    }

    /**
     * Optional. The type of URL that this variable represents. Different types
     * of URLs may be handled differently at rendering time.
     *
     * Generated from protobuf field <code>optional .google.ads.admanager.v1.CreativeTemplateVariableUrlTypeEnum.CreativeTemplateVariableUrlType url_type = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param int $var
     * @return $this
     */
    public function setUrlType($var)
    {
        GPBUtil::checkEnum($var, \Google\Ads\AdManager\V1\CreativeTemplateVariableUrlTypeEnum\CreativeTemplateVariableUrlType::class);
        $this->url_type = $var;

        return $this;
    }

}

