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

namespace Google\Identity\AccessContextManager\V1;

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

/**
 * A request to replace all existing Access Levels in an Access Policy with
 * the Access Levels provided. This is done atomically.
 *
 * Generated from protobuf message <code>google.identity.accesscontextmanager.v1.ReplaceAccessLevelsRequest</code>
 */
class ReplaceAccessLevelsRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. Resource name for the access policy which owns these
     * [Access Levels]
     * [google.identity.accesscontextmanager.v1.AccessLevel].
     * Format: `accessPolicies/{policy_id}`
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    private $parent = '';
    /**
     * Required. The desired [Access Levels]
     * [google.identity.accesscontextmanager.v1.AccessLevel] that should
     * replace all existing [Access Levels]
     * [google.identity.accesscontextmanager.v1.AccessLevel] in the
     * [Access Policy]
     * [google.identity.accesscontextmanager.v1.AccessPolicy].
     *
     * Generated from protobuf field <code>repeated .google.identity.accesscontextmanager.v1.AccessLevel access_levels = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $access_levels;
    /**
     * Optional. The etag for the version of the [Access Policy]
     * [google.identity.accesscontextmanager.v1.AccessPolicy] that this
     * replace operation is to be performed on. If, at the time of replace, the
     * etag for the Access Policy stored in Access Context Manager is different
     * from the specified etag, then the replace operation will not be performed
     * and the call will fail. This field is not required. If etag is not
     * provided, the operation will be performed as if a valid etag is provided.
     *
     * Generated from protobuf field <code>string etag = 4;</code>
     */
    private $etag = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $parent
     *           Required. Resource name for the access policy which owns these
     *           [Access Levels]
     *           [google.identity.accesscontextmanager.v1.AccessLevel].
     *           Format: `accessPolicies/{policy_id}`
     *     @type \Google\Identity\AccessContextManager\V1\AccessLevel[]|\Google\Protobuf\Internal\RepeatedField $access_levels
     *           Required. The desired [Access Levels]
     *           [google.identity.accesscontextmanager.v1.AccessLevel] that should
     *           replace all existing [Access Levels]
     *           [google.identity.accesscontextmanager.v1.AccessLevel] in the
     *           [Access Policy]
     *           [google.identity.accesscontextmanager.v1.AccessPolicy].
     *     @type string $etag
     *           Optional. The etag for the version of the [Access Policy]
     *           [google.identity.accesscontextmanager.v1.AccessPolicy] that this
     *           replace operation is to be performed on. If, at the time of replace, the
     *           etag for the Access Policy stored in Access Context Manager is different
     *           from the specified etag, then the replace operation will not be performed
     *           and the call will fail. This field is not required. If etag is not
     *           provided, the operation will be performed as if a valid etag is provided.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Identity\Accesscontextmanager\V1\AccessContextManager::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. Resource name for the access policy which owns these
     * [Access Levels]
     * [google.identity.accesscontextmanager.v1.AccessLevel].
     * Format: `accessPolicies/{policy_id}`
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getParent()
    {
        return $this->parent;
    }

    /**
     * Required. Resource name for the access policy which owns these
     * [Access Levels]
     * [google.identity.accesscontextmanager.v1.AccessLevel].
     * Format: `accessPolicies/{policy_id}`
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setParent($var)
    {
        GPBUtil::checkString($var, True);
        $this->parent = $var;

        return $this;
    }

    /**
     * Required. The desired [Access Levels]
     * [google.identity.accesscontextmanager.v1.AccessLevel] that should
     * replace all existing [Access Levels]
     * [google.identity.accesscontextmanager.v1.AccessLevel] in the
     * [Access Policy]
     * [google.identity.accesscontextmanager.v1.AccessPolicy].
     *
     * Generated from protobuf field <code>repeated .google.identity.accesscontextmanager.v1.AccessLevel access_levels = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getAccessLevels()
    {
        return $this->access_levels;
    }

    /**
     * Required. The desired [Access Levels]
     * [google.identity.accesscontextmanager.v1.AccessLevel] that should
     * replace all existing [Access Levels]
     * [google.identity.accesscontextmanager.v1.AccessLevel] in the
     * [Access Policy]
     * [google.identity.accesscontextmanager.v1.AccessPolicy].
     *
     * Generated from protobuf field <code>repeated .google.identity.accesscontextmanager.v1.AccessLevel access_levels = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Identity\AccessContextManager\V1\AccessLevel[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setAccessLevels($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Identity\AccessContextManager\V1\AccessLevel::class);
        $this->access_levels = $arr;

        return $this;
    }

    /**
     * Optional. The etag for the version of the [Access Policy]
     * [google.identity.accesscontextmanager.v1.AccessPolicy] that this
     * replace operation is to be performed on. If, at the time of replace, the
     * etag for the Access Policy stored in Access Context Manager is different
     * from the specified etag, then the replace operation will not be performed
     * and the call will fail. This field is not required. If etag is not
     * provided, the operation will be performed as if a valid etag is provided.
     *
     * Generated from protobuf field <code>string etag = 4;</code>
     * @return string
     */
    public function getEtag()
    {
        return $this->etag;
    }

    /**
     * Optional. The etag for the version of the [Access Policy]
     * [google.identity.accesscontextmanager.v1.AccessPolicy] that this
     * replace operation is to be performed on. If, at the time of replace, the
     * etag for the Access Policy stored in Access Context Manager is different
     * from the specified etag, then the replace operation will not be performed
     * and the call will fail. This field is not required. If etag is not
     * provided, the operation will be performed as if a valid etag is provided.
     *
     * Generated from protobuf field <code>string etag = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setEtag($var)
    {
        GPBUtil::checkString($var, True);
        $this->etag = $var;

        return $this;
    }

}

