
com.pulumi.snowflake.FunctionScala Maven / Gradle / Ivy
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.snowflake;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import com.pulumi.snowflake.FunctionScalaArgs;
import com.pulumi.snowflake.Utilities;
import com.pulumi.snowflake.inputs.FunctionScalaState;
import com.pulumi.snowflake.outputs.FunctionScalaArgument;
import com.pulumi.snowflake.outputs.FunctionScalaImport;
import com.pulumi.snowflake.outputs.FunctionScalaParameter;
import com.pulumi.snowflake.outputs.FunctionScalaSecret;
import com.pulumi.snowflake.outputs.FunctionScalaShowOutput;
import com.pulumi.snowflake.outputs.FunctionScalaTargetPath;
import java.lang.Boolean;
import java.lang.String;
import java.util.List;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* ## Import
*
* ```sh
* $ pulumi import snowflake:index/functionScala:FunctionScala example '"<database_name>"."<schema_name>"."<function_name>"(varchar, varchar, varchar)'
* ```
*
* Note: Snowflake is not returning all information needed to populate the state correctly after import (e.g. data types with attributes like NUMBER(32, 10) are returned as NUMBER, default values for arguments are not returned at all).
*
* Also, `ALTER` for functions is very limited so most of the attributes on this resource are marked as force new. Because of that, in multiple situations plan won't be empty after importing and manual state operations may be required.
*
*/
@ResourceType(type="snowflake:index/functionScala:FunctionScala")
public class FunctionScala extends com.pulumi.resources.CustomResource {
/**
* List of the arguments for the function. Consult the [docs](https://docs.snowflake.com/en/sql-reference/sql/create-function#all-languages) for more details.
*
*/
@Export(name="arguments", refs={List.class,FunctionScalaArgument.class}, tree="[0,1]")
private Output* @Nullable */ List> arguments;
/**
* @return List of the arguments for the function. Consult the [docs](https://docs.snowflake.com/en/sql-reference/sql/create-function#all-languages) for more details.
*
*/
public Output>> arguments() {
return Codegen.optional(this.arguments);
}
/**
* Specifies a comment for the function.
*
*/
@Export(name="comment", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> comment;
/**
* @return Specifies a comment for the function.
*
*/
public Output> comment() {
return Codegen.optional(this.comment);
}
/**
* The database in which to create the function. Due to technical limitations (read more here), avoid using the following characters: `|`, `.`, `"`.
*
*/
@Export(name="database", refs={String.class}, tree="[0]")
private Output database;
/**
* @return The database in which to create the function. Due to technical limitations (read more here), avoid using the following characters: `|`, `.`, `"`.
*
*/
public Output database() {
return this.database;
}
/**
* Enable stdout/stderr fast path logging for anonyous stored procs. This is a public parameter (similar to LOG*LEVEL). For more information, check *CONSOLE_OUTPUT docs[ENABLE](https://docs.snowflake.com/en/sql-reference/parameters#enable-console-output).
*
*/
@Export(name="enableConsoleOutput", refs={Boolean.class}, tree="[0]")
private Output enableConsoleOutput;
/**
* @return Enable stdout/stderr fast path logging for anonyous stored procs. This is a public parameter (similar to LOG*LEVEL). For more information, check *CONSOLE_OUTPUT docs[ENABLE](https://docs.snowflake.com/en/sql-reference/parameters#enable-console-output).
*
*/
public Output enableConsoleOutput() {
return this.enableConsoleOutput;
}
/**
* The names of [external access integrations](https://docs.snowflake.com/en/sql-reference/sql/create-external-access-integration) needed in order for this function’s handler code to access external networks. An external access integration specifies [network rules](https://docs.snowflake.com/en/sql-reference/sql/create-network-rule) and [secrets](https://docs.snowflake.com/en/sql-reference/sql/create-secret) that specify external locations and credentials (if any) allowed for use by handler code when making requests of an external network, such as an external REST API.
*
*/
@Export(name="externalAccessIntegrations", refs={List.class,String.class}, tree="[0,1]")
private Output* @Nullable */ List> externalAccessIntegrations;
/**
* @return The names of [external access integrations](https://docs.snowflake.com/en/sql-reference/sql/create-external-access-integration) needed in order for this function’s handler code to access external networks. An external access integration specifies [network rules](https://docs.snowflake.com/en/sql-reference/sql/create-network-rule) and [secrets](https://docs.snowflake.com/en/sql-reference/sql/create-secret) that specify external locations and credentials (if any) allowed for use by handler code when making requests of an external network, such as an external REST API.
*
*/
public Output>> externalAccessIntegrations() {
return Codegen.optional(this.externalAccessIntegrations);
}
/**
* Fully qualified name of the resource. For more information, see [object name resolution](https://docs.snowflake.com/en/sql-reference/name-resolution).
*
*/
@Export(name="fullyQualifiedName", refs={String.class}, tree="[0]")
private Output fullyQualifiedName;
/**
* @return Fully qualified name of the resource. For more information, see [object name resolution](https://docs.snowflake.com/en/sql-reference/name-resolution).
*
*/
public Output fullyQualifiedName() {
return this.fullyQualifiedName;
}
/**
* Defines the handler code executed when the UDF is called. Wrapping `$$` signs are added by the provider automatically; do not include them. The `function_definition` value must be Scala source code. For more information, see [Introduction to Scala UDFs](https://docs.snowflake.com/en/developer-guide/udf/scala/udf-scala-introduction). To mitigate permadiff on this field, the provider replaces blank characters with a space. This can lead to false positives in cases where a change in case or run of whitespace is semantically significant.
*
*/
@Export(name="functionDefinition", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> functionDefinition;
/**
* @return Defines the handler code executed when the UDF is called. Wrapping `$$` signs are added by the provider automatically; do not include them. The `function_definition` value must be Scala source code. For more information, see [Introduction to Scala UDFs](https://docs.snowflake.com/en/developer-guide/udf/scala/udf-scala-introduction). To mitigate permadiff on this field, the provider replaces blank characters with a space. This can lead to false positives in cases where a change in case or run of whitespace is semantically significant.
*
*/
public Output> functionDefinition() {
return Codegen.optional(this.functionDefinition);
}
/**
* Specifies language for the user. Used to detect external changes.
*
*/
@Export(name="functionLanguage", refs={String.class}, tree="[0]")
private Output functionLanguage;
/**
* @return Specifies language for the user. Used to detect external changes.
*
*/
public Output functionLanguage() {
return this.functionLanguage;
}
/**
* The name of the handler method or class. If the handler is for a scalar UDF, returning a non-tabular value, the HANDLER value should be a method name, as in the following form: `MyClass.myMethod`.
*
*/
@Export(name="handler", refs={String.class}, tree="[0]")
private Output handler;
/**
* @return The name of the handler method or class. If the handler is for a scalar UDF, returning a non-tabular value, the HANDLER value should be a method name, as in the following form: `MyClass.myMethod`.
*
*/
public Output handler() {
return this.handler;
}
/**
* The location (stage), path, and name of the file(s) to import, such as a JAR or other kind of file. The JAR file might contain handler dependency libraries. It can contain one or more .class files and zero or more resource files. JNI (Java Native Interface) is not supported. Snowflake prohibits loading libraries that contain native code (as opposed to Java bytecode). A non-JAR file might a file read by handler code. For an example, see [Reading a file specified statically in IMPORTS](https://docs.snowflake.com/en/developer-guide/udf/java/udf-java-cookbook.html#label-reading-file-from-java-udf-imports). Consult the [docs](https://docs.snowflake.com/en/sql-reference/sql/create-function#scala).
*
*/
@Export(name="imports", refs={List.class,FunctionScalaImport.class}, tree="[0,1]")
private Output* @Nullable */ List> imports;
/**
* @return The location (stage), path, and name of the file(s) to import, such as a JAR or other kind of file. The JAR file might contain handler dependency libraries. It can contain one or more .class files and zero or more resource files. JNI (Java Native Interface) is not supported. Snowflake prohibits loading libraries that contain native code (as opposed to Java bytecode). A non-JAR file might a file read by handler code. For an example, see [Reading a file specified statically in IMPORTS](https://docs.snowflake.com/en/developer-guide/udf/java/udf-java-cookbook.html#label-reading-file-from-java-udf-imports). Consult the [docs](https://docs.snowflake.com/en/sql-reference/sql/create-function#scala).
*
*/
public Output>> imports() {
return Codegen.optional(this.imports);
}
@Export(name="isSecure", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> isSecure;
public Output> isSecure() {
return Codegen.optional(this.isSecure);
}
/**
* LOG*LEVEL to use when filtering events For more information, check [LOG*LEVEL docs](https://docs.snowflake.com/en/sql-reference/parameters#log-level).
*
*/
@Export(name="logLevel", refs={String.class}, tree="[0]")
private Output logLevel;
/**
* @return LOG*LEVEL to use when filtering events For more information, check [LOG*LEVEL docs](https://docs.snowflake.com/en/sql-reference/parameters#log-level).
*
*/
public Output logLevel() {
return this.logLevel;
}
/**
* METRIC*LEVEL value to control whether to emit metrics to Event Table For more information, check [METRIC*LEVEL docs](https://docs.snowflake.com/en/sql-reference/parameters#metric-level).
*
*/
@Export(name="metricLevel", refs={String.class}, tree="[0]")
private Output metricLevel;
/**
* @return METRIC*LEVEL value to control whether to emit metrics to Event Table For more information, check [METRIC*LEVEL docs](https://docs.snowflake.com/en/sql-reference/parameters#metric-level).
*
*/
public Output metricLevel() {
return this.metricLevel;
}
/**
* The name of the function; the identifier does not need to be unique for the schema in which the function is created because UDFs are identified and resolved by the combination of the name and argument types. Check the [docs](https://docs.snowflake.com/en/sql-reference/sql/create-function#all-languages). Due to technical limitations (read more here), avoid using the following characters: `|`, `.`, `"`.
*
*/
@Export(name="name", refs={String.class}, tree="[0]")
private Output name;
/**
* @return The name of the function; the identifier does not need to be unique for the schema in which the function is created because UDFs are identified and resolved by the combination of the name and argument types. Check the [docs](https://docs.snowflake.com/en/sql-reference/sql/create-function#all-languages). Due to technical limitations (read more here), avoid using the following characters: `|`, `.`, `"`.
*
*/
public Output name() {
return this.name;
}
/**
* Specifies the behavior of the function when called with null inputs. Valid values are (case-insensitive): `CALLED ON NULL INPUT` | `RETURNS NULL ON NULL INPUT`.
*
*/
@Export(name="nullInputBehavior", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> nullInputBehavior;
/**
* @return Specifies the behavior of the function when called with null inputs. Valid values are (case-insensitive): `CALLED ON NULL INPUT` | `RETURNS NULL ON NULL INPUT`.
*
*/
public Output> nullInputBehavior() {
return Codegen.optional(this.nullInputBehavior);
}
/**
* The name and version number of Snowflake system packages required as dependencies. The value should be of the form `package_name:version_number`, where `package_name` is `snowflake_domain:package`.
*
*/
@Export(name="packages", refs={List.class,String.class}, tree="[0,1]")
private Output* @Nullable */ List> packages;
/**
* @return The name and version number of Snowflake system packages required as dependencies. The value should be of the form `package_name:version_number`, where `package_name` is `snowflake_domain:package`.
*
*/
public Output>> packages() {
return Codegen.optional(this.packages);
}
/**
* Outputs the result of `SHOW PARAMETERS IN FUNCTION` for the given function.
*
*/
@Export(name="parameters", refs={List.class,FunctionScalaParameter.class}, tree="[0,1]")
private Output> parameters;
/**
* @return Outputs the result of `SHOW PARAMETERS IN FUNCTION` for the given function.
*
*/
public Output> parameters() {
return this.parameters;
}
/**
* Specifies the behavior of the function when returning results. Valid values are (case-insensitive): `VOLATILE` | `IMMUTABLE`.
*
*/
@Export(name="returnResultsBehavior", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> returnResultsBehavior;
/**
* @return Specifies the behavior of the function when returning results. Valid values are (case-insensitive): `VOLATILE` | `IMMUTABLE`.
*
*/
public Output> returnResultsBehavior() {
return Codegen.optional(this.returnResultsBehavior);
}
/**
* Specifies the results returned by the UDF, which determines the UDF type. Use `<result_data_type>` to create a scalar UDF that returns a single value with the specified data type. Use `TABLE (col_name col_data_type, ...)` to creates a table UDF that returns tabular results with the specified table column(s) and column type(s). For the details, consult the [docs](https://docs.snowflake.com/en/sql-reference/sql/create-function#all-languages).
*
*/
@Export(name="returnType", refs={String.class}, tree="[0]")
private Output returnType;
/**
* @return Specifies the results returned by the UDF, which determines the UDF type. Use `<result_data_type>` to create a scalar UDF that returns a single value with the specified data type. Use `TABLE (col_name col_data_type, ...)` to creates a table UDF that returns tabular results with the specified table column(s) and column type(s). For the details, consult the [docs](https://docs.snowflake.com/en/sql-reference/sql/create-function#all-languages).
*
*/
public Output returnType() {
return this.returnType;
}
/**
* Specifies the Scala runtime version to use. The supported versions of Scala are: 2.12.
*
*/
@Export(name="runtimeVersion", refs={String.class}, tree="[0]")
private Output runtimeVersion;
/**
* @return Specifies the Scala runtime version to use. The supported versions of Scala are: 2.12.
*
*/
public Output runtimeVersion() {
return this.runtimeVersion;
}
/**
* The schema in which to create the function. Due to technical limitations (read more here), avoid using the following characters: `|`, `.`, `"`.
*
*/
@Export(name="schema", refs={String.class}, tree="[0]")
private Output schema;
/**
* @return The schema in which to create the function. Due to technical limitations (read more here), avoid using the following characters: `|`, `.`, `"`.
*
*/
public Output schema() {
return this.schema;
}
/**
* Assigns the names of [secrets](https://docs.snowflake.com/en/sql-reference/sql/create-secret) to variables so that you can use the variables to reference the secrets when retrieving information from secrets in handler code. Secrets you specify here must be allowed by the [external access integration](https://docs.snowflake.com/en/sql-reference/sql/create-external-access-integration) specified as a value of this CREATE FUNCTION command’s EXTERNAL*ACCESS*INTEGRATIONS parameter.
*
*/
@Export(name="secrets", refs={List.class,FunctionScalaSecret.class}, tree="[0,1]")
private Output* @Nullable */ List> secrets;
/**
* @return Assigns the names of [secrets](https://docs.snowflake.com/en/sql-reference/sql/create-secret) to variables so that you can use the variables to reference the secrets when retrieving information from secrets in handler code. Secrets you specify here must be allowed by the [external access integration](https://docs.snowflake.com/en/sql-reference/sql/create-external-access-integration) specified as a value of this CREATE FUNCTION command’s EXTERNAL*ACCESS*INTEGRATIONS parameter.
*
*/
public Output>> secrets() {
return Codegen.optional(this.secrets);
}
/**
* Outputs the result of `SHOW FUNCTION` for the given function.
*
*/
@Export(name="showOutputs", refs={List.class,FunctionScalaShowOutput.class}, tree="[0,1]")
private Output> showOutputs;
/**
* @return Outputs the result of `SHOW FUNCTION` for the given function.
*
*/
public Output> showOutputs() {
return this.showOutputs;
}
/**
* The name of the handler method or class. If the handler is for a scalar UDF, returning a non-tabular value, the HANDLER value should be a method name, as in the following form: `MyClass.myMethod`.
*
*/
@Export(name="targetPath", refs={FunctionScalaTargetPath.class}, tree="[0]")
private Output* @Nullable */ FunctionScalaTargetPath> targetPath;
/**
* @return The name of the handler method or class. If the handler is for a scalar UDF, returning a non-tabular value, the HANDLER value should be a method name, as in the following form: `MyClass.myMethod`.
*
*/
public Output> targetPath() {
return Codegen.optional(this.targetPath);
}
/**
* Trace level value to use when generating/filtering trace events For more information, check [TRACE_LEVEL docs](https://docs.snowflake.com/en/sql-reference/parameters#trace-level).
*
*/
@Export(name="traceLevel", refs={String.class}, tree="[0]")
private Output traceLevel;
/**
* @return Trace level value to use when generating/filtering trace events For more information, check [TRACE_LEVEL docs](https://docs.snowflake.com/en/sql-reference/parameters#trace-level).
*
*/
public Output traceLevel() {
return this.traceLevel;
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public FunctionScala(java.lang.String name) {
this(name, FunctionScalaArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public FunctionScala(java.lang.String name, FunctionScalaArgs args) {
this(name, args, null);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
* @param options A bag of options that control this resource's behavior.
*/
public FunctionScala(java.lang.String name, FunctionScalaArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("snowflake:index/functionScala:FunctionScala", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private FunctionScala(java.lang.String name, Output id, @Nullable FunctionScalaState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("snowflake:index/functionScala:FunctionScala", name, state, makeResourceOptions(options, id), false);
}
private static FunctionScalaArgs makeArgs(FunctionScalaArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? FunctionScalaArgs.Empty : args;
}
private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) {
var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
.version(Utilities.getVersion())
.build();
return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id);
}
/**
* Get an existing Host resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state
* @param options Optional settings to control the behavior of the CustomResource.
*/
public static FunctionScala get(java.lang.String name, Output id, @Nullable FunctionScalaState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new FunctionScala(name, id, state, options);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy