# 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 copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from . import outputs
from ._inputs import *

__all__ = ['ItemEntitlementArgs', 'ItemEntitlement']

@pulumi.input_type
class ItemEntitlementArgs:
    def __init__(__self__, *,
                 catalog_item_id: pulumi.Input[str],
                 project_id: pulumi.Input[str]):
        """
        The set of arguments for constructing a ItemEntitlement resource.
        :param pulumi.Input[str] catalog_item_id: The id of the catalog item to create the entitlement.
        :param pulumi.Input[str] project_id: The id of the project this entity belongs to.
        """
        pulumi.set(__self__, "catalog_item_id", catalog_item_id)
        pulumi.set(__self__, "project_id", project_id)

    @property
    @pulumi.getter(name="catalogItemId")
    def catalog_item_id(self) -> pulumi.Input[str]:
        """
        The id of the catalog item to create the entitlement.
        """
        return pulumi.get(self, "catalog_item_id")

    @catalog_item_id.setter
    def catalog_item_id(self, value: pulumi.Input[str]):
        pulumi.set(self, "catalog_item_id", value)

    @property
    @pulumi.getter(name="projectId")
    def project_id(self) -> pulumi.Input[str]:
        """
        The id of the project this entity belongs to.
        """
        return pulumi.get(self, "project_id")

    @project_id.setter
    def project_id(self, value: pulumi.Input[str]):
        pulumi.set(self, "project_id", value)


@pulumi.input_type
class _ItemEntitlementState:
    def __init__(__self__, *,
                 catalog_item_id: Optional[pulumi.Input[str]] = None,
                 definitions: Optional[pulumi.Input[Sequence[pulumi.Input['ItemEntitlementDefinitionArgs']]]] = None,
                 project_id: Optional[pulumi.Input[str]] = None):
        """
        Input properties used for looking up and filtering ItemEntitlement resources.
        :param pulumi.Input[str] catalog_item_id: The id of the catalog item to create the entitlement.
        :param pulumi.Input[Sequence[pulumi.Input['ItemEntitlementDefinitionArgs']]] definitions: Represents a catalog item that is linked to a project via an entitlement.
        :param pulumi.Input[str] project_id: The id of the project this entity belongs to.
        """
        if catalog_item_id is not None:
            pulumi.set(__self__, "catalog_item_id", catalog_item_id)
        if definitions is not None:
            pulumi.set(__self__, "definitions", definitions)
        if project_id is not None:
            pulumi.set(__self__, "project_id", project_id)

    @property
    @pulumi.getter(name="catalogItemId")
    def catalog_item_id(self) -> Optional[pulumi.Input[str]]:
        """
        The id of the catalog item to create the entitlement.
        """
        return pulumi.get(self, "catalog_item_id")

    @catalog_item_id.setter
    def catalog_item_id(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "catalog_item_id", value)

    @property
    @pulumi.getter
    def definitions(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['ItemEntitlementDefinitionArgs']]]]:
        """
        Represents a catalog item that is linked to a project via an entitlement.
        """
        return pulumi.get(self, "definitions")

    @definitions.setter
    def definitions(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['ItemEntitlementDefinitionArgs']]]]):
        pulumi.set(self, "definitions", value)

    @property
    @pulumi.getter(name="projectId")
    def project_id(self) -> Optional[pulumi.Input[str]]:
        """
        The id of the project this entity belongs to.
        """
        return pulumi.get(self, "project_id")

    @project_id.setter
    def project_id(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "project_id", value)


class ItemEntitlement(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 catalog_item_id: Optional[pulumi.Input[str]] = None,
                 project_id: Optional[pulumi.Input[str]] = None,
                 __props__=None):
        """
        This resource provides a way to create a catalog item entitlement in VMware vRealize Automation.

        ## Example Usage
        ### S

        ```python
        import pulumi
        import pulumiverse_vra as vra

        this = vra.catalog.ItemEntitlement("this",
            catalog_item_id=var["catalog_item_id"],
            project_id=var["project_id"])
        ```

        ## Import

        Catalog item entitlement can be imported using the id, e.g.

        ```sh
         $ pulumi import vra:catalog/itemEntitlement:ItemEntitlement this 05956583-6488-4e7d-84c9-92a7b7219a15`
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] catalog_item_id: The id of the catalog item to create the entitlement.
        :param pulumi.Input[str] project_id: The id of the project this entity belongs to.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: ItemEntitlementArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        This resource provides a way to create a catalog item entitlement in VMware vRealize Automation.

        ## Example Usage
        ### S

        ```python
        import pulumi
        import pulumiverse_vra as vra

        this = vra.catalog.ItemEntitlement("this",
            catalog_item_id=var["catalog_item_id"],
            project_id=var["project_id"])
        ```

        ## Import

        Catalog item entitlement can be imported using the id, e.g.

        ```sh
         $ pulumi import vra:catalog/itemEntitlement:ItemEntitlement this 05956583-6488-4e7d-84c9-92a7b7219a15`
        ```

        :param str resource_name: The name of the resource.
        :param ItemEntitlementArgs args: The arguments to use to populate this resource's properties.
        :param pulumi.ResourceOptions opts: Options for the resource.
        """
        ...
    def __init__(__self__, resource_name: str, *args, **kwargs):
        resource_args, opts = _utilities.get_resource_args_opts(ItemEntitlementArgs, pulumi.ResourceOptions, *args, **kwargs)
        if resource_args is not None:
            __self__._internal_init(resource_name, opts, **resource_args.__dict__)
        else:
            __self__._internal_init(resource_name, *args, **kwargs)

    def _internal_init(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 catalog_item_id: Optional[pulumi.Input[str]] = None,
                 project_id: Optional[pulumi.Input[str]] = None,
                 __props__=None):
        opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        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__ = ItemEntitlementArgs.__new__(ItemEntitlementArgs)

            if catalog_item_id is None and not opts.urn:
                raise TypeError("Missing required property 'catalog_item_id'")
            __props__.__dict__["catalog_item_id"] = catalog_item_id
            if project_id is None and not opts.urn:
                raise TypeError("Missing required property 'project_id'")
            __props__.__dict__["project_id"] = project_id
            __props__.__dict__["definitions"] = None
        super(ItemEntitlement, __self__).__init__(
            'vra:catalog/itemEntitlement:ItemEntitlement',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            catalog_item_id: Optional[pulumi.Input[str]] = None,
            definitions: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['ItemEntitlementDefinitionArgs']]]]] = None,
            project_id: Optional[pulumi.Input[str]] = None) -> 'ItemEntitlement':
        """
        Get an existing ItemEntitlement 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[str] catalog_item_id: The id of the catalog item to create the entitlement.
        :param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['ItemEntitlementDefinitionArgs']]]] definitions: Represents a catalog item that is linked to a project via an entitlement.
        :param pulumi.Input[str] project_id: The id of the project this entity belongs to.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _ItemEntitlementState.__new__(_ItemEntitlementState)

        __props__.__dict__["catalog_item_id"] = catalog_item_id
        __props__.__dict__["definitions"] = definitions
        __props__.__dict__["project_id"] = project_id
        return ItemEntitlement(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter(name="catalogItemId")
    def catalog_item_id(self) -> pulumi.Output[str]:
        """
        The id of the catalog item to create the entitlement.
        """
        return pulumi.get(self, "catalog_item_id")

    @property
    @pulumi.getter
    def definitions(self) -> pulumi.Output[Sequence['outputs.ItemEntitlementDefinition']]:
        """
        Represents a catalog item that is linked to a project via an entitlement.
        """
        return pulumi.get(self, "definitions")

    @property
    @pulumi.getter(name="projectId")
    def project_id(self) -> pulumi.Output[str]:
        """
        The id of the project this entity belongs to.
        """
        return pulumi.get(self, "project_id")

