<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: grafeas/v1/provenance.proto

namespace Grafeas\V1;

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

/**
 * Command describes a step performed as part of the build pipeline.
 *
 * Generated from protobuf message <code>grafeas.v1.Command</code>
 */
class Command extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. Name of the command, as presented on the command line, or if the
     * command is packaged as a Docker container, as presented to `docker pull`.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     */
    protected $name = '';
    /**
     * Environment variables set before running this command.
     *
     * Generated from protobuf field <code>repeated string env = 2;</code>
     */
    private $env;
    /**
     * Command-line arguments used when executing this command.
     *
     * Generated from protobuf field <code>repeated string args = 3;</code>
     */
    private $args;
    /**
     * Working directory (relative to project source root) used when running this
     * command.
     *
     * Generated from protobuf field <code>string dir = 4;</code>
     */
    protected $dir = '';
    /**
     * Optional unique identifier for this command, used in wait_for to reference
     * this command as a dependency.
     *
     * Generated from protobuf field <code>string id = 5;</code>
     */
    protected $id = '';
    /**
     * The ID(s) of the command(s) that this command depends on.
     *
     * Generated from protobuf field <code>repeated string wait_for = 6;</code>
     */
    private $wait_for;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Required. Name of the command, as presented on the command line, or if the
     *           command is packaged as a Docker container, as presented to `docker pull`.
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $env
     *           Environment variables set before running this command.
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $args
     *           Command-line arguments used when executing this command.
     *     @type string $dir
     *           Working directory (relative to project source root) used when running this
     *           command.
     *     @type string $id
     *           Optional unique identifier for this command, used in wait_for to reference
     *           this command as a dependency.
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $wait_for
     *           The ID(s) of the command(s) that this command depends on.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Grafeas\V1\Provenance::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. Name of the command, as presented on the command line, or if the
     * command is packaged as a Docker container, as presented to `docker pull`.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Required. Name of the command, as presented on the command line, or if the
     * command is packaged as a Docker container, as presented to `docker pull`.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Environment variables set before running this command.
     *
     * Generated from protobuf field <code>repeated string env = 2;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getEnv()
    {
        return $this->env;
    }

    /**
     * Environment variables set before running this command.
     *
     * Generated from protobuf field <code>repeated string env = 2;</code>
     * @param array<string>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setEnv($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->env = $arr;

        return $this;
    }

    /**
     * Command-line arguments used when executing this command.
     *
     * Generated from protobuf field <code>repeated string args = 3;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getArgs()
    {
        return $this->args;
    }

    /**
     * Command-line arguments used when executing this command.
     *
     * Generated from protobuf field <code>repeated string args = 3;</code>
     * @param array<string>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setArgs($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->args = $arr;

        return $this;
    }

    /**
     * Working directory (relative to project source root) used when running this
     * command.
     *
     * Generated from protobuf field <code>string dir = 4;</code>
     * @return string
     */
    public function getDir()
    {
        return $this->dir;
    }

    /**
     * Working directory (relative to project source root) used when running this
     * command.
     *
     * Generated from protobuf field <code>string dir = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setDir($var)
    {
        GPBUtil::checkString($var, True);
        $this->dir = $var;

        return $this;
    }

    /**
     * Optional unique identifier for this command, used in wait_for to reference
     * this command as a dependency.
     *
     * Generated from protobuf field <code>string id = 5;</code>
     * @return string
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Optional unique identifier for this command, used in wait_for to reference
     * this command as a dependency.
     *
     * Generated from protobuf field <code>string id = 5;</code>
     * @param string $var
     * @return $this
     */
    public function setId($var)
    {
        GPBUtil::checkString($var, True);
        $this->id = $var;

        return $this;
    }

    /**
     * The ID(s) of the command(s) that this command depends on.
     *
     * Generated from protobuf field <code>repeated string wait_for = 6;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getWaitFor()
    {
        return $this->wait_for;
    }

    /**
     * The ID(s) of the command(s) that this command depends on.
     *
     * Generated from protobuf field <code>repeated string wait_for = 6;</code>
     * @param array<string>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setWaitFor($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->wait_for = $arr;

        return $this;
    }

}

