<?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;

/**
 * Describes a pre-shared key used to setup MACsec in static connectivity
 * association key (CAK) mode.
 *
 * Generated from protobuf message <code>google.cloud.compute.v1.InterconnectMacsecPreSharedKey</code>
 */
class InterconnectMacsecPreSharedKey extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. A name for this pre-shared key.
     * The name must be 1-63 characters long, and comply withRFC1035. 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>optional string name = 3373707;</code>
     */
    protected $name = null;
    /**
     * A RFC3339 timestamp on or after which the key is
     * valid. startTime can be in the future. If the keychain has a single
     * key, startTime can be omitted. If the keychain has multiple keys,
     * startTime is mandatory for each key. The start times of keys must be in
     * increasing order. The start times of two consecutive keys must be
     * at least 6 hours apart.
     *
     * Generated from protobuf field <code>optional string start_time = 37467274;</code>
     */
    protected $start_time = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Required. A name for this pre-shared key.
     *           The name must be 1-63 characters long, and comply withRFC1035. 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 string $start_time
     *           A RFC3339 timestamp on or after which the key is
     *           valid. startTime can be in the future. If the keychain has a single
     *           key, startTime can be omitted. If the keychain has multiple keys,
     *           startTime is mandatory for each key. The start times of keys must be in
     *           increasing order. The start times of two consecutive keys must be
     *           at least 6 hours apart.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. A name for this pre-shared key.
     * The name must be 1-63 characters long, and comply withRFC1035. 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>optional string name = 3373707;</code>
     * @return string
     */
    public function getName()
    {
        return isset($this->name) ? $this->name : '';
    }

    public function hasName()
    {
        return isset($this->name);
    }

    public function clearName()
    {
        unset($this->name);
    }

    /**
     * Required. A name for this pre-shared key.
     * The name must be 1-63 characters long, and comply withRFC1035. 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>optional string name = 3373707;</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * A RFC3339 timestamp on or after which the key is
     * valid. startTime can be in the future. If the keychain has a single
     * key, startTime can be omitted. If the keychain has multiple keys,
     * startTime is mandatory for each key. The start times of keys must be in
     * increasing order. The start times of two consecutive keys must be
     * at least 6 hours apart.
     *
     * Generated from protobuf field <code>optional string start_time = 37467274;</code>
     * @return string
     */
    public function getStartTime()
    {
        return isset($this->start_time) ? $this->start_time : '';
    }

    public function hasStartTime()
    {
        return isset($this->start_time);
    }

    public function clearStartTime()
    {
        unset($this->start_time);
    }

    /**
     * A RFC3339 timestamp on or after which the key is
     * valid. startTime can be in the future. If the keychain has a single
     * key, startTime can be omitted. If the keychain has multiple keys,
     * startTime is mandatory for each key. The start times of keys must be in
     * increasing order. The start times of two consecutive keys must be
     * at least 6 hours apart.
     *
     * Generated from protobuf field <code>optional string start_time = 37467274;</code>
     * @param string $var
     * @return $this
     */
    public function setStartTime($var)
    {
        GPBUtil::checkString($var, True);
        $this->start_time = $var;

        return $this;
    }

}

