<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/lifesciences/v2beta/workflows.proto

namespace Google\Cloud\LifeSciences\V2beta;

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

/**
 * Specifies a series of actions to execute, expressed as Docker containers.
 *
 * Generated from protobuf message <code>google.cloud.lifesciences.v2beta.Pipeline</code>
 */
class Pipeline extends \Google\Protobuf\Internal\Message
{
    /**
     * The list of actions to execute, in the order they are specified.
     *
     * Generated from protobuf field <code>repeated .google.cloud.lifesciences.v2beta.Action actions = 1;</code>
     */
    private $actions;
    /**
     * The resources required for execution.
     *
     * Generated from protobuf field <code>.google.cloud.lifesciences.v2beta.Resources resources = 2;</code>
     */
    private $resources = null;
    /**
     * The environment to pass into every action. Each action can also specify
     * additional environment variables but cannot delete an entry from this map
     * (though they can overwrite it with a different value).
     *
     * Generated from protobuf field <code>map<string, string> environment = 3;</code>
     */
    private $environment;
    /**
     * The encrypted environment to pass into every action. Each action can also
     * specify its own encrypted environment.
     * The secret must decrypt to a JSON-encoded dictionary where key-value pairs
     * serve as environment variable names and their values. The decoded
     * environment variables can overwrite the values specified by the
     * `environment` field.
     *
     * Generated from protobuf field <code>.google.cloud.lifesciences.v2beta.Secret encrypted_environment = 5;</code>
     */
    private $encrypted_environment = null;
    /**
     * The maximum amount of time to give the pipeline to complete.  This includes
     * the time spent waiting for a worker to be allocated.  If the pipeline fails
     * to complete before the timeout, it will be cancelled and the error code
     * will be set to DEADLINE_EXCEEDED.
     * If unspecified, it will default to 7 days.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration timeout = 4;</code>
     */
    private $timeout = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type array<\Google\Cloud\LifeSciences\V2beta\Action>|\Google\Protobuf\Internal\RepeatedField $actions
     *           The list of actions to execute, in the order they are specified.
     *     @type \Google\Cloud\LifeSciences\V2beta\Resources $resources
     *           The resources required for execution.
     *     @type array|\Google\Protobuf\Internal\MapField $environment
     *           The environment to pass into every action. Each action can also specify
     *           additional environment variables but cannot delete an entry from this map
     *           (though they can overwrite it with a different value).
     *     @type \Google\Cloud\LifeSciences\V2beta\Secret $encrypted_environment
     *           The encrypted environment to pass into every action. Each action can also
     *           specify its own encrypted environment.
     *           The secret must decrypt to a JSON-encoded dictionary where key-value pairs
     *           serve as environment variable names and their values. The decoded
     *           environment variables can overwrite the values specified by the
     *           `environment` field.
     *     @type \Google\Protobuf\Duration $timeout
     *           The maximum amount of time to give the pipeline to complete.  This includes
     *           the time spent waiting for a worker to be allocated.  If the pipeline fails
     *           to complete before the timeout, it will be cancelled and the error code
     *           will be set to DEADLINE_EXCEEDED.
     *           If unspecified, it will default to 7 days.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Lifesciences\V2Beta\Workflows::initOnce();
        parent::__construct($data);
    }

    /**
     * The list of actions to execute, in the order they are specified.
     *
     * Generated from protobuf field <code>repeated .google.cloud.lifesciences.v2beta.Action actions = 1;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getActions()
    {
        return $this->actions;
    }

    /**
     * The list of actions to execute, in the order they are specified.
     *
     * Generated from protobuf field <code>repeated .google.cloud.lifesciences.v2beta.Action actions = 1;</code>
     * @param array<\Google\Cloud\LifeSciences\V2beta\Action>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setActions($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\LifeSciences\V2beta\Action::class);
        $this->actions = $arr;

        return $this;
    }

    /**
     * The resources required for execution.
     *
     * Generated from protobuf field <code>.google.cloud.lifesciences.v2beta.Resources resources = 2;</code>
     * @return \Google\Cloud\LifeSciences\V2beta\Resources|null
     */
    public function getResources()
    {
        return $this->resources;
    }

    public function hasResources()
    {
        return isset($this->resources);
    }

    public function clearResources()
    {
        unset($this->resources);
    }

    /**
     * The resources required for execution.
     *
     * Generated from protobuf field <code>.google.cloud.lifesciences.v2beta.Resources resources = 2;</code>
     * @param \Google\Cloud\LifeSciences\V2beta\Resources $var
     * @return $this
     */
    public function setResources($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\LifeSciences\V2beta\Resources::class);
        $this->resources = $var;

        return $this;
    }

    /**
     * The environment to pass into every action. Each action can also specify
     * additional environment variables but cannot delete an entry from this map
     * (though they can overwrite it with a different value).
     *
     * Generated from protobuf field <code>map<string, string> environment = 3;</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getEnvironment()
    {
        return $this->environment;
    }

    /**
     * The environment to pass into every action. Each action can also specify
     * additional environment variables but cannot delete an entry from this map
     * (though they can overwrite it with a different value).
     *
     * Generated from protobuf field <code>map<string, string> environment = 3;</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setEnvironment($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING);
        $this->environment = $arr;

        return $this;
    }

    /**
     * The encrypted environment to pass into every action. Each action can also
     * specify its own encrypted environment.
     * The secret must decrypt to a JSON-encoded dictionary where key-value pairs
     * serve as environment variable names and their values. The decoded
     * environment variables can overwrite the values specified by the
     * `environment` field.
     *
     * Generated from protobuf field <code>.google.cloud.lifesciences.v2beta.Secret encrypted_environment = 5;</code>
     * @return \Google\Cloud\LifeSciences\V2beta\Secret|null
     */
    public function getEncryptedEnvironment()
    {
        return $this->encrypted_environment;
    }

    public function hasEncryptedEnvironment()
    {
        return isset($this->encrypted_environment);
    }

    public function clearEncryptedEnvironment()
    {
        unset($this->encrypted_environment);
    }

    /**
     * The encrypted environment to pass into every action. Each action can also
     * specify its own encrypted environment.
     * The secret must decrypt to a JSON-encoded dictionary where key-value pairs
     * serve as environment variable names and their values. The decoded
     * environment variables can overwrite the values specified by the
     * `environment` field.
     *
     * Generated from protobuf field <code>.google.cloud.lifesciences.v2beta.Secret encrypted_environment = 5;</code>
     * @param \Google\Cloud\LifeSciences\V2beta\Secret $var
     * @return $this
     */
    public function setEncryptedEnvironment($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\LifeSciences\V2beta\Secret::class);
        $this->encrypted_environment = $var;

        return $this;
    }

    /**
     * The maximum amount of time to give the pipeline to complete.  This includes
     * the time spent waiting for a worker to be allocated.  If the pipeline fails
     * to complete before the timeout, it will be cancelled and the error code
     * will be set to DEADLINE_EXCEEDED.
     * If unspecified, it will default to 7 days.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration timeout = 4;</code>
     * @return \Google\Protobuf\Duration|null
     */
    public function getTimeout()
    {
        return $this->timeout;
    }

    public function hasTimeout()
    {
        return isset($this->timeout);
    }

    public function clearTimeout()
    {
        unset($this->timeout);
    }

    /**
     * The maximum amount of time to give the pipeline to complete.  This includes
     * the time spent waiting for a worker to be allocated.  If the pipeline fails
     * to complete before the timeout, it will be cancelled and the error code
     * will be set to DEADLINE_EXCEEDED.
     * If unspecified, it will default to 7 days.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration timeout = 4;</code>
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setTimeout($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->timeout = $var;

        return $this;
    }

}

