All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.gcp.cloudfunctions.kotlin.FunctionArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 8.12.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.cloudfunctions.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.cloudfunctions.FunctionArgs.builder
import com.pulumi.gcp.cloudfunctions.kotlin.inputs.FunctionEventTriggerArgs
import com.pulumi.gcp.cloudfunctions.kotlin.inputs.FunctionEventTriggerArgsBuilder
import com.pulumi.gcp.cloudfunctions.kotlin.inputs.FunctionSecretEnvironmentVariableArgs
import com.pulumi.gcp.cloudfunctions.kotlin.inputs.FunctionSecretEnvironmentVariableArgsBuilder
import com.pulumi.gcp.cloudfunctions.kotlin.inputs.FunctionSecretVolumeArgs
import com.pulumi.gcp.cloudfunctions.kotlin.inputs.FunctionSecretVolumeArgsBuilder
import com.pulumi.gcp.cloudfunctions.kotlin.inputs.FunctionSourceRepositoryArgs
import com.pulumi.gcp.cloudfunctions.kotlin.inputs.FunctionSourceRepositoryArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Any
import kotlin.Boolean
import kotlin.Int
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Creates a new Cloud Function. For more information see:
 * * [API documentation](https://cloud.google.com/functions/docs/reference/rest/v1/projects.locations.functions)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/functions/docs)
 * > **Warning:** As of November 1, 2019, newly created Functions are
 * private-by-default and will require [appropriate IAM permissions](https://cloud.google.com/functions/docs/reference/iam/roles)
 * to be invoked. See below examples for how to set up the appropriate permissions,
 * or view the [Cloud Functions IAM resources](https://www.terraform.io/docs/providers/google/r/cloudfunctions_cloud_function_iam.html)
 * for Cloud Functions.
 * ## Example Usage
 * ### Public Function
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const bucket = new gcp.storage.Bucket("bucket", {
 *     name: "test-bucket",
 *     location: "US",
 * });
 * const archive = new gcp.storage.BucketObject("archive", {
 *     name: "index.zip",
 *     bucket: bucket.name,
 *     source: new pulumi.asset.FileAsset("./path/to/zip/file/which/contains/code"),
 * });
 * const _function = new gcp.cloudfunctions.Function("function", {
 *     name: "function-test",
 *     description: "My function",
 *     runtime: "nodejs16",
 *     availableMemoryMb: 128,
 *     sourceArchiveBucket: bucket.name,
 *     sourceArchiveObject: archive.name,
 *     triggerHttp: true,
 *     entryPoint: "helloGET",
 * });
 * // IAM entry for all users to invoke the function
 * const invoker = new gcp.cloudfunctions.FunctionIamMember("invoker", {
 *     project: _function.project,
 *     region: _function.region,
 *     cloudFunction: _function.name,
 *     role: "roles/cloudfunctions.invoker",
 *     member: "allUsers",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * bucket = gcp.storage.Bucket("bucket",
 *     name="test-bucket",
 *     location="US")
 * archive = gcp.storage.BucketObject("archive",
 *     name="index.zip",
 *     bucket=bucket.name,
 *     source=pulumi.FileAsset("./path/to/zip/file/which/contains/code"))
 * function = gcp.cloudfunctions.Function("function",
 *     name="function-test",
 *     description="My function",
 *     runtime="nodejs16",
 *     available_memory_mb=128,
 *     source_archive_bucket=bucket.name,
 *     source_archive_object=archive.name,
 *     trigger_http=True,
 *     entry_point="helloGET")
 * # IAM entry for all users to invoke the function
 * invoker = gcp.cloudfunctions.FunctionIamMember("invoker",
 *     project=function.project,
 *     region=function.region,
 *     cloud_function=function.name,
 *     role="roles/cloudfunctions.invoker",
 *     member="allUsers")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var bucket = new Gcp.Storage.Bucket("bucket", new()
 *     {
 *         Name = "test-bucket",
 *         Location = "US",
 *     });
 *     var archive = new Gcp.Storage.BucketObject("archive", new()
 *     {
 *         Name = "index.zip",
 *         Bucket = bucket.Name,
 *         Source = new FileAsset("./path/to/zip/file/which/contains/code"),
 *     });
 *     var function = new Gcp.CloudFunctions.Function("function", new()
 *     {
 *         Name = "function-test",
 *         Description = "My function",
 *         Runtime = "nodejs16",
 *         AvailableMemoryMb = 128,
 *         SourceArchiveBucket = bucket.Name,
 *         SourceArchiveObject = archive.Name,
 *         TriggerHttp = true,
 *         EntryPoint = "helloGET",
 *     });
 *     // IAM entry for all users to invoke the function
 *     var invoker = new Gcp.CloudFunctions.FunctionIamMember("invoker", new()
 *     {
 *         Project = function.Project,
 *         Region = function.Region,
 *         CloudFunction = function.Name,
 *         Role = "roles/cloudfunctions.invoker",
 *         Member = "allUsers",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/cloudfunctions"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/storage"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		bucket, err := storage.NewBucket(ctx, "bucket", &storage.BucketArgs{
 * 			Name:     pulumi.String("test-bucket"),
 * 			Location: pulumi.String("US"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		archive, err := storage.NewBucketObject(ctx, "archive", &storage.BucketObjectArgs{
 * 			Name:   pulumi.String("index.zip"),
 * 			Bucket: bucket.Name,
 * 			Source: pulumi.NewFileAsset("./path/to/zip/file/which/contains/code"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		function, err := cloudfunctions.NewFunction(ctx, "function", &cloudfunctions.FunctionArgs{
 * 			Name:                pulumi.String("function-test"),
 * 			Description:         pulumi.String("My function"),
 * 			Runtime:             pulumi.String("nodejs16"),
 * 			AvailableMemoryMb:   pulumi.Int(128),
 * 			SourceArchiveBucket: bucket.Name,
 * 			SourceArchiveObject: archive.Name,
 * 			TriggerHttp:         pulumi.Bool(true),
 * 			EntryPoint:          pulumi.String("helloGET"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		// IAM entry for all users to invoke the function
 * 		_, err = cloudfunctions.NewFunctionIamMember(ctx, "invoker", &cloudfunctions.FunctionIamMemberArgs{
 * 			Project:       function.Project,
 * 			Region:        function.Region,
 * 			CloudFunction: function.Name,
 * 			Role:          pulumi.String("roles/cloudfunctions.invoker"),
 * 			Member:        pulumi.String("allUsers"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.gcp.storage.Bucket;
 * import com.pulumi.gcp.storage.BucketArgs;
 * import com.pulumi.gcp.storage.BucketObject;
 * import com.pulumi.gcp.storage.BucketObjectArgs;
 * import com.pulumi.gcp.cloudfunctions.Function;
 * import com.pulumi.gcp.cloudfunctions.FunctionArgs;
 * import com.pulumi.gcp.cloudfunctions.FunctionIamMember;
 * import com.pulumi.gcp.cloudfunctions.FunctionIamMemberArgs;
 * import com.pulumi.asset.FileAsset;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 *     public static void stack(Context ctx) {
 *         var bucket = new Bucket("bucket", BucketArgs.builder()
 *             .name("test-bucket")
 *             .location("US")
 *             .build());
 *         var archive = new BucketObject("archive", BucketObjectArgs.builder()
 *             .name("index.zip")
 *             .bucket(bucket.name())
 *             .source(new FileAsset("./path/to/zip/file/which/contains/code"))
 *             .build());
 *         var function = new Function("function", FunctionArgs.builder()
 *             .name("function-test")
 *             .description("My function")
 *             .runtime("nodejs16")
 *             .availableMemoryMb(128)
 *             .sourceArchiveBucket(bucket.name())
 *             .sourceArchiveObject(archive.name())
 *             .triggerHttp(true)
 *             .entryPoint("helloGET")
 *             .build());
 *         // IAM entry for all users to invoke the function
 *         var invoker = new FunctionIamMember("invoker", FunctionIamMemberArgs.builder()
 *             .project(function.project())
 *             .region(function.region())
 *             .cloudFunction(function.name())
 *             .role("roles/cloudfunctions.invoker")
 *             .member("allUsers")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   bucket:
 *     type: gcp:storage:Bucket
 *     properties:
 *       name: test-bucket
 *       location: US
 *   archive:
 *     type: gcp:storage:BucketObject
 *     properties:
 *       name: index.zip
 *       bucket: ${bucket.name}
 *       source:
 *         fn::FileAsset: ./path/to/zip/file/which/contains/code
 *   function:
 *     type: gcp:cloudfunctions:Function
 *     properties:
 *       name: function-test
 *       description: My function
 *       runtime: nodejs16
 *       availableMemoryMb: 128
 *       sourceArchiveBucket: ${bucket.name}
 *       sourceArchiveObject: ${archive.name}
 *       triggerHttp: true
 *       entryPoint: helloGET
 *   # IAM entry for all users to invoke the function
 *   invoker:
 *     type: gcp:cloudfunctions:FunctionIamMember
 *     properties:
 *       project: ${function.project}
 *       region: ${function.region}
 *       cloudFunction: ${function.name}
 *       role: roles/cloudfunctions.invoker
 *       member: allUsers
 * ```
 * 
 * ### Single User
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const bucket = new gcp.storage.Bucket("bucket", {
 *     name: "test-bucket",
 *     location: "US",
 * });
 * const archive = new gcp.storage.BucketObject("archive", {
 *     name: "index.zip",
 *     bucket: bucket.name,
 *     source: new pulumi.asset.FileAsset("./path/to/zip/file/which/contains/code"),
 * });
 * const _function = new gcp.cloudfunctions.Function("function", {
 *     name: "function-test",
 *     description: "My function",
 *     runtime: "nodejs16",
 *     availableMemoryMb: 128,
 *     sourceArchiveBucket: bucket.name,
 *     sourceArchiveObject: archive.name,
 *     triggerHttp: true,
 *     httpsTriggerSecurityLevel: "SECURE_ALWAYS",
 *     timeout: 60,
 *     entryPoint: "helloGET",
 *     labels: {
 *         "my-label": "my-label-value",
 *     },
 *     environmentVariables: {
 *         MY_ENV_VAR: "my-env-var-value",
 *     },
 * });
 * // IAM entry for a single user to invoke the function
 * const invoker = new gcp.cloudfunctions.FunctionIamMember("invoker", {
 *     project: _function.project,
 *     region: _function.region,
 *     cloudFunction: _function.name,
 *     role: "roles/cloudfunctions.invoker",
 *     member: "user:[email protected]",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * bucket = gcp.storage.Bucket("bucket",
 *     name="test-bucket",
 *     location="US")
 * archive = gcp.storage.BucketObject("archive",
 *     name="index.zip",
 *     bucket=bucket.name,
 *     source=pulumi.FileAsset("./path/to/zip/file/which/contains/code"))
 * function = gcp.cloudfunctions.Function("function",
 *     name="function-test",
 *     description="My function",
 *     runtime="nodejs16",
 *     available_memory_mb=128,
 *     source_archive_bucket=bucket.name,
 *     source_archive_object=archive.name,
 *     trigger_http=True,
 *     https_trigger_security_level="SECURE_ALWAYS",
 *     timeout=60,
 *     entry_point="helloGET",
 *     labels={
 *         "my-label": "my-label-value",
 *     },
 *     environment_variables={
 *         "MY_ENV_VAR": "my-env-var-value",
 *     })
 * # IAM entry for a single user to invoke the function
 * invoker = gcp.cloudfunctions.FunctionIamMember("invoker",
 *     project=function.project,
 *     region=function.region,
 *     cloud_function=function.name,
 *     role="roles/cloudfunctions.invoker",
 *     member="user:[email protected]")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var bucket = new Gcp.Storage.Bucket("bucket", new()
 *     {
 *         Name = "test-bucket",
 *         Location = "US",
 *     });
 *     var archive = new Gcp.Storage.BucketObject("archive", new()
 *     {
 *         Name = "index.zip",
 *         Bucket = bucket.Name,
 *         Source = new FileAsset("./path/to/zip/file/which/contains/code"),
 *     });
 *     var function = new Gcp.CloudFunctions.Function("function", new()
 *     {
 *         Name = "function-test",
 *         Description = "My function",
 *         Runtime = "nodejs16",
 *         AvailableMemoryMb = 128,
 *         SourceArchiveBucket = bucket.Name,
 *         SourceArchiveObject = archive.Name,
 *         TriggerHttp = true,
 *         HttpsTriggerSecurityLevel = "SECURE_ALWAYS",
 *         Timeout = 60,
 *         EntryPoint = "helloGET",
 *         Labels =
 *         {
 *             { "my-label", "my-label-value" },
 *         },
 *         EnvironmentVariables =
 *         {
 *             { "MY_ENV_VAR", "my-env-var-value" },
 *         },
 *     });
 *     // IAM entry for a single user to invoke the function
 *     var invoker = new Gcp.CloudFunctions.FunctionIamMember("invoker", new()
 *     {
 *         Project = function.Project,
 *         Region = function.Region,
 *         CloudFunction = function.Name,
 *         Role = "roles/cloudfunctions.invoker",
 *         Member = "user:[email protected]",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/cloudfunctions"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/storage"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		bucket, err := storage.NewBucket(ctx, "bucket", &storage.BucketArgs{
 * 			Name:     pulumi.String("test-bucket"),
 * 			Location: pulumi.String("US"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		archive, err := storage.NewBucketObject(ctx, "archive", &storage.BucketObjectArgs{
 * 			Name:   pulumi.String("index.zip"),
 * 			Bucket: bucket.Name,
 * 			Source: pulumi.NewFileAsset("./path/to/zip/file/which/contains/code"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		function, err := cloudfunctions.NewFunction(ctx, "function", &cloudfunctions.FunctionArgs{
 * 			Name:                      pulumi.String("function-test"),
 * 			Description:               pulumi.String("My function"),
 * 			Runtime:                   pulumi.String("nodejs16"),
 * 			AvailableMemoryMb:         pulumi.Int(128),
 * 			SourceArchiveBucket:       bucket.Name,
 * 			SourceArchiveObject:       archive.Name,
 * 			TriggerHttp:               pulumi.Bool(true),
 * 			HttpsTriggerSecurityLevel: pulumi.String("SECURE_ALWAYS"),
 * 			Timeout:                   pulumi.Int(60),
 * 			EntryPoint:                pulumi.String("helloGET"),
 * 			Labels: pulumi.Map{
 * 				"my-label": pulumi.Any("my-label-value"),
 * 			},
 * 			EnvironmentVariables: pulumi.Map{
 * 				"MY_ENV_VAR": pulumi.Any("my-env-var-value"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		// IAM entry for a single user to invoke the function
 * 		_, err = cloudfunctions.NewFunctionIamMember(ctx, "invoker", &cloudfunctions.FunctionIamMemberArgs{
 * 			Project:       function.Project,
 * 			Region:        function.Region,
 * 			CloudFunction: function.Name,
 * 			Role:          pulumi.String("roles/cloudfunctions.invoker"),
 * 			Member:        pulumi.String("user:[email protected]"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.gcp.storage.Bucket;
 * import com.pulumi.gcp.storage.BucketArgs;
 * import com.pulumi.gcp.storage.BucketObject;
 * import com.pulumi.gcp.storage.BucketObjectArgs;
 * import com.pulumi.gcp.cloudfunctions.Function;
 * import com.pulumi.gcp.cloudfunctions.FunctionArgs;
 * import com.pulumi.gcp.cloudfunctions.FunctionIamMember;
 * import com.pulumi.gcp.cloudfunctions.FunctionIamMemberArgs;
 * import com.pulumi.asset.FileAsset;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 *     public static void stack(Context ctx) {
 *         var bucket = new Bucket("bucket", BucketArgs.builder()
 *             .name("test-bucket")
 *             .location("US")
 *             .build());
 *         var archive = new BucketObject("archive", BucketObjectArgs.builder()
 *             .name("index.zip")
 *             .bucket(bucket.name())
 *             .source(new FileAsset("./path/to/zip/file/which/contains/code"))
 *             .build());
 *         var function = new Function("function", FunctionArgs.builder()
 *             .name("function-test")
 *             .description("My function")
 *             .runtime("nodejs16")
 *             .availableMemoryMb(128)
 *             .sourceArchiveBucket(bucket.name())
 *             .sourceArchiveObject(archive.name())
 *             .triggerHttp(true)
 *             .httpsTriggerSecurityLevel("SECURE_ALWAYS")
 *             .timeout(60)
 *             .entryPoint("helloGET")
 *             .labels(Map.of("my-label", "my-label-value"))
 *             .environmentVariables(Map.of("MY_ENV_VAR", "my-env-var-value"))
 *             .build());
 *         // IAM entry for a single user to invoke the function
 *         var invoker = new FunctionIamMember("invoker", FunctionIamMemberArgs.builder()
 *             .project(function.project())
 *             .region(function.region())
 *             .cloudFunction(function.name())
 *             .role("roles/cloudfunctions.invoker")
 *             .member("user:[email protected]")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   bucket:
 *     type: gcp:storage:Bucket
 *     properties:
 *       name: test-bucket
 *       location: US
 *   archive:
 *     type: gcp:storage:BucketObject
 *     properties:
 *       name: index.zip
 *       bucket: ${bucket.name}
 *       source:
 *         fn::FileAsset: ./path/to/zip/file/which/contains/code
 *   function:
 *     type: gcp:cloudfunctions:Function
 *     properties:
 *       name: function-test
 *       description: My function
 *       runtime: nodejs16
 *       availableMemoryMb: 128
 *       sourceArchiveBucket: ${bucket.name}
 *       sourceArchiveObject: ${archive.name}
 *       triggerHttp: true
 *       httpsTriggerSecurityLevel: SECURE_ALWAYS
 *       timeout: 60
 *       entryPoint: helloGET
 *       labels:
 *         my-label: my-label-value
 *       environmentVariables:
 *         MY_ENV_VAR: my-env-var-value
 *   # IAM entry for a single user to invoke the function
 *   invoker:
 *     type: gcp:cloudfunctions:FunctionIamMember
 *     properties:
 *       project: ${function.project}
 *       region: ${function.region}
 *       cloudFunction: ${function.name}
 *       role: roles/cloudfunctions.invoker
 *       member: user:[email protected]
 * ```
 * 
 * ## Import
 * Functions can be imported using the `name` or `{{project}}/{{region}}/name`, e.g.
 * * `{{project}}/{{region}}/{{name}}`
 * * `{{name}}`
 * When using the `pulumi import` command, Functions can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:cloudfunctions/function:Function default {{project}}/{{region}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:cloudfunctions/function:Function default {{name}}
 * ```
 * @property availableMemoryMb Memory (in MB), available to the function. Default value is `256`. Possible values include `128`, `256`, `512`, `1024`, etc.
 * @property buildEnvironmentVariables A set of key/value environment variable pairs available during build time.
 * @property buildWorkerPool Name of the Cloud Build Custom Worker Pool that should be used to build the function.
 * @property description Description of the function.
 * @property dockerRegistry Docker Registry to use for storing the function's Docker images. Allowed values are ARTIFACT_REGISTRY (default) and CONTAINER_REGISTRY.
 * @property dockerRepository User-managed repository created in Artifact Registry to which the function's Docker image will be pushed after it is built by Cloud Build. May optionally be encrypted with a customer-managed encryption key (CMEK). If unspecified and `docker_registry` is not explicitly set to `CONTAINER_REGISTRY`, GCF will create and use a default Artifact Registry repository named 'gcf-artifacts' in the region.
 * @property entryPoint Name of the function that will be executed when the Google Cloud Function is triggered.
 * @property environmentVariables A set of key/value environment variable pairs to assign to the function.
 * @property eventTrigger A source that fires events in response to a condition in another service. Structure is documented below. Cannot be used with `trigger_http`.
 * @property httpsTriggerSecurityLevel The security level for the function. The following options are available:
 * * `SECURE_ALWAYS` Requests for a URL that match this handler that do not use HTTPS are automatically redirected to the HTTPS URL with the same path. Query parameters are reserved for the redirect.
 * * `SECURE_OPTIONAL` Both HTTP and HTTPS requests with URLs that match the handler succeed without redirects. The application can examine the request to determine which protocol was used and respond accordingly.
 * @property httpsTriggerUrl URL which triggers function execution. Returned only if `trigger_http` is used.
 * @property ingressSettings String value that controls what traffic can reach the function. Allowed values are `ALLOW_ALL`, `ALLOW_INTERNAL_AND_GCLB` and `ALLOW_INTERNAL_ONLY`. Check [ingress documentation](https://cloud.google.com/functions/docs/networking/network-settings#ingress_settings) to see the impact of each settings value. Changes to this field will recreate the cloud function.
 * @property kmsKeyName Resource name of a KMS crypto key (managed by the user) used to encrypt/decrypt function resources. It must match the pattern `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
 * If specified, you must also provide an artifact registry repository using the `docker_repository` field that was created with the same KMS crypto key. Before deploying, please complete all pre-requisites described in https://cloud.google.com/functions/docs/securing/cmek#granting_service_accounts_access_to_the_key
 * @property labels A set of key/value label pairs to assign to the function. Label keys must follow the requirements at https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements.
 * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
 * Please refer to the field 'effective_labels' for all of the labels present on the resource.
 * @property maxInstances The limit on the maximum number of function instances that may coexist at a given time.
 * @property minInstances The limit on the minimum number of function instances that may coexist at a given time.
 * @property name A user-defined name of the function. Function names must be unique globally.
 * @property project Project of the function. If it is not provided, the provider project is used.
 * @property region Region of function. If it is not provided, the provider region is used.
 * @property runtime The runtime in which the function is going to run.
 * Eg. `"nodejs16"`, `"python39"`, `"dotnet3"`, `"go116"`, `"java11"`, `"ruby30"`, `"php74"`, etc. Check the [official doc](https://cloud.google.com/functions/docs/concepts/exec#runtimes) for the up-to-date list.
 * - - -
 * @property secretEnvironmentVariables Secret environment variables configuration. Structure is documented below.
 * @property secretVolumes Secret volumes configuration. Structure is documented below.
 * @property serviceAccountEmail If provided, the self-provided service account to run the function with.
 * @property sourceArchiveBucket The GCS bucket containing the zip archive which contains the function.
 * @property sourceArchiveObject The source archive object (file) in archive bucket.
 * @property sourceRepository Represents parameters related to source repository where a function is hosted.
 * Cannot be set alongside `source_archive_bucket` or `source_archive_object`. Structure is documented below. It must match the pattern `projects/{project}/locations/{location}/repositories/{repository}`.*
 * @property timeout Timeout (in seconds) for the function. Default value is 60 seconds. Cannot be more than 540 seconds.
 * @property triggerHttp Boolean variable. Any HTTP request (of a supported type) to the endpoint will trigger function execution. Supported HTTP request types are: POST, PUT, GET, DELETE, and OPTIONS. Endpoint is returned as `https_trigger_url`. Cannot be used with `event_trigger`.
 * @property vpcConnector The VPC Network Connector that this cloud function can connect to. It should be set up as fully-qualified URI. The format of this field is `projects/*/locations/*/connectors/*`.
 * @property vpcConnectorEgressSettings The egress settings for the connector, controlling what traffic is diverted through it. Allowed values are `ALL_TRAFFIC` and `PRIVATE_RANGES_ONLY`. Defaults to `PRIVATE_RANGES_ONLY`. If unset, this field preserves the previously set value.
 * */*/*/
 */
public data class FunctionArgs(
    public val availableMemoryMb: Output? = null,
    public val buildEnvironmentVariables: Output>? = null,
    public val buildWorkerPool: Output? = null,
    public val description: Output? = null,
    public val dockerRegistry: Output? = null,
    public val dockerRepository: Output? = null,
    public val entryPoint: Output? = null,
    public val environmentVariables: Output>? = null,
    public val eventTrigger: Output? = null,
    public val httpsTriggerSecurityLevel: Output? = null,
    public val httpsTriggerUrl: Output? = null,
    public val ingressSettings: Output? = null,
    public val kmsKeyName: Output? = null,
    public val labels: Output>? = null,
    public val maxInstances: Output? = null,
    public val minInstances: Output? = null,
    public val name: Output? = null,
    public val project: Output? = null,
    public val region: Output? = null,
    public val runtime: Output? = null,
    public val secretEnvironmentVariables: Output>? =
        null,
    public val secretVolumes: Output>? = null,
    public val serviceAccountEmail: Output? = null,
    public val sourceArchiveBucket: Output? = null,
    public val sourceArchiveObject: Output? = null,
    public val sourceRepository: Output? = null,
    public val timeout: Output? = null,
    public val triggerHttp: Output? = null,
    public val vpcConnector: Output? = null,
    public val vpcConnectorEgressSettings: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.cloudfunctions.FunctionArgs =
        com.pulumi.gcp.cloudfunctions.FunctionArgs.builder()
            .availableMemoryMb(availableMemoryMb?.applyValue({ args0 -> args0 }))
            .buildEnvironmentVariables(
                buildEnvironmentVariables?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            )
            .buildWorkerPool(buildWorkerPool?.applyValue({ args0 -> args0 }))
            .description(description?.applyValue({ args0 -> args0 }))
            .dockerRegistry(dockerRegistry?.applyValue({ args0 -> args0 }))
            .dockerRepository(dockerRepository?.applyValue({ args0 -> args0 }))
            .entryPoint(entryPoint?.applyValue({ args0 -> args0 }))
            .environmentVariables(
                environmentVariables?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            )
            .eventTrigger(eventTrigger?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .httpsTriggerSecurityLevel(httpsTriggerSecurityLevel?.applyValue({ args0 -> args0 }))
            .httpsTriggerUrl(httpsTriggerUrl?.applyValue({ args0 -> args0 }))
            .ingressSettings(ingressSettings?.applyValue({ args0 -> args0 }))
            .kmsKeyName(kmsKeyName?.applyValue({ args0 -> args0 }))
            .labels(labels?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .maxInstances(maxInstances?.applyValue({ args0 -> args0 }))
            .minInstances(minInstances?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .project(project?.applyValue({ args0 -> args0 }))
            .region(region?.applyValue({ args0 -> args0 }))
            .runtime(runtime?.applyValue({ args0 -> args0 }))
            .secretEnvironmentVariables(
                secretEnvironmentVariables?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .secretVolumes(
                secretVolumes?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .serviceAccountEmail(serviceAccountEmail?.applyValue({ args0 -> args0 }))
            .sourceArchiveBucket(sourceArchiveBucket?.applyValue({ args0 -> args0 }))
            .sourceArchiveObject(sourceArchiveObject?.applyValue({ args0 -> args0 }))
            .sourceRepository(sourceRepository?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .timeout(timeout?.applyValue({ args0 -> args0 }))
            .triggerHttp(triggerHttp?.applyValue({ args0 -> args0 }))
            .vpcConnector(vpcConnector?.applyValue({ args0 -> args0 }))
            .vpcConnectorEgressSettings(vpcConnectorEgressSettings?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [FunctionArgs].
 */
@PulumiTagMarker
public class FunctionArgsBuilder internal constructor() {
    private var availableMemoryMb: Output? = null

    private var buildEnvironmentVariables: Output>? = null

    private var buildWorkerPool: Output? = null

    private var description: Output? = null

    private var dockerRegistry: Output? = null

    private var dockerRepository: Output? = null

    private var entryPoint: Output? = null

    private var environmentVariables: Output>? = null

    private var eventTrigger: Output? = null

    private var httpsTriggerSecurityLevel: Output? = null

    private var httpsTriggerUrl: Output? = null

    private var ingressSettings: Output? = null

    private var kmsKeyName: Output? = null

    private var labels: Output>? = null

    private var maxInstances: Output? = null

    private var minInstances: Output? = null

    private var name: Output? = null

    private var project: Output? = null

    private var region: Output? = null

    private var runtime: Output? = null

    private var secretEnvironmentVariables: Output>? =
        null

    private var secretVolumes: Output>? = null

    private var serviceAccountEmail: Output? = null

    private var sourceArchiveBucket: Output? = null

    private var sourceArchiveObject: Output? = null

    private var sourceRepository: Output? = null

    private var timeout: Output? = null

    private var triggerHttp: Output? = null

    private var vpcConnector: Output? = null

    private var vpcConnectorEgressSettings: Output? = null

    /**
     * @param value Memory (in MB), available to the function. Default value is `256`. Possible values include `128`, `256`, `512`, `1024`, etc.
     */
    @JvmName("gyykywpsgokfhkyd")
    public suspend fun availableMemoryMb(`value`: Output) {
        this.availableMemoryMb = value
    }

    /**
     * @param value A set of key/value environment variable pairs available during build time.
     */
    @JvmName("wjlwwyrixmujoqsb")
    public suspend fun buildEnvironmentVariables(`value`: Output>) {
        this.buildEnvironmentVariables = value
    }

    /**
     * @param value Name of the Cloud Build Custom Worker Pool that should be used to build the function.
     */
    @JvmName("rqrsenmmgfkxghjx")
    public suspend fun buildWorkerPool(`value`: Output) {
        this.buildWorkerPool = value
    }

    /**
     * @param value Description of the function.
     */
    @JvmName("paugfpfluyrqsrth")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value Docker Registry to use for storing the function's Docker images. Allowed values are ARTIFACT_REGISTRY (default) and CONTAINER_REGISTRY.
     */
    @JvmName("mdydhvkcymyvbypv")
    public suspend fun dockerRegistry(`value`: Output) {
        this.dockerRegistry = value
    }

    /**
     * @param value User-managed repository created in Artifact Registry to which the function's Docker image will be pushed after it is built by Cloud Build. May optionally be encrypted with a customer-managed encryption key (CMEK). If unspecified and `docker_registry` is not explicitly set to `CONTAINER_REGISTRY`, GCF will create and use a default Artifact Registry repository named 'gcf-artifacts' in the region.
     */
    @JvmName("xfiyfsjldgnjssjv")
    public suspend fun dockerRepository(`value`: Output) {
        this.dockerRepository = value
    }

    /**
     * @param value Name of the function that will be executed when the Google Cloud Function is triggered.
     */
    @JvmName("ekyqribvnudrxbbd")
    public suspend fun entryPoint(`value`: Output) {
        this.entryPoint = value
    }

    /**
     * @param value A set of key/value environment variable pairs to assign to the function.
     */
    @JvmName("rtrrdlmaxunyrlyb")
    public suspend fun environmentVariables(`value`: Output>) {
        this.environmentVariables = value
    }

    /**
     * @param value A source that fires events in response to a condition in another service. Structure is documented below. Cannot be used with `trigger_http`.
     */
    @JvmName("udfigudbudjaklce")
    public suspend fun eventTrigger(`value`: Output) {
        this.eventTrigger = value
    }

    /**
     * @param value The security level for the function. The following options are available:
     * * `SECURE_ALWAYS` Requests for a URL that match this handler that do not use HTTPS are automatically redirected to the HTTPS URL with the same path. Query parameters are reserved for the redirect.
     * * `SECURE_OPTIONAL` Both HTTP and HTTPS requests with URLs that match the handler succeed without redirects. The application can examine the request to determine which protocol was used and respond accordingly.
     */
    @JvmName("larsnrhwhmjdavki")
    public suspend fun httpsTriggerSecurityLevel(`value`: Output) {
        this.httpsTriggerSecurityLevel = value
    }

    /**
     * @param value URL which triggers function execution. Returned only if `trigger_http` is used.
     */
    @JvmName("bpiirqmedqlrsdkx")
    public suspend fun httpsTriggerUrl(`value`: Output) {
        this.httpsTriggerUrl = value
    }

    /**
     * @param value String value that controls what traffic can reach the function. Allowed values are `ALLOW_ALL`, `ALLOW_INTERNAL_AND_GCLB` and `ALLOW_INTERNAL_ONLY`. Check [ingress documentation](https://cloud.google.com/functions/docs/networking/network-settings#ingress_settings) to see the impact of each settings value. Changes to this field will recreate the cloud function.
     */
    @JvmName("trfdrgdvvygxqmuu")
    public suspend fun ingressSettings(`value`: Output) {
        this.ingressSettings = value
    }

    /**
     * @param value Resource name of a KMS crypto key (managed by the user) used to encrypt/decrypt function resources. It must match the pattern `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
     * If specified, you must also provide an artifact registry repository using the `docker_repository` field that was created with the same KMS crypto key. Before deploying, please complete all pre-requisites described in https://cloud.google.com/functions/docs/securing/cmek#granting_service_accounts_access_to_the_key
     */
    @JvmName("cfkfcxujemqwogin")
    public suspend fun kmsKeyName(`value`: Output) {
        this.kmsKeyName = value
    }

    /**
     * @param value A set of key/value label pairs to assign to the function. Label keys must follow the requirements at https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements.
     * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
     * Please refer to the field 'effective_labels' for all of the labels present on the resource.
     */
    @JvmName("loofupmomtdnmcyl")
    public suspend fun labels(`value`: Output>) {
        this.labels = value
    }

    /**
     * @param value The limit on the maximum number of function instances that may coexist at a given time.
     */
    @JvmName("trueiopktmplnsxy")
    public suspend fun maxInstances(`value`: Output) {
        this.maxInstances = value
    }

    /**
     * @param value The limit on the minimum number of function instances that may coexist at a given time.
     */
    @JvmName("xfvkfidqwngvxbjg")
    public suspend fun minInstances(`value`: Output) {
        this.minInstances = value
    }

    /**
     * @param value A user-defined name of the function. Function names must be unique globally.
     */
    @JvmName("ihqpgommxfgagmws")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value Project of the function. If it is not provided, the provider project is used.
     */
    @JvmName("lktswqexgkhsawgy")
    public suspend fun project(`value`: Output) {
        this.project = value
    }

    /**
     * @param value Region of function. If it is not provided, the provider region is used.
     */
    @JvmName("yxesiscwmtgympna")
    public suspend fun region(`value`: Output) {
        this.region = value
    }

    /**
     * @param value The runtime in which the function is going to run.
     * Eg. `"nodejs16"`, `"python39"`, `"dotnet3"`, `"go116"`, `"java11"`, `"ruby30"`, `"php74"`, etc. Check the [official doc](https://cloud.google.com/functions/docs/concepts/exec#runtimes) for the up-to-date list.
     * - - -
     */
    @JvmName("mcjqisoxibhhppys")
    public suspend fun runtime(`value`: Output) {
        this.runtime = value
    }

    /**
     * @param value Secret environment variables configuration. Structure is documented below.
     */
    @JvmName("sjcruebtkjemeajq")
    public suspend fun secretEnvironmentVariables(`value`: Output>) {
        this.secretEnvironmentVariables = value
    }

    @JvmName("tynxahbiheavnakb")
    public suspend fun secretEnvironmentVariables(vararg values: Output) {
        this.secretEnvironmentVariables = Output.all(values.asList())
    }

    /**
     * @param values Secret environment variables configuration. Structure is documented below.
     */
    @JvmName("phojhcuthljkrsye")
    public suspend fun secretEnvironmentVariables(values: List>) {
        this.secretEnvironmentVariables = Output.all(values)
    }

    /**
     * @param value Secret volumes configuration. Structure is documented below.
     */
    @JvmName("vytxrgadwkwrnwhe")
    public suspend fun secretVolumes(`value`: Output>) {
        this.secretVolumes = value
    }

    @JvmName("qkppxfberfnswokp")
    public suspend fun secretVolumes(vararg values: Output) {
        this.secretVolumes = Output.all(values.asList())
    }

    /**
     * @param values Secret volumes configuration. Structure is documented below.
     */
    @JvmName("sexyfwliabfwlyaq")
    public suspend fun secretVolumes(values: List>) {
        this.secretVolumes = Output.all(values)
    }

    /**
     * @param value If provided, the self-provided service account to run the function with.
     */
    @JvmName("mruvnesgjcggaany")
    public suspend fun serviceAccountEmail(`value`: Output) {
        this.serviceAccountEmail = value
    }

    /**
     * @param value The GCS bucket containing the zip archive which contains the function.
     */
    @JvmName("vajcnsqotecdgqqx")
    public suspend fun sourceArchiveBucket(`value`: Output) {
        this.sourceArchiveBucket = value
    }

    /**
     * @param value The source archive object (file) in archive bucket.
     */
    @JvmName("oxplxuckgagnpwfy")
    public suspend fun sourceArchiveObject(`value`: Output) {
        this.sourceArchiveObject = value
    }

    /**
     * @param value Represents parameters related to source repository where a function is hosted.
     * Cannot be set alongside `source_archive_bucket` or `source_archive_object`. Structure is documented below. It must match the pattern `projects/{project}/locations/{location}/repositories/{repository}`.*
     */
    @JvmName("jdltgrbdtrebdncy")
    public suspend fun sourceRepository(`value`: Output) {
        this.sourceRepository = value
    }

    /**
     * @param value Timeout (in seconds) for the function. Default value is 60 seconds. Cannot be more than 540 seconds.
     */
    @JvmName("twqkksnyctpwelrx")
    public suspend fun timeout(`value`: Output) {
        this.timeout = value
    }

    /**
     * @param value Boolean variable. Any HTTP request (of a supported type) to the endpoint will trigger function execution. Supported HTTP request types are: POST, PUT, GET, DELETE, and OPTIONS. Endpoint is returned as `https_trigger_url`. Cannot be used with `event_trigger`.
     */
    @JvmName("bowkwrmeukupbwmq")
    public suspend fun triggerHttp(`value`: Output) {
        this.triggerHttp = value
    }

    /**
     * @param value The VPC Network Connector that this cloud function can connect to. It should be set up as fully-qualified URI. The format of this field is `projects/*/locations/*/connectors/*`.
     * */*/*/
     */
    @JvmName("ojueodoklkmdyepj")
    public suspend fun vpcConnector(`value`: Output) {
        this.vpcConnector = value
    }

    /**
     * @param value The egress settings for the connector, controlling what traffic is diverted through it. Allowed values are `ALL_TRAFFIC` and `PRIVATE_RANGES_ONLY`. Defaults to `PRIVATE_RANGES_ONLY`. If unset, this field preserves the previously set value.
     */
    @JvmName("yijnyyuyypofysim")
    public suspend fun vpcConnectorEgressSettings(`value`: Output) {
        this.vpcConnectorEgressSettings = value
    }

    /**
     * @param value Memory (in MB), available to the function. Default value is `256`. Possible values include `128`, `256`, `512`, `1024`, etc.
     */
    @JvmName("mfitrwdeekanhouf")
    public suspend fun availableMemoryMb(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.availableMemoryMb = mapped
    }

    /**
     * @param value A set of key/value environment variable pairs available during build time.
     */
    @JvmName("xhayxutbtojjipyi")
    public suspend fun buildEnvironmentVariables(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.buildEnvironmentVariables = mapped
    }

    /**
     * @param values A set of key/value environment variable pairs available during build time.
     */
    @JvmName("pscvqkbpervbrfbj")
    public fun buildEnvironmentVariables(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.buildEnvironmentVariables = mapped
    }

    /**
     * @param value Name of the Cloud Build Custom Worker Pool that should be used to build the function.
     */
    @JvmName("uxdkbryouflmrvnn")
    public suspend fun buildWorkerPool(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.buildWorkerPool = mapped
    }

    /**
     * @param value Description of the function.
     */
    @JvmName("blkiiceoicvmsnlt")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value Docker Registry to use for storing the function's Docker images. Allowed values are ARTIFACT_REGISTRY (default) and CONTAINER_REGISTRY.
     */
    @JvmName("huqqxuxsevgsdscc")
    public suspend fun dockerRegistry(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.dockerRegistry = mapped
    }

    /**
     * @param value User-managed repository created in Artifact Registry to which the function's Docker image will be pushed after it is built by Cloud Build. May optionally be encrypted with a customer-managed encryption key (CMEK). If unspecified and `docker_registry` is not explicitly set to `CONTAINER_REGISTRY`, GCF will create and use a default Artifact Registry repository named 'gcf-artifacts' in the region.
     */
    @JvmName("tgfnnkfxrbyrwbvn")
    public suspend fun dockerRepository(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.dockerRepository = mapped
    }

    /**
     * @param value Name of the function that will be executed when the Google Cloud Function is triggered.
     */
    @JvmName("ftwiowplcvaeqemc")
    public suspend fun entryPoint(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.entryPoint = mapped
    }

    /**
     * @param value A set of key/value environment variable pairs to assign to the function.
     */
    @JvmName("jvhmykarqyotqavd")
    public suspend fun environmentVariables(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.environmentVariables = mapped
    }

    /**
     * @param values A set of key/value environment variable pairs to assign to the function.
     */
    @JvmName("nnhbxkehcrtfqnem")
    public fun environmentVariables(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.environmentVariables = mapped
    }

    /**
     * @param value A source that fires events in response to a condition in another service. Structure is documented below. Cannot be used with `trigger_http`.
     */
    @JvmName("fklrmtxwkuggunlt")
    public suspend fun eventTrigger(`value`: FunctionEventTriggerArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.eventTrigger = mapped
    }

    /**
     * @param argument A source that fires events in response to a condition in another service. Structure is documented below. Cannot be used with `trigger_http`.
     */
    @JvmName("apiaufvwxjdlibrt")
    public suspend fun eventTrigger(argument: suspend FunctionEventTriggerArgsBuilder.() -> Unit) {
        val toBeMapped = FunctionEventTriggerArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.eventTrigger = mapped
    }

    /**
     * @param value The security level for the function. The following options are available:
     * * `SECURE_ALWAYS` Requests for a URL that match this handler that do not use HTTPS are automatically redirected to the HTTPS URL with the same path. Query parameters are reserved for the redirect.
     * * `SECURE_OPTIONAL` Both HTTP and HTTPS requests with URLs that match the handler succeed without redirects. The application can examine the request to determine which protocol was used and respond accordingly.
     */
    @JvmName("tryuqdptivsrwpqs")
    public suspend fun httpsTriggerSecurityLevel(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.httpsTriggerSecurityLevel = mapped
    }

    /**
     * @param value URL which triggers function execution. Returned only if `trigger_http` is used.
     */
    @JvmName("opdrqjjbebkwsnyp")
    public suspend fun httpsTriggerUrl(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.httpsTriggerUrl = mapped
    }

    /**
     * @param value String value that controls what traffic can reach the function. Allowed values are `ALLOW_ALL`, `ALLOW_INTERNAL_AND_GCLB` and `ALLOW_INTERNAL_ONLY`. Check [ingress documentation](https://cloud.google.com/functions/docs/networking/network-settings#ingress_settings) to see the impact of each settings value. Changes to this field will recreate the cloud function.
     */
    @JvmName("ubdkjqqfnolueyfn")
    public suspend fun ingressSettings(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ingressSettings = mapped
    }

    /**
     * @param value Resource name of a KMS crypto key (managed by the user) used to encrypt/decrypt function resources. It must match the pattern `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
     * If specified, you must also provide an artifact registry repository using the `docker_repository` field that was created with the same KMS crypto key. Before deploying, please complete all pre-requisites described in https://cloud.google.com/functions/docs/securing/cmek#granting_service_accounts_access_to_the_key
     */
    @JvmName("tuufxcqiaerarewv")
    public suspend fun kmsKeyName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.kmsKeyName = mapped
    }

    /**
     * @param value A set of key/value label pairs to assign to the function. Label keys must follow the requirements at https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements.
     * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
     * Please refer to the field 'effective_labels' for all of the labels present on the resource.
     */
    @JvmName("jrqrrqydeiqrvqdn")
    public suspend fun labels(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param values A set of key/value label pairs to assign to the function. Label keys must follow the requirements at https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements.
     * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
     * Please refer to the field 'effective_labels' for all of the labels present on the resource.
     */
    @JvmName("dqmufbrpdtrhihad")
    public fun labels(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param value The limit on the maximum number of function instances that may coexist at a given time.
     */
    @JvmName("hswsoitwcctagaaq")
    public suspend fun maxInstances(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.maxInstances = mapped
    }

    /**
     * @param value The limit on the minimum number of function instances that may coexist at a given time.
     */
    @JvmName("bulmssonmgxuoaqo")
    public suspend fun minInstances(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.minInstances = mapped
    }

    /**
     * @param value A user-defined name of the function. Function names must be unique globally.
     */
    @JvmName("qehvovpbhwywhefd")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value Project of the function. If it is not provided, the provider project is used.
     */
    @JvmName("mogsomuqudgfqbjg")
    public suspend fun project(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.project = mapped
    }

    /**
     * @param value Region of function. If it is not provided, the provider region is used.
     */
    @JvmName("fnuuafqydyjjuecu")
    public suspend fun region(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.region = mapped
    }

    /**
     * @param value The runtime in which the function is going to run.
     * Eg. `"nodejs16"`, `"python39"`, `"dotnet3"`, `"go116"`, `"java11"`, `"ruby30"`, `"php74"`, etc. Check the [official doc](https://cloud.google.com/functions/docs/concepts/exec#runtimes) for the up-to-date list.
     * - - -
     */
    @JvmName("tqppvrksrplprnhm")
    public suspend fun runtime(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.runtime = mapped
    }

    /**
     * @param value Secret environment variables configuration. Structure is documented below.
     */
    @JvmName("lxbitxljrereyeax")
    public suspend fun secretEnvironmentVariables(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.secretEnvironmentVariables = mapped
    }

    /**
     * @param argument Secret environment variables configuration. Structure is documented below.
     */
    @JvmName("ddgsuocdshqwrlja")
    public suspend fun secretEnvironmentVariables(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            FunctionSecretEnvironmentVariableArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.secretEnvironmentVariables = mapped
    }

    /**
     * @param argument Secret environment variables configuration. Structure is documented below.
     */
    @JvmName("gsihtcirscnuyqkg")
    public suspend fun secretEnvironmentVariables(vararg argument: suspend FunctionSecretEnvironmentVariableArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            FunctionSecretEnvironmentVariableArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.secretEnvironmentVariables = mapped
    }

    /**
     * @param argument Secret environment variables configuration. Structure is documented below.
     */
    @JvmName("jlgoqmhvprmjarkl")
    public suspend fun secretEnvironmentVariables(argument: suspend FunctionSecretEnvironmentVariableArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            FunctionSecretEnvironmentVariableArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.secretEnvironmentVariables = mapped
    }

    /**
     * @param values Secret environment variables configuration. Structure is documented below.
     */
    @JvmName("boeivkqjnbueblks")
    public suspend fun secretEnvironmentVariables(vararg values: FunctionSecretEnvironmentVariableArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.secretEnvironmentVariables = mapped
    }

    /**
     * @param value Secret volumes configuration. Structure is documented below.
     */
    @JvmName("gbhlnoifyvnycuvg")
    public suspend fun secretVolumes(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.secretVolumes = mapped
    }

    /**
     * @param argument Secret volumes configuration. Structure is documented below.
     */
    @JvmName("hliejoeyuolsoprk")
    public suspend fun secretVolumes(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            FunctionSecretVolumeArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.secretVolumes = mapped
    }

    /**
     * @param argument Secret volumes configuration. Structure is documented below.
     */
    @JvmName("mfuvdrfjkpsiuguh")
    public suspend fun secretVolumes(vararg argument: suspend FunctionSecretVolumeArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            FunctionSecretVolumeArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.secretVolumes = mapped
    }

    /**
     * @param argument Secret volumes configuration. Structure is documented below.
     */
    @JvmName("juqlfahxflfkteuc")
    public suspend fun secretVolumes(argument: suspend FunctionSecretVolumeArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(FunctionSecretVolumeArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.secretVolumes = mapped
    }

    /**
     * @param values Secret volumes configuration. Structure is documented below.
     */
    @JvmName("bfurtucwivhcmnjo")
    public suspend fun secretVolumes(vararg values: FunctionSecretVolumeArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.secretVolumes = mapped
    }

    /**
     * @param value If provided, the self-provided service account to run the function with.
     */
    @JvmName("bacbjvacoxskuayx")
    public suspend fun serviceAccountEmail(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.serviceAccountEmail = mapped
    }

    /**
     * @param value The GCS bucket containing the zip archive which contains the function.
     */
    @JvmName("eserjnujwghcaiwt")
    public suspend fun sourceArchiveBucket(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sourceArchiveBucket = mapped
    }

    /**
     * @param value The source archive object (file) in archive bucket.
     */
    @JvmName("jgfsoduydodbrajv")
    public suspend fun sourceArchiveObject(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sourceArchiveObject = mapped
    }

    /**
     * @param value Represents parameters related to source repository where a function is hosted.
     * Cannot be set alongside `source_archive_bucket` or `source_archive_object`. Structure is documented below. It must match the pattern `projects/{project}/locations/{location}/repositories/{repository}`.*
     */
    @JvmName("mtcnqtaipixakqqy")
    public suspend fun sourceRepository(`value`: FunctionSourceRepositoryArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sourceRepository = mapped
    }

    /**
     * @param argument Represents parameters related to source repository where a function is hosted.
     * Cannot be set alongside `source_archive_bucket` or `source_archive_object`. Structure is documented below. It must match the pattern `projects/{project}/locations/{location}/repositories/{repository}`.*
     */
    @JvmName("xdkidtgtspauwfsu")
    public suspend fun sourceRepository(argument: suspend FunctionSourceRepositoryArgsBuilder.() -> Unit) {
        val toBeMapped = FunctionSourceRepositoryArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.sourceRepository = mapped
    }

    /**
     * @param value Timeout (in seconds) for the function. Default value is 60 seconds. Cannot be more than 540 seconds.
     */
    @JvmName("dbimcodlhbqkrrfg")
    public suspend fun timeout(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.timeout = mapped
    }

    /**
     * @param value Boolean variable. Any HTTP request (of a supported type) to the endpoint will trigger function execution. Supported HTTP request types are: POST, PUT, GET, DELETE, and OPTIONS. Endpoint is returned as `https_trigger_url`. Cannot be used with `event_trigger`.
     */
    @JvmName("glcqrufrpvoutwqo")
    public suspend fun triggerHttp(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.triggerHttp = mapped
    }

    /**
     * @param value The VPC Network Connector that this cloud function can connect to. It should be set up as fully-qualified URI. The format of this field is `projects/*/locations/*/connectors/*`.
     * */*/*/
     */
    @JvmName("sprsjstibrccqbds")
    public suspend fun vpcConnector(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.vpcConnector = mapped
    }

    /**
     * @param value The egress settings for the connector, controlling what traffic is diverted through it. Allowed values are `ALL_TRAFFIC` and `PRIVATE_RANGES_ONLY`. Defaults to `PRIVATE_RANGES_ONLY`. If unset, this field preserves the previously set value.
     */
    @JvmName("ulagbkpttkisbcds")
    public suspend fun vpcConnectorEgressSettings(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.vpcConnectorEgressSettings = mapped
    }

    internal fun build(): FunctionArgs = FunctionArgs(
        availableMemoryMb = availableMemoryMb,
        buildEnvironmentVariables = buildEnvironmentVariables,
        buildWorkerPool = buildWorkerPool,
        description = description,
        dockerRegistry = dockerRegistry,
        dockerRepository = dockerRepository,
        entryPoint = entryPoint,
        environmentVariables = environmentVariables,
        eventTrigger = eventTrigger,
        httpsTriggerSecurityLevel = httpsTriggerSecurityLevel,
        httpsTriggerUrl = httpsTriggerUrl,
        ingressSettings = ingressSettings,
        kmsKeyName = kmsKeyName,
        labels = labels,
        maxInstances = maxInstances,
        minInstances = minInstances,
        name = name,
        project = project,
        region = region,
        runtime = runtime,
        secretEnvironmentVariables = secretEnvironmentVariables,
        secretVolumes = secretVolumes,
        serviceAccountEmail = serviceAccountEmail,
        sourceArchiveBucket = sourceArchiveBucket,
        sourceArchiveObject = sourceArchiveObject,
        sourceRepository = sourceRepository,
        timeout = timeout,
        triggerHttp = triggerHttp,
        vpcConnector = vpcConnector,
        vpcConnectorEgressSettings = vpcConnectorEgressSettings,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy