// *** 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.SourceControlArgs;
import com.pulumi.azure.automation.inputs.SourceControlState;
import com.pulumi.azure.automation.outputs.SourceControlSecurity;
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.Boolean;
import java.lang.String;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Manages an Automation Source Control.
 * 
 * ## 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.SourceControl;
 * import com.pulumi.azure.automation.SourceControlArgs;
 * import com.pulumi.azure.automation.inputs.SourceControlSecurityArgs;
 * 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;West Europe&#34;)
 *             .build());
 * 
 *         var exampleAccount = new Account(&#34;exampleAccount&#34;, AccountArgs.builder()        
 *             .location(exampleResourceGroup.location())
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .skuName(&#34;Basic&#34;)
 *             .build());
 * 
 *         var exampleSourceControl = new SourceControl(&#34;exampleSourceControl&#34;, SourceControlArgs.builder()        
 *             .automationAccountId(exampleAccount.id())
 *             .folderPath(&#34;runbook&#34;)
 *             .security(SourceControlSecurityArgs.builder()
 *                 .token(&#34;ghp_xxx&#34;)
 *                 .tokenType(&#34;PersonalAccessToken&#34;)
 *                 .build())
 *             .repositoryUrl(&#34;https://github.com/foo/bat.git&#34;)
 *             .sourceControlType(&#34;GitHub&#34;)
 *             .branch(&#34;main&#34;)
 *             .build());
 * 
 *     }
 * }
 * ```
 * 
 * ## Import
 * 
 * Automations can be imported using the `resource id`, e.g.
 * 
 * ```sh
 *  $ pulumi import azure:automation/sourceControl:SourceControl example /subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.Automation/automationAccounts/account1/sourceControls/sc1
 * ```
 * 
 */
@ResourceType(type="azure:automation/sourceControl:SourceControl")
public class SourceControl extends com.pulumi.resources.CustomResource {
    /**
     * Whether auto async the Source Control.
     * 
     */
    @Export(name="automaticSync", refs={Boolean.class}, tree="[0]")
    private Output</* @Nullable */ Boolean> automaticSync;

    /**
     * @return Whether auto async the Source Control.
     * 
     */
    public Output<Optional<Boolean>> automaticSync() {
        return Codegen.optional(this.automaticSync);
    }
    /**
     * 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;
    }
    /**
     * Specify the repo branch of the Source Control. Empty value is valid only for `VsoTfvc`.
     * 
     */
    @Export(name="branch", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> branch;

    /**
     * @return Specify the repo branch of the Source Control. Empty value is valid only for `VsoTfvc`.
     * 
     */
    public Output<Optional<String>> branch() {
        return Codegen.optional(this.branch);
    }
    /**
     * A short description of the Source Control.
     * 
     */
    @Export(name="description", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> description;

    /**
     * @return A short description of the Source Control.
     * 
     */
    public Output<Optional<String>> description() {
        return Codegen.optional(this.description);
    }
    /**
     * The folder path of the source control. This Path must be relative.
     * 
     */
    @Export(name="folderPath", refs={String.class}, tree="[0]")
    private Output<String> folderPath;

    /**
     * @return The folder path of the source control. This Path must be relative.
     * 
     */
    public Output<String> folderPath() {
        return this.folderPath;
    }
    /**
     * The name which should be used for this Automation Source Control. Changing this forces a new Automation Source Control 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 Source Control. Changing this forces a new Automation Source Control to be created.
     * 
     */
    public Output<String> name() {
        return this.name;
    }
    /**
     * Whether auto publish the Source Control. Defaults to `true`.
     * 
     */
    @Export(name="publishRunbookEnabled", refs={Boolean.class}, tree="[0]")
    private Output</* @Nullable */ Boolean> publishRunbookEnabled;

    /**
     * @return Whether auto publish the Source Control. Defaults to `true`.
     * 
     */
    public Output<Optional<Boolean>> publishRunbookEnabled() {
        return Codegen.optional(this.publishRunbookEnabled);
    }
    /**
     * The Repository URL of the source control.
     * 
     */
    @Export(name="repositoryUrl", refs={String.class}, tree="[0]")
    private Output<String> repositoryUrl;

    /**
     * @return The Repository URL of the source control.
     * 
     */
    public Output<String> repositoryUrl() {
        return this.repositoryUrl;
    }
    /**
     * A `security` block as defined below.
     * 
     */
    @Export(name="security", refs={SourceControlSecurity.class}, tree="[0]")
    private Output<SourceControlSecurity> security;

    /**
     * @return A `security` block as defined below.
     * 
     */
    public Output<SourceControlSecurity> security() {
        return this.security;
    }
    /**
     * The source type of Source Control, possible vaules are `VsoGit`, `VsoTfvc` and `GitHub`, and the value is case sensitive.
     * 
     */
    @Export(name="sourceControlType", refs={String.class}, tree="[0]")
    private Output<String> sourceControlType;

    /**
     * @return The source type of Source Control, possible vaules are `VsoGit`, `VsoTfvc` and `GitHub`, and the value is case sensitive.
     * 
     */
    public Output<String> sourceControlType() {
        return this.sourceControlType;
    }

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

    private SourceControl(String name, Output<String> id, @Nullable SourceControlState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("azure:automation/sourceControl:SourceControl", 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 SourceControl get(String name, Output<String> id, @Nullable SourceControlState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        return new SourceControl(name, id, state, options);
    }
}
