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

import com.pulumi.azure.Utilities;
import com.pulumi.azure.appservice.SourceControlTokenArgs;
import com.pulumi.azure.appservice.inputs.SourceControlTokenState;
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;

/**
 * ## Example Usage
 * ```java
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azure.appservice.SourceControlToken;
 * import com.pulumi.azure.appservice.SourceControlTokenArgs;
 * 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 SourceControlToken(&#34;example&#34;, SourceControlTokenArgs.builder()        
 *             .token(&#34;ghp_sometokenvaluesecretsauce&#34;)
 *             .type(&#34;GitHub&#34;)
 *             .build());
 * 
 *     }
 * }
 * ```
 * 
 * ## Import
 * 
 * App Service Source GitHub Tokens can be imported using the `resource id`, e.g.
 * 
 * ```sh
 *  $ pulumi import azure:appservice/sourceControlToken:SourceControlToken example /providers/Microsoft.Web/sourceControls/GitHub
 * ```
 * 
 */
@ResourceType(type="azure:appservice/sourceControlToken:SourceControlToken")
public class SourceControlToken extends com.pulumi.resources.CustomResource {
    /**
     * The Access Token.
     * 
     */
    @Export(name="token", refs={String.class}, tree="[0]")
    private Output<String> token;

    /**
     * @return The Access Token.
     * 
     */
    public Output<String> token() {
        return this.token;
    }
    /**
     * The Access Token Secret.
     * 
     * &gt; **NOTE:** The token used for deploying App Service needs the following permissions: `repo` and `workflow`.
     * 
     */
    @Export(name="tokenSecret", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> tokenSecret;

    /**
     * @return The Access Token Secret.
     * 
     * &gt; **NOTE:** The token used for deploying App Service needs the following permissions: `repo` and `workflow`.
     * 
     */
    public Output<Optional<String>> tokenSecret() {
        return Codegen.optional(this.tokenSecret);
    }
    /**
     * The Token type. Possible values include `Bitbucket`, `Dropbox`, `Github`, and `OneDrive`.
     * 
     */
    @Export(name="type", refs={String.class}, tree="[0]")
    private Output<String> type;

    /**
     * @return The Token type. Possible values include `Bitbucket`, `Dropbox`, `Github`, and `OneDrive`.
     * 
     */
    public Output<String> type() {
        return this.type;
    }

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

    private SourceControlToken(String name, Output<String> id, @Nullable SourceControlTokenState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("azure:appservice/sourceControlToken:SourceControlToken", 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())
            .additionalSecretOutputs(List.of(
                "token",
                "tokenSecret"
            ))
            .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 SourceControlToken get(String name, Output<String> id, @Nullable SourceControlTokenState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        return new SourceControlToken(name, id, state, options);
    }
}
