# 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

__all__ = [
    'GetCmacResult',
    'AwaitableGetCmacResult',
    'get_cmac',
    'get_cmac_output',
]

@pulumi.output_type
class GetCmacResult:
    """
    A collection of values returned by getCmac.
    """
    def __init__(__self__, batch_inputs=None, batch_results=None, cmac=None, id=None, input=None, key_version=None, mac_length=None, name=None, namespace=None, path=None, url_mac_length=None):
        if batch_inputs and not isinstance(batch_inputs, list):
            raise TypeError("Expected argument 'batch_inputs' to be a list")
        pulumi.set(__self__, "batch_inputs", batch_inputs)
        if batch_results and not isinstance(batch_results, list):
            raise TypeError("Expected argument 'batch_results' to be a list")
        pulumi.set(__self__, "batch_results", batch_results)
        if cmac and not isinstance(cmac, str):
            raise TypeError("Expected argument 'cmac' to be a str")
        pulumi.set(__self__, "cmac", cmac)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if input and not isinstance(input, str):
            raise TypeError("Expected argument 'input' to be a str")
        pulumi.set(__self__, "input", input)
        if key_version and not isinstance(key_version, int):
            raise TypeError("Expected argument 'key_version' to be a int")
        pulumi.set(__self__, "key_version", key_version)
        if mac_length and not isinstance(mac_length, int):
            raise TypeError("Expected argument 'mac_length' to be a int")
        pulumi.set(__self__, "mac_length", mac_length)
        if name and not isinstance(name, str):
            raise TypeError("Expected argument 'name' to be a str")
        pulumi.set(__self__, "name", name)
        if namespace and not isinstance(namespace, str):
            raise TypeError("Expected argument 'namespace' to be a str")
        pulumi.set(__self__, "namespace", namespace)
        if path and not isinstance(path, str):
            raise TypeError("Expected argument 'path' to be a str")
        pulumi.set(__self__, "path", path)
        if url_mac_length and not isinstance(url_mac_length, int):
            raise TypeError("Expected argument 'url_mac_length' to be a int")
        pulumi.set(__self__, "url_mac_length", url_mac_length)

    @_builtins.property
    @pulumi.getter(name="batchInputs")
    def batch_inputs(self) -> Optional[Sequence[Mapping[str, _builtins.str]]]:
        return pulumi.get(self, "batch_inputs")

    @_builtins.property
    @pulumi.getter(name="batchResults")
    def batch_results(self) -> Sequence[Mapping[str, _builtins.str]]:
        """
        The results returned from Vault if using `batch_input`
        """
        return pulumi.get(self, "batch_results")

    @_builtins.property
    @pulumi.getter
    def cmac(self) -> _builtins.str:
        """
        The CMAC returned from Vault if using `input`
        """
        return pulumi.get(self, "cmac")

    @_builtins.property
    @pulumi.getter
    def id(self) -> _builtins.str:
        """
        The provider-assigned unique ID for this managed resource.
        """
        return pulumi.get(self, "id")

    @_builtins.property
    @pulumi.getter
    def input(self) -> Optional[_builtins.str]:
        return pulumi.get(self, "input")

    @_builtins.property
    @pulumi.getter(name="keyVersion")
    def key_version(self) -> Optional[_builtins.int]:
        return pulumi.get(self, "key_version")

    @_builtins.property
    @pulumi.getter(name="macLength")
    def mac_length(self) -> Optional[_builtins.int]:
        return pulumi.get(self, "mac_length")

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

    @_builtins.property
    @pulumi.getter
    def namespace(self) -> Optional[_builtins.str]:
        return pulumi.get(self, "namespace")

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

    @_builtins.property
    @pulumi.getter(name="urlMacLength")
    def url_mac_length(self) -> Optional[_builtins.int]:
        return pulumi.get(self, "url_mac_length")


