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

namespace Google\Cloud\Iap\V1;

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

/**
 * Configuration for IAP allowed domains. Lets you to restrict access to an app
 * and allow access to only the domains that you list.
 *
 * Generated from protobuf message <code>google.cloud.iap.v1.AllowedDomainsSettings</code>
 */
class AllowedDomainsSettings extends \Google\Protobuf\Internal\Message
{
    /**
     * Configuration for customers to opt in for the feature.
     *
     * Generated from protobuf field <code>optional bool enable = 1;</code>
     */
    protected $enable = null;
    /**
     * List of trusted domains.
     *
     * Generated from protobuf field <code>repeated string domains = 2;</code>
     */
    private $domains;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type bool $enable
     *           Configuration for customers to opt in for the feature.
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $domains
     *           List of trusted domains.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Iap\V1\Service::initOnce();
        parent::__construct($data);
    }

    /**
     * Configuration for customers to opt in for the feature.
     *
     * Generated from protobuf field <code>optional bool enable = 1;</code>
     * @return bool
     */
    public function getEnable()
    {
        return isset($this->enable) ? $this->enable : false;
    }

    public function hasEnable()
    {
        return isset($this->enable);
    }

    public function clearEnable()
    {
        unset($this->enable);
    }

    /**
     * Configuration for customers to opt in for the feature.
     *
     * Generated from protobuf field <code>optional bool enable = 1;</code>
     * @param bool $var
     * @return $this
     */
    public function setEnable($var)
    {
        GPBUtil::checkBool($var);
        $this->enable = $var;

        return $this;
    }

    /**
     * List of trusted domains.
     *
     * Generated from protobuf field <code>repeated string domains = 2;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getDomains()
    {
        return $this->domains;
    }

    /**
     * List of trusted domains.
     *
     * Generated from protobuf field <code>repeated string domains = 2;</code>
     * @param array<string>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setDomains($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->domains = $arr;

        return $this;
    }

}

