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

namespace Google\Cloud\Speech\V2;

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

/**
 * Message representing the config for the Speech-to-Text API. This includes an
 * optional [KMS key](https://cloud.google.com/kms/docs/resource-hierarchy#keys)
 * with which incoming data will be encrypted.
 *
 * Generated from protobuf message <code>google.cloud.speech.v2.Config</code>
 */
class Config extends \Google\Protobuf\Internal\Message
{
    /**
     * Output only. The name of the config resource. There is exactly one config
     * resource per project per location. The expected format is
     * `projects/{project}/locations/{location}/config`.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $name = '';
    /**
     * Optional. An optional [KMS key
     * name](https://cloud.google.com/kms/docs/resource-hierarchy#keys) that if
     * present, will be used to encrypt Speech-to-Text resources at-rest. Updating
     * this key will not encrypt existing resources using this key; only new
     * resources will be encrypted using this key. The expected format is
     * `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
     *
     * Generated from protobuf field <code>string kms_key_name = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {</code>
     */
    private $kms_key_name = '';
    /**
     * Output only. The most recent time this resource was modified.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $update_time = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Output only. The name of the config resource. There is exactly one config
     *           resource per project per location. The expected format is
     *           `projects/{project}/locations/{location}/config`.
     *     @type string $kms_key_name
     *           Optional. An optional [KMS key
     *           name](https://cloud.google.com/kms/docs/resource-hierarchy#keys) that if
     *           present, will be used to encrypt Speech-to-Text resources at-rest. Updating
     *           this key will not encrypt existing resources using this key; only new
     *           resources will be encrypted using this key. The expected format is
     *           `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
     *     @type \Google\Protobuf\Timestamp $update_time
     *           Output only. The most recent time this resource was modified.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Speech\V2\CloudSpeech::initOnce();
        parent::__construct($data);
    }

    /**
     * Output only. The name of the config resource. There is exactly one config
     * resource per project per location. The expected format is
     * `projects/{project}/locations/{location}/config`.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Output only. The name of the config resource. There is exactly one config
     * resource per project per location. The expected format is
     * `projects/{project}/locations/{location}/config`.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Optional. An optional [KMS key
     * name](https://cloud.google.com/kms/docs/resource-hierarchy#keys) that if
     * present, will be used to encrypt Speech-to-Text resources at-rest. Updating
     * this key will not encrypt existing resources using this key; only new
     * resources will be encrypted using this key. The expected format is
     * `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
     *
     * Generated from protobuf field <code>string kms_key_name = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getKmsKeyName()
    {
        return $this->kms_key_name;
    }

    /**
     * Optional. An optional [KMS key
     * name](https://cloud.google.com/kms/docs/resource-hierarchy#keys) that if
     * present, will be used to encrypt Speech-to-Text resources at-rest. Updating
     * this key will not encrypt existing resources using this key; only new
     * resources will be encrypted using this key. The expected format is
     * `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
     *
     * Generated from protobuf field <code>string kms_key_name = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setKmsKeyName($var)
    {
        GPBUtil::checkString($var, True);
        $this->kms_key_name = $var;

        return $this;
    }

    /**
     * Output only. The most recent time this resource was modified.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getUpdateTime()
    {
        return $this->update_time;
    }

    public function hasUpdateTime()
    {
        return isset($this->update_time);
    }

    public function clearUpdateTime()
    {
        unset($this->update_time);
    }

    /**
     * Output only. The most recent time this resource was modified.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setUpdateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->update_time = $var;

        return $this;
    }

}