class AwaitableGetCmacResult(GetCmacResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetCmacResult(
            batch_inputs=self.batch_inputs,
            batch_results=self.batch_results,
            cmac=self.cmac,
            id=self.id,
            input=self.input,
            key_version=self.key_version,
            mac_length=self.mac_length,
            name=self.name,
            namespace=self.namespace,
            path=self.path,
            url_mac_length=self.url_mac_length)


def get_cmac(batch_inputs: Optional[Sequence[Mapping[str, _builtins.str]]] = None,
             batch_results: Optional[Sequence[Mapping[str, _builtins.str]]] = None,
             cmac: Optional[_builtins.str] = None,
             input: Optional[_builtins.str] = None,
             key_version: Optional[_builtins.int] = None,
             mac_length: Optional[_builtins.int] = None,
             name: Optional[_builtins.str] = None,
             namespace: Optional[_builtins.str] = None,
             path: Optional[_builtins.str] = None,
             url_mac_length: Optional[_builtins.int] = None,
             opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetCmacResult:
    """
    This is a data source which can be used to generate a CMAC using a Vault Transit key.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_vault as vault

    test = vault.transit.get_cmac(path="transit",
        name="test",
        input="aGVsbG8gd29ybGQ=")
    ```


    :param Sequence[Mapping[str, _builtins.str]] batch_results: The results returned from Vault if using `batch_input`
    :param _builtins.str cmac: The CMAC returned from Vault if using `input`
    """
    __args__ = dict()
    __args__['batchInputs'] = batch_inputs
    __args__['batchResults'] = batch_results
    __args__['cmac'] = cmac
    __args__['input'] = input
    __args__['keyVersion'] = key_version
    __args__['macLength'] = mac_length
    __args__['name'] = name
    __args__['namespace'] = namespace
    __args__['path'] = path
    __args__['urlMacLength'] = url_mac_length
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('vault:transit/getCmac:getCmac', __args__, opts=opts, typ=GetCmacResult).value

    return AwaitableGetCmacResult(
        batch_inputs=pulumi.get(__ret__, 'batch_inputs'),
        batch_results=pulumi.get(__ret__, 'batch_results'),
        cmac=pulumi.get(__ret__, 'cmac'),
        id=pulumi.get(__ret__, 'id'),
        input=pulumi.get(__ret__, 'input'),
        key_version=pulumi.get(__ret__, 'key_version'),
        mac_length=pulumi.get(__ret__, 'mac_length'),
        name=pulumi.get(__ret__, 'name'),
        namespace=pulumi.get(__ret__, 'namespace'),
        path=pulumi.get(__ret__, 'path'),
        url_mac_length=pulumi.get(__ret__, 'url_mac_length'))
def get_cmac_output(batch_inputs: Optional[pulumi.Input[Optional[Sequence[Mapping[str, _builtins.str]]]]] = None,
                    batch_results: Optional[pulumi.Input[Optional[Sequence[Mapping[str, _builtins.str]]]]] = None,
                    cmac: Optional[pulumi.Input[Optional[_builtins.str]]] = None,
                    input: Optional[pulumi.Input[Optional[_builtins.str]]] = None,
                    key_version: Optional[pulumi.Input[Optional[_builtins.int]]] = None,
                    mac_length: Optional[pulumi.Input[Optional[_builtins.int]]] = None,
                    name: Optional[pulumi.Input[_builtins.str]] = None,
                    namespace: Optional[pulumi.Input[Optional[_builtins.str]]] = None,
                    path: Optional[pulumi.Input[_builtins.str]] = None,
                    url_mac_length: Optional[pulumi.Input[Optional[_builtins.int]]] = None,
                    opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetCmacResult]:
    """
    This is a data source which can be used to generate a CMAC using a Vault Transit key.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_vault as vault

    test = vault.transit.get_cmac(path="transit",
        name="test",
        input="aGVsbG8gd29ybGQ=")
    ```


    :param Sequence[Mapping[str, _builtins.str]] batch_results: The results returned from Vault if using `batch_input`
    :param _builtins.str cmac: The CMAC returned from Vault if using `input`
    """
    __args__ = dict()
    __args__['batchInputs'] = batch_inputs
    __args__['batchResults'] = batch_results
    __args__['cmac'] = cmac
    __args__['input'] = input
    __args__['keyVersion'] = key_version
    __args__['macLength'] = mac_length
    __args__['name'] = name
    __args__['namespace'] = namespace
    __args__['path'] = path
    __args__['urlMacLength'] = url_mac_length
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('vault:transit/getCmac:getCmac', __args__, opts=opts, typ=GetCmacResult)
    return __ret__.apply(lambda __response__: GetCmacResult(
        batch_inputs=pulumi.get(__response__, 'batch_inputs'),
        batch_results=pulumi.get(__response__, 'batch_results'),
        cmac=pulumi.get(__response__, 'cmac'),
        id=pulumi.get(__response__, 'id'),
        input=pulumi.get(__response__, 'input'),
        key_version=pulumi.get(__response__, 'key_version'),
        mac_length=pulumi.get(__response__, 'mac_length'),
        name=pulumi.get(__response__, 'name'),
        namespace=pulumi.get(__response__, 'namespace'),
        path=pulumi.get(__response__, 'path'),
        url_mac_length=pulumi.get(__response__, 'url_mac_length')))
