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

import com.pulumi.azure.Utilities;
import com.pulumi.azure.apimanagement.ProductArgs;
import com.pulumi.azure.apimanagement.inputs.ProductState;
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.Optional;
import javax.annotation.Nullable;

/**
 * Manages an API Management Product.
 * 
 * ## 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.apimanagement.Service;
 * import com.pulumi.azure.apimanagement.ServiceArgs;
 * import com.pulumi.azure.apimanagement.Product;
 * import com.pulumi.azure.apimanagement.ProductArgs;
 * 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 exampleService = new Service(&#34;exampleService&#34;, ServiceArgs.builder()        
 *             .location(exampleResourceGroup.location())
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .publisherName(&#34;My Company&#34;)
 *             .publisherEmail(&#34;company@exmaple.com&#34;)
 *             .skuName(&#34;Developer_1&#34;)
 *             .build());
 * 
 *         var exampleProduct = new Product(&#34;exampleProduct&#34;, ProductArgs.builder()        
 *             .productId(&#34;test-product&#34;)
 *             .apiManagementName(exampleService.name())
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .displayName(&#34;Test Product&#34;)
 *             .subscriptionRequired(true)
 *             .approvalRequired(true)
 *             .published(true)
 *             .build());
 * 
 *     }
 * }
 * ```
 * 
 * ## Import
 * 
 * API Management Products can be imported using the `resource id`, e.g.
 * 
 * ```sh
 *  $ pulumi import azure:apimanagement/product:Product example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.ApiManagement/service/instance1/products/myproduct
 * ```
 * 
 */
@ResourceType(type="azure:apimanagement/product:Product")
public class Product extends com.pulumi.resources.CustomResource {
    /**
     * The name of the API Management Service. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="apiManagementName", refs={String.class}, tree="[0]")
    private Output<String> apiManagementName;

    /**
     * @return The name of the API Management Service. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> apiManagementName() {
        return this.apiManagementName;
    }
    /**
     * Do subscribers need to be approved prior to being able to use the Product?
     * 
     * &gt; **NOTE:** `approval_required` can only be set when `subscription_required` is set to `true`.
     * 
     */
    @Export(name="approvalRequired", refs={Boolean.class}, tree="[0]")
    private Output</* @Nullable */ Boolean> approvalRequired;

    /**
     * @return Do subscribers need to be approved prior to being able to use the Product?
     * 
     * &gt; **NOTE:** `approval_required` can only be set when `subscription_required` is set to `true`.
     * 
     */
    public Output<Optional<Boolean>> approvalRequired() {
        return Codegen.optional(this.approvalRequired);
    }
    /**
     * A description of this Product, which may include HTML formatting tags.
     * 
     */
    @Export(name="description", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> description;

    /**
     * @return A description of this Product, which may include HTML formatting tags.
     * 
     */
    public Output<Optional<String>> description() {
        return Codegen.optional(this.description);
    }
    /**
     * The Display Name for this API Management Product.
     * 
     */
    @Export(name="displayName", refs={String.class}, tree="[0]")
    private Output<String> displayName;

    /**
     * @return The Display Name for this API Management Product.
     * 
     */
    public Output<String> displayName() {
        return this.displayName;
    }
    /**
     * The Identifier for this Product, which must be unique within the API Management Service. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="productId", refs={String.class}, tree="[0]")
    private Output<String> productId;

    /**
     * @return The Identifier for this Product, which must be unique within the API Management Service. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> productId() {
        return this.productId;
    }
    /**
     * Is this Product Published?
     * 
     */
    @Export(name="published", refs={Boolean.class}, tree="[0]")
    private Output<Boolean> published;

    /**
     * @return Is this Product Published?
     * 
     */
    public Output<Boolean> published() {
        return this.published;
    }
    /**
     * The name of the Resource Group in which the API Management Service should be exist. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="resourceGroupName", refs={String.class}, tree="[0]")
    private Output<String> resourceGroupName;

    /**
     * @return The name of the Resource Group in which the API Management Service should be exist. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> resourceGroupName() {
        return this.resourceGroupName;
    }
    /**
     * Is a Subscription required to access API&#39;s included in this Product? Defaults to `true`.
     * 
     */
    @Export(name="subscriptionRequired", refs={Boolean.class}, tree="[0]")
    private Output</* @Nullable */ Boolean> subscriptionRequired;

    /**
     * @return Is a Subscription required to access API&#39;s included in this Product? Defaults to `true`.
     * 
     */
    public Output<Optional<Boolean>> subscriptionRequired() {
        return Codegen.optional(this.subscriptionRequired);
    }
    /**
     * The number of subscriptions a user can have to this Product at the same time.
     * 
     * &gt; **NOTE:** `subscriptions_limit` can only be set when `subscription_required` is set to `true`.
     * 
     */
    @Export(name="subscriptionsLimit", refs={Integer.class}, tree="[0]")
    private Output</* @Nullable */ Integer> subscriptionsLimit;

    /**
     * @return The number of subscriptions a user can have to this Product at the same time.
     * 
     * &gt; **NOTE:** `subscriptions_limit` can only be set when `subscription_required` is set to `true`.
     * 
     */
    public Output<Optional<Integer>> subscriptionsLimit() {
        return Codegen.optional(this.subscriptionsLimit);
    }
    /**
     * The Terms and Conditions for this Product, which must be accepted by Developers before they can begin the Subscription process.
     * 
     */
    @Export(name="terms", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> terms;

    /**
     * @return The Terms and Conditions for this Product, which must be accepted by Developers before they can begin the Subscription process.
     * 
     */
    public Output<Optional<String>> terms() {
        return Codegen.optional(this.terms);
    }

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

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