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

import com.pulumi.azure.Utilities;
import com.pulumi.azure.confidentialledger.LedgerArgs;
import com.pulumi.azure.confidentialledger.inputs.LedgerState;
import com.pulumi.azure.confidentialledger.outputs.LedgerAzureadBasedServicePrincipal;
import com.pulumi.azure.confidentialledger.outputs.LedgerCertificateBasedSecurityPrincipal;
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.Map;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Manages a Confidential Ledger.
 * 
 * ## Example Usage
 * ```java
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azure.core.CoreFunctions;
 * import com.pulumi.azure.core.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.confidentialledger.Ledger;
 * import com.pulumi.azure.confidentialledger.LedgerArgs;
 * import com.pulumi.azure.confidentialledger.inputs.LedgerAzureadBasedServicePrincipalArgs;
 * 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) {
 *         final var current = CoreFunctions.getClientConfig();
 * 
 *         var example = new ResourceGroup(&#34;example&#34;, ResourceGroupArgs.builder()        
 *             .location(&#34;West Europe&#34;)
 *             .build());
 * 
 *         var ledger = new Ledger(&#34;ledger&#34;, LedgerArgs.builder()        
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .ledgerType(&#34;Private&#34;)
 *             .azureadBasedServicePrincipals(LedgerAzureadBasedServicePrincipalArgs.builder()
 *                 .principalId(current.applyValue(getClientConfigResult -&gt; getClientConfigResult.objectId()))
 *                 .tenantId(current.applyValue(getClientConfigResult -&gt; getClientConfigResult.tenantId()))
 *                 .ledgerRoleName(&#34;Administrator&#34;)
 *                 .build())
 *             .build());
 * 
 *     }
 * }
 * ```
 * 
 * ## Import
 * 
 * Confidential Ledgers can be imported using the `resource id`, e.g.
 * 
 * ```sh
 *  $ pulumi import azure:confidentialledger/ledger:Ledger example /subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-group/providers/Microsoft.ConfidentialLedger/ledgers/example-ledger
 * ```
 * 
 */
@ResourceType(type="azure:confidentialledger/ledger:Ledger")
public class Ledger extends com.pulumi.resources.CustomResource {
    /**
     * A list of `azuread_based_service_principal` blocks as defined below.
     * 
     */
    @Export(name="azureadBasedServicePrincipals", refs={List.class,LedgerAzureadBasedServicePrincipal.class}, tree="[0,1]")
    private Output<List<LedgerAzureadBasedServicePrincipal>> azureadBasedServicePrincipals;

    /**
     * @return A list of `azuread_based_service_principal` blocks as defined below.
     * 
     */
    public Output<List<LedgerAzureadBasedServicePrincipal>> azureadBasedServicePrincipals() {
        return this.azureadBasedServicePrincipals;
    }
    /**
     * A list of `certificate_based_security_principal` blocks as defined below.
     * 
     */
    @Export(name="certificateBasedSecurityPrincipals", refs={List.class,LedgerCertificateBasedSecurityPrincipal.class}, tree="[0,1]")
    private Output</* @Nullable */ List<LedgerCertificateBasedSecurityPrincipal>> certificateBasedSecurityPrincipals;

    /**
     * @return A list of `certificate_based_security_principal` blocks as defined below.
     * 
     */
    public Output<Optional<List<LedgerCertificateBasedSecurityPrincipal>>> certificateBasedSecurityPrincipals() {
        return Codegen.optional(this.certificateBasedSecurityPrincipals);
    }
    /**
     * The Identity Service Endpoint for this Confidential Ledger.
     * 
     */
    @Export(name="identityServiceEndpoint", refs={String.class}, tree="[0]")
    private Output<String> identityServiceEndpoint;

    /**
     * @return The Identity Service Endpoint for this Confidential Ledger.
     * 
     */
    public Output<String> identityServiceEndpoint() {
        return this.identityServiceEndpoint;
    }
    /**
     * The Endpoint for this Confidential Ledger.
     * 
     */
    @Export(name="ledgerEndpoint", refs={String.class}, tree="[0]")
    private Output<String> ledgerEndpoint;

    /**
     * @return The Endpoint for this Confidential Ledger.
     * 
     */
    public Output<String> ledgerEndpoint() {
        return this.ledgerEndpoint;
    }
    /**
     * Specifies the type of Confidential Ledger. Possible values are `Private` and `Public`. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="ledgerType", refs={String.class}, tree="[0]")
    private Output<String> ledgerType;

    /**
     * @return Specifies the type of Confidential Ledger. Possible values are `Private` and `Public`. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> ledgerType() {
        return this.ledgerType;
    }
    /**
     * Specifies the supported Azure location where the Confidential Ledger exists. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="location", refs={String.class}, tree="[0]")
    private Output<String> location;

    /**
     * @return Specifies the supported Azure location where the Confidential Ledger exists. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> location() {
        return this.location;
    }
    /**
     * Specifies the name of the Confidential Ledger. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="name", refs={String.class}, tree="[0]")
    private Output<String> name;

    /**
     * @return Specifies the name of the Confidential Ledger. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> name() {
        return this.name;
    }
    /**
     * The name of the Resource Group where the Confidential Ledger exists. 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 where the Confidential Ledger exists. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> resourceGroupName() {
        return this.resourceGroupName;
    }
    /**
     * A mapping of tags to assign to the Confidential Ledger.
     * 
     */
    @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 Confidential Ledger.
     * 
     */
    public Output<Optional<Map<String,String>>> tags() {
        return Codegen.optional(this.tags);
    }

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

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