// *** 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.azure.automation;

import com.pulumi.azure.Utilities;
import com.pulumi.azure.automation.SoftwareUpdateConfigurationArgs;
import com.pulumi.azure.automation.inputs.SoftwareUpdateConfigurationState;
import com.pulumi.azure.automation.outputs.SoftwareUpdateConfigurationLinux;
import com.pulumi.azure.automation.outputs.SoftwareUpdateConfigurationPostTask;
import com.pulumi.azure.automation.outputs.SoftwareUpdateConfigurationPreTask;
import com.pulumi.azure.automation.outputs.SoftwareUpdateConfigurationSchedule;
import com.pulumi.azure.automation.outputs.SoftwareUpdateConfigurationTarget;
import com.pulumi.azure.automation.outputs.SoftwareUpdateConfigurationWindows;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.String;
import java.util.List;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Manages an Automation Software Update Configuraion.
 * 
 * ## Example Usage
 * ```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.RunBook;
 * import com.pulumi.azure.automation.RunBookArgs;
 * import com.pulumi.azure.automation.SoftwareUpdateConfiguration;
 * import com.pulumi.azure.automation.SoftwareUpdateConfigurationArgs;
 * import com.pulumi.azure.automation.inputs.SoftwareUpdateConfigurationLinuxArgs;
 * import com.pulumi.azure.automation.inputs.SoftwareUpdateConfigurationPreTaskArgs;
 * 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 exampleResourceGroup = new ResourceGroup(&#34;exampleResourceGroup&#34;, ResourceGroupArgs.builder()        
 *             .location(&#34;East US&#34;)
 *             .build());
 * 
 *         var exampleAccount = new Account(&#34;exampleAccount&#34;, AccountArgs.builder()        
 *             .location(exampleResourceGroup.location())
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .skuName(&#34;Basic&#34;)
 *             .build());
 * 
 *         var exampleRunBook = new RunBook(&#34;exampleRunBook&#34;, RunBookArgs.builder()        
 *             .location(exampleResourceGroup.location())
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .automationAccountName(exampleAccount.name())
 *             .logVerbose(&#34;true&#34;)
 *             .logProgress(&#34;true&#34;)
 *             .description(&#34;This is a example runbook for terraform acceptance example&#34;)
 *             .runbookType(&#34;Python3&#34;)
 *             .content(&#34;&#34;&#34;
 * # Some example content
 * # for Terraform acceptance example
 *             &#34;&#34;&#34;)
 *             .tags(Map.of(&#34;ENV&#34;, &#34;runbook_test&#34;))
 *             .build());
 * 
 *         var exampleSoftwareUpdateConfiguration = new SoftwareUpdateConfiguration(&#34;exampleSoftwareUpdateConfiguration&#34;, SoftwareUpdateConfigurationArgs.builder()        
 *             .automationAccountId(exampleAccount.id())
 *             .operatingSystem(&#34;Linux&#34;)
 *             .linuxes(SoftwareUpdateConfigurationLinuxArgs.builder()
 *                 .classificationIncluded(&#34;Security&#34;)
 *                 .excludedPackages(&#34;apt&#34;)
 *                 .includedPackages(&#34;vim&#34;)
 *                 .reboot(&#34;IfRequired&#34;)
 *                 .build())
 *             .preTasks(SoftwareUpdateConfigurationPreTaskArgs.builder()
 *                 .source(exampleRunBook.name())
 *                 .parameters(Map.of(&#34;COMPUTER_NAME&#34;, &#34;Foo&#34;))
 *                 .build())
 *             .duration(&#34;PT2H2M2S&#34;)
 *             .build());
 * 
 *     }
 * }
 * ```
 * 
 * ## Import
 * 
 * Automations Software Update Configuration can be imported using the `resource id`, e.g.
 * 
 * ```sh
 *  $ pulumi import azure:automation/softwareUpdateConfiguration:SoftwareUpdateConfiguration example /subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.Automation/automationAccounts/account1/softwareUpdateConfigurations/suc1
 * ```
 * 
 */
