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

namespace Google\Cloud\Kms\V1;

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

/**
 * Request message for
 * [KeyManagementService.UpdateCryptoKey][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKey].
 *
 * Generated from protobuf message <code>google.cloud.kms.v1.UpdateCryptoKeyRequest</code>
 */
class UpdateCryptoKeyRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. [CryptoKey][google.cloud.kms.v1.CryptoKey] with updated values.
     *
     * Generated from protobuf field <code>.google.cloud.kms.v1.CryptoKey crypto_key = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $crypto_key = null;
    /**
     * Required. List of fields to be updated in this request.
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $update_mask = null;

    /**
     * @param \Google\Cloud\Kms\V1\CryptoKey $cryptoKey  Required. [CryptoKey][google.cloud.kms.v1.CryptoKey] with updated values.
     * @param \Google\Protobuf\FieldMask     $updateMask Required. List of fields to be updated in this request.
     *
     * @return \Google\Cloud\Kms\V1\UpdateCryptoKeyRequest
     *
     * @experimental
     */
    public static function build(\Google\Cloud\Kms\V1\CryptoKey $cryptoKey, \Google\Protobuf\FieldMask $updateMask): self
    {
        return (new self())
            ->setCryptoKey($cryptoKey)
            ->setUpdateMask($updateMask);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Kms\V1\CryptoKey $crypto_key
     *           Required. [CryptoKey][google.cloud.kms.v1.CryptoKey] with updated values.
     *     @type \Google\Protobuf\FieldMask $update_mask
     *           Required. List of fields to be updated in this request.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. [CryptoKey][google.cloud.kms.v1.CryptoKey] with updated values.
     *
     * Generated from protobuf field <code>.google.cloud.kms.v1.CryptoKey crypto_key = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\Kms\V1\CryptoKey|null
     */
    public function getCryptoKey()
    {
        return $this->crypto_key;
    }

    public function hasCryptoKey()
    {
        return isset($this->crypto_key);
    }

    public function clearCryptoKey()
    {
        unset($this->crypto_key);
    }

    /**
     * Required. [CryptoKey][google.cloud.kms.v1.CryptoKey] with updated values.
     *
     * Generated from protobuf field <code>.google.cloud.kms.v1.CryptoKey crypto_key = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\Kms\V1\CryptoKey $var
     * @return $this
     */
    public function setCryptoKey($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Kms\V1\CryptoKey::class);
        $this->crypto_key = $var;

        return $this;
    }

    /**
     * Required. List of fields to be updated in this request.
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Protobuf\FieldMask|null
     */
    public function getUpdateMask()
    {
        return $this->update_mask;
    }

    public function hasUpdateMask()
    {
        return isset($this->update_mask);
    }

    public function clearUpdateMask()
    {
        unset($this->update_mask);
    }

    /**
     * Required. List of fields to be updated in this request.
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Protobuf\FieldMask $var
     * @return $this
     */
    public function setUpdateMask($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class);
        $this->update_mask = $var;

        return $this;
    }

}

