<?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 reauthentication policies.
 *
 * Generated from protobuf message <code>google.cloud.iap.v1.ReauthSettings</code>
 */
class ReauthSettings extends \Google\Protobuf\Internal\Message
{
    /**
     * Reauth method requested.
     *
     * Generated from protobuf field <code>.google.cloud.iap.v1.ReauthSettings.Method method = 1;</code>
     */
    private $method = 0;
    /**
     * Reauth session lifetime, how long before a user has to reauthenticate
     * again.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration max_age = 2;</code>
     */
    private $max_age = null;
    /**
     * How IAP determines the effective policy in cases of hierarchial policies.
     * Policies are merged from higher in the hierarchy to lower in the hierarchy.
     *
     * Generated from protobuf field <code>.google.cloud.iap.v1.ReauthSettings.PolicyType policy_type = 3;</code>
     */
    private $policy_type = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $method
     *           Reauth method requested.
     *     @type \Google\Protobuf\Duration $max_age
     *           Reauth session lifetime, how long before a user has to reauthenticate
     *           again.
     *     @type int $policy_type
     *           How IAP determines the effective policy in cases of hierarchial policies.
     *           Policies are merged from higher in the hierarchy to lower in the hierarchy.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Iap\V1\Service::initOnce();
        parent::__construct($data);
    }

    /**
     * Reauth method requested.
     *
     * Generated from protobuf field <code>.google.cloud.iap.v1.ReauthSettings.Method method = 1;</code>
     * @return int
     */
    public function getMethod()
    {
        return $this->method;
    }

    /**
     * Reauth method requested.
     *
     * Generated from protobuf field <code>.google.cloud.iap.v1.ReauthSettings.Method method = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setMethod($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Iap\V1\ReauthSettings\Method::class);
        $this->method = $var;

        return $this;
    }

    /**
     * Reauth session lifetime, how long before a user has to reauthenticate
     * again.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration max_age = 2;</code>
     * @return \Google\Protobuf\Duration|null
     */
    public function getMaxAge()
    {
        return $this->max_age;
    }

    public function hasMaxAge()
    {
        return isset($this->max_age);
    }

    public function clearMaxAge()
    {
        unset($this->max_age);
    }

    /**
     * Reauth session lifetime, how long before a user has to reauthenticate
     * again.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration max_age = 2;</code>
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setMaxAge($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->max_age = $var;

        return $this;
    }

    /**
     * How IAP determines the effective policy in cases of hierarchial policies.
     * Policies are merged from higher in the hierarchy to lower in the hierarchy.
     *
     * Generated from protobuf field <code>.google.cloud.iap.v1.ReauthSettings.PolicyType policy_type = 3;</code>
     * @return int
     */
    public function getPolicyType()
    {
        return $this->policy_type;
    }

    /**
     * How IAP determines the effective policy in cases of hierarchial policies.
     * Policies are merged from higher in the hierarchy to lower in the hierarchy.
     *
     * Generated from protobuf field <code>.google.cloud.iap.v1.ReauthSettings.PolicyType policy_type = 3;</code>
     * @param int $var
     * @return $this
     */
    public function setPolicyType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Iap\V1\ReauthSettings\PolicyType::class);
        $this->policy_type = $var;

        return $this;
    }

}