@ResourceType(type="azure:automation/softwareUpdateConfiguration:SoftwareUpdateConfiguration")
public class SoftwareUpdateConfiguration extends com.pulumi.resources.CustomResource {
    /**
     * The ID of Automation Account to manage this Source Control. Changing this forces a new Automation Source Control to be created.
     * 
     */
    @Export(name="automationAccountId", refs={String.class}, tree="[0]")
    private Output<String> automationAccountId;

    /**
     * @return The ID of Automation Account to manage this Source Control. Changing this forces a new Automation Source Control to be created.
     * 
     */
    public Output<String> automationAccountId() {
        return this.automationAccountId;
    }
    /**
     * Maximum time allowed for the software update configuration run. using format `PT[n]H[n]M[n]S` as per ISO8601. Defaults to `PT2H`.
     * 
     */
    @Export(name="duration", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> duration;

    /**
     * @return Maximum time allowed for the software update configuration run. using format `PT[n]H[n]M[n]S` as per ISO8601. Defaults to `PT2H`.
     * 
     */
    public Output<Optional<String>> duration() {
        return Codegen.optional(this.duration);
    }
    /**
     * The Error code when failed.
     * 
     */
    @Export(name="errorCode", refs={String.class}, tree="[0]")
    private Output<String> errorCode;

    /**
     * @return The Error code when failed.
     * 
     */
    public Output<String> errorCode() {
        return this.errorCode;
    }
    /**
     * The Error message indicating why the operation failed.
     * 
     * @deprecated
     * `error_meesage` will be removed in favour of `error_message` in version 4.0 of the AzureRM Provider
     * 
     */
    @Deprecated /* `error_meesage` will be removed in favour of `error_message` in version 4.0 of the AzureRM Provider */
    @Export(name="errorMeesage", refs={String.class}, tree="[0]")
    private Output<String> errorMeesage;

    /**
     * @return The Error message indicating why the operation failed.
     * 
     */
    public Output<String> errorMeesage() {
        return this.errorMeesage;
    }
    @Export(name="errorMessage", refs={String.class}, tree="[0]")
    private Output<String> errorMessage;

    public Output<String> errorMessage() {
        return this.errorMessage;
    }
    /**
     * A `linux` block as defined below.
     * 
     */
    @Export(name="linuxes", refs={List.class,SoftwareUpdateConfigurationLinux.class}, tree="[0,1]")
    private Output</* @Nullable */ List<SoftwareUpdateConfigurationLinux>> linuxes;

    /**
     * @return A `linux` block as defined below.
     * 
     */
    public Output<Optional<List<SoftwareUpdateConfigurationLinux>>> linuxes() {
        return Codegen.optional(this.linuxes);
    }
    /**
     * The name which should be used for this Automation. Changing this forces a new Automation to be created.
     * 
     */
    @Export(name="name", refs={String.class}, tree="[0]")
    private Output<String> name;

    /**
     * @return The name which should be used for this Automation. Changing this forces a new Automation to be created.
     * 
     */
    public Output<String> name() {
        return this.name;
    }
    /**
     * Specifies a list of names of non-Azure machines for the software update configuration.
     * 
     */
    @Export(name="nonAzureComputerNames", refs={List.class,String.class}, tree="[0,1]")
    private Output</* @Nullable */ List<String>> nonAzureComputerNames;

    /**
     * @return Specifies a list of names of non-Azure machines for the software update configuration.
     * 
     */
    public Output<Optional<List<String>>> nonAzureComputerNames() {
        return Codegen.optional(this.nonAzureComputerNames);
    }
    /**
     * @deprecated
     * This property has been deprecated and will be removed in a future release. The use of either the `linux` or `windows` blocks replaces setting this value directly. This value is ignored by the provider.
     * 
     */
    @Deprecated /* This property has been deprecated and will be removed in a future release. The use of either the `linux` or `windows` blocks replaces setting this value directly. This value is ignored by the provider. */
    @Export(name="operatingSystem", refs={String.class}, tree="[0]")
    private Output<String> operatingSystem;

    public Output<String> operatingSystem() {
        return this.operatingSystem;
    }
    /**
     * A `post_task` blocks as defined below.
     * 
     */
    @Export(name="postTasks", refs={List.class,SoftwareUpdateConfigurationPostTask.class}, tree="[0,1]")
    private Output</* @Nullable */ List<SoftwareUpdateConfigurationPostTask>> postTasks;

    /**
     * @return A `post_task` blocks as defined below.
     * 
     */
    public Output<Optional<List<SoftwareUpdateConfigurationPostTask>>> postTasks() {
        return Codegen.optional(this.postTasks);
    }
    /**
     * A `pre_task` blocks as defined below.
     * 
     */
    @Export(name="preTasks", refs={List.class,SoftwareUpdateConfigurationPreTask.class}, tree="[0,1]")
    private Output</* @Nullable */ List<SoftwareUpdateConfigurationPreTask>> preTasks;

    /**
     * @return A `pre_task` blocks as defined below.
     * 
     */
    public Output<Optional<List<SoftwareUpdateConfigurationPreTask>>> preTasks() {
        return Codegen.optional(this.preTasks);
    }
    /**
     * A `schedule` blocks as defined below.
     * 
     */
    @Export(name="schedules", refs={List.class,SoftwareUpdateConfigurationSchedule.class}, tree="[0,1]")
    private Output<List<SoftwareUpdateConfigurationSchedule>> schedules;

    /**
     * @return A `schedule` blocks as defined below.
     * 
     */
    public Output<List<SoftwareUpdateConfigurationSchedule>> schedules() {
        return this.schedules;
    }
    /**
     * A `target` blocks as defined below.
     * 
     */
    @Export(name="target", refs={SoftwareUpdateConfigurationTarget.class}, tree="[0]")
    private Output</* @Nullable */ SoftwareUpdateConfigurationTarget> target;

    /**
     * @return A `target` blocks as defined below.
     * 
     */
    public Output<Optional<SoftwareUpdateConfigurationTarget>> target() {
        return Codegen.optional(this.target);
    }
    /**
     * Specifies a list of Azure Resource IDs of azure virtual machines.
     * 
     */
    @Export(name="virtualMachineIds", refs={List.class,String.class}, tree="[0,1]")
    private Output</* @Nullable */ List<String>> virtualMachineIds;

    /**
     * @return Specifies a list of Azure Resource IDs of azure virtual machines.
     * 
     */
    public Output<Optional<List<String>>> virtualMachineIds() {
        return Codegen.optional(this.virtualMachineIds);
    }
    /**
     * A `windows` block as defined below.
     * 
     * &gt; **NOTE:** One of `linux` or `windows` must be specified.
     * 
     */
    @Export(name="windows", refs={SoftwareUpdateConfigurationWindows.class}, tree="[0]")
    private Output</* @Nullable */ SoftwareUpdateConfigurationWindows> windows;

    /**
     * @return A `windows` block as defined below.
     * 
     * &gt; **NOTE:** One of `linux` or `windows` must be specified.
     * 
     */
    public Output<Optional<SoftwareUpdateConfigurationWindows>> windows() {
        return Codegen.optional(this.windows);
    }

    /**
     *
     * @param name The _unique_ name of the resulting resource.
     */
    public SoftwareUpdateConfiguration(String name) {
        this(name, SoftwareUpdateConfigurationArgs.Empty);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     */
    public SoftwareUpdateConfiguration(String name, SoftwareUpdateConfigurationArgs 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 SoftwareUpdateConfiguration(String name, SoftwareUpdateConfigurationArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("azure:automation/softwareUpdateConfiguration:SoftwareUpdateConfiguration", name, args == null ? SoftwareUpdateConfigurationArgs.Empty : args, makeResourceOptions(options, Codegen.empty()));
    }

    private SoftwareUpdateConfiguration(String name, Output<String> id, @Nullable SoftwareUpdateConfigurationState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("azure:automation/softwareUpdateConfiguration:SoftwareUpdateConfiguration", name, state, makeResourceOptions(options, id));
    }

    private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output<String> 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 SoftwareUpdateConfiguration get(String name, Output<String> id, @Nullable SoftwareUpdateConfigurationState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        return new SoftwareUpdateConfiguration(name, id, state, options);
    }
}
