def METHOD_NAME(expand: Optional[str] = None,
                      resource_group_name: Optional[str] = None,
                      template_spec_name: Optional[str] = None,
                      opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetTemplateSpecResult:
    """
    Gets a Template Spec with a given name.
    Azure REST API version: 2022-02-01.
    :param str expand: Allows for expansion of additional Template Spec details in the response. Optional.
    :param str resource_group_name: The name of the resource group. The name is case insensitive.
    :param str template_spec_name: Name of the Template Spec.
    """
    __args__ = dict()
    __args__['expand'] = expand
    __args__['resourceGroupName'] = resource_group_name
    __args__['templateSpecName'] = template_spec_name
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('azure-native:resources:getTemplateSpec', __args__, opts=opts, typ=GetTemplateSpecResult).value
    return AwaitableGetTemplateSpecResult(
        description=pulumi.get(__ret__, 'description'),
        display_name=pulumi.get(__ret__, 'display_name'),
        id=pulumi.get(__ret__, 'id'),
        location=pulumi.get(__ret__, 'location'),
        metadata=pulumi.get(__ret__, 'metadata'),
        name=pulumi.get(__ret__, 'name'),
        system_data=pulumi.get(__ret__, 'system_data'),
        tags=pulumi.get(__ret__, 'tags'),
        type=pulumi.get(__ret__, 'type'),
        versions=pulumi.get(__ret__, 'versions'))