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

import * as pulumi from "@pulumi/pulumi";
import * as inputs from "./types/input";
import * as outputs from "./types/output";
import * as utilities from "./utilities";

/**
 * This resource allows you to configure entity properties for your Statsig project.
 *
 * To learn more about entity properties, see [Entity Properties Documentation](https://docs.statsig.com/statsig-warehouse-native/features/entity-properties/)
 *
 * To learn more about the API powering this resource, see [Experiments API Documentation](https://docs.statsig.com/console-api/experiments)
 *
 * > Note: This resource is only available for [Warehouse Native](https://docs.statsig.com/statsig-warehouse-native/introduction/) projects
 */
export class EntityProperty extends pulumi.CustomResource {
    /**
     * Get an existing EntityProperty 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.
     * @param opts Optional settings to control the behavior of the CustomResource.
     */
    public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: EntityPropertyState, opts?: pulumi.CustomResourceOptions): EntityProperty {
        return new EntityProperty(name, <any>state, { ...opts, id: id });
    }

    /** @internal */
    public static readonly __pulumiType = 'statsig:index/entityProperty:EntityProperty';

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

    /**
     * Optional detailed context for the entity property source.
     */
    public readonly description!: pulumi.Output<string>;
    /**
     * Mappings of Statsig units to their columns.
     */
    public readonly idTypeMappings!: pulumi.Output<outputs.EntityPropertyIdTypeMapping[]>;
    /**
     * Specifies if the source can only be edited via the Console API.
     */
    public readonly isReadOnly!: pulumi.Output<boolean>;
    /**
     * Unique identifier for the entity property source.
     */
    public readonly name!: pulumi.Output<string>;
    /**
     * Schema for owner data including ID, type, name. Note that if Entity is created by CONSOLE API, owner will be undefined.
     */
    public /*out*/ readonly owner!: pulumi.Output<outputs.EntityPropertyOwner>;
    /**
     * SQL query defining the data source.
     */
    public readonly sql!: pulumi.Output<string>;
    /**
     * Optional tags for categorization.
     */
    public readonly tags!: pulumi.Output<string[]>;
    /**
     * Indicates if the timestamp is treated as a day.
     */
    public readonly timestampAsDay!: pulumi.Output<boolean>;
    /**
     * Optional column name for timestamp.
     */
    public readonly timestampColumn!: pulumi.Output<string>;

    /**
     * Create a EntityProperty 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: EntityPropertyArgs, opts?: pulumi.CustomResourceOptions)
    constructor(name: string, argsOrState?: EntityPropertyArgs | EntityPropertyState, opts?: pulumi.CustomResourceOptions) {
        let resourceInputs: pulumi.Inputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState as EntityPropertyState | undefined;
            resourceInputs["description"] = state ? state.description : undefined;
            resourceInputs["idTypeMappings"] = state ? state.idTypeMappings : undefined;
            resourceInputs["isReadOnly"] = state ? state.isReadOnly : undefined;
            resourceInputs["name"] = state ? state.name : undefined;
            resourceInputs["owner"] = state ? state.owner : undefined;
            resourceInputs["sql"] = state ? state.sql : undefined;
            resourceInputs["tags"] = state ? state.tags : undefined;
            resourceInputs["timestampAsDay"] = state ? state.timestampAsDay : undefined;
            resourceInputs["timestampColumn"] = state ? state.timestampColumn : undefined;
        } else {
            const args = argsOrState as EntityPropertyArgs | undefined;
            if ((!args || args.idTypeMappings === undefined) && !opts.urn) {
                throw new Error("Missing required property 'idTypeMappings'");
            }
            if ((!args || args.sql === undefined) && !opts.urn) {
                throw new Error("Missing required property 'sql'");
            }
            resourceInputs["description"] = args ? args.description : undefined;
            resourceInputs["idTypeMappings"] = args ? args.idTypeMappings : undefined;
            resourceInputs["isReadOnly"] = args ? args.isReadOnly : undefined;
            resourceInputs["name"] = args ? args.name : undefined;
            resourceInputs["sql"] = args ? args.sql : undefined;
            resourceInputs["tags"] = args ? args.tags : undefined;
            resourceInputs["timestampAsDay"] = args ? args.timestampAsDay : undefined;
            resourceInputs["timestampColumn"] = args ? args.timestampColumn : undefined;
            resourceInputs["owner"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(EntityProperty.__pulumiType, name, resourceInputs, opts);
    }
}

/**
 * Input properties used for looking up and filtering EntityProperty resources.
 */
export interface EntityPropertyState {
    /**
     * Optional detailed context for the entity property source.
     */
    description?: pulumi.Input<string>;
    /**
     * Mappings of Statsig units to their columns.
     */
    idTypeMappings?: pulumi.Input<pulumi.Input<inputs.EntityPropertyIdTypeMapping>[]>;
    /**
     * Specifies if the source can only be edited via the Console API.
     */
    isReadOnly?: pulumi.Input<boolean>;
    /**
     * Unique identifier for the entity property source.
     */
    name?: pulumi.Input<string>;
    /**
     * Schema for owner data including ID, type, name. Note that if Entity is created by CONSOLE API, owner will be undefined.
     */
    owner?: pulumi.Input<inputs.EntityPropertyOwner>;
    /**
     * SQL query defining the data source.
     */
    sql?: pulumi.Input<string>;
    /**
     * Optional tags for categorization.
     */
    tags?: pulumi.Input<pulumi.Input<string>[]>;
    /**
     * Indicates if the timestamp is treated as a day.
     */
    timestampAsDay?: pulumi.Input<boolean>;
    /**
     * Optional column name for timestamp.
     */
    timestampColumn?: pulumi.Input<string>;
}

/**
 * The set of arguments for constructing a EntityProperty resource.
 */
export interface EntityPropertyArgs {
    /**
     * Optional detailed context for the entity property source.
     */
    description?: pulumi.Input<string>;
    /**
     * Mappings of Statsig units to their columns.
     */
    idTypeMappings: pulumi.Input<pulumi.Input<inputs.EntityPropertyIdTypeMapping>[]>;
    /**
     * Specifies if the source can only be edited via the Console API.
     */
    isReadOnly?: pulumi.Input<boolean>;
    /**
     * Unique identifier for the entity property source.
     */
    name?: pulumi.Input<string>;
    /**
     * SQL query defining the data source.
     */
    sql: pulumi.Input<string>;
    /**
     * Optional tags for categorization.
     */
    tags?: pulumi.Input<pulumi.Input<string>[]>;
    /**
     * Indicates if the timestamp is treated as a day.
     */
    timestampAsDay?: pulumi.Input<boolean>;
    /**
     * Optional column name for timestamp.
     */
    timestampColumn?: pulumi.Input<string>;
}
