# coding=utf-8
# *** 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 warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from . import _utilities, _tables

__all__ = ['AppV2']


class AppV2(pulumi.CustomResource):
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 annotations: Optional[pulumi.Input[Mapping[str, Any]]] = None,
                 chart_name: Optional[pulumi.Input[str]] = None,
                 chart_version: Optional[pulumi.Input[str]] = None,
                 cleanup_on_fail: Optional[pulumi.Input[bool]] = None,
                 cluster_id: Optional[pulumi.Input[str]] = None,
                 disable_hooks: Optional[pulumi.Input[bool]] = None,
                 disable_open_api_validation: Optional[pulumi.Input[bool]] = None,
                 force_upgrade: Optional[pulumi.Input[bool]] = None,
                 labels: Optional[pulumi.Input[Mapping[str, Any]]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 namespace: Optional[pulumi.Input[str]] = None,
                 project_id: Optional[pulumi.Input[str]] = None,
                 repo_name: Optional[pulumi.Input[str]] = None,
                 values: Optional[pulumi.Input[str]] = None,
                 wait: Optional[pulumi.Input[bool]] = None,
                 __props__=None,
                 __name__=None,
                 __opts__=None):
        """
        Provides a Rancher App v2 resource. This can be used to manage helm charts for Rancher v2 environments and retrieve their information. App v2 resource is available at Rancher v2.5.x and above.

        ## Example Usage

        ```python
        import pulumi
        import pulumi_rancher2 as rancher2

        # Create a new Rancher2 App V2 using
        foo = rancher2.AppV2("foo",
            cluster_id="<CLUSTER_ID>",
            namespace="cattle-monitoring-system",
            repo_name="rancher-charts",
            chart_name="rancher-monitoring",
            chart_version="9.4.200",
            values=(lambda path: open(path).read())("values.yaml"))
        ```

        ## Import

        V2 apps can be imported using the Rancher cluster ID and App V2 name.

        ```sh
         $ pulumi import rancher2:index/appV2:AppV2 foo &lt;CLUSTER_ID&gt;.&lt;APP_V2_NAME&gt;
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[Mapping[str, Any]] annotations: Annotations for the app v2 (map)
        :param pulumi.Input[str] chart_name: The app v2 chart name (string)
        :param pulumi.Input[str] chart_version: The app v2 chart version (string)
        :param pulumi.Input[bool] cleanup_on_fail: Cleanup app v2 on failed chart upgrade. Default: `false` (bool)
        :param pulumi.Input[str] cluster_id: The cluster id of the app (string)
        :param pulumi.Input[bool] disable_hooks: Disable app v2 chart hooks. Default: `false` (bool)
        :param pulumi.Input[bool] disable_open_api_validation: Disable app V2 Open API Validation. Default: `false` (bool)
        :param pulumi.Input[bool] force_upgrade: Force app V2 chart upgrade. Default: `false` (bool)
        :param pulumi.Input[Mapping[str, Any]] labels: Labels for the app v2 (map)
        :param pulumi.Input[str] name: The name of the app v2 (string)
        :param pulumi.Input[str] namespace: The namespace of the app v2 (string)
        :param pulumi.Input[str] project_id: Deploy the app v2 within project ID (string)
        :param pulumi.Input[str] repo_name: Repo name (string)
        :param pulumi.Input[str] values: The app v2 values yaml. Yaml format is required (string)
        :param pulumi.Input[bool] wait: Wait until app is deployed. Default: `true` (bool)
        """
        if __name__ is not None:
            warnings.warn("explicit use of __name__ is deprecated", DeprecationWarning)
            resource_name = __name__
        if __opts__ is not None:
            warnings.warn("explicit use of __opts__ is deprecated, use 'opts' instead", DeprecationWarning)
            opts = __opts__
        if opts is None:
            opts = pulumi.ResourceOptions()
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.version is None:
            opts.version = _utilities.get_version()
        if opts.id is None:
            if __props__ is not None:
                raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
            __props__ = dict()

            __props__['annotations'] = annotations
            if chart_name is None and not opts.urn:
                raise TypeError("Missing required property 'chart_name'")
            __props__['chart_name'] = chart_name
            __props__['chart_version'] = chart_version
            __props__['cleanup_on_fail'] = cleanup_on_fail
            if cluster_id is None and not opts.urn:
                raise TypeError("Missing required property 'cluster_id'")
            __props__['cluster_id'] = cluster_id
            __props__['disable_hooks'] = disable_hooks
            __props__['disable_open_api_validation'] = disable_open_api_validation
            __props__['force_upgrade'] = force_upgrade
            __props__['labels'] = labels
            __props__['name'] = name
            if namespace is None and not opts.urn:
                raise TypeError("Missing required property 'namespace'")
            __props__['namespace'] = namespace
            __props__['project_id'] = project_id
            if repo_name is None and not opts.urn:
                raise TypeError("Missing required property 'repo_name'")
            __props__['repo_name'] = repo_name
            __props__['values'] = values
            __props__['wait'] = wait
            __props__['cluster_name'] = None
        super(AppV2, __self__).__init__(
            'rancher2:index/appV2:AppV2',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            annotations: Optional[pulumi.Input[Mapping[str, Any]]] = None,
            chart_name: Optional[pulumi.Input[str]] = None,
            chart_version: Optional[pulumi.Input[str]] = None,
            cleanup_on_fail: Optional[pulumi.Input[bool]] = None,
            cluster_id: Optional[pulumi.Input[str]] = None,
            cluster_name: Optional[pulumi.Input[str]] = None,
            disable_hooks: Optional[pulumi.Input[bool]] = None,
            disable_open_api_validation: Optional[pulumi.Input[bool]] = None,
            force_upgrade: Optional[pulumi.Input[bool]] = None,
            labels: Optional[pulumi.Input[Mapping[str, Any]]] = None,
            name: Optional[pulumi.Input[str]] = None,
            namespace: Optional[pulumi.Input[str]] = None,
            project_id: Optional[pulumi.Input[str]] = None,
            repo_name: Optional[pulumi.Input[str]] = None,
            values: Optional[pulumi.Input[str]] = None,
            wait: Optional[pulumi.Input[bool]] = None) -> 'AppV2':
        """
        Get an existing AppV2 resource's state with the given name, id, and optional extra
        properties used to qualify the lookup.

        :param str resource_name: The unique name of the resulting resource.
        :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[Mapping[str, Any]] annotations: Annotations for the app v2 (map)
        :param pulumi.Input[str] chart_name: The app v2 chart name (string)
        :param pulumi.Input[str] chart_version: The app v2 chart version (string)
        :param pulumi.Input[bool] cleanup_on_fail: Cleanup app v2 on failed chart upgrade. Default: `false` (bool)
        :param pulumi.Input[str] cluster_id: The cluster id of the app (string)
        :param pulumi.Input[str] cluster_name: (Computed) The cluster name of the app (string)
        :param pulumi.Input[bool] disable_hooks: Disable app v2 chart hooks. Default: `false` (bool)
        :param pulumi.Input[bool] disable_open_api_validation: Disable app V2 Open API Validation. Default: `false` (bool)
        :param pulumi.Input[bool] force_upgrade: Force app V2 chart upgrade. Default: `false` (bool)
        :param pulumi.Input[Mapping[str, Any]] labels: Labels for the app v2 (map)
        :param pulumi.Input[str] name: The name of the app v2 (string)
        :param pulumi.Input[str] namespace: The namespace of the app v2 (string)
        :param pulumi.Input[str] project_id: Deploy the app v2 within project ID (string)
        :param pulumi.Input[str] repo_name: Repo name (string)
        :param pulumi.Input[str] values: The app v2 values yaml. Yaml format is required (string)
        :param pulumi.Input[bool] wait: Wait until app is deployed. Default: `true` (bool)
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = dict()

        __props__["annotations"] = annotations
        __props__["chart_name"] = chart_name
        __props__["chart_version"] = chart_version
        __props__["cleanup_on_fail"] = cleanup_on_fail
        __props__["cluster_id"] = cluster_id
        __props__["cluster_name"] = cluster_name
        __props__["disable_hooks"] = disable_hooks
        __props__["disable_open_api_validation"] = disable_open_api_validation
        __props__["force_upgrade"] = force_upgrade
        __props__["labels"] = labels
        __props__["name"] = name
        __props__["namespace"] = namespace
        __props__["project_id"] = project_id
        __props__["repo_name"] = repo_name
        __props__["values"] = values
        __props__["wait"] = wait
        return AppV2(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter
    def annotations(self) -> pulumi.Output[Mapping[str, Any]]:
        """
        Annotations for the app v2 (map)
        """
        return pulumi.get(self, "annotations")

    @property
    @pulumi.getter(name="chartName")
    def chart_name(self) -> pulumi.Output[str]:
        """
        The app v2 chart name (string)
        """
        return pulumi.get(self, "chart_name")

    @property
    @pulumi.getter(name="chartVersion")
    def chart_version(self) -> pulumi.Output[str]:
        """
        The app v2 chart version (string)
        """
        return pulumi.get(self, "chart_version")

    @property
    @pulumi.getter(name="cleanupOnFail")
    def cleanup_on_fail(self) -> pulumi.Output[Optional[bool]]:
        """
        Cleanup app v2 on failed chart upgrade. Default: `false` (bool)
        """
        return pulumi.get(self, "cleanup_on_fail")

    @property
    @pulumi.getter(name="clusterId")
    def cluster_id(self) -> pulumi.Output[str]:
        """
        The cluster id of the app (string)
        """
        return pulumi.get(self, "cluster_id")

    @property
    @pulumi.getter(name="clusterName")
    def cluster_name(self) -> pulumi.Output[str]:
        """
        (Computed) The cluster name of the app (string)
        """
        return pulumi.get(self, "cluster_name")

    @property
    @pulumi.getter(name="disableHooks")
    def disable_hooks(self) -> pulumi.Output[Optional[bool]]:
        """
        Disable app v2 chart hooks. Default: `false` (bool)
        """
        return pulumi.get(self, "disable_hooks")

    @property
    @pulumi.getter(name="disableOpenApiValidation")
    def disable_open_api_validation(self) -> pulumi.Output[Optional[bool]]:
        """
        Disable app V2 Open API Validation. Default: `false` (bool)
        """
        return pulumi.get(self, "disable_open_api_validation")

    @property
    @pulumi.getter(name="forceUpgrade")
    def force_upgrade(self) -> pulumi.Output[Optional[bool]]:
        """
        Force app V2 chart upgrade. Default: `false` (bool)
        """
        return pulumi.get(self, "force_upgrade")

    @property
    @pulumi.getter
    def labels(self) -> pulumi.Output[Mapping[str, Any]]:
        """
        Labels for the app v2 (map)
        """
        return pulumi.get(self, "labels")

    @property
    @pulumi.getter
    def name(self) -> pulumi.Output[str]:
        """
        The name of the app v2 (string)
        """
        return pulumi.get(self, "name")

    @property
    @pulumi.getter
    def namespace(self) -> pulumi.Output[str]:
        """
        The namespace of the app v2 (string)
        """
        return pulumi.get(self, "namespace")

    @property
    @pulumi.getter(name="projectId")
    def project_id(self) -> pulumi.Output[Optional[str]]:
        """
        Deploy the app v2 within project ID (string)
        """
        return pulumi.get(self, "project_id")

    @property
    @pulumi.getter(name="repoName")
    def repo_name(self) -> pulumi.Output[str]:
        """
        Repo name (string)
        """
        return pulumi.get(self, "repo_name")

    @property
    @pulumi.getter
    def values(self) -> pulumi.Output[Optional[str]]:
        """
        The app v2 values yaml. Yaml format is required (string)
        """
        return pulumi.get(self, "values")

    @property
    @pulumi.getter
    def wait(self) -> pulumi.Output[Optional[bool]]:
        """
        Wait until app is deployed. Default: `true` (bool)
        """
        return pulumi.get(self, "wait")

    def translate_output_property(self, prop):
        return _tables.CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop

    def translate_input_property(self, prop):
        return _tables.SNAKE_TO_CAMEL_CASE_TABLE.get(prop) or prop

