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

namespace Google\Cloud\PrivilegedAccessManager\V1\PrivilegedAccess\GcpIamAccess;

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

/**
 * IAM Role bindings that are created after a successful grant.
 *
 * Generated from protobuf message <code>google.cloud.privilegedaccessmanager.v1.PrivilegedAccess.GcpIamAccess.RoleBinding</code>
 */
class RoleBinding extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. IAM role to be granted.
     * https://cloud.google.com/iam/docs/roles-overview.
     *
     * Generated from protobuf field <code>string role = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $role = '';
    /**
     * Optional. The expression field of the IAM condition to be associated
     * with the role. If specified, a user with an active grant for this
     * entitlement is able to access the resource only if this condition
     * evaluates to true for their request.
     * This field uses the same CEL format as IAM and supports all attributes
     * that IAM supports, except tags.
     * https://cloud.google.com/iam/docs/conditions-overview#attributes.
     *
     * Generated from protobuf field <code>string condition_expression = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $condition_expression = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $role
     *           Required. IAM role to be granted.
     *           https://cloud.google.com/iam/docs/roles-overview.
     *     @type string $condition_expression
     *           Optional. The expression field of the IAM condition to be associated
     *           with the role. If specified, a user with an active grant for this
     *           entitlement is able to access the resource only if this condition
     *           evaluates to true for their request.
     *           This field uses the same CEL format as IAM and supports all attributes
     *           that IAM supports, except tags.
     *           https://cloud.google.com/iam/docs/conditions-overview#attributes.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Privilegedaccessmanager\V1\Privilegedaccessmanager::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. IAM role to be granted.
     * https://cloud.google.com/iam/docs/roles-overview.
     *
     * Generated from protobuf field <code>string role = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getRole()
    {
        return $this->role;
    }

    /**
     * Required. IAM role to be granted.
     * https://cloud.google.com/iam/docs/roles-overview.
     *
     * Generated from protobuf field <code>string role = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setRole($var)
    {
        GPBUtil::checkString($var, True);
        $this->role = $var;

        return $this;
    }

    /**
     * Optional. The expression field of the IAM condition to be associated
     * with the role. If specified, a user with an active grant for this
     * entitlement is able to access the resource only if this condition
     * evaluates to true for their request.
     * This field uses the same CEL format as IAM and supports all attributes
     * that IAM supports, except tags.
     * https://cloud.google.com/iam/docs/conditions-overview#attributes.
     *
     * Generated from protobuf field <code>string condition_expression = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getConditionExpression()
    {
        return $this->condition_expression;
    }

    /**
     * Optional. The expression field of the IAM condition to be associated
     * with the role. If specified, a user with an active grant for this
     * entitlement is able to access the resource only if this condition
     * evaluates to true for their request.
     * This field uses the same CEL format as IAM and supports all attributes
     * that IAM supports, except tags.
     * https://cloud.google.com/iam/docs/conditions-overview#attributes.
     *
     * Generated from protobuf field <code>string condition_expression = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setConditionExpression($var)
    {
        GPBUtil::checkString($var, True);
        $this->condition_expression = $var;

        return $this;
    }

}


