<?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 are based on information about the
 * [ApiOperation]
 * [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation]
 * intended to be performed on the `resources` specified. 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. The request must
 * match `operations` AND `resources` fields in order to be allowed egress out
 * of the perimeter.
 *
 * Generated from protobuf message <code>google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo</code>
 */
class EgressTo extends \Google\Protobuf\Internal\Message
{
    /**
     * A list of resources, currently only projects in the form
     * `projects/<projectnumber>`, that are allowed to be accessed by sources
     * defined in the corresponding [EgressFrom]
     * [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom].
     * A request matches if it contains a resource in this list.  If `*` is
     * specified for `resources`, then this [EgressTo]
     * [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo]
     * rule will authorize access to all resources outside the perimeter.
     *
     * Generated from protobuf field <code>repeated string resources = 1;</code>
     */
    private $resources;
    /**
     * A list of [ApiOperations]
     * [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation]
     * allowed to be performed by the sources specified in the corresponding
     * [EgressFrom]
     * [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom].
     * A request matches if it uses an operation/service in this list.
     *
     * Generated from protobuf field <code>repeated .google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation operations = 2;</code>
     */
    private $operations;
    /**
     * A list of external resources that are allowed to be accessed. Only AWS
     * and Azure resources are supported. For Amazon S3, the supported format is
     * s3://BUCKET_NAME. For Azure Storage, the supported format is
     * azure://myaccount.blob.core.windows.net/CONTAINER_NAME. A request matches
     * if it contains an external resource in this list (Example:
     * s3://bucket/path). Currently '*' is not allowed.
     *
     * Generated from protobuf field <code>repeated string external_resources = 3;</code>
     */
    private $external_resources;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $resources
     *           A list of resources, currently only projects in the form
     *           `projects/<projectnumber>`, that are allowed to be accessed by sources
     *           defined in the corresponding [EgressFrom]
     *           [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom].
     *           A request matches if it contains a resource in this list.  If `*` is
     *           specified for `resources`, then this [EgressTo]
     *           [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo]
     *           rule will authorize access to all resources outside the perimeter.
     *     @type array<\Google\Identity\AccessContextManager\V1\ServicePerimeterConfig\ApiOperation>|\Google\Protobuf\Internal\RepeatedField $operations
     *           A list of [ApiOperations]
     *           [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation]
     *           allowed to be performed by the sources specified in the corresponding
     *           [EgressFrom]
     *           [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom].
     *           A request matches if it uses an operation/service in this list.
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $external_resources
     *           A list of external resources that are allowed to be accessed. Only AWS
     *           and Azure resources are supported. For Amazon S3, the supported format is
     *           s3://BUCKET_NAME. For Azure Storage, the supported format is
     *           azure://myaccount.blob.core.windows.net/CONTAINER_NAME. A request matches
     *           if it contains an external resource in this list (Example:
     *           s3://bucket/path). Currently '*' is not allowed.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Identity\Accesscontextmanager\V1\ServicePerimeter::initOnce();
        parent::__construct($data);
    }

    /**
     * A list of resources, currently only projects in the form
     * `projects/<projectnumber>`, that are allowed to be accessed by sources
     * defined in the corresponding [EgressFrom]
     * [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom].
     * A request matches if it contains a resource in this list.  If `*` is
     * specified for `resources`, then this [EgressTo]
     * [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo]
     * rule will authorize access to all resources outside the perimeter.
     *
     * Generated from protobuf field <code>repeated string resources = 1;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getResources()
    {
        return $this->resources;
    }

    /**
     * A list of resources, currently only projects in the form
     * `projects/<projectnumber>`, that are allowed to be accessed by sources
     * defined in the corresponding [EgressFrom]
     * [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom].
     * A request matches if it contains a resource in this list.  If `*` is
     * specified for `resources`, then this [EgressTo]
     * [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo]
     * rule will authorize access to all resources outside the perimeter.
     *
     * Generated from protobuf field <code>repeated string resources = 1;</code>
     * @param array<string>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setResources($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->resources = $arr;

        return $this;
    }

    /**
     * A list of [ApiOperations]
     * [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation]
     * allowed to be performed by the sources specified in the corresponding
     * [EgressFrom]
     * [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom].
     * A request matches if it uses an operation/service in this list.
     *
     * Generated from protobuf field <code>repeated .google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation operations = 2;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getOperations()
    {
        return $this->operations;
    }

    /**
     * A list of [ApiOperations]
     * [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation]
     * allowed to be performed by the sources specified in the corresponding
     * [EgressFrom]
     * [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom].
     * A request matches if it uses an operation/service in this list.
     *
     * Generated from protobuf field <code>repeated .google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation operations = 2;</code>
     * @param array<\Google\Identity\AccessContextManager\V1\ServicePerimeterConfig\ApiOperation>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setOperations($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Identity\AccessContextManager\V1\ServicePerimeterConfig\ApiOperation::class);
        $this->operations = $arr;

        return $this;
    }

    /**
     * A list of external resources that are allowed to be accessed. Only AWS
     * and Azure resources are supported. For Amazon S3, the supported format is
     * s3://BUCKET_NAME. For Azure Storage, the supported format is
     * azure://myaccount.blob.core.windows.net/CONTAINER_NAME. A request matches
     * if it contains an external resource in this list (Example:
     * s3://bucket/path). Currently '*' is not allowed.
     *
     * Generated from protobuf field <code>repeated string external_resources = 3;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getExternalResources()
    {
        return $this->external_resources;
    }

    /**
     * A list of external resources that are allowed to be accessed. Only AWS
     * and Azure resources are supported. For Amazon S3, the supported format is
     * s3://BUCKET_NAME. For Azure Storage, the supported format is
     * azure://myaccount.blob.core.windows.net/CONTAINER_NAME. A request matches
     * if it contains an external resource in this list (Example:
     * s3://bucket/path). Currently '*' is not allowed.
     *
     * Generated from protobuf field <code>repeated string external_resources = 3;</code>
     * @param array<string>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setExternalResources($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->external_resources = $arr;

        return $this;
    }

}

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

