# 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 Union
from .. import utilities, tables


class Assignment(pulumi.CustomResource):
    blueprint_name: pulumi.Output[str]
    """
    The name of the blueprint assigned
    """
    description: pulumi.Output[str]
    """
    The Description on the Blueprint
    """
    display_name: pulumi.Output[str]
    """
    The display name of the blueprint
    """
    identity: pulumi.Output[dict]
    location: pulumi.Output[str]
    """
    The Azure location of the Assignment.
    """
    lock_exclude_principals: pulumi.Output[list]
    """
    a list of up to 5 Principal IDs that are permitted to bypass the locks applied by the Blueprint.
    """
    lock_mode: pulumi.Output[str]
    """
    The locking mode of the Blueprint Assignment.  One of `None` (Default), `AllResourcesReadOnly`, or `AlResourcesDoNotDelete`.
    """
    name: pulumi.Output[str]
    """
    The name of the Blueprint Assignment
    """
    parameter_values: pulumi.Output[str]
    """
    a JSON string to supply Blueprint Assignment parameter values.
    """
    resource_groups: pulumi.Output[str]
    """
    a JSON string to supply the Blueprint Resource Group information.
    """
    target_subscription_id: pulumi.Output[str]
    """
    The Subscription ID the Blueprint Published Version is to be applied to.
    """
    type: pulumi.Output[str]
    """
    The Identity type for the Managed Service Identity. Currently only `UserAssigned` is supported.
    """
    version_id: pulumi.Output[str]
    """
    The ID of the Published Version of the blueprint to be assigned.
    """
    def __init__(__self__, resource_name, opts=None, identity=None, location=None, lock_exclude_principals=None, lock_mode=None, name=None, parameter_values=None, resource_groups=None, target_subscription_id=None, version_id=None, __props__=None, __name__=None, __opts__=None):
        """
        Create a Assignment 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[str] location: The Azure location of the Assignment.
        :param pulumi.Input[list] lock_exclude_principals: a list of up to 5 Principal IDs that are permitted to bypass the locks applied by the Blueprint.
        :param pulumi.Input[str] lock_mode: The locking mode of the Blueprint Assignment.  One of `None` (Default), `AllResourcesReadOnly`, or `AlResourcesDoNotDelete`.
        :param pulumi.Input[str] name: The name of the Blueprint Assignment
        :param pulumi.Input[str] parameter_values: a JSON string to supply Blueprint Assignment parameter values.
        :param pulumi.Input[str] resource_groups: a JSON string to supply the Blueprint Resource Group information.
        :param pulumi.Input[str] target_subscription_id: The Subscription ID the Blueprint Published Version is to be applied to.
        :param pulumi.Input[str] version_id: The ID of the Published Version of the blueprint to be assigned.

        The **identity** object supports the following:

          * `identityIds` (`pulumi.Input[list]`)
          * `principal_id` (`pulumi.Input[str]`)
          * `tenant_id` (`pulumi.Input[str]`)
          * `type` (`pulumi.Input[str]`) - The Identity type for the Managed Service Identity. Currently only `UserAssigned` is supported.
        """
        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__['identity'] = identity
            __props__['location'] = location
            __props__['lock_exclude_principals'] = lock_exclude_principals
            __props__['lock_mode'] = lock_mode
            __props__['name'] = name
            __props__['parameter_values'] = parameter_values
            __props__['resource_groups'] = resource_groups
            if target_subscription_id is None:
                raise TypeError("Missing required property 'target_subscription_id'")
            __props__['target_subscription_id'] = target_subscription_id
            if version_id is None:
                raise TypeError("Missing required property 'version_id'")
            __props__['version_id'] = version_id
            __props__['blueprint_name'] = None
            __props__['description'] = None
            __props__['display_name'] = None
            __props__['type'] = None
        super(Assignment, __self__).__init__(
            'azure:blueprint/assignment:Assignment',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name, id, opts=None, blueprint_name=None, description=None, display_name=None, identity=None, location=None, lock_exclude_principals=None, lock_mode=None, name=None, parameter_values=None, resource_groups=None, target_subscription_id=None, type=None, version_id=None):
        """
        Get an existing Assignment 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[str] blueprint_name: The name of the blueprint assigned
        :param pulumi.Input[str] description: The Description on the Blueprint
        :param pulumi.Input[str] display_name: The display name of the blueprint
        :param pulumi.Input[str] location: The Azure location of the Assignment.
        :param pulumi.Input[list] lock_exclude_principals: a list of up to 5 Principal IDs that are permitted to bypass the locks applied by the Blueprint.
        :param pulumi.Input[str] lock_mode: The locking mode of the Blueprint Assignment.  One of `None` (Default), `AllResourcesReadOnly`, or `AlResourcesDoNotDelete`.
        :param pulumi.Input[str] name: The name of the Blueprint Assignment
        :param pulumi.Input[str] parameter_values: a JSON string to supply Blueprint Assignment parameter values.
        :param pulumi.Input[str] resource_groups: a JSON string to supply the Blueprint Resource Group information.
        :param pulumi.Input[str] target_subscription_id: The Subscription ID the Blueprint Published Version is to be applied to.
        :param pulumi.Input[str] type: The Identity type for the Managed Service Identity. Currently only `UserAssigned` is supported.
        :param pulumi.Input[str] version_id: The ID of the Published Version of the blueprint to be assigned.

        The **identity** object supports the following:

          * `identityIds` (`pulumi.Input[list]`)
          * `principal_id` (`pulumi.Input[str]`)
          * `tenant_id` (`pulumi.Input[str]`)
          * `type` (`pulumi.Input[str]`) - The Identity type for the Managed Service Identity. Currently only `UserAssigned` is supported.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = dict()

        __props__["blueprint_name"] = blueprint_name
        __props__["description"] = description
        __props__["display_name"] = display_name
        __props__["identity"] = identity
        __props__["location"] = location
        __props__["lock_exclude_principals"] = lock_exclude_principals
        __props__["lock_mode"] = lock_mode
        __props__["name"] = name
        __props__["parameter_values"] = parameter_values
        __props__["resource_groups"] = resource_groups
        __props__["target_subscription_id"] = target_subscription_id
        __props__["type"] = type
        __props__["version_id"] = version_id
        return Assignment(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
