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

namespace Google\Cloud\Compute\V1;

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

/**
 * Represents an Instance Template resource.
 * You can use instance templates to create VM instances and managed instance groups. For more information, read Instance Templates. (== resource_for {$api_version}.instanceTemplates ==)
 *
 * Generated from protobuf message <code>google.cloud.compute.v1.InstanceTemplate</code>
 */
class InstanceTemplate extends \Google\Protobuf\Internal\Message
{
    /**
     * [Output Only] The creation timestamp for this instance template in RFC3339 text format.
     *
     * Generated from protobuf field <code>string creation_timestamp = 30525366;</code>
     */
    private $creation_timestamp = '';
    /**
     * An optional description of this resource. Provide this property when you create the resource.
     *
     * Generated from protobuf field <code>string description = 154502140;</code>
     */
    private $description = '';
    /**
     * [Output Only] A unique identifier for this instance template. The server defines this identifier.
     *
     * Generated from protobuf field <code>string id = 3355;</code>
     */
    private $id = '';
    /**
     * [Output Only] The resource type, which is always compute#instanceTemplate for instance templates.
     *
     * Generated from protobuf field <code>string kind = 3292052;</code>
     */
    private $kind = '';
    /**
     * Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
     *
     * Generated from protobuf field <code>string name = 3373707;</code>
     */
    private $name = '';
    /**
     * The instance properties for this instance template.
     *
     * Generated from protobuf field <code>.google.cloud.compute.v1.InstanceProperties properties = 147688755;</code>
     */
    private $properties = null;
    /**
     * [Output Only] The URL for this instance template. The server defines this URL.
     *
     * Generated from protobuf field <code>string self_link = 187779341;</code>
     */
    private $self_link = '';
    /**
     * The source instance used to create the template. You can provide this as a partial or full URL to the resource. For example, the following are valid values:
     * - https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance
     * - projects/project/zones/zone/instances/instance
     *
     * Generated from protobuf field <code>string source_instance = 127880249;</code>
     */
    private $source_instance = '';
    /**
     * The source instance params to use to create this instance template.
     *
     * Generated from protobuf field <code>.google.cloud.compute.v1.SourceInstanceParams source_instance_params = 135342156;</code>
     */
    private $source_instance_params = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $creation_timestamp
     *           [Output Only] The creation timestamp for this instance template in RFC3339 text format.
     *     @type string $description
     *           An optional description of this resource. Provide this property when you create the resource.
     *     @type string $id
     *           [Output Only] A unique identifier for this instance template. The server defines this identifier.
     *     @type string $kind
     *           [Output Only] The resource type, which is always compute#instanceTemplate for instance templates.
     *     @type string $name
     *           Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
     *     @type \Google\Cloud\Compute\V1\InstanceProperties $properties
     *           The instance properties for this instance template.
     *     @type string $self_link
     *           [Output Only] The URL for this instance template. The server defines this URL.
     *     @type string $source_instance
     *           The source instance used to create the template. You can provide this as a partial or full URL to the resource. For example, the following are valid values:
     *           - https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance
     *           - projects/project/zones/zone/instances/instance
     *     @type \Google\Cloud\Compute\V1\SourceInstanceParams $source_instance_params
     *           The source instance params to use to create this instance template.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce();
        parent::__construct($data);
    }

    /**
     * [Output Only] The creation timestamp for this instance template in RFC3339 text format.
     *
     * Generated from protobuf field <code>string creation_timestamp = 30525366;</code>
     * @return string
     */
    public function getCreationTimestamp()
    {
        return $this->creation_timestamp;
    }

    /**
     * [Output Only] The creation timestamp for this instance template in RFC3339 text format.
     *
     * Generated from protobuf field <code>string creation_timestamp = 30525366;</code>
     * @param string $var
     * @return $this
     */
    public function setCreationTimestamp($var)
    {
        GPBUtil::checkString($var, True);
        $this->creation_timestamp = $var;

        return $this;
    }

    /**
     * An optional description of this resource. Provide this property when you create the resource.
     *
     * Generated from protobuf field <code>string description = 154502140;</code>
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * An optional description of this resource. Provide this property when you create the resource.
     *
     * Generated from protobuf field <code>string description = 154502140;</code>
     * @param string $var
     * @return $this
     */
    public function setDescription($var)
    {
        GPBUtil::checkString($var, True);
        $this->description = $var;

        return $this;
    }

    /**
     * [Output Only] A unique identifier for this instance template. The server defines this identifier.
     *
     * Generated from protobuf field <code>string id = 3355;</code>
     * @return string
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * [Output Only] A unique identifier for this instance template. The server defines this identifier.
     *
     * Generated from protobuf field <code>string id = 3355;</code>
     * @param string $var
     * @return $this
     */
    public function setId($var)
    {
        GPBUtil::checkString($var, True);
        $this->id = $var;

        return $this;
    }

    /**
     * [Output Only] The resource type, which is always compute#instanceTemplate for instance templates.
     *
     * Generated from protobuf field <code>string kind = 3292052;</code>
     * @return string
     */
    public function getKind()
    {
        return $this->kind;
    }

    /**
     * [Output Only] The resource type, which is always compute#instanceTemplate for instance templates.
     *
     * Generated from protobuf field <code>string kind = 3292052;</code>
     * @param string $var
     * @return $this
     */
    public function setKind($var)
    {
        GPBUtil::checkString($var, True);
        $this->kind = $var;

        return $this;
    }

    /**
     * Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
     *
     * Generated from protobuf field <code>string name = 3373707;</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
     *
     * Generated from protobuf field <code>string name = 3373707;</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * The instance properties for this instance template.
     *
     * Generated from protobuf field <code>.google.cloud.compute.v1.InstanceProperties properties = 147688755;</code>
     * @return \Google\Cloud\Compute\V1\InstanceProperties
     */
    public function getProperties()
    {
        return isset($this->properties) ? $this->properties : null;
    }

    public function hasProperties()
    {
        return isset($this->properties);
    }

    public function clearProperties()
    {
        unset($this->properties);
    }

    /**
     * The instance properties for this instance template.
     *
     * Generated from protobuf field <code>.google.cloud.compute.v1.InstanceProperties properties = 147688755;</code>
     * @param \Google\Cloud\Compute\V1\InstanceProperties $var
     * @return $this
     */
    public function setProperties($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstanceProperties::class);
        $this->properties = $var;

        return $this;
    }

    /**
     * [Output Only] The URL for this instance template. The server defines this URL.
     *
     * Generated from protobuf field <code>string self_link = 187779341;</code>
     * @return string
     */
    public function getSelfLink()
    {
        return $this->self_link;
    }

    /**
     * [Output Only] The URL for this instance template. The server defines this URL.
     *
     * Generated from protobuf field <code>string self_link = 187779341;</code>
     * @param string $var
     * @return $this
     */
    public function setSelfLink($var)
    {
        GPBUtil::checkString($var, True);
        $this->self_link = $var;

        return $this;
    }

    /**
     * The source instance used to create the template. You can provide this as a partial or full URL to the resource. For example, the following are valid values:
     * - https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance
     * - projects/project/zones/zone/instances/instance
     *
     * Generated from protobuf field <code>string source_instance = 127880249;</code>
     * @return string
     */
    public function getSourceInstance()
    {
        return $this->source_instance;
    }

    /**
     * The source instance used to create the template. You can provide this as a partial or full URL to the resource. For example, the following are valid values:
     * - https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance
     * - projects/project/zones/zone/instances/instance
     *
     * Generated from protobuf field <code>string source_instance = 127880249;</code>
     * @param string $var
     * @return $this
     */
    public function setSourceInstance($var)
    {
        GPBUtil::checkString($var, True);
        $this->source_instance = $var;

        return $this;
    }

    /**
     * The source instance params to use to create this instance template.
     *
     * Generated from protobuf field <code>.google.cloud.compute.v1.SourceInstanceParams source_instance_params = 135342156;</code>
     * @return \Google\Cloud\Compute\V1\SourceInstanceParams
     */
    public function getSourceInstanceParams()
    {
        return isset($this->source_instance_params) ? $this->source_instance_params : null;
    }

    public function hasSourceInstanceParams()
    {
        return isset($this->source_instance_params);
    }

    public function clearSourceInstanceParams()
    {
        unset($this->source_instance_params);
    }

    /**
     * The source instance params to use to create this instance template.
     *
     * Generated from protobuf field <code>.google.cloud.compute.v1.SourceInstanceParams source_instance_params = 135342156;</code>
     * @param \Google\Cloud\Compute\V1\SourceInstanceParams $var
     * @return $this
     */
    public function setSourceInstanceParams($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SourceInstanceParams::class);
        $this->source_instance_params = $var;

        return $this;
    }

}

