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

com.pulumi.azurenative.containerservice.kotlin.MaintenanceConfigurationArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.azurenative.containerservice.kotlin

import com.pulumi.azurenative.containerservice.MaintenanceConfigurationArgs.builder
import com.pulumi.azurenative.containerservice.kotlin.inputs.TimeInWeekArgs
import com.pulumi.azurenative.containerservice.kotlin.inputs.TimeInWeekArgsBuilder
import com.pulumi.azurenative.containerservice.kotlin.inputs.TimeSpanArgs
import com.pulumi.azurenative.containerservice.kotlin.inputs.TimeSpanArgsBuilder
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.collections.List
import kotlin.jvm.JvmName

/**
 * See [planned maintenance](https://docs.microsoft.com/azure/aks/planned-maintenance) for more information about planned maintenance.
 * Azure REST API version: 2023-04-01. Prior API version in Azure Native 1.x: 2021-03-01.
 * Other available API versions: 2023-05-02-preview, 2023-06-01, 2023-06-02-preview, 2023-07-01, 2023-07-02-preview, 2023-08-01, 2023-08-02-preview, 2023-09-01, 2023-09-02-preview, 2023-10-01, 2023-10-02-preview, 2023-11-01, 2023-11-02-preview, 2024-01-01, 2024-01-02-preview, 2024-02-01, 2024-02-02-preview, 2024-03-02-preview, 2024-04-02-preview, 2024-05-01, 2024-05-02-preview, 2024-06-02-preview, 2024-07-01.
 * ## Example Usage
 * ### Create/Update Maintenance Configuration
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var maintenanceConfiguration = new AzureNative.ContainerService.MaintenanceConfiguration("maintenanceConfiguration", new()
 *     {
 *         ConfigName = "default",
 *         NotAllowedTime = new[]
 *         {
 *             new AzureNative.ContainerService.Inputs.TimeSpanArgs
 *             {
 *                 End = "2020-11-30T12:00:00Z",
 *                 Start = "2020-11-26T03:00:00Z",
 *             },
 *         },
 *         ResourceGroupName = "rg1",
 *         ResourceName = "clustername1",
 *         TimeInWeek = new[]
 *         {
 *             new AzureNative.ContainerService.Inputs.TimeInWeekArgs
 *             {
 *                 Day = AzureNative.ContainerService.WeekDay.Monday,
 *                 HourSlots = new[]
 *                 {
 *                     1,
 *                     2,
 *                 },
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	containerservice "github.com/pulumi/pulumi-azure-native-sdk/containerservice/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := containerservice.NewMaintenanceConfiguration(ctx, "maintenanceConfiguration", &containerservice.MaintenanceConfigurationArgs{
 * 			ConfigName: pulumi.String("default"),
 * 			NotAllowedTime: containerservice.TimeSpanArray{
 * 				&containerservice.TimeSpanArgs{
 * 					End:   pulumi.String("2020-11-30T12:00:00Z"),
 * 					Start: pulumi.String("2020-11-26T03:00:00Z"),
 * 				},
 * 			},
 * 			ResourceGroupName: pulumi.String("rg1"),
 * 			ResourceName:      pulumi.String("clustername1"),
 * 			TimeInWeek: containerservice.TimeInWeekArray{
 * 				&containerservice.TimeInWeekArgs{
 * 					Day: pulumi.String(containerservice.WeekDayMonday),
 * 					HourSlots: pulumi.IntArray{
 * 						pulumi.Int(1),
 * 						pulumi.Int(2),
 * 					},
 * 				},
 * 			},
 * 		})
 * 		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.containerservice.MaintenanceConfiguration;
 * import com.pulumi.azurenative.containerservice.MaintenanceConfigurationArgs;
 * import com.pulumi.azurenative.containerservice.inputs.TimeSpanArgs;
 * import com.pulumi.azurenative.containerservice.inputs.TimeInWeekArgs;
 * 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 maintenanceConfiguration = new MaintenanceConfiguration("maintenanceConfiguration", MaintenanceConfigurationArgs.builder()
 *             .configName("default")
 *             .notAllowedTime(TimeSpanArgs.builder()
 *                 .end("2020-11-30T12:00:00Z")
 *                 .start("2020-11-26T03:00:00Z")
 *                 .build())
 *             .resourceGroupName("rg1")
 *             .resourceName("clustername1")
 *             .timeInWeek(TimeInWeekArgs.builder()
 *                 .day("Monday")
 *                 .hourSlots(
 *                     1,
 *                     2)
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ## Import
 * An existing resource can be imported using its type token, name, and identifier, e.g.
 * ```sh
 * $ pulumi import azure-native:containerservice:MaintenanceConfiguration default /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}
 * ```
 * @property configName The name of the maintenance configuration.
 * @property notAllowedTime Time slots on which upgrade is not allowed.
 * @property resourceGroupName The name of the resource group. The name is case insensitive.
 * @property resourceName The name of the managed cluster resource.
 * @property timeInWeek If two array entries specify the same day of the week, the applied configuration is the union of times in both entries.
 */
