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

namespace Google\Identity\AccessContextManager\V1\ServicePerimeterConfig;

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

/**
 * Defines the conditions under which an [EgressPolicy]
 * [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy]
 * matches a request. Conditions based on information about the source of the
 * request. Note that if the destination of the request is also protected by a
 * [ServicePerimeter]
 * [google.identity.accesscontextmanager.v1.ServicePerimeter], then that
 * [ServicePerimeter]
 * [google.identity.accesscontextmanager.v1.ServicePerimeter] must have
 * an [IngressPolicy]
 * [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy]
 * which allows access in order for this request to succeed.
 *
 * Generated from protobuf message <code>google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom</code>
 */
class EgressFrom extends \Google\Protobuf\Internal\Message
{
    /**
     * A list of identities that are allowed access through this [EgressPolicy].
     * Should be in the format of email address. The email address should
     * represent individual user or service account only.
     *
     * Generated from protobuf field <code>repeated string identities = 1;</code>
     */
    private $identities;
    /**
     * Specifies the type of identities that are allowed access to outside the
     * perimeter. If left unspecified, then members of `identities` field will
     * be allowed access.
     *
     * Generated from protobuf field <code>.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType identity_type = 2;</code>
     */
    private $identity_type = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $identities
     *           A list of identities that are allowed access through this [EgressPolicy].
     *           Should be in the format of email address. The email address should
     *           represent individual user or service account only.
     *     @type int $identity_type
     *           Specifies the type of identities that are allowed access to outside the
     *           perimeter. If left unspecified, then members of `identities` field will
     *           be allowed access.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Identity\Accesscontextmanager\V1\ServicePerimeter::initOnce();
        parent::__construct($data);
    }

    /**
     * A list of identities that are allowed access through this [EgressPolicy].
     * Should be in the format of email address. The email address should
     * represent individual user or service account only.
     *
     * Generated from protobuf field <code>repeated string identities = 1;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getIdentities()
    {
        return $this->identities;
    }

    /**
     * A list of identities that are allowed access through this [EgressPolicy].
     * Should be in the format of email address. The email address should
     * represent individual user or service account only.
     *
     * Generated from protobuf field <code>repeated string identities = 1;</code>
     * @param array<string>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setIdentities($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->identities = $arr;

        return $this;
    }

    /**
     * Specifies the type of identities that are allowed access to outside the
     * perimeter. If left unspecified, then members of `identities` field will
     * be allowed access.
     *
     * Generated from protobuf field <code>.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType identity_type = 2;</code>
     * @return int
     */
    public function getIdentityType()
    {
        return $this->identity_type;
    }

    /**
     * Specifies the type of identities that are allowed access to outside the
     * perimeter. If left unspecified, then members of `identities` field will
     * be allowed access.
     *
     * Generated from protobuf field <code>.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType identity_type = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setIdentityType($var)
    {
        GPBUtil::checkEnum($var, \Google\Identity\AccessContextManager\V1\ServicePerimeterConfig\IdentityType::class);
        $this->identity_type = $var;

        return $this;
    }

}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(EgressFrom::class, \Google\Identity\AccessContextManager\V1\ServicePerimeterConfig_EgressFrom::class);

