<?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 [IngressPolicy]
 * [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy]
 * matches a request. Conditions are based on information about the source of
 * the request. The request must satisfy what is defined in `sources` AND
 * identity related fields in order to match.
 *
 * Generated from protobuf message <code>google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom</code>
 */
class IngressFrom extends \Google\Protobuf\Internal\Message
{
    /**
     * Sources that this [IngressPolicy]
     * [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy]
     * authorizes access from.
     *
     * Generated from protobuf field <code>repeated .google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource sources = 1;</code>
     */
    private $sources;
    /**
     * A list of identities that are allowed access through this ingress
     * policy. 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 = 2;</code>
     */
    private $identities;
    /**
     * Specifies the type of identities that are allowed access from 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 = 3;</code>
     */
    private $identity_type = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Identity\AccessContextManager\V1\ServicePerimeterConfig\IngressSource[]|\Google\Protobuf\Internal\RepeatedField $sources
     *           Sources that this [IngressPolicy]
     *           [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy]
     *           authorizes access from.
     *     @type string[]|\Google\Protobuf\Internal\RepeatedField $identities
     *           A list of identities that are allowed access through this ingress
     *           policy. 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 from 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);
    }

    /**
     * Sources that this [IngressPolicy]
     * [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy]
     * authorizes access from.
     *
     * Generated from protobuf field <code>repeated .google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource sources = 1;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getSources()
    {
        return $this->sources;
    }

    /**
     * Sources that this [IngressPolicy]
     * [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy]
     * authorizes access from.
     *
     * Generated from protobuf field <code>repeated .google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource sources = 1;</code>
     * @param \Google\Identity\AccessContextManager\V1\ServicePerimeterConfig\IngressSource[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setSources($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Identity\AccessContextManager\V1\ServicePerimeterConfig\IngressSource::class);
        $this->sources = $arr;

        return $this;
    }

    /**
     * A list of identities that are allowed access through this ingress
     * policy. 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 = 2;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getIdentities()
    {
        return $this->identities;
    }

    /**
     * A list of identities that are allowed access through this ingress
     * policy. 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 = 2;</code>
     * @param 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 from 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 = 3;</code>
     * @return int
     */
    public function getIdentityType()
    {
        return $this->identity_type;
    }

    /**
     * Specifies the type of identities that are allowed access from 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 = 3;</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(IngressFrom::class, \Google\Identity\AccessContextManager\V1\ServicePerimeterConfig_IngressFrom::class);

