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

namespace Google\Identity\AccessContextManager\V1;

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

/**
 * Restricts access to Cloud Console and Google Cloud APIs for a set of users
 * using Context-Aware Access.
 *
 * Generated from protobuf message <code>google.identity.accesscontextmanager.v1.GcpUserAccessBinding</code>
 */
class GcpUserAccessBinding extends \Google\Protobuf\Internal\Message
{
    /**
     * Immutable. Assigned by the server during creation. The last segment has an arbitrary
     * length and has only URI unreserved characters (as defined by
     * [RFC 3986 Section 2.3](https://tools.ietf.org/html/rfc3986#section-2.3)).
     * Should not be specified by the client during creation.
     * Example: "organizations/256/gcpUserAccessBindings/b3-BhcX_Ud5N"
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IMMUTABLE];</code>
     */
    private $name = '';
    /**
     * Required. Immutable. Google Group id whose members are subject to this binding's restrictions.
     * See "id" in the [G Suite Directory API's Groups resource]
     * (https://developers.google.com/admin-sdk/directory/v1/reference/groups#resource).
     * If a group's email address/alias is changed, this resource will continue
     * to point at the changed group. This field does not accept group email
     * addresses or aliases.
     * Example: "01d520gv4vjcrht"
     *
     * Generated from protobuf field <code>string group_key = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];</code>
     */
    private $group_key = '';
    /**
     * Required. Access level that a user must have to be granted access. Only one access
     * level is supported, not multiple. This repeated field must have exactly
     * one element.
     * Example: "accessPolicies/9522/accessLevels/device_trusted"
     *
     * Generated from protobuf field <code>repeated string access_levels = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    private $access_levels;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Immutable. Assigned by the server during creation. The last segment has an arbitrary
     *           length and has only URI unreserved characters (as defined by
     *           [RFC 3986 Section 2.3](https://tools.ietf.org/html/rfc3986#section-2.3)).
     *           Should not be specified by the client during creation.
     *           Example: "organizations/256/gcpUserAccessBindings/b3-BhcX_Ud5N"
     *     @type string $group_key
     *           Required. Immutable. Google Group id whose members are subject to this binding's restrictions.
     *           See "id" in the [G Suite Directory API's Groups resource]
     *           (https://developers.google.com/admin-sdk/directory/v1/reference/groups#resource).
     *           If a group's email address/alias is changed, this resource will continue
     *           to point at the changed group. This field does not accept group email
     *           addresses or aliases.
     *           Example: "01d520gv4vjcrht"
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $access_levels
     *           Required. Access level that a user must have to be granted access. Only one access
     *           level is supported, not multiple. This repeated field must have exactly
     *           one element.
     *           Example: "accessPolicies/9522/accessLevels/device_trusted"
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Identity\Accesscontextmanager\V1\GcpUserAccessBinding::initOnce();
        parent::__construct($data);
    }

    /**
     * Immutable. Assigned by the server during creation. The last segment has an arbitrary
     * length and has only URI unreserved characters (as defined by
     * [RFC 3986 Section 2.3](https://tools.ietf.org/html/rfc3986#section-2.3)).
     * Should not be specified by the client during creation.
     * Example: "organizations/256/gcpUserAccessBindings/b3-BhcX_Ud5N"
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IMMUTABLE];</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Immutable. Assigned by the server during creation. The last segment has an arbitrary
     * length and has only URI unreserved characters (as defined by
     * [RFC 3986 Section 2.3](https://tools.ietf.org/html/rfc3986#section-2.3)).
     * Should not be specified by the client during creation.
     * Example: "organizations/256/gcpUserAccessBindings/b3-BhcX_Ud5N"
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IMMUTABLE];</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Required. Immutable. Google Group id whose members are subject to this binding's restrictions.
     * See "id" in the [G Suite Directory API's Groups resource]
     * (https://developers.google.com/admin-sdk/directory/v1/reference/groups#resource).
     * If a group's email address/alias is changed, this resource will continue
     * to point at the changed group. This field does not accept group email
     * addresses or aliases.
     * Example: "01d520gv4vjcrht"
     *
     * Generated from protobuf field <code>string group_key = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];</code>
     * @return string
     */
    public function getGroupKey()
    {
        return $this->group_key;
    }

    /**
     * Required. Immutable. Google Group id whose members are subject to this binding's restrictions.
     * See "id" in the [G Suite Directory API's Groups resource]
     * (https://developers.google.com/admin-sdk/directory/v1/reference/groups#resource).
     * If a group's email address/alias is changed, this resource will continue
     * to point at the changed group. This field does not accept group email
     * addresses or aliases.
     * Example: "01d520gv4vjcrht"
     *
     * Generated from protobuf field <code>string group_key = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];</code>
     * @param string $var
     * @return $this
     */
    public function setGroupKey($var)
    {
        GPBUtil::checkString($var, True);
        $this->group_key = $var;

        return $this;
    }

    /**
     * Required. Access level that a user must have to be granted access. Only one access
     * level is supported, not multiple. This repeated field must have exactly
     * one element.
     * Example: "accessPolicies/9522/accessLevels/device_trusted"
     *
     * Generated from protobuf field <code>repeated string access_levels = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getAccessLevels()
    {
        return $this->access_levels;
    }

    /**
     * Required. Access level that a user must have to be granted access. Only one access
     * level is supported, not multiple. This repeated field must have exactly
     * one element.
     * Example: "accessPolicies/9522/accessLevels/device_trusted"
     *
     * Generated from protobuf field <code>repeated string access_levels = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @param array<string>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setAccessLevels($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->access_levels = $arr;

        return $this;
    }

}

