<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/iam/v3/principal_access_boundary_policy_resources.proto

namespace Google\Cloud\Iam\V3;

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

/**
 * Principal access boundary policy details
 *
 * Generated from protobuf message <code>google.iam.v3.PrincipalAccessBoundaryPolicyDetails</code>
 */
class PrincipalAccessBoundaryPolicyDetails extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. A list of principal access boundary policy rules. The number of
     * rules in a policy is limited to 500.
     *
     * Generated from protobuf field <code>repeated .google.iam.v3.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $rules;
    /**
     * Optional.
     * The version number (for example, `1` or `latest`) that indicates which
     * permissions are able to be blocked by the policy. If empty, the PAB policy
     * version will be set to the most recent version number at the time of the
     * policy's creation.
     *
     * Generated from protobuf field <code>string enforcement_version = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $enforcement_version = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Iam\V3\PrincipalAccessBoundaryPolicyRule[] $rules
     *           Required. A list of principal access boundary policy rules. The number of
     *           rules in a policy is limited to 500.
     *     @type string $enforcement_version
     *           Optional.
     *           The version number (for example, `1` or `latest`) that indicates which
     *           permissions are able to be blocked by the policy. If empty, the PAB policy
     *           version will be set to the most recent version number at the time of the
     *           policy's creation.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Iam\V3\PrincipalAccessBoundaryPolicyResources::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. A list of principal access boundary policy rules. The number of
     * rules in a policy is limited to 500.
     *
     * Generated from protobuf field <code>repeated .google.iam.v3.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return RepeatedField<\Google\Cloud\Iam\V3\PrincipalAccessBoundaryPolicyRule>
     */
    public function getRules()
    {
        return $this->rules;
    }

    /**
     * Required. A list of principal access boundary policy rules. The number of
     * rules in a policy is limited to 500.
     *
     * Generated from protobuf field <code>repeated .google.iam.v3.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\Iam\V3\PrincipalAccessBoundaryPolicyRule[] $var
     * @return $this
     */
    public function setRules($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Iam\V3\PrincipalAccessBoundaryPolicyRule::class);
        $this->rules = $arr;

        return $this;
    }

    /**
     * Optional.
     * The version number (for example, `1` or `latest`) that indicates which
     * permissions are able to be blocked by the policy. If empty, the PAB policy
     * version will be set to the most recent version number at the time of the
     * policy's creation.
     *
     * Generated from protobuf field <code>string enforcement_version = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getEnforcementVersion()
    {
        return $this->enforcement_version;
    }

    /**
     * Optional.
     * The version number (for example, `1` or `latest`) that indicates which
     * permissions are able to be blocked by the policy. If empty, the PAB policy
     * version will be set to the most recent version number at the time of the
     * policy's creation.
     *
     * Generated from protobuf field <code>string enforcement_version = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setEnforcementVersion($var)
    {
        GPBUtil::checkString($var, True);
        $this->enforcement_version = $var;

        return $this;
    }

}

