# coding=utf-8
# *** WARNING: this file was generated by pulumi-language-python. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import builtins as _builtins
import warnings
import sys
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
if sys.version_info >= (3, 11):
    from typing import NotRequired, TypedDict, TypeAlias
else:
    from typing_extensions import NotRequired, TypedDict, TypeAlias
from . import _utilities
from . import outputs
from ._inputs import *

__all__ = [
    'GetStorageCredentialResult',
    'AwaitableGetStorageCredentialResult',
    'get_storage_credential',
    'get_storage_credential_output',
]

@pulumi.output_type
class GetStorageCredentialResult:
    """
    A collection of values returned by getStorageCredential.
    """
    def __init__(__self__, id=None, name=None, provider_config=None, storage_credential_info=None):
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if name and not isinstance(name, str):
            raise TypeError("Expected argument 'name' to be a str")
        pulumi.set(__self__, "name", name)
        if provider_config and not isinstance(provider_config, dict):
            raise TypeError("Expected argument 'provider_config' to be a dict")
        pulumi.set(__self__, "provider_config", provider_config)
        if storage_credential_info and not isinstance(storage_credential_info, dict):
            raise TypeError("Expected argument 'storage_credential_info' to be a dict")
        pulumi.set(__self__, "storage_credential_info", storage_credential_info)

    @_builtins.property
    @pulumi.getter
    def id(self) -> _builtins.str:
        """
        Unique ID of storage credential.
        """
        return pulumi.get(self, "id")

    @_builtins.property
    @pulumi.getter
    def name(self) -> _builtins.str:
        return pulumi.get(self, "name")

    @_builtins.property
    @pulumi.getter(name="providerConfig")
    def provider_config(self) -> Optional['outputs.GetStorageCredentialProviderConfigResult']:
        return pulumi.get(self, "provider_config")

    @_builtins.property
    @pulumi.getter(name="storageCredentialInfo")
    def storage_credential_info(self) -> 'outputs.GetStorageCredentialStorageCredentialInfoResult':
        """
        array of objects with information about storage credential.
        """
        return pulumi.get(self, "storage_credential_info")


class AwaitableGetStorageCredentialResult(GetStorageCredentialResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetStorageCredentialResult(
            id=self.id,
            name=self.name,
            provider_config=self.provider_config,
            storage_credential_info=self.storage_credential_info)


def get_storage_credential(id: Optional[_builtins.str] = None,
                           name: Optional[_builtins.str] = None,
                           provider_config: Optional[Union['GetStorageCredentialProviderConfigArgs', 'GetStorageCredentialProviderConfigArgsDict']] = None,
                           storage_credential_info: Optional[Union['GetStorageCredentialStorageCredentialInfoArgs', 'GetStorageCredentialStorageCredentialInfoArgsDict']] = None,
                           opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetStorageCredentialResult:
    """
    Retrieves details about a StorageCredential that were created by Pulumi or manually.

    > This data source can only be used with a workspace-level provider!

    ## Example Usage

    Getting details of an existing storage credential in the metastore

    ```python
    import pulumi
    import pulumi_databricks as databricks

    this = databricks.get_storage_credential(name="this")
    pulumi.export("createdBy", this.storage_credential_info.created_by)
    ```

    ## Related Resources

    The following resources are used in the same context:

    * get_storage_credentials to get names of all credentials
    * StorageCredential to manage Storage Credentials within Unity Catalog.


    :param _builtins.str id: Unique ID of storage credential.
    :param _builtins.str name: The name of the storage credential
    :param Union['GetStorageCredentialProviderConfigArgs', 'GetStorageCredentialProviderConfigArgsDict'] provider_config: Configure the provider for management through account provider. This block consists of the following fields:
    :param Union['GetStorageCredentialStorageCredentialInfoArgs', 'GetStorageCredentialStorageCredentialInfoArgsDict'] storage_credential_info: array of objects with information about storage credential.
    """
    __args__ = dict()
    __args__['id'] = id
    __args__['name'] = name
    __args__['providerConfig'] = provider_config
    __args__['storageCredentialInfo'] = storage_credential_info
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('databricks:index/getStorageCredential:getStorageCredential', __args__, opts=opts, typ=GetStorageCredentialResult).value

    return AwaitableGetStorageCredentialResult(
        id=pulumi.get(__ret__, 'id'),
        name=pulumi.get(__ret__, 'name'),
        provider_config=pulumi.get(__ret__, 'provider_config'),
        storage_credential_info=pulumi.get(__ret__, 'storage_credential_info'))
def get_storage_credential_output(id: Optional[pulumi.Input[Optional[_builtins.str]]] = None,
                                  name: Optional[pulumi.Input[_builtins.str]] = None,
                                  provider_config: Optional[pulumi.Input[Optional[Union['GetStorageCredentialProviderConfigArgs', 'GetStorageCredentialProviderConfigArgsDict']]]] = None,
                                  storage_credential_info: Optional[pulumi.Input[Optional[Union['GetStorageCredentialStorageCredentialInfoArgs', 'GetStorageCredentialStorageCredentialInfoArgsDict']]]] = None,
                                  opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetStorageCredentialResult]:
    """
    Retrieves details about a StorageCredential that were created by Pulumi or manually.

    > This data source can only be used with a workspace-level provider!

    ## Example Usage

    Getting details of an existing storage credential in the metastore

    ```python
    import pulumi
    import pulumi_databricks as databricks

    this = databricks.get_storage_credential(name="this")
    pulumi.export("createdBy", this.storage_credential_info.created_by)
    ```

    ## Related Resources

    The following resources are used in the same context:

    * get_storage_credentials to get names of all credentials
    * StorageCredential to manage Storage Credentials within Unity Catalog.


    :param _builtins.str id: Unique ID of storage credential.
    :param _builtins.str name: The name of the storage credential
    :param Union['GetStorageCredentialProviderConfigArgs', 'GetStorageCredentialProviderConfigArgsDict'] provider_config: Configure the provider for management through account provider. This block consists of the following fields:
    :param Union['GetStorageCredentialStorageCredentialInfoArgs', 'GetStorageCredentialStorageCredentialInfoArgsDict'] storage_credential_info: array of objects with information about storage credential.
    """
    __args__ = dict()
    __args__['id'] = id
    __args__['name'] = name
    __args__['providerConfig'] = provider_config
    __args__['storageCredentialInfo'] = storage_credential_info
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('databricks:index/getStorageCredential:getStorageCredential', __args__, opts=opts, typ=GetStorageCredentialResult)
    return __ret__.apply(lambda __response__: GetStorageCredentialResult(
        id=pulumi.get(__response__, 'id'),
        name=pulumi.get(__response__, 'name'),
        provider_config=pulumi.get(__response__, 'provider_config'),
        storage_credential_info=pulumi.get(__response__, 'storage_credential_info')))
