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

namespace Google\Cloud\Functions\V1;

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

/**
 * Request of `GenerateSourceUploadUrl` method.
 *
 * Generated from protobuf message <code>google.cloud.functions.v1.GenerateUploadUrlRequest</code>
 */
class GenerateUploadUrlRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * The project and location in which the Google Cloud Storage signed URL
     * should be generated, specified in the format `projects/&#42;&#47;locations/&#42;`.
     *
     * Generated from protobuf field <code>string parent = 1;</code>
     */
    private $parent = '';
    /**
     * Resource name of a KMS crypto key (managed by the user) used to
     * encrypt/decrypt function source code objects in staging Cloud Storage
     * buckets. When you generate an upload url and upload your source code, it
     * gets copied to a staging Cloud Storage bucket in an internal regional
     * project. The source code is then copied to a versioned directory in the
     * sources bucket in the consumer project during the function deployment.
     * It must match the pattern
     * `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
     * The Google Cloud Functions service account
     * (service-{project_number}&#64;gcf-admin-robot.iam.gserviceaccount.com) must be
     * granted the role 'Cloud KMS CryptoKey Encrypter/Decrypter
     * (roles/cloudkms.cryptoKeyEncrypterDecrypter)' on the
     * Key/KeyRing/Project/Organization (least access preferred). GCF will
     * delegate access to the Google Storage service account in the internal
     * project.
     *
     * Generated from protobuf field <code>string kms_key_name = 2 [(.google.api.resource_reference) = {</code>
     */
    private $kms_key_name = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $parent
     *           The project and location in which the Google Cloud Storage signed URL
     *           should be generated, specified in the format `projects/&#42;&#47;locations/&#42;`.
     *     @type string $kms_key_name
     *           Resource name of a KMS crypto key (managed by the user) used to
     *           encrypt/decrypt function source code objects in staging Cloud Storage
     *           buckets. When you generate an upload url and upload your source code, it
     *           gets copied to a staging Cloud Storage bucket in an internal regional
     *           project. The source code is then copied to a versioned directory in the
     *           sources bucket in the consumer project during the function deployment.
     *           It must match the pattern
     *           `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
     *           The Google Cloud Functions service account
     *           (service-{project_number}&#64;gcf-admin-robot.iam.gserviceaccount.com) must be
     *           granted the role 'Cloud KMS CryptoKey Encrypter/Decrypter
     *           (roles/cloudkms.cryptoKeyEncrypterDecrypter)' on the
     *           Key/KeyRing/Project/Organization (least access preferred). GCF will
     *           delegate access to the Google Storage service account in the internal
     *           project.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Functions\V1\Functions::initOnce();
        parent::__construct($data);
    }

    /**
     * The project and location in which the Google Cloud Storage signed URL
     * should be generated, specified in the format `projects/&#42;&#47;locations/&#42;`.
     *
     * Generated from protobuf field <code>string parent = 1;</code>
     * @return string
     */
    public function getParent()
    {
        return $this->parent;
    }

    /**
     * The project and location in which the Google Cloud Storage signed URL
     * should be generated, specified in the format `projects/&#42;&#47;locations/&#42;`.
     *
     * Generated from protobuf field <code>string parent = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setParent($var)
    {
        GPBUtil::checkString($var, True);
        $this->parent = $var;

        return $this;
    }

    /**
     * Resource name of a KMS crypto key (managed by the user) used to
     * encrypt/decrypt function source code objects in staging Cloud Storage
     * buckets. When you generate an upload url and upload your source code, it
     * gets copied to a staging Cloud Storage bucket in an internal regional
     * project. The source code is then copied to a versioned directory in the
     * sources bucket in the consumer project during the function deployment.
     * It must match the pattern
     * `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
     * The Google Cloud Functions service account
     * (service-{project_number}&#64;gcf-admin-robot.iam.gserviceaccount.com) must be
     * granted the role 'Cloud KMS CryptoKey Encrypter/Decrypter
     * (roles/cloudkms.cryptoKeyEncrypterDecrypter)' on the
     * Key/KeyRing/Project/Organization (least access preferred). GCF will
     * delegate access to the Google Storage service account in the internal
     * project.
     *
     * Generated from protobuf field <code>string kms_key_name = 2 [(.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getKmsKeyName()
    {
        return $this->kms_key_name;
    }

    /**
     * Resource name of a KMS crypto key (managed by the user) used to
     * encrypt/decrypt function source code objects in staging Cloud Storage
     * buckets. When you generate an upload url and upload your source code, it
     * gets copied to a staging Cloud Storage bucket in an internal regional
     * project. The source code is then copied to a versioned directory in the
     * sources bucket in the consumer project during the function deployment.
     * It must match the pattern
     * `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
     * The Google Cloud Functions service account
     * (service-{project_number}&#64;gcf-admin-robot.iam.gserviceaccount.com) must be
     * granted the role 'Cloud KMS CryptoKey Encrypter/Decrypter
     * (roles/cloudkms.cryptoKeyEncrypterDecrypter)' on the
     * Key/KeyRing/Project/Organization (least access preferred). GCF will
     * delegate access to the Google Storage service account in the internal
     * project.
     *
     * Generated from protobuf field <code>string kms_key_name = 2 [(.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;
    }

}

