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

namespace Temporal\Api\Nexus\V1;

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

/**
 * A cluster-global binding from an endpoint ID to a target for dispatching incoming Nexus requests.
 *
 * Generated from protobuf message <code>temporal.api.nexus.v1.Endpoint</code>
 */
class Endpoint extends \Google\Protobuf\Internal\Message
{
    /**
     * Data version for this endpoint, incremented for every update issued via the UpdateNexusEndpoint API.
     *
     * Generated from protobuf field <code>int64 version = 1;</code>
     */
    protected $version = 0;
    /**
     * Unique server-generated endpoint ID.
     *
     * Generated from protobuf field <code>string id = 2;</code>
     */
    protected $id = '';
    /**
     * Spec for the endpoint.
     *
     * Generated from protobuf field <code>.temporal.api.nexus.v1.EndpointSpec spec = 3;</code>
     */
    protected $spec = null;
    /**
     * The date and time when the endpoint was created.
     * (-- api-linter: core::0142::time-field-names=disabled
     *     aip.dev/not-precedent: Not following linter rules. --)
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp created_time = 4;</code>
     */
    protected $created_time = null;
    /**
     * The date and time when the endpoint was last modified.
     * Will not be set if the endpoint has never been modified.
     * (-- api-linter: core::0142::time-field-names=disabled
     *     aip.dev/not-precedent: Not following linter rules. --)
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp last_modified_time = 5;</code>
     */
    protected $last_modified_time = null;
    /**
     * Server exposed URL prefix for invocation of operations on this endpoint.
     * This doesn't include the protocol, hostname or port as the server does not know how it should be accessed
     * publicly. The URL is stable in the face of endpoint renames.
     *
     * Generated from protobuf field <code>string url_prefix = 6;</code>
     */
    protected $url_prefix = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int|string $version
     *           Data version for this endpoint, incremented for every update issued via the UpdateNexusEndpoint API.
     *     @type string $id
     *           Unique server-generated endpoint ID.
     *     @type \Temporal\Api\Nexus\V1\EndpointSpec $spec
     *           Spec for the endpoint.
     *     @type \Google\Protobuf\Timestamp $created_time
     *           The date and time when the endpoint was created.
     *           (-- api-linter: core::0142::time-field-names=disabled
     *               aip.dev/not-precedent: Not following linter rules. --)
     *     @type \Google\Protobuf\Timestamp $last_modified_time
     *           The date and time when the endpoint was last modified.
     *           Will not be set if the endpoint has never been modified.
     *           (-- api-linter: core::0142::time-field-names=disabled
     *               aip.dev/not-precedent: Not following linter rules. --)
     *     @type string $url_prefix
     *           Server exposed URL prefix for invocation of operations on this endpoint.
     *           This doesn't include the protocol, hostname or port as the server does not know how it should be accessed
     *           publicly. The URL is stable in the face of endpoint renames.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Temporal\Api\Nexus\V1\Message::initOnce();
        parent::__construct($data);
    }

    /**
     * Data version for this endpoint, incremented for every update issued via the UpdateNexusEndpoint API.
     *
     * Generated from protobuf field <code>int64 version = 1;</code>
     * @return int|string
     */
    public function getVersion()
    {
        return $this->version;
    }

    /**
     * Data version for this endpoint, incremented for every update issued via the UpdateNexusEndpoint API.
     *
     * Generated from protobuf field <code>int64 version = 1;</code>
     * @param int|string $var
     * @return $this
     */
    public function setVersion($var)
    {
        GPBUtil::checkInt64($var);
        $this->version = $var;

        return $this;
    }

    /**
     * Unique server-generated endpoint ID.
     *
     * Generated from protobuf field <code>string id = 2;</code>
     * @return string
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Unique server-generated endpoint ID.
     *
     * Generated from protobuf field <code>string id = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setId($var)
    {
        GPBUtil::checkString($var, True);
        $this->id = $var;

        return $this;
    }

    /**
     * Spec for the endpoint.
     *
     * Generated from protobuf field <code>.temporal.api.nexus.v1.EndpointSpec spec = 3;</code>
     * @return \Temporal\Api\Nexus\V1\EndpointSpec|null
     */
    public function getSpec()
    {
        return $this->spec;
    }

    public function hasSpec()
    {
        return isset($this->spec);
    }

    public function clearSpec()
    {
        unset($this->spec);
    }

    /**
     * Spec for the endpoint.
     *
     * Generated from protobuf field <code>.temporal.api.nexus.v1.EndpointSpec spec = 3;</code>
     * @param \Temporal\Api\Nexus\V1\EndpointSpec $var
     * @return $this
     */
    public function setSpec($var)
    {
        GPBUtil::checkMessage($var, \Temporal\Api\Nexus\V1\EndpointSpec::class);
        $this->spec = $var;

        return $this;
    }

    /**
     * The date and time when the endpoint was created.
     * (-- api-linter: core::0142::time-field-names=disabled
     *     aip.dev/not-precedent: Not following linter rules. --)
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp created_time = 4;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getCreatedTime()
    {
        return $this->created_time;
    }

    public function hasCreatedTime()
    {
        return isset($this->created_time);
    }

    public function clearCreatedTime()
    {
        unset($this->created_time);
    }

    /**
     * The date and time when the endpoint was created.
     * (-- api-linter: core::0142::time-field-names=disabled
     *     aip.dev/not-precedent: Not following linter rules. --)
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp created_time = 4;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setCreatedTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->created_time = $var;

        return $this;
    }

    /**
     * The date and time when the endpoint was last modified.
     * Will not be set if the endpoint has never been modified.
     * (-- api-linter: core::0142::time-field-names=disabled
     *     aip.dev/not-precedent: Not following linter rules. --)
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp last_modified_time = 5;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getLastModifiedTime()
    {
        return $this->last_modified_time;
    }

    public function hasLastModifiedTime()
    {
        return isset($this->last_modified_time);
    }

    public function clearLastModifiedTime()
    {
        unset($this->last_modified_time);
    }

    /**
     * The date and time when the endpoint was last modified.
     * Will not be set if the endpoint has never been modified.
     * (-- api-linter: core::0142::time-field-names=disabled
     *     aip.dev/not-precedent: Not following linter rules. --)
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp last_modified_time = 5;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setLastModifiedTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->last_modified_time = $var;

        return $this;
    }

    /**
     * Server exposed URL prefix for invocation of operations on this endpoint.
     * This doesn't include the protocol, hostname or port as the server does not know how it should be accessed
     * publicly. The URL is stable in the face of endpoint renames.
     *
     * Generated from protobuf field <code>string url_prefix = 6;</code>
     * @return string
     */
    public function getUrlPrefix()
    {
        return $this->url_prefix;
    }

    /**
     * Server exposed URL prefix for invocation of operations on this endpoint.
     * This doesn't include the protocol, hostname or port as the server does not know how it should be accessed
     * publicly. The URL is stable in the face of endpoint renames.
     *
     * Generated from protobuf field <code>string url_prefix = 6;</code>
     * @param string $var
     * @return $this
     */
    public function setUrlPrefix($var)
    {
        GPBUtil::checkString($var, True);
        $this->url_prefix = $var;

        return $this;
    }

}

