<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: temporal/api/deployment/v1/message.proto

namespace Temporal\Api\Deployment\V1;

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

/**
 * A Worker Deployment (Deployment, for short) represents all workers serving 
 * a shared set of Task Queues. Typically, a Deployment represents one service or 
 * application.
 * A Deployment contains multiple Deployment Versions, each representing a different 
 * version of workers. (see documentation of WorkerDeploymentVersionInfo)
 * Deployment records are created in Temporal server automatically when their
 * first poller arrives to the server.
 * Experimental. Worker Deployments are experimental and might significantly change in the future.
 *
 * Generated from protobuf message <code>temporal.api.deployment.v1.WorkerDeploymentInfo</code>
 */
class WorkerDeploymentInfo extends \Google\Protobuf\Internal\Message
{
    /**
     * Identifies a Worker Deployment. Must be unique within the namespace.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     */
    protected $name = '';
    /**
     * Deployment Versions that are currently tracked in this Deployment. A DeploymentVersion will be
     * cleaned up automatically if all the following conditions meet:
     * - It does not receive new executions (is not current or ramping)
     * - It has no active pollers (see WorkerDeploymentVersionInfo.pollers_status) 
     * - It is drained (see WorkerDeploymentVersionInfo.drainage_status) 
     *
     * Generated from protobuf field <code>repeated .temporal.api.deployment.v1.WorkerDeploymentInfo.WorkerDeploymentVersionSummary version_summaries = 2;</code>
     */
    private $version_summaries;
    /**
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 3;</code>
     */
    protected $create_time = null;
    /**
     * Generated from protobuf field <code>.temporal.api.deployment.v1.RoutingConfig routing_config = 4;</code>
     */
    protected $routing_config = null;
    /**
     * Identity of the last client who modified the configuration of this Deployment. Set to the
     * `identity` value sent by APIs such as `SetWorkerDeploymentCurrentVersion` and
     * `SetWorkerDeploymentRampingVersion`.
     *
     * Generated from protobuf field <code>string last_modifier_identity = 5;</code>
     */
    protected $last_modifier_identity = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Identifies a Worker Deployment. Must be unique within the namespace.
     *     @type \Temporal\Api\Deployment\V1\WorkerDeploymentInfo\WorkerDeploymentVersionSummary[] $version_summaries
     *           Deployment Versions that are currently tracked in this Deployment. A DeploymentVersion will be
     *           cleaned up automatically if all the following conditions meet:
     *           - It does not receive new executions (is not current or ramping)
     *           - It has no active pollers (see WorkerDeploymentVersionInfo.pollers_status) 
     *           - It is drained (see WorkerDeploymentVersionInfo.drainage_status) 
     *     @type \Google\Protobuf\Timestamp $create_time
     *     @type \Temporal\Api\Deployment\V1\RoutingConfig $routing_config
     *     @type string $last_modifier_identity
     *           Identity of the last client who modified the configuration of this Deployment. Set to the
     *           `identity` value sent by APIs such as `SetWorkerDeploymentCurrentVersion` and
     *           `SetWorkerDeploymentRampingVersion`.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Temporal\Api\Deployment\V1\Message::initOnce();
        parent::__construct($data);
    }

    /**
     * Identifies a Worker Deployment. Must be unique within the namespace.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Identifies a Worker Deployment. Must be unique within the namespace.
     *
     * 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;
    }

    /**
     * Deployment Versions that are currently tracked in this Deployment. A DeploymentVersion will be
     * cleaned up automatically if all the following conditions meet:
     * - It does not receive new executions (is not current or ramping)
     * - It has no active pollers (see WorkerDeploymentVersionInfo.pollers_status) 
     * - It is drained (see WorkerDeploymentVersionInfo.drainage_status) 
     *
     * Generated from protobuf field <code>repeated .temporal.api.deployment.v1.WorkerDeploymentInfo.WorkerDeploymentVersionSummary version_summaries = 2;</code>
     * @return RepeatedField<\Temporal\Api\Deployment\V1\WorkerDeploymentInfo\WorkerDeploymentVersionSummary>
     */
    public function getVersionSummaries()
    {
        return $this->version_summaries;
    }

    /**
     * Deployment Versions that are currently tracked in this Deployment. A DeploymentVersion will be
     * cleaned up automatically if all the following conditions meet:
     * - It does not receive new executions (is not current or ramping)
     * - It has no active pollers (see WorkerDeploymentVersionInfo.pollers_status) 
     * - It is drained (see WorkerDeploymentVersionInfo.drainage_status) 
     *
     * Generated from protobuf field <code>repeated .temporal.api.deployment.v1.WorkerDeploymentInfo.WorkerDeploymentVersionSummary version_summaries = 2;</code>
     * @param \Temporal\Api\Deployment\V1\WorkerDeploymentInfo\WorkerDeploymentVersionSummary[] $var
     * @return $this
     */
    public function setVersionSummaries($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Temporal\Api\Deployment\V1\WorkerDeploymentInfo\WorkerDeploymentVersionSummary::class);
        $this->version_summaries = $arr;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 3;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getCreateTime()
    {
        return $this->create_time;
    }

    public function hasCreateTime()
    {
        return isset($this->create_time);
    }

    public function clearCreateTime()
    {
        unset($this->create_time);
    }

    /**
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 3;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setCreateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->create_time = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.temporal.api.deployment.v1.RoutingConfig routing_config = 4;</code>
     * @return \Temporal\Api\Deployment\V1\RoutingConfig|null
     */
    public function getRoutingConfig()
    {
        return $this->routing_config;
    }

    public function hasRoutingConfig()
    {
        return isset($this->routing_config);
    }

    public function clearRoutingConfig()
    {
        unset($this->routing_config);
    }

    /**
     * Generated from protobuf field <code>.temporal.api.deployment.v1.RoutingConfig routing_config = 4;</code>
     * @param \Temporal\Api\Deployment\V1\RoutingConfig $var
     * @return $this
     */
    public function setRoutingConfig($var)
    {
        GPBUtil::checkMessage($var, \Temporal\Api\Deployment\V1\RoutingConfig::class);
        $this->routing_config = $var;

        return $this;
    }

    /**
     * Identity of the last client who modified the configuration of this Deployment. Set to the
     * `identity` value sent by APIs such as `SetWorkerDeploymentCurrentVersion` and
     * `SetWorkerDeploymentRampingVersion`.
     *
     * Generated from protobuf field <code>string last_modifier_identity = 5;</code>
     * @return string
     */
    public function getLastModifierIdentity()
    {
        return $this->last_modifier_identity;
    }

    /**
     * Identity of the last client who modified the configuration of this Deployment. Set to the
     * `identity` value sent by APIs such as `SetWorkerDeploymentCurrentVersion` and
     * `SetWorkerDeploymentRampingVersion`.
     *
     * Generated from protobuf field <code>string last_modifier_identity = 5;</code>
     * @param string $var
     * @return $this
     */
    public function setLastModifierIdentity($var)
    {
        GPBUtil::checkString($var, True);
        $this->last_modifier_identity = $var;

        return $this;
    }

}