public data class MaintenanceConfigurationArgs(
    public val configName: Output? = null,
    public val notAllowedTime: Output>? = null,
    public val resourceGroupName: Output? = null,
    public val resourceName: Output? = null,
    public val timeInWeek: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.containerservice.MaintenanceConfigurationArgs =
        com.pulumi.azurenative.containerservice.MaintenanceConfigurationArgs.builder()
            .configName(configName?.applyValue({ args0 -> args0 }))
            .notAllowedTime(
                notAllowedTime?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .resourceName(resourceName?.applyValue({ args0 -> args0 }))
            .timeInWeek(
                timeInWeek?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            ).build()
}

/**
 * Builder for [MaintenanceConfigurationArgs].
 */
@PulumiTagMarker
public class MaintenanceConfigurationArgsBuilder internal constructor() {
    private var configName: Output? = null

    private var notAllowedTime: Output>? = null

    private var resourceGroupName: Output? = null

    private var resourceName: Output? = null

    private var timeInWeek: Output>? = null

    /**
     * @param value The name of the maintenance configuration.
     */
    @JvmName("bmcisvablrqkocgm")
    public suspend fun configName(`value`: Output) {
        this.configName = value
    }

    /**
     * @param value Time slots on which upgrade is not allowed.
     */
    @JvmName("crhlhnhmusotcnlp")
    public suspend fun notAllowedTime(`value`: Output>) {
        this.notAllowedTime = value
    }

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

    /**
     * @param values Time slots on which upgrade is not allowed.
     */
    @JvmName("vfkfranpvbipmpih")
    public suspend fun notAllowedTime(values: List>) {
        this.notAllowedTime = Output.all(values)
    }

    /**
     * @param value The name of the resource group. The name is case insensitive.
     */
    @JvmName("ebpsdmottutdxgnv")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value The name of the managed cluster resource.
     */
    @JvmName("xgoblovldgfnloax")
    public suspend fun resourceName(`value`: Output) {
        this.resourceName = value
    }

    /**
     * @param value If two array entries specify the same day of the week, the applied configuration is the union of times in both entries.
     */
    @JvmName("fnyfwgmntwqmupja")
    public suspend fun timeInWeek(`value`: Output>) {
        this.timeInWeek = value
    }

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

    /**
     * @param values If two array entries specify the same day of the week, the applied configuration is the union of times in both entries.
     */
    @JvmName("mwsfkhccldwbqhyp")
    public suspend fun timeInWeek(values: List>) {
        this.timeInWeek = Output.all(values)
    }

    /**
     * @param value The name of the maintenance configuration.
     */
    @JvmName("npbgsslgrxhxvwhj")
    public suspend fun configName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.configName = mapped
    }

    /**
     * @param value Time slots on which upgrade is not allowed.
     */
    @JvmName("shnbablxwdwulrbn")
    public suspend fun notAllowedTime(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.notAllowedTime = mapped
    }

    /**
     * @param argument Time slots on which upgrade is not allowed.
     */
    @JvmName("tsadkpkxkprgfgpr")
    public suspend fun notAllowedTime(argument: List Unit>) {
        val toBeMapped = argument.toList().map { TimeSpanArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.notAllowedTime = mapped
    }

    /**
     * @param argument Time slots on which upgrade is not allowed.
     */
    @JvmName("fucqrvutnshusgxl")
    public suspend fun notAllowedTime(vararg argument: suspend TimeSpanArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map { TimeSpanArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.notAllowedTime = mapped
    }

    /**
     * @param argument Time slots on which upgrade is not allowed.
     */
    @JvmName("jtvjfutvxcylsftv")
    public suspend fun notAllowedTime(argument: suspend TimeSpanArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(TimeSpanArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.notAllowedTime = mapped
    }

    /**
     * @param values Time slots on which upgrade is not allowed.
     */
    @JvmName("kthuulscwwraokbk")
    public suspend fun notAllowedTime(vararg values: TimeSpanArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.notAllowedTime = mapped
    }

    /**
     * @param value The name of the resource group. The name is case insensitive.
     */
    @JvmName("enhfncxtoyurrpfw")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value The name of the managed cluster resource.
     */
    @JvmName("rhvhnlgglbkvfmxa")
    public suspend fun resourceName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceName = mapped
    }

    /**
     * @param value If two array entries specify the same day of the week, the applied configuration is the union of times in both entries.
     */
    @JvmName("hhsnvckcqbiueyoh")
    public suspend fun timeInWeek(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.timeInWeek = mapped
    }

    /**
     * @param argument If two array entries specify the same day of the week, the applied configuration is the union of times in both entries.
     */
    @JvmName("bpsvqqnyrbkhajdj")
    public suspend fun timeInWeek(argument: List Unit>) {
        val toBeMapped = argument.toList().map { TimeInWeekArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.timeInWeek = mapped
    }

    /**
     * @param argument If two array entries specify the same day of the week, the applied configuration is the union of times in both entries.
     */
    @JvmName("kbrctqeyumqhlcbu")
    public suspend fun timeInWeek(vararg argument: suspend TimeInWeekArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map { TimeInWeekArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.timeInWeek = mapped
    }

    /**
     * @param argument If two array entries specify the same day of the week, the applied configuration is the union of times in both entries.
     */
    @JvmName("ebaifiuceqskmudy")
    public suspend fun timeInWeek(argument: suspend TimeInWeekArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(TimeInWeekArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.timeInWeek = mapped
    }

    /**
     * @param values If two array entries specify the same day of the week, the applied configuration is the union of times in both entries.
     */
    @JvmName("ynwofhnqaqjpocyi")
    public suspend fun timeInWeek(vararg values: TimeInWeekArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.timeInWeek = mapped
    }

    internal fun build(): MaintenanceConfigurationArgs = MaintenanceConfigurationArgs(
        configName = configName,
        notAllowedTime = notAllowedTime,
        resourceGroupName = resourceGroupName,
        resourceName = resourceName,
        timeInWeek = timeInWeek,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy