# 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 json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from . import utilities, tables

class App(pulumi.CustomResource):
    annotations: pulumi.Output[dict]
    """
    Annotations for App object (map)
    """
    answers: pulumi.Output[dict]
    """
    Answers for the app template. If modified, app will be upgraded (map)
    """
    catalog_name: pulumi.Output[str]
    """
    Catalog name of the app. If modified, app will be upgraded. For use scoped catalogs:
    * add cluster ID before name, `c-XXXXX:<name>`
    * add project ID before name, `p-XXXXX:<name>`
    """
    description: pulumi.Output[str]
    """
    Description for the app (string)
    """
    external_id: pulumi.Output[str]
    """
    (Computed) The url of the app template on a catalog (string)
    """
    force_upgrade: pulumi.Output[bool]
    """
    Force app upgrade (string)
    """
    labels: pulumi.Output[dict]
    """
    Labels for App object (map)
    """
    name: pulumi.Output[str]
    """
    The name of the app (string)
    """
    project_id: pulumi.Output[str]
    """
    The project id where the app will be installed (string)
    """
    revision_id: pulumi.Output[str]
    """
    Current revision id for the app. If modified, If this argument is provided or modified, app will be rollbacked to `revision_id` (string)
    """
    target_namespace: pulumi.Output[str]
    """
    The namespace name where the app will be installed (string)
    """
    template_name: pulumi.Output[str]
    """
    Template name of the app. If modified, app will be upgraded (string)
    """
    template_version: pulumi.Output[str]
    """
    Template version of the app. If modified, app will be upgraded. Default: `latest` (string)
    """
    values_yaml: pulumi.Output[str]
    """
    values.yaml base64 encoded file content for the app template. If modified, app will be upgraded (string)
    """
    def __init__(__self__, resource_name, opts=None, annotations=None, answers=None, catalog_name=None, description=None, force_upgrade=None, labels=None, name=None, project_id=None, revision_id=None, target_namespace=None, template_name=None, template_version=None, values_yaml=None, __props__=None, __name__=None, __opts__=None):
        """
        Create a App resource with the given unique name, props, and options.
        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[dict] annotations: Annotations for App object (map)
        :param pulumi.Input[dict] answers: Answers for the app template. If modified, app will be upgraded (map)
        :param pulumi.Input[str] catalog_name: Catalog name of the app. If modified, app will be upgraded. For use scoped catalogs:
               * add cluster ID before name, `c-XXXXX:<name>`
               * add project ID before name, `p-XXXXX:<name>`
        :param pulumi.Input[str] description: Description for the app (string)
        :param pulumi.Input[bool] force_upgrade: Force app upgrade (string)
        :param pulumi.Input[dict] labels: Labels for App object (map)
        :param pulumi.Input[str] name: The name of the app (string)
        :param pulumi.Input[str] project_id: The project id where the app will be installed (string)
        :param pulumi.Input[str] revision_id: Current revision id for the app. If modified, If this argument is provided or modified, app will be rollbacked to `revision_id` (string)
        :param pulumi.Input[str] target_namespace: The namespace name where the app will be installed (string)
        :param pulumi.Input[str] template_name: Template name of the app. If modified, app will be upgraded (string)
        :param pulumi.Input[str] template_version: Template version of the app. If modified, app will be upgraded. Default: `latest` (string)
        :param pulumi.Input[str] values_yaml: values.yaml base64 encoded file content for the app template. If modified, app will be upgraded (string)
        """
        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
            __props__['answers'] = answers
            if catalog_name is None:
                raise TypeError("Missing required property 'catalog_name'")
            __props__['catalog_name'] = catalog_name
            __props__['description'] = description
            __props__['force_upgrade'] = force_upgrade
            __props__['labels'] = labels
            __props__['name'] = name
            if project_id is None:
                raise TypeError("Missing required property 'project_id'")
            __props__['project_id'] = project_id
            __props__['revision_id'] = revision_id
            if target_namespace is None:
                raise TypeError("Missing required property 'target_namespace'")
            __props__['target_namespace'] = target_namespace
            if template_name is None:
                raise TypeError("Missing required property 'template_name'")
            __props__['template_name'] = template_name
            __props__['template_version'] = template_version
            __props__['values_yaml'] = values_yaml
            __props__['external_id'] = None
        super(App, __self__).__init__(
            'rancher2:index/app:App',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name, id, opts=None, annotations=None, answers=None, catalog_name=None, description=None, external_id=None, force_upgrade=None, labels=None, name=None, project_id=None, revision_id=None, target_namespace=None, template_name=None, template_version=None, values_yaml=None):
        """
        Get an existing App 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 str id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[dict] annotations: Annotations for App object (map)
        :param pulumi.Input[dict] answers: Answers for the app template. If modified, app will be upgraded (map)
        :param pulumi.Input[str] catalog_name: Catalog name of the app. If modified, app will be upgraded. For use scoped catalogs:
               * add cluster ID before name, `c-XXXXX:<name>`
               * add project ID before name, `p-XXXXX:<name>`
        :param pulumi.Input[str] description: Description for the app (string)
        :param pulumi.Input[str] external_id: (Computed) The url of the app template on a catalog (string)
        :param pulumi.Input[bool] force_upgrade: Force app upgrade (string)
        :param pulumi.Input[dict] labels: Labels for App object (map)
        :param pulumi.Input[str] name: The name of the app (string)
        :param pulumi.Input[str] project_id: The project id where the app will be installed (string)
        :param pulumi.Input[str] revision_id: Current revision id for the app. If modified, If this argument is provided or modified, app will be rollbacked to `revision_id` (string)
        :param pulumi.Input[str] target_namespace: The namespace name where the app will be installed (string)
        :param pulumi.Input[str] template_name: Template name of the app. If modified, app will be upgraded (string)
        :param pulumi.Input[str] template_version: Template version of the app. If modified, app will be upgraded. Default: `latest` (string)
        :param pulumi.Input[str] values_yaml: values.yaml base64 encoded file content for the app template. If modified, app will be upgraded (string)
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = dict()

        __props__["annotations"] = annotations
        __props__["answers"] = answers
        __props__["catalog_name"] = catalog_name
        __props__["description"] = description
        __props__["external_id"] = external_id
        __props__["force_upgrade"] = force_upgrade
        __props__["labels"] = labels
        __props__["name"] = name
        __props__["project_id"] = project_id
        __props__["revision_id"] = revision_id
        __props__["target_namespace"] = target_namespace
        __props__["template_name"] = template_name
        __props__["template_version"] = template_version
        __props__["values_yaml"] = values_yaml
        return App(resource_name, opts=opts, __props__=__props__)
    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

