// *** WARNING: this file was generated by the Kulado Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

import * as kulado from "@kulado/kulado";
import * as utilities from "../utilities";

/**
 * > This content is derived from https://github.com/terraform-providers/terraform-provider-azurerm/blob/master/website/docs/r/container_service.html.markdown.
 */
export class Service extends kulado.CustomResource {
    /**
     * Get an existing Service 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 Any extra arguments used during the lookup.
     */
    public static get(name: string, id: kulado.Input<kulado.ID>, state?: ServiceState, opts?: kulado.CustomResourceOptions): Service {
        return new Service(name, <any>state, { ...opts, id: id });
    }

    /** @internal */
    public static readonly __kuladoType = 'azure:containerservice/service:Service';

    /**
     * Returns true if the given object is an instance of Service.  This is designed to work even
     * when multiple copies of the Kulado SDK have been loaded into the same process.
     */
    public static isInstance(obj: any): obj is Service {
        if (obj === undefined || obj === null) {
            return false;
        }
        return obj['__kuladoType'] === Service.__kuladoType;
    }

    /**
     * A Agent Pool Profile's block as documented below.
     */
    public readonly agentPoolProfile!: kulado.Output<{ count?: number, dnsPrefix: string, fqdn: string, name: string, vmSize: string }>;
    /**
     * A VM Diagnostics Profile block as documented below.
     */
    public readonly diagnosticsProfile!: kulado.Output<{ enabled: boolean, storageUri: string }>;
    /**
     * A Linux Profile block as documented below.
     */
    public readonly linuxProfile!: kulado.Output<{ adminUsername: string, sshKey: { keyData: string } }>;
    /**
     * The location where the Container Service instance should be created. Changing this forces a new resource to be created.
     */
    public readonly location!: kulado.Output<string>;
    /**
     * A Master Profile block as documented below.
     */
    public readonly masterProfile!: kulado.Output<{ count?: number, dnsPrefix: string, fqdn: string }>;
    /**
     * Unique name of the agent pool profile in the context of the subscription and resource group.
     */
    public readonly name!: kulado.Output<string>;
    /**
     * Specifies the Container Orchestration Platform to use. Currently can be either `DCOS`, `Kubernetes` or `Swarm`. Changing this forces a new resource to be created.
     */
    public readonly orchestrationPlatform!: kulado.Output<string>;
    /**
     * Specifies the resource group where the resource exists. Changing this forces a new resource to be created.
     */
    public readonly resourceGroupName!: kulado.Output<string>;
    /**
     * A Service Principal block as documented below.
     */
    public readonly servicePrincipal!: kulado.Output<{ clientId: string, clientSecret: string } | undefined>;
    /**
     * A mapping of tags to assign to the resource.
     */
    public readonly tags!: kulado.Output<{[key: string]: any}>;

    /**
     * Create a Service resource with the given unique name, arguments, and options.
     *
     * @param name The _unique_ name of the resource.
     * @param args The arguments to use to populate this resource's properties.
     * @param opts A bag of options that control this resource's behavior.
     */
    constructor(name: string, args: ServiceArgs, opts?: kulado.CustomResourceOptions)
    constructor(name: string, argsOrState?: ServiceArgs | ServiceState, opts?: kulado.CustomResourceOptions) {
        let inputs: kulado.Inputs = {};
        if (opts && opts.id) {
            const state = argsOrState as ServiceState | undefined;
            inputs["agentPoolProfile"] = state ? state.agentPoolProfile : undefined;
            inputs["diagnosticsProfile"] = state ? state.diagnosticsProfile : undefined;
            inputs["linuxProfile"] = state ? state.linuxProfile : undefined;
            inputs["location"] = state ? state.location : undefined;
            inputs["masterProfile"] = state ? state.masterProfile : undefined;
            inputs["name"] = state ? state.name : undefined;
            inputs["orchestrationPlatform"] = state ? state.orchestrationPlatform : undefined;
            inputs["resourceGroupName"] = state ? state.resourceGroupName : undefined;
            inputs["servicePrincipal"] = state ? state.servicePrincipal : undefined;
            inputs["tags"] = state ? state.tags : undefined;
        } else {
            const args = argsOrState as ServiceArgs | undefined;
            if (!args || args.agentPoolProfile === undefined) {
                throw new Error("Missing required property 'agentPoolProfile'");
            }
            if (!args || args.diagnosticsProfile === undefined) {
                throw new Error("Missing required property 'diagnosticsProfile'");
            }
            if (!args || args.linuxProfile === undefined) {
                throw new Error("Missing required property 'linuxProfile'");
            }
            if (!args || args.masterProfile === undefined) {
                throw new Error("Missing required property 'masterProfile'");
            }
            if (!args || args.orchestrationPlatform === undefined) {
                throw new Error("Missing required property 'orchestrationPlatform'");
            }
            if (!args || args.resourceGroupName === undefined) {
                throw new Error("Missing required property 'resourceGroupName'");
            }
            inputs["agentPoolProfile"] = args ? args.agentPoolProfile : undefined;
            inputs["diagnosticsProfile"] = args ? args.diagnosticsProfile : undefined;
            inputs["linuxProfile"] = args ? args.linuxProfile : undefined;
            inputs["location"] = args ? args.location : undefined;
            inputs["masterProfile"] = args ? args.masterProfile : undefined;
            inputs["name"] = args ? args.name : undefined;
            inputs["orchestrationPlatform"] = args ? args.orchestrationPlatform : undefined;
            inputs["resourceGroupName"] = args ? args.resourceGroupName : undefined;
            inputs["servicePrincipal"] = args ? args.servicePrincipal : undefined;
            inputs["tags"] = args ? args.tags : undefined;
        }
        super(Service.__kuladoType, name, inputs, opts);
    }
}

/**
 * Input properties used for looking up and filtering Service resources.
 */
export interface ServiceState {
    /**
     * A Agent Pool Profile's block as documented below.
     */
    readonly agentPoolProfile?: kulado.Input<{ count?: kulado.Input<number>, dnsPrefix: kulado.Input<string>, fqdn?: kulado.Input<string>, name: kulado.Input<string>, vmSize: kulado.Input<string> }>;
    /**
     * A VM Diagnostics Profile block as documented below.
     */
    readonly diagnosticsProfile?: kulado.Input<{ enabled: kulado.Input<boolean>, storageUri?: kulado.Input<string> }>;
    /**
     * A Linux Profile block as documented below.
     */
    readonly linuxProfile?: kulado.Input<{ adminUsername: kulado.Input<string>, sshKey: kulado.Input<{ keyData: kulado.Input<string> }> }>;
    /**
     * The location where the Container Service instance should be created. Changing this forces a new resource to be created.
     */
    readonly location?: kulado.Input<string>;
    /**
     * A Master Profile block as documented below.
     */
    readonly masterProfile?: kulado.Input<{ count?: kulado.Input<number>, dnsPrefix: kulado.Input<string>, fqdn?: kulado.Input<string> }>;
    /**
     * Unique name of the agent pool profile in the context of the subscription and resource group.
     */
    readonly name?: kulado.Input<string>;
    /**
     * Specifies the Container Orchestration Platform to use. Currently can be either `DCOS`, `Kubernetes` or `Swarm`. Changing this forces a new resource to be created.
     */
    readonly orchestrationPlatform?: kulado.Input<string>;
    /**
     * Specifies the resource group where the resource exists. Changing this forces a new resource to be created.
     */
    readonly resourceGroupName?: kulado.Input<string>;
    /**
     * A Service Principal block as documented below.
     */
    readonly servicePrincipal?: kulado.Input<{ clientId: kulado.Input<string>, clientSecret: kulado.Input<string> }>;
    /**
     * A mapping of tags to assign to the resource.
     */
    readonly tags?: kulado.Input<{[key: string]: any}>;
}

/**
 * The set of arguments for constructing a Service resource.
 */
export interface ServiceArgs {
    /**
     * A Agent Pool Profile's block as documented below.
     */
    readonly agentPoolProfile: kulado.Input<{ count?: kulado.Input<number>, dnsPrefix: kulado.Input<string>, fqdn?: kulado.Input<string>, name: kulado.Input<string>, vmSize: kulado.Input<string> }>;
    /**
     * A VM Diagnostics Profile block as documented below.
     */
    readonly diagnosticsProfile: kulado.Input<{ enabled: kulado.Input<boolean>, storageUri?: kulado.Input<string> }>;
    /**
     * A Linux Profile block as documented below.
     */
    readonly linuxProfile: kulado.Input<{ adminUsername: kulado.Input<string>, sshKey: kulado.Input<{ keyData: kulado.Input<string> }> }>;
    /**
     * The location where the Container Service instance should be created. Changing this forces a new resource to be created.
     */
    readonly location?: kulado.Input<string>;
    /**
     * A Master Profile block as documented below.
     */
    readonly masterProfile: kulado.Input<{ count?: kulado.Input<number>, dnsPrefix: kulado.Input<string>, fqdn?: kulado.Input<string> }>;
    /**
     * Unique name of the agent pool profile in the context of the subscription and resource group.
     */
    readonly name?: kulado.Input<string>;
    /**
     * Specifies the Container Orchestration Platform to use. Currently can be either `DCOS`, `Kubernetes` or `Swarm`. Changing this forces a new resource to be created.
     */
    readonly orchestrationPlatform: kulado.Input<string>;
    /**
     * Specifies the resource group where the resource exists. Changing this forces a new resource to be created.
     */
    readonly resourceGroupName: kulado.Input<string>;
    /**
     * A Service Principal block as documented below.
     */
    readonly servicePrincipal?: kulado.Input<{ clientId: kulado.Input<string>, clientSecret: kulado.Input<string> }>;
    /**
     * A mapping of tags to assign to the resource.
     */
    readonly tags?: kulado.Input<{[key: string]: any}>;
}
