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

namespace Google\Ads\GoogleAds\V23\Common;

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

/**
 * One input field instance within a form.
 *
 * Generated from protobuf message <code>google.ads.googleads.v23.common.LeadFormField</code>
 */
class LeadFormField extends \Google\Protobuf\Internal\Message
{
    /**
     * Describes the input type, which may be a predefined type such as "full
     * name" or a pre-vetted question like "What kind of vehicle do you have?".
     *
     * Generated from protobuf field <code>.google.ads.googleads.v23.enums.LeadFormFieldUserInputTypeEnum.LeadFormFieldUserInputType input_type = 1;</code>
     */
    protected $input_type = 0;
    protected $answers;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $input_type
     *           Describes the input type, which may be a predefined type such as "full
     *           name" or a pre-vetted question like "What kind of vehicle do you have?".
     *     @type \Google\Ads\GoogleAds\V23\Common\LeadFormSingleChoiceAnswers $single_choice_answers
     *           Answer configuration for a single choice question. Can be set only for
     *           pre-vetted question fields. Minimum of 2 answers required and maximum of
     *           12 allowed.
     *     @type bool $has_location_answer
     *           Answer configuration for location question. If true, campaign/account
     *           level location data (state, city, business name etc) will be rendered on
     *           the Lead Form.
     *           Starting V13.1, has_location_answer can only be set for "What is your
     *           preferred dealership?" question, for advertisers with Location Assets
     *           setup at campaign/account level.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Ads\GoogleAds\V23\Common\AssetTypes::initOnce();
        parent::__construct($data);
    }

    /**
     * Describes the input type, which may be a predefined type such as "full
     * name" or a pre-vetted question like "What kind of vehicle do you have?".
     *
     * Generated from protobuf field <code>.google.ads.googleads.v23.enums.LeadFormFieldUserInputTypeEnum.LeadFormFieldUserInputType input_type = 1;</code>
     * @return int
     */
    public function getInputType()
    {
        return $this->input_type;
    }

    /**
     * Describes the input type, which may be a predefined type such as "full
     * name" or a pre-vetted question like "What kind of vehicle do you have?".
     *
     * Generated from protobuf field <code>.google.ads.googleads.v23.enums.LeadFormFieldUserInputTypeEnum.LeadFormFieldUserInputType input_type = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setInputType($var)
    {
        GPBUtil::checkEnum($var, \Google\Ads\GoogleAds\V23\Enums\LeadFormFieldUserInputTypeEnum\LeadFormFieldUserInputType::class);
        $this->input_type = $var;

        return $this;
    }

    /**
     * Answer configuration for a single choice question. Can be set only for
     * pre-vetted question fields. Minimum of 2 answers required and maximum of
     * 12 allowed.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v23.common.LeadFormSingleChoiceAnswers single_choice_answers = 2;</code>
     * @return \Google\Ads\GoogleAds\V23\Common\LeadFormSingleChoiceAnswers|null
     */
    public function getSingleChoiceAnswers()
    {
        return $this->readOneof(2);
    }

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

    /**
     * Answer configuration for a single choice question. Can be set only for
     * pre-vetted question fields. Minimum of 2 answers required and maximum of
     * 12 allowed.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v23.common.LeadFormSingleChoiceAnswers single_choice_answers = 2;</code>
     * @param \Google\Ads\GoogleAds\V23\Common\LeadFormSingleChoiceAnswers $var
     * @return $this
     */
    public function setSingleChoiceAnswers($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V23\Common\LeadFormSingleChoiceAnswers::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Answer configuration for location question. If true, campaign/account
     * level location data (state, city, business name etc) will be rendered on
     * the Lead Form.
     * Starting V13.1, has_location_answer can only be set for "What is your
     * preferred dealership?" question, for advertisers with Location Assets
     * setup at campaign/account level.
     *
     * Generated from protobuf field <code>bool has_location_answer = 3;</code>
     * @return bool
     */
    public function getHasLocationAnswer()
    {
        return $this->readOneof(3);
    }

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

    /**
     * Answer configuration for location question. If true, campaign/account
     * level location data (state, city, business name etc) will be rendered on
     * the Lead Form.
     * Starting V13.1, has_location_answer can only be set for "What is your
     * preferred dealership?" question, for advertisers with Location Assets
     * setup at campaign/account level.
     *
     * Generated from protobuf field <code>bool has_location_answer = 3;</code>
     * @param bool $var
     * @return $this
     */
    public function setHasLocationAnswer($var)
    {
        GPBUtil::checkBool($var);
        $this->writeOneof(3, $var);

        return $this;
    }

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

}

