<?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 a customer-supplied Signing Key used by Cloud CDN Signed URLs
 *
 * Generated from protobuf message <code>google.cloud.compute.v1.SignedUrlKey</code>
 */
class SignedUrlKey extends \Google\Protobuf\Internal\Message
{
    /**
     * Name of the key. 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>optional string key_name = 500938859;</code>
     */
    private $key_name = null;
    /**
     * 128-bit key value used for signing the URL. The key value must be a valid RFC 4648 Section 5 base64url encoded string.
     *
     * Generated from protobuf field <code>optional string key_value = 504106897;</code>
     */
    private $key_value = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $key_name
     *           Name of the key. 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 string $key_value
     *           128-bit key value used for signing the URL. The key value must be a valid RFC 4648 Section 5 base64url encoded string.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce();
        parent::__construct($data);
    }

    /**
     * Name of the key. 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>optional string key_name = 500938859;</code>
     * @return string
     */
    public function getKeyName()
    {
        return isset($this->key_name) ? $this->key_name : '';
    }

    public function hasKeyName()
    {
        return isset($this->key_name);
    }

    public function clearKeyName()
    {
        unset($this->key_name);
    }

    /**
     * Name of the key. 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>optional string key_name = 500938859;</code>
     * @param string $var
     * @return $this
     */
    public function setKeyName($var)
    {
        GPBUtil::checkString($var, True);
        $this->key_name = $var;

        return $this;
    }

    /**
     * 128-bit key value used for signing the URL. The key value must be a valid RFC 4648 Section 5 base64url encoded string.
     *
     * Generated from protobuf field <code>optional string key_value = 504106897;</code>
     * @return string
     */
    public function getKeyValue()
    {
        return isset($this->key_value) ? $this->key_value : '';
    }

    public function hasKeyValue()
    {
        return isset($this->key_value);
    }

    public function clearKeyValue()
    {
        unset($this->key_value);
    }

    /**
     * 128-bit key value used for signing the URL. The key value must be a valid RFC 4648 Section 5 base64url encoded string.
     *
     * Generated from protobuf field <code>optional string key_value = 504106897;</code>
     * @param string $var
     * @return $this
     */
    public function setKeyValue($var)
    {
        GPBUtil::checkString($var, True);
        $this->key_value = $var;

        return $this;
    }

}

