<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/ads/googleads/v21/common/customizer_value.proto

namespace Google\Ads\GoogleAds\V21\Common;

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

/**
 * A customizer value that is referenced in customizer linkage entities
 * like CustomerCustomizer, CampaignCustomizer, etc.
 *
 * Generated from protobuf message <code>google.ads.googleads.v21.common.CustomizerValue</code>
 */
class CustomizerValue extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The data type for the customizer value. It must match the
     * attribute type. The string_value content must match the constraints
     * associated with the type.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v21.enums.CustomizerAttributeTypeEnum.CustomizerAttributeType type = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $type = 0;
    /**
     * Required. Value to insert in creative text. Customizer values of all types
     * are stored as string to make formatting unambiguous.
     *
     * Generated from protobuf field <code>string string_value = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $string_value = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $type
     *           Required. The data type for the customizer value. It must match the
     *           attribute type. The string_value content must match the constraints
     *           associated with the type.
     *     @type string $string_value
     *           Required. Value to insert in creative text. Customizer values of all types
     *           are stored as string to make formatting unambiguous.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Ads\GoogleAds\V21\Common\CustomizerValue::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The data type for the customizer value. It must match the
     * attribute type. The string_value content must match the constraints
     * associated with the type.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v21.enums.CustomizerAttributeTypeEnum.CustomizerAttributeType type = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * Required. The data type for the customizer value. It must match the
     * attribute type. The string_value content must match the constraints
     * associated with the type.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v21.enums.CustomizerAttributeTypeEnum.CustomizerAttributeType type = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setType($var)
    {
        GPBUtil::checkEnum($var, \Google\Ads\GoogleAds\V21\Enums\CustomizerAttributeTypeEnum\CustomizerAttributeType::class);
        $this->type = $var;

        return $this;
    }

    /**
     * Required. Value to insert in creative text. Customizer values of all types
     * are stored as string to make formatting unambiguous.
     *
     * Generated from protobuf field <code>string string_value = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getStringValue()
    {
        return $this->string_value;
    }

    /**
     * Required. Value to insert in creative text. Customizer values of all types
     * are stored as string to make formatting unambiguous.
     *
     * Generated from protobuf field <code>string string_value = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setStringValue($var)
    {
        GPBUtil::checkString($var, True);
        $this->string_value = $var;

        return $this;
    }

}

