[[["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 latest version of the Google Cloud Functions v2 API class Function is 1.7.0, and there are multiple previous versions available, ranging from 1.0.0 to 1.6.0.\u003c/p\u003e\n"],["\u003cp\u003eThe Function class describes a Cloud Function that executes user computations in response to an event and encapsulates configurations.\u003c/p\u003e\n"],["\u003cp\u003eIt implements multiple interfaces, including IMessage, IEquatable, IDeepCloneable, and IBufferMessage, and inherits from the base object class.\u003c/p\u003e\n"],["\u003cp\u003eKey properties of the Function class include BuildConfig, CreateTime, Description, Environment, EventTrigger, ServiceConfig, State, and UpdateTime.\u003c/p\u003e\n"],["\u003cp\u003eIt also has properties to manage encryption through KmsKeyName, as well as user-defined labels and a user-defined function name.\u003c/p\u003e\n"]]],[],null,["# Cloud Functions v2 API - Class Function (1.7.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.7.0 (latest)](/dotnet/docs/reference/Google.Cloud.Functions.V2/latest/Google.Cloud.Functions.V2.Function)\n- [1.6.0](/dotnet/docs/reference/Google.Cloud.Functions.V2/1.6.0/Google.Cloud.Functions.V2.Function)\n- [1.5.0](/dotnet/docs/reference/Google.Cloud.Functions.V2/1.5.0/Google.Cloud.Functions.V2.Function)\n- [1.4.0](/dotnet/docs/reference/Google.Cloud.Functions.V2/1.4.0/Google.Cloud.Functions.V2.Function)\n- [1.3.0](/dotnet/docs/reference/Google.Cloud.Functions.V2/1.3.0/Google.Cloud.Functions.V2.Function)\n- [1.2.0](/dotnet/docs/reference/Google.Cloud.Functions.V2/1.2.0/Google.Cloud.Functions.V2.Function)\n- [1.1.0](/dotnet/docs/reference/Google.Cloud.Functions.V2/1.1.0/Google.Cloud.Functions.V2.Function)\n- [1.0.0](/dotnet/docs/reference/Google.Cloud.Functions.V2/1.0.0/Google.Cloud.Functions.V2.Function) \n\n public sealed class Function : IMessage\u003cFunction\u003e, IEquatable\u003cFunction\u003e, IDeepCloneable\u003cFunction\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Cloud Functions v2 API class Function.\n\nDescribes a Cloud Function that contains user computation executed in\nresponse to an event. It encapsulates function and trigger configurations. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e Function \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[Function](/dotnet/docs/reference/Google.Cloud.Functions.V2/latest/Google.Cloud.Functions.V2.Function), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[Function](/dotnet/docs/reference/Google.Cloud.Functions.V2/latest/Google.Cloud.Functions.V2.Function), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[Function](/dotnet/docs/reference/Google.Cloud.Functions.V2/latest/Google.Cloud.Functions.V2.Function), [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.V2](/dotnet/docs/reference/Google.Cloud.Functions.V2/latest/Google.Cloud.Functions.V2)\n\nAssembly\n--------\n\nGoogle.Cloud.Functions.V2.dll\n\nConstructors\n------------\n\n### Function()\n\n public Function()\n\n### Function(Function)\n\n public Function(Function other)\n\nProperties\n----------\n\n### BuildConfig\n\n public BuildConfig BuildConfig { get; set; }\n\nDescribes the Build step of the function that builds a container from the\ngiven source.\n\n### CreateTime\n\n public Timestamp CreateTime { get; set; }\n\nOutput only. The create timestamp of a Cloud Function. This is only\napplicable to 2nd Gen functions.\n\n### Description\n\n public string Description { get; set; }\n\nUser-provided description of a function.\n\n### Environment\n\n public Environment Environment { get; set; }\n\nDescribe whether the function is 1st Gen or 2nd Gen.\n\n### EventTrigger\n\n public EventTrigger EventTrigger { get; set; }\n\nAn Eventarc trigger managed by Google Cloud Functions that fires events in\nresponse to a condition in another service.\n\n### FunctionName\n\n public FunctionName FunctionName { get; set; }\n\n[FunctionName](/dotnet/docs/reference/Google.Cloud.Functions.V2/latest/Google.Cloud.Functions.V2.FunctionName)-typed view over the [Name](/dotnet/docs/reference/Google.Cloud.Functions.V2/latest/Google.Cloud.Functions.V2.Function#Google_Cloud_Functions_V2_Function_Name) resource name property.\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 resources.\n\nIt must match the pattern\n`projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.\n\n### KmsKeyNameAsCryptoKeyName\n\n public CryptoKeyName KmsKeyNameAsCryptoKeyName { get; set; }\n\n[CryptoKeyName](/dotnet/docs/reference/Google.Cloud.Functions.V2/latest/Google.Cloud.Functions.V2.CryptoKeyName)-typed view over the [KmsKeyName](/dotnet/docs/reference/Google.Cloud.Functions.V2/latest/Google.Cloud.Functions.V2.Function#Google_Cloud_Functions_V2_Function_KmsKeyName) resource name property.\n\n### Labels\n\n public MapField\u003cstring, string\u003e Labels { get; }\n\nLabels associated with this Cloud Function.\n\n### Name\n\n public string Name { get; set; }\n\nA user-defined name of the function. Function names must be unique\nglobally and match pattern `projects/*/locations/*/functions/*`\n\n### SatisfiesPzs\n\n public bool SatisfiesPzs { get; set; }\n\nOutput only. Reserved for future use.\n\n### ServiceConfig\n\n public ServiceConfig ServiceConfig { get; set; }\n\nDescribes the Service being deployed. Currently deploys services to Cloud\nRun (fully managed).\n\n### State\n\n public Function.Types.State State { get; set; }\n\nOutput only. State of the function.\n\n### StateMessages\n\n public RepeatedField\u003cStateMessage\u003e StateMessages { get; }\n\nOutput only. State Messages for this Cloud Function.\n\n### UpdateTime\n\n public Timestamp UpdateTime { get; set; }\n\nOutput only. The last update timestamp of a Cloud Function.\n\n### Url\n\n public string Url { get; set; }\n\nOutput only. The deployed url for the function."]]