<?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
{
    /**
     * Optional. Configuration for customers to opt in for the feature.
     *
     * Generated from protobuf field <code>optional bool enable = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $enable = null;
    /**
     * Optional. List of trusted domains.
     *
     * Generated from protobuf field <code>repeated string domains = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $domains;

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

    /**
     * Optional. Configuration for customers to opt in for the feature.
     *
     * Generated from protobuf field <code>optional bool enable = 1 [(.google.api.field_behavior) = OPTIONAL];</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);
    }

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

        return $this;
    }

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

    /**
     * Optional. List of trusted domains.
     *
     * Generated from protobuf field <code>repeated string domains = 2 [(.google.api.field_behavior) = OPTIONAL];</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;
    }

}

