The function environment the generated upload url will be used for.
The upload url for 2nd Gen functions can also be used for 1st gen
functions, but not vice versa. If not specified, 2nd generation-style
upload URLs are generated.
[Preview] Resource name of a KMS crypto key (managed by the user) used to
encrypt/decrypt function source code objects in intermediate Cloud Storage
buckets. When you generate an upload url and upload your source code, it
gets copied to an intermediate Cloud Storage bucket. 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}@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).
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-09 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eGenerateUploadUrlRequest\u003c/code\u003e class is used to request a source upload URL for Cloud Functions, as part of the Cloud Functions v2beta API.\u003c/p\u003e\n"],["\u003cp\u003eThis class implements multiple interfaces, including \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e, and inherits from \u003ccode\u003eobject\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eIt has properties for specifying the \u003ccode\u003eEnvironment\u003c/code\u003e of the function, the \u003ccode\u003eKmsKeyName\u003c/code\u003e for encrypting source code in intermediate storage, and the \u003ccode\u003eParent\u003c/code\u003e project and location for the URL generation.\u003c/p\u003e\n"],["\u003cp\u003eThere are two constructors available for creating a \u003ccode\u003eGenerateUploadUrlRequest\u003c/code\u003e, one being a default empty constructor, and another that copies properties from an existing \u003ccode\u003eGenerateUploadUrlRequest\u003c/code\u003e instance.\u003c/p\u003e\n"],["\u003cp\u003eThe most recent version of the \u003ccode\u003eGenerateUploadUrlRequest\u003c/code\u003e is 1.0.0-beta07, however version 1.0.0-beta06 also exists.\u003c/p\u003e\n"]]],[],null,["# Cloud Functions v2beta API - Class GenerateUploadUrlRequest (1.0.0-beta07)\n\nVersion latestkeyboard_arrow_down\n\n- [1.0.0-beta07 (latest)](/dotnet/docs/reference/Google.Cloud.Functions.V2Beta/latest/Google.Cloud.Functions.V2Beta.GenerateUploadUrlRequest)\n- [1.0.0-beta06](/dotnet/docs/reference/Google.Cloud.Functions.V2Beta/1.0.0-beta06/Google.Cloud.Functions.V2Beta.GenerateUploadUrlRequest) \n\n public sealed class GenerateUploadUrlRequest : IMessage\u003cGenerateUploadUrlRequest\u003e, IEquatable\u003cGenerateUploadUrlRequest\u003e, IDeepCloneable\u003cGenerateUploadUrlRequest\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Cloud Functions v2beta API class GenerateUploadUrlRequest.\n\nRequest of `GenerateSourceUploadUrl` method. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e GenerateUploadUrlRequest \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[GenerateUploadUrlRequest](/dotnet/docs/reference/Google.Cloud.Functions.V2Beta/latest/Google.Cloud.Functions.V2Beta.GenerateUploadUrlRequest), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[GenerateUploadUrlRequest](/dotnet/docs/reference/Google.Cloud.Functions.V2Beta/latest/Google.Cloud.Functions.V2Beta.GenerateUploadUrlRequest), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[GenerateUploadUrlRequest](/dotnet/docs/reference/Google.Cloud.Functions.V2Beta/latest/Google.Cloud.Functions.V2Beta.GenerateUploadUrlRequest), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.Functions.V2Beta](/dotnet/docs/reference/Google.Cloud.Functions.V2Beta/latest/Google.Cloud.Functions.V2Beta)\n\nAssembly\n--------\n\nGoogle.Cloud.Functions.V2Beta.dll\n\nConstructors\n------------\n\n### GenerateUploadUrlRequest()\n\n public GenerateUploadUrlRequest()\n\n### GenerateUploadUrlRequest(GenerateUploadUrlRequest)\n\n public GenerateUploadUrlRequest(GenerateUploadUrlRequest other)\n\nProperties\n----------\n\n### Environment\n\n public Environment Environment { get; set; }\n\nThe function environment the generated upload url will be used for.\nThe upload url for 2nd Gen functions can also be used for 1st gen\nfunctions, but not vice versa. If not specified, 2nd generation-style\nupload URLs are generated.\n\n### KmsKeyName\n\n public string KmsKeyName { get; set; }\n\n\\[Preview\\] Resource name of a KMS crypto key (managed by the user) used to\nencrypt/decrypt function source code objects in intermediate Cloud Storage\nbuckets. When you generate an upload url and upload your source code, it\ngets copied to an intermediate Cloud Storage bucket. The source code is\nthen copied to a versioned directory in the sources bucket in the consumer\nproject during the function deployment.\n\nIt must match the pattern\n`projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.\n\nThe Google Cloud Functions service account\n(service-{project_number}@gcf-admin-robot.iam.gserviceaccount.com) must be\ngranted the role 'Cloud KMS CryptoKey Encrypter/Decrypter\n(roles/cloudkms.cryptoKeyEncrypterDecrypter)' on the\nKey/KeyRing/Project/Organization (least access preferred).\n\n### KmsKeyNameAsCryptoKeyName\n\n public CryptoKeyName KmsKeyNameAsCryptoKeyName { get; set; }\n\n[CryptoKeyName](/dotnet/docs/reference/Google.Cloud.Functions.V2Beta/latest/Google.Cloud.Functions.V2Beta.CryptoKeyName)-typed view over the [KmsKeyName](/dotnet/docs/reference/Google.Cloud.Functions.V2Beta/latest/Google.Cloud.Functions.V2Beta.GenerateUploadUrlRequest#Google_Cloud_Functions_V2Beta_GenerateUploadUrlRequest_KmsKeyName) resource name property.\n\n### Parent\n\n public string Parent { get; set; }\n\nRequired. The project and location in which the Google Cloud Storage signed\nURL should be generated, specified in the format `projects/*/locations/*`.\n\n### ParentAsLocationName\n\n public LocationName ParentAsLocationName { get; set; }\n\n[LocationName](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.ResourceNames.LocationName.html)-typed view over the [Parent](/dotnet/docs/reference/Google.Cloud.Functions.V2Beta/latest/Google.Cloud.Functions.V2Beta.GenerateUploadUrlRequest#Google_Cloud_Functions_V2Beta_GenerateUploadUrlRequest_Parent) resource name property."]]