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

com.pulumi.azure.automation.kotlin.Python3PackageArgs.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.automation.kotlin

import com.pulumi.azure.automation.Python3PackageArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Manages a Automation Python3 Package.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "rg-example",
 *     location: "%[2]s",
 * });
 * const exampleAccount = new azure.automation.Account("example", {
 *     name: "accexample",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     skuName: "Basic",
 * });
 * const examplePython3Package = new azure.automation.Python3Package("example", {
 *     name: "example",
 *     resourceGroupName: example.name,
 *     automationAccountName: exampleAccount.name,
 *     contentUri: "https://pypi.org/packages/source/r/requests/requests-2.31.0.tar.gz",
 *     contentVersion: "2.31.0",
 *     hashAlgorithm: "sha256",
 *     hashValue: "942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1",
 *     tags: {
 *         key: "foo",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="rg-example",
 *     location="%[2]s")
 * example_account = azure.automation.Account("example",
 *     name="accexample",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     sku_name="Basic")
 * example_python3_package = azure.automation.Python3Package("example",
 *     name="example",
 *     resource_group_name=example.name,
 *     automation_account_name=example_account.name,
 *     content_uri="https://pypi.org/packages/source/r/requests/requests-2.31.0.tar.gz",
 *     content_version="2.31.0",
 *     hash_algorithm="sha256",
 *     hash_value="942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1",
 *     tags={
 *         "key": "foo",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Azure.Core.ResourceGroup("example", new()
 *     {
 *         Name = "rg-example",
 *         Location = "%[2]s",
 *     });
 *     var exampleAccount = new Azure.Automation.Account("example", new()
 *     {
 *         Name = "accexample",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         SkuName = "Basic",
 *     });
 *     var examplePython3Package = new Azure.Automation.Python3Package("example", new()
 *     {
 *         Name = "example",
 *         ResourceGroupName = example.Name,
 *         AutomationAccountName = exampleAccount.Name,
 *         ContentUri = "https://pypi.org/packages/source/r/requests/requests-2.31.0.tar.gz",
 *         ContentVersion = "2.31.0",
 *         HashAlgorithm = "sha256",
 *         HashValue = "942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1",
 *         Tags =
 *         {
 *             { "key", "foo" },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/automation"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
 * 			Name:     pulumi.String("rg-example"),
 * 			Location: pulumi.String("%[2]s"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleAccount, err := automation.NewAccount(ctx, "example", &automation.AccountArgs{
 * 			Name:              pulumi.String("accexample"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			SkuName:           pulumi.String("Basic"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = automation.NewPython3Package(ctx, "example", &automation.Python3PackageArgs{
 * 			Name:                  pulumi.String("example"),
 * 			ResourceGroupName:     example.Name,
 * 			AutomationAccountName: exampleAccount.Name,
 * 			ContentUri:            pulumi.String("https://pypi.org/packages/source/r/requests/requests-2.31.0.tar.gz"),
 * 			ContentVersion:        pulumi.String("2.31.0"),
 * 			HashAlgorithm:         pulumi.String("sha256"),
 * 			HashValue:             pulumi.String("942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1"),
 * 			Tags: pulumi.StringMap{
 * 				"key": pulumi.String("foo"),
 * 			},
 * 		})
 * 		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.azure.core.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.automation.Account;
 * import com.pulumi.azure.automation.AccountArgs;
 * import com.pulumi.azure.automation.Python3Package;
 * import com.pulumi.azure.automation.Python3PackageArgs;
 * 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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
 *             .name("rg-example")
 *             .location("%[2]s")
 *             .build());
 *         var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
 *             .name("accexample")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .skuName("Basic")
 *             .build());
 *         var examplePython3Package = new Python3Package("examplePython3Package", Python3PackageArgs.builder()
 *             .name("example")
 *             .resourceGroupName(example.name())
 *             .automationAccountName(exampleAccount.name())
 *             .contentUri("https://pypi.org/packages/source/r/requests/requests-2.31.0.tar.gz")
 *             .contentVersion("2.31.0")
 *             .hashAlgorithm("sha256")
 *             .hashValue("942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1")
 *             .tags(Map.of("key", "foo"))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: rg-example
 *       location: '%[2]s'
 *   exampleAccount:
 *     type: azure:automation:Account
 *     name: example
 *     properties:
 *       name: accexample
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       skuName: Basic
 *   examplePython3Package:
 *     type: azure:automation:Python3Package
 *     name: example
 *     properties:
 *       name: example
 *       resourceGroupName: ${example.name}
 *       automationAccountName: ${exampleAccount.name}
 *       contentUri: https://pypi.org/packages/source/r/requests/requests-2.31.0.tar.gz
 *       contentVersion: 2.31.0
 *       hashAlgorithm: sha256
 *       hashValue: 942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1
 *       tags:
 *         key: foo
 * ```
 * 
 * ## Import
 * Automation Python3 Packages can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:automation/python3Package:Python3Package example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Automation/automationAccounts/account1/python3Packages/pkg
 * ```
 * @property automationAccountName The name of the automation account in which the Python3 Package is created. Changing this forces a new resource to be created.
 * @property contentUri The URL of the python package. Changing this forces a new Automation Python3 Package to be created.
 * @property contentVersion Specify the version of the python3 package. The value should meet the system.version class format like `1.1.1`. Changing this forces a new Automation Python3 Package to be created.
 * @property hashAlgorithm Specify the hash algorithm used to hash the content of the python3 package. Changing this forces a new Automation Python3 Package to be created.
 * @property hashValue Specity the hash value of the content. Changing this forces a new Automation Python3 Package to be created.
 * @property name The name which should be used for this Automation Python3 Package. Changing this forces a new Automation Python3 Package to be created.
 * @property resourceGroupName The name of the resource group in which the Python3 Package is created. Changing this forces a new resource to be created.
 * @property tags A mapping of tags which should be assigned to the Automation Python3 Package.
 */
public data class Python3PackageArgs(
    public val automationAccountName: Output? = null,
    public val contentUri: Output? = null,
    public val contentVersion: Output? = null,
    public val hashAlgorithm: Output? = null,
    public val hashValue: Output? = null,
    public val name: Output? = null,
    public val resourceGroupName: Output? = null,
    public val tags: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.automation.Python3PackageArgs =
        com.pulumi.azure.automation.Python3PackageArgs.builder()
            .automationAccountName(automationAccountName?.applyValue({ args0 -> args0 }))
            .contentUri(contentUri?.applyValue({ args0 -> args0 }))
            .contentVersion(contentVersion?.applyValue({ args0 -> args0 }))
            .hashAlgorithm(hashAlgorithm?.applyValue({ args0 -> args0 }))
            .hashValue(hashValue?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .tags(
                tags?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            ).build()
}

/**
 * Builder for [Python3PackageArgs].
 */
@PulumiTagMarker
public class Python3PackageArgsBuilder internal constructor() {
    private var automationAccountName: Output? = null

    private var contentUri: Output? = null

    private var contentVersion: Output? = null

    private var hashAlgorithm: Output? = null

    private var hashValue: Output? = null

    private var name: Output? = null

    private var resourceGroupName: Output? = null

    private var tags: Output>? = null

    /**
     * @param value The name of the automation account in which the Python3 Package is created. Changing this forces a new resource to be created.
     */
    @JvmName("ltvapoccnshuaeqh")
    public suspend fun automationAccountName(`value`: Output) {
        this.automationAccountName = value
    }

    /**
     * @param value The URL of the python package. Changing this forces a new Automation Python3 Package to be created.
     */
    @JvmName("bchluxdirmdixjsa")
    public suspend fun contentUri(`value`: Output) {
        this.contentUri = value
    }

    /**
     * @param value Specify the version of the python3 package. The value should meet the system.version class format like `1.1.1`. Changing this forces a new Automation Python3 Package to be created.
     */
    @JvmName("tiucoevkdrhlipdh")
    public suspend fun contentVersion(`value`: Output) {
        this.contentVersion = value
    }

    /**
     * @param value Specify the hash algorithm used to hash the content of the python3 package. Changing this forces a new Automation Python3 Package to be created.
     */
    @JvmName("kvegqdrcilmlprfc")
    public suspend fun hashAlgorithm(`value`: Output) {
        this.hashAlgorithm = value
    }

    /**
     * @param value Specity the hash value of the content. Changing this forces a new Automation Python3 Package to be created.
     */
    @JvmName("hbgvlrduftneqfvd")
    public suspend fun hashValue(`value`: Output) {
        this.hashValue = value
    }

    /**
     * @param value The name which should be used for this Automation Python3 Package. Changing this forces a new Automation Python3 Package to be created.
     */
    @JvmName("pxtntijhhjjuoyls")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The name of the resource group in which the Python3 Package is created. Changing this forces a new resource to be created.
     */
    @JvmName("vkgnjcmkyisddwcm")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value A mapping of tags which should be assigned to the Automation Python3 Package.
     */
    @JvmName("kosswbjdlvypvyma")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value The name of the automation account in which the Python3 Package is created. Changing this forces a new resource to be created.
     */
    @JvmName("yyjdenkquxkqmpgt")
    public suspend fun automationAccountName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.automationAccountName = mapped
    }

    /**
     * @param value The URL of the python package. Changing this forces a new Automation Python3 Package to be created.
     */
    @JvmName("elvnooquvvbvpbas")
    public suspend fun contentUri(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.contentUri = mapped
    }

    /**
     * @param value Specify the version of the python3 package. The value should meet the system.version class format like `1.1.1`. Changing this forces a new Automation Python3 Package to be created.
     */
    @JvmName("uuwvhpivfjtehjwp")
    public suspend fun contentVersion(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.contentVersion = mapped
    }

    /**
     * @param value Specify the hash algorithm used to hash the content of the python3 package. Changing this forces a new Automation Python3 Package to be created.
     */
    @JvmName("qqlmuimefrnmpdnf")
    public suspend fun hashAlgorithm(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.hashAlgorithm = mapped
    }

    /**
     * @param value Specity the hash value of the content. Changing this forces a new Automation Python3 Package to be created.
     */
    @JvmName("ustrkksmyaapovrj")
    public suspend fun hashValue(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.hashValue = mapped
    }

    /**
     * @param value The name which should be used for this Automation Python3 Package. Changing this forces a new Automation Python3 Package to be created.
     */
    @JvmName("tfdggcrovglnkoul")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The name of the resource group in which the Python3 Package is created. Changing this forces a new resource to be created.
     */
    @JvmName("rbabcmfwaiblstwv")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value A mapping of tags which should be assigned to the Automation Python3 Package.
     */
    @JvmName("dkicyxndebsmeeiw")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values A mapping of tags which should be assigned to the Automation Python3 Package.
     */
    @JvmName("jrqryrsbrmfwsvpv")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    internal fun build(): Python3PackageArgs = Python3PackageArgs(
        automationAccountName = automationAccountName,
        contentUri = contentUri,
        contentVersion = contentVersion,
        hashAlgorithm = hashAlgorithm,
        hashValue = hashValue,
        name = name,
        resourceGroupName = resourceGroupName,
        tags = tags,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy