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

import com.pulumi.azure.Utilities;
import com.pulumi.azure.appconfiguration.ConfigurationFeatureArgs;
import com.pulumi.azure.appconfiguration.inputs.ConfigurationFeatureState;
import com.pulumi.azure.appconfiguration.outputs.ConfigurationFeatureTargetingFilter;
import com.pulumi.azure.appconfiguration.outputs.ConfigurationFeatureTimewindowFilter;
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.Integer;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Manages an Azure App Configuration Feature.
 * 
 * &gt; **Note:** App Configuration Features are provisioned using a Data Plane API which requires the role `App Configuration Data Owner` on either the App Configuration or a parent scope (such as the Resource Group/Subscription). [More information can be found in the Azure Documentation for App Configuration](https://docs.microsoft.com/azure/azure-app-configuration/concept-enable-rbac#azure-built-in-roles-for-azure-app-configuration). This is similar to providing App Configuration Keys.
 * 
 * ## 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.appconfiguration.ConfigurationStore;
 * import com.pulumi.azure.appconfiguration.ConfigurationStoreArgs;
 * import com.pulumi.azure.core.CoreFunctions;
 * import com.pulumi.azure.authorization.Assignment;
 * import com.pulumi.azure.authorization.AssignmentArgs;
 * import com.pulumi.azure.appconfiguration.ConfigurationFeature;
 * import com.pulumi.azure.appconfiguration.ConfigurationFeatureArgs;
 * 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(&#34;example&#34;, ResourceGroupArgs.builder()        
 *             .location(&#34;West Europe&#34;)
 *             .build());
 * 
 *         var appconf = new ConfigurationStore(&#34;appconf&#34;, ConfigurationStoreArgs.builder()        
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .build());
 * 
 *         final var current = CoreFunctions.getClientConfig();
 * 
 *         var appconfDataowner = new Assignment(&#34;appconfDataowner&#34;, AssignmentArgs.builder()        
 *             .scope(appconf.id())
 *             .roleDefinitionName(&#34;App Configuration Data Owner&#34;)
 *             .principalId(current.applyValue(getClientConfigResult -&gt; getClientConfigResult.objectId()))
 *             .build());
 * 
 *         var test = new ConfigurationFeature(&#34;test&#34;, ConfigurationFeatureArgs.builder()        
 *             .configurationStoreId(appconf.id())
 *             .description(&#34;test description&#34;)
 *             .label(&#34;test-ackeylabel&#34;)
 *             .enabled(true)
 *             .build());
 * 
 *     }
 * }
 * ```
 * 
 * ## Import
 * 
 * App Configuration Features can be imported using the `resource id`, e.g.
 * 
 * ```sh
 *  $ pulumi import azure:appconfiguration/configurationFeature:ConfigurationFeature test https://appconfname1.azconfig.io/kv/.appconfig.featureflag%2FkeyName?label=labelName
 * ```
 * 
 *  If you wish to import with an empty label then simply leave the label&#39;s name blank
 * 
 * ```sh
 *  $ pulumi import azure:appconfiguration/configurationFeature:ConfigurationFeature test https://appconfname1.azconfig.io/kv/.appconfig.featureflag%2FkeyName?label=
 * ```
 * 
 */
@ResourceType(type="azure:appconfiguration/configurationFeature:ConfigurationFeature")
public class ConfigurationFeature extends com.pulumi.resources.CustomResource {
    /**
     * Specifies the id of the App Configuration. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="configurationStoreId", refs={String.class}, tree="[0]")
    private Output<String> configurationStoreId;

    /**
     * @return Specifies the id of the App Configuration. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> configurationStoreId() {
        return this.configurationStoreId;
    }
    /**
     * The description of the App Configuration Feature.
     * 
     */
    @Export(name="description", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> description;

    /**
     * @return The description of the App Configuration Feature.
     * 
     */
    public Output<Optional<String>> description() {
        return Codegen.optional(this.description);
    }
    /**
     * The status of the App Configuration Feature. By default, this is set to false.
     * 
     */
    @Export(name="enabled", refs={Boolean.class}, tree="[0]")
    private Output</* @Nullable */ Boolean> enabled;

    /**
     * @return The status of the App Configuration Feature. By default, this is set to false.
     * 
     */
    public Output<Optional<Boolean>> enabled() {
        return Codegen.optional(this.enabled);
    }
    @Export(name="etag", refs={String.class}, tree="[0]")
    private Output<String> etag;

    public Output<String> etag() {
        return this.etag;
    }
    /**
     * The key of the App Configuration Feature. The value for `name` will be used if this is unspecified. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="key", refs={String.class}, tree="[0]")
    private Output<String> key;

    /**
     * @return The key of the App Configuration Feature. The value for `name` will be used if this is unspecified. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> key() {
        return this.key;
    }
    /**
     * The label of the App Configuration Feature. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="label", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> label;

    /**
     * @return The label of the App Configuration Feature. Changing this forces a new resource to be created.
     * 
     */
    public Output<Optional<String>> label() {
        return Codegen.optional(this.label);
    }
    /**
     * Should this App Configuration Feature be Locked to prevent changes?
     * 
     */
    @Export(name="locked", refs={Boolean.class}, tree="[0]")
    private Output</* @Nullable */ Boolean> locked;

    /**
     * @return Should this App Configuration Feature be Locked to prevent changes?
     * 
     */
    public Output<Optional<Boolean>> locked() {
        return Codegen.optional(this.locked);
    }
    /**
     * The name of the App Configuration Feature. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="name", refs={String.class}, tree="[0]")
    private Output<String> name;

    /**
     * @return The name of the App Configuration Feature. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> name() {
        return this.name;
    }
    /**
     * A list of one or more numbers representing the value of the percentage required to enable this feature.
     * 
     */
    @Export(name="percentageFilterValue", refs={Integer.class}, tree="[0]")
    private Output</* @Nullable */ Integer> percentageFilterValue;

    /**
     * @return A list of one or more numbers representing the value of the percentage required to enable this feature.
     * 
     */
    public Output<Optional<Integer>> percentageFilterValue() {
        return Codegen.optional(this.percentageFilterValue);
    }
    /**
     * A mapping of tags to assign to the resource.
     * 
     */
    @Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]")
    private Output</* @Nullable */ Map<String,String>> tags;

    /**
     * @return A mapping of tags to assign to the resource.
     * 
     */
    public Output<Optional<Map<String,String>>> tags() {
        return Codegen.optional(this.tags);
    }
    /**
     * A `targeting_filter` block as defined below.
     * 
     */
    @Export(name="targetingFilters", refs={List.class,ConfigurationFeatureTargetingFilter.class}, tree="[0,1]")
    private Output</* @Nullable */ List<ConfigurationFeatureTargetingFilter>> targetingFilters;

    /**
     * @return A `targeting_filter` block as defined below.
     * 
     */
    public Output<Optional<List<ConfigurationFeatureTargetingFilter>>> targetingFilters() {
        return Codegen.optional(this.targetingFilters);
    }
    /**
     * A `timewindow_filter` block as defined below.
     * 
     */
    @Export(name="timewindowFilters", refs={List.class,ConfigurationFeatureTimewindowFilter.class}, tree="[0,1]")
    private Output</* @Nullable */ List<ConfigurationFeatureTimewindowFilter>> timewindowFilters;

    /**
     * @return A `timewindow_filter` block as defined below.
     * 
     */
    public Output<Optional<List<ConfigurationFeatureTimewindowFilter>>> timewindowFilters() {
        return Codegen.optional(this.timewindowFilters);
    }

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

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