# 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 DatasetBlobStorage(pulumi.CustomResource):
    container_name: pulumi.Output[str]
    """
    The name of the storage account container to be shared with the receiver. Changing this forces a new Data Share Blob Storage Dataset to be created.
    """
    data_share_id: pulumi.Output[str]
    """
    The ID of the Data Share in which this Data Share Blob Storage Dataset should be created. Changing this forces a new Data Share Blob Storage Dataset to be created.
    """
    display_name: pulumi.Output[str]
    """
    The name of the Data Share Dataset.
    """
    file_path: pulumi.Output[str]
    """
    The path of the file in the storage container to be shared with the receiver. Changing this forces a new Data Share Blob Storage Dataset to be created.
    """
    folder_path: pulumi.Output[str]
    """
    The path of the folder in the storage container to be shared with the receiver. Changing this forces a new Data Share Blob Storage Dataset to be created.
    """
    name: pulumi.Output[str]
    """
    The name which should be used for this Data Share Blob Storage Dataset. Changing this forces a new Data Share Blob Storage Dataset to be created.
    """
    storage_account: pulumi.Output[dict]
    """
    A `storage_account` block as defined below.

      * `name` (`str`) - The name of the storage account to be shared with the receiver. Changing this forces a new Data Share Blob Storage Dataset to be created.
      * `resource_group_name` (`str`) - The resource group name of the storage account to be shared with the receiver. Changing this forces a new Data Share Blob Storage Dataset to be created.
      * `subscription_id` (`str`) - The subscription id of the storage account to be shared with the receiver. Changing this forces a new Data Share Blob Storage Dataset to be created.
    """
    def __init__(__self__, resource_name, opts=None, container_name=None, data_share_id=None, file_path=None, folder_path=None, name=None, storage_account=None, __props__=None, __name__=None, __opts__=None):
        """
        Manages a Data Share Blob Storage Dataset.

        ## Example Usage

        ```python
        import pulumi
        import pulumi_azure as azure
        import pulumi_azuread as azuread

        example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
        example_account = azure.datashare.Account("exampleAccount",
            location=example_resource_group.location,
            resource_group_name=example_resource_group.name,
            identity={
                "type": "SystemAssigned",
            })
        example_share = azure.datashare.Share("exampleShare",
            account_id=example_account.id,
            kind="CopyBased")
        example_storage_account_account = azure.storage.Account("exampleStorage/accountAccount",
            resource_group_name=example_resource_group.name,
            location=example_resource_group.location,
            account_tier="Standard",
            account_replication_type="RAGRS")
        example_container = azure.storage.Container("exampleContainer",
            storage_account_name=example_storage / account_account["name"],
            container_access_type="container")
        example_service_principal = example_account.name.apply(lambda name: azuread.get_service_principal(display_name=name))
        example_assignment = azure.authorization.Assignment("exampleAssignment",
            scope=example_storage / account_account["id"],
            role_definition_name="Storage Blob Data Reader",
            principal_id=example_service_principal.object_id)
        example_dataset_blob_storage = azure.datashare.DatasetBlobStorage("exampleDatasetBlobStorage",
            data_share_id=example_share.id,
            container_name=example_container.name,
            storage_account={
                "name": example_storage / account_account["name"],
                "resource_group_name": example_storage / account_account["resourceGroupName"],
                "subscription_id": "00000000-0000-0000-0000-000000000000",
            },
            file_path="myfile.txt",
            opts=ResourceOptions(depends_on=[example_assignment]))
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] container_name: The name of the storage account container to be shared with the receiver. Changing this forces a new Data Share Blob Storage Dataset to be created.
        :param pulumi.Input[str] data_share_id: The ID of the Data Share in which this Data Share Blob Storage Dataset should be created. Changing this forces a new Data Share Blob Storage Dataset to be created.
        :param pulumi.Input[str] file_path: The path of the file in the storage container to be shared with the receiver. Changing this forces a new Data Share Blob Storage Dataset to be created.
        :param pulumi.Input[str] folder_path: The path of the folder in the storage container to be shared with the receiver. Changing this forces a new Data Share Blob Storage Dataset to be created.
        :param pulumi.Input[str] name: The name which should be used for this Data Share Blob Storage Dataset. Changing this forces a new Data Share Blob Storage Dataset to be created.
        :param pulumi.Input[dict] storage_account: A `storage_account` block as defined below.

        The **storage_account** object supports the following:

          * `name` (`pulumi.Input[str]`) - The name of the storage account to be shared with the receiver. Changing this forces a new Data Share Blob Storage Dataset to be created.
          * `resource_group_name` (`pulumi.Input[str]`) - The resource group name of the storage account to be shared with the receiver. Changing this forces a new Data Share Blob Storage Dataset to be created.
          * `subscription_id` (`pulumi.Input[str]`) - The subscription id of the storage account to be shared with the receiver. Changing this forces a new Data Share Blob Storage Dataset to be created.
        """
        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()

            if container_name is None:
                raise TypeError("Missing required property 'container_name'")
            __props__['container_name'] = container_name
            if data_share_id is None:
                raise TypeError("Missing required property 'data_share_id'")
            __props__['data_share_id'] = data_share_id
            __props__['file_path'] = file_path
            __props__['folder_path'] = folder_path
            __props__['name'] = name
            if storage_account is None:
                raise TypeError("Missing required property 'storage_account'")
            __props__['storage_account'] = storage_account
            __props__['display_name'] = None
        super(DatasetBlobStorage, __self__).__init__(
            'azure:datashare/datasetBlobStorage:DatasetBlobStorage',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name, id, opts=None, container_name=None, data_share_id=None, display_name=None, file_path=None, folder_path=None, name=None, storage_account=None):
        """
        Get an existing DatasetBlobStorage 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] container_name: The name of the storage account container to be shared with the receiver. Changing this forces a new Data Share Blob Storage Dataset to be created.
        :param pulumi.Input[str] data_share_id: The ID of the Data Share in which this Data Share Blob Storage Dataset should be created. Changing this forces a new Data Share Blob Storage Dataset to be created.
        :param pulumi.Input[str] display_name: The name of the Data Share Dataset.
        :param pulumi.Input[str] file_path: The path of the file in the storage container to be shared with the receiver. Changing this forces a new Data Share Blob Storage Dataset to be created.
        :param pulumi.Input[str] folder_path: The path of the folder in the storage container to be shared with the receiver. Changing this forces a new Data Share Blob Storage Dataset to be created.
        :param pulumi.Input[str] name: The name which should be used for this Data Share Blob Storage Dataset. Changing this forces a new Data Share Blob Storage Dataset to be created.
        :param pulumi.Input[dict] storage_account: A `storage_account` block as defined below.

        The **storage_account** object supports the following:

          * `name` (`pulumi.Input[str]`) - The name of the storage account to be shared with the receiver. Changing this forces a new Data Share Blob Storage Dataset to be created.
          * `resource_group_name` (`pulumi.Input[str]`) - The resource group name of the storage account to be shared with the receiver. Changing this forces a new Data Share Blob Storage Dataset to be created.
          * `subscription_id` (`pulumi.Input[str]`) - The subscription id of the storage account to be shared with the receiver. Changing this forces a new Data Share Blob Storage Dataset to be created.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = dict()

        __props__["container_name"] = container_name
        __props__["data_share_id"] = data_share_id
        __props__["display_name"] = display_name
        __props__["file_path"] = file_path
        __props__["folder_path"] = folder_path
        __props__["name"] = name
        __props__["storage_account"] = storage_account
        return DatasetBlobStorage(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
