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

namespace Google\Cloud\Asset\V1\IamPolicyAnalysisQuery;

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

/**
 * Specifies an identity for which to determine resource access, based on
 * roles assigned either directly to them or to the groups they belong to,
 * directly or indirectly.
 *
 * Generated from protobuf message <code>google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector</code>
 */
class IdentitySelector extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The identity appear in the form of principals in
     * [IAM policy
     * binding](https://cloud.google.com/iam/reference/rest/v1/Binding).
     * The examples of supported forms are:
     * "user:mike&#64;example.com",
     * "group:admins&#64;example.com",
     * "domain:google.com",
     * "serviceAccount:my-project-id&#64;appspot.gserviceaccount.com".
     * Notice that wildcard characters (such as * and ?) are not supported.
     * You must give a specific identity.
     *
     * Generated from protobuf field <code>string identity = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $identity = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $identity
     *           Required. The identity appear in the form of principals in
     *           [IAM policy
     *           binding](https://cloud.google.com/iam/reference/rest/v1/Binding).
     *           The examples of supported forms are:
     *           "user:mike&#64;example.com",
     *           "group:admins&#64;example.com",
     *           "domain:google.com",
     *           "serviceAccount:my-project-id&#64;appspot.gserviceaccount.com".
     *           Notice that wildcard characters (such as * and ?) are not supported.
     *           You must give a specific identity.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Asset\V1\AssetService::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The identity appear in the form of principals in
     * [IAM policy
     * binding](https://cloud.google.com/iam/reference/rest/v1/Binding).
     * The examples of supported forms are:
     * "user:mike&#64;example.com",
     * "group:admins&#64;example.com",
     * "domain:google.com",
     * "serviceAccount:my-project-id&#64;appspot.gserviceaccount.com".
     * Notice that wildcard characters (such as * and ?) are not supported.
     * You must give a specific identity.
     *
     * Generated from protobuf field <code>string identity = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getIdentity()
    {
        return $this->identity;
    }

    /**
     * Required. The identity appear in the form of principals in
     * [IAM policy
     * binding](https://cloud.google.com/iam/reference/rest/v1/Binding).
     * The examples of supported forms are:
     * "user:mike&#64;example.com",
     * "group:admins&#64;example.com",
     * "domain:google.com",
     * "serviceAccount:my-project-id&#64;appspot.gserviceaccount.com".
     * Notice that wildcard characters (such as * and ?) are not supported.
     * You must give a specific identity.
     *
     * Generated from protobuf field <code>string identity = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setIdentity($var)
    {
        GPBUtil::checkString($var, True);
        $this->identity = $var;

        return $this;
    }

}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(IdentitySelector::class, \Google\Cloud\Asset\V1\IamPolicyAnalysisQuery_IdentitySelector::class);

