
com.pulumi.azurenative.machinelearningservices.kotlin.ConnectionRaiPolicyArgs.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azurenative.machinelearningservices.kotlin
import com.pulumi.azurenative.machinelearningservices.ConnectionRaiPolicyArgs.builder
import com.pulumi.azurenative.machinelearningservices.kotlin.inputs.RaiPolicyPropertiesArgs
import com.pulumi.azurenative.machinelearningservices.kotlin.inputs.RaiPolicyPropertiesArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.jvm.JvmName
/**
* Azure OpenAI Content Filters resource.
* Azure REST API version: 2024-04-01-preview.
* Other available API versions: 2024-07-01-preview.
* ## Example Usage
* ### Create Rai policy
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using AzureNative = Pulumi.AzureNative;
* return await Deployment.RunAsync(() =>
* {
* var connectionRaiPolicy = new AzureNative.MachineLearningServices.ConnectionRaiPolicy("connectionRaiPolicy", new()
* {
* ConnectionName = "testConnection",
* Properties = new AzureNative.MachineLearningServices.Inputs.RaiPolicyPropertiesArgs
* {
* BasePolicyName = "112",
* CompletionBlocklists = new[]
* {
* new AzureNative.MachineLearningServices.Inputs.RaiBlocklistConfigArgs
* {
* Blocking = false,
* BlocklistName = "blocklistName",
* },
* },
* ContentFilters = new[]
* {
* new AzureNative.MachineLearningServices.Inputs.RaiPolicyContentFilterArgs
* {
* AllowedContentLevel = AzureNative.MachineLearningServices.AllowedContentLevel.Low,
* Blocking = false,
* Enabled = false,
* Name = "policyName",
* Source = AzureNative.MachineLearningServices.RaiPolicyContentSource.Prompt,
* },
* },
* Mode = AzureNative.MachineLearningServices.RaiPolicyMode.Blocking,
* PromptBlocklists = new[]
* {
* new AzureNative.MachineLearningServices.Inputs.RaiBlocklistConfigArgs
* {
* Blocking = false,
* BlocklistName = "blocklistName",
* },
* },
* Type = AzureNative.MachineLearningServices.RaiPolicyType.SystemManaged,
* },
* RaiPolicyName = "raiPolicyName",
* ResourceGroupName = "test-rg",
* WorkspaceName = "aml-workspace-name",
* });
* });
* ```
* ```go
* package main
* import (
* machinelearningservices "github.com/pulumi/pulumi-azure-native-sdk/machinelearningservices/v2"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := machinelearningservices.NewConnectionRaiPolicy(ctx, "connectionRaiPolicy", &machinelearningservices.ConnectionRaiPolicyArgs{
* ConnectionName: pulumi.String("testConnection"),
* Properties: &machinelearningservices.RaiPolicyPropertiesArgs{
* BasePolicyName: pulumi.String("112"),
* CompletionBlocklists: machinelearningservices.RaiBlocklistConfigArray{
* &machinelearningservices.RaiBlocklistConfigArgs{
* Blocking: pulumi.Bool(false),
* BlocklistName: pulumi.String("blocklistName"),
* },
* },
* ContentFilters: machinelearningservices.RaiPolicyContentFilterArray{
* &machinelearningservices.RaiPolicyContentFilterArgs{
* AllowedContentLevel: pulumi.String(machinelearningservices.AllowedContentLevelLow),
* Blocking: pulumi.Bool(false),
* Enabled: pulumi.Bool(false),
* Name: pulumi.String("policyName"),
* Source: pulumi.String(machinelearningservices.RaiPolicyContentSourcePrompt),
* },
* },
* Mode: pulumi.String(machinelearningservices.RaiPolicyModeBlocking),
* PromptBlocklists: machinelearningservices.RaiBlocklistConfigArray{
* &machinelearningservices.RaiBlocklistConfigArgs{
* Blocking: pulumi.Bool(false),
* BlocklistName: pulumi.String("blocklistName"),
* },
* },
* Type: pulumi.String(machinelearningservices.RaiPolicyTypeSystemManaged),
* },
* RaiPolicyName: pulumi.String("raiPolicyName"),
* ResourceGroupName: pulumi.String("test-rg"),
* WorkspaceName: pulumi.String("aml-workspace-name"),
* })
* 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.azurenative.machinelearningservices.ConnectionRaiPolicy;
* import com.pulumi.azurenative.machinelearningservices.ConnectionRaiPolicyArgs;
* import com.pulumi.azurenative.machinelearningservices.inputs.RaiPolicyPropertiesArgs;
* 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 connectionRaiPolicy = new ConnectionRaiPolicy("connectionRaiPolicy", ConnectionRaiPolicyArgs.builder()
* .connectionName("testConnection")
* .properties(RaiPolicyPropertiesArgs.builder()
* .basePolicyName("112")
* .completionBlocklists(RaiBlocklistConfigArgs.builder()
* .blocking(false)
* .blocklistName("blocklistName")
* .build())
* .contentFilters(RaiPolicyContentFilterArgs.builder()
* .allowedContentLevel("Low")
* .blocking(false)
* .enabled(false)
* .name("policyName")
* .source("Prompt")
* .build())
* .mode("Blocking")
* .promptBlocklists(RaiBlocklistConfigArgs.builder()
* .blocking(false)
* .blocklistName("blocklistName")
* .build())
* .type("SystemManaged")
* .build())
* .raiPolicyName("raiPolicyName")
* .resourceGroupName("test-rg")
* .workspaceName("aml-workspace-name")
* .build());
* }
* }
* ```
* ## Import
* An existing resource can be imported using its type token, name, and identifier, e.g.
* ```sh
* $ pulumi import azure-native:machinelearningservices:ConnectionRaiPolicy raiPolicyName /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName}
* ```
* @property connectionName Friendly name of the workspace connection
* @property properties Azure OpenAI Content Filters properties.
* @property raiPolicyName Name of the Rai Policy.
* @property resourceGroupName The name of the resource group. The name is case insensitive.
* @property workspaceName Azure Machine Learning Workspace Name
*/
public data class ConnectionRaiPolicyArgs(
public val connectionName: Output? = null,
public val properties: Output? = null,
public val raiPolicyName: Output? = null,
public val resourceGroupName: Output? = null,
public val workspaceName: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.azurenative.machinelearningservices.ConnectionRaiPolicyArgs =
com.pulumi.azurenative.machinelearningservices.ConnectionRaiPolicyArgs.builder()
.connectionName(connectionName?.applyValue({ args0 -> args0 }))
.properties(properties?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.raiPolicyName(raiPolicyName?.applyValue({ args0 -> args0 }))
.resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
.workspaceName(workspaceName?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [ConnectionRaiPolicyArgs].
*/
@PulumiTagMarker
public class ConnectionRaiPolicyArgsBuilder internal constructor() {
private var connectionName: Output? = null
private var properties: Output? = null
private var raiPolicyName: Output? = null
private var resourceGroupName: Output? = null
private var workspaceName: Output? = null
/**
* @param value Friendly name of the workspace connection
*/
@JvmName("ijdefmkoxwqestbm")
public suspend fun connectionName(`value`: Output) {
this.connectionName = value
}
/**
* @param value Azure OpenAI Content Filters properties.
*/
@JvmName("srymeultxabxrhup")
public suspend fun properties(`value`: Output) {
this.properties = value
}
/**
* @param value Name of the Rai Policy.
*/
@JvmName("fcsjbhpnpuygqxak")
public suspend fun raiPolicyName(`value`: Output) {
this.raiPolicyName = value
}
/**
* @param value The name of the resource group. The name is case insensitive.
*/
@JvmName("qsetqnjmrkpqldcf")
public suspend fun resourceGroupName(`value`: Output) {
this.resourceGroupName = value
}
/**
* @param value Azure Machine Learning Workspace Name
*/
@JvmName("osqwgnubvtaffvjn")
public suspend fun workspaceName(`value`: Output) {
this.workspaceName = value
}
/**
* @param value Friendly name of the workspace connection
*/
@JvmName("vlsfxoqnobmfdjve")
public suspend fun connectionName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.connectionName = mapped
}
/**
* @param value Azure OpenAI Content Filters properties.
*/
@JvmName("fgoscfnvsyxtofqk")
public suspend fun properties(`value`: RaiPolicyPropertiesArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.properties = mapped
}
/**
* @param argument Azure OpenAI Content Filters properties.
*/
@JvmName("eqqxgsqsivnceivy")
public suspend fun properties(argument: suspend RaiPolicyPropertiesArgsBuilder.() -> Unit) {
val toBeMapped = RaiPolicyPropertiesArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.properties = mapped
}
/**
* @param value Name of the Rai Policy.
*/
@JvmName("rccxborjdnrtokdg")
public suspend fun raiPolicyName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.raiPolicyName = mapped
}
/**
* @param value The name of the resource group. The name is case insensitive.
*/
@JvmName("ifgmsfirlwbufxdl")
public suspend fun resourceGroupName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.resourceGroupName = mapped
}
/**
* @param value Azure Machine Learning Workspace Name
*/
@JvmName("cybnuxejmrwythxy")
public suspend fun workspaceName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.workspaceName = mapped
}
internal fun build(): ConnectionRaiPolicyArgs = ConnectionRaiPolicyArgs(
connectionName = connectionName,
properties = properties,
raiPolicyName = raiPolicyName,
resourceGroupName = resourceGroupName,
workspaceName = workspaceName,
)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy