# 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__ = ['GitCredentialArgs', 'GitCredential']

@pulumi.input_type
class GitCredentialArgs:
    def __init__(__self__, *,
                 git_provider: pulumi.Input[_builtins.str],
                 force: Optional[pulumi.Input[_builtins.bool]] = None,
                 git_email: Optional[pulumi.Input[_builtins.str]] = None,
                 git_username: Optional[pulumi.Input[_builtins.str]] = None,
                 is_default_for_provider: Optional[pulumi.Input[_builtins.bool]] = None,
                 name: Optional[pulumi.Input[_builtins.str]] = None,
                 personal_access_token: Optional[pulumi.Input[_builtins.str]] = None,
                 principal_id: Optional[pulumi.Input[_builtins.str]] = None):
        """
        The set of arguments for constructing a GitCredential resource.
        :param pulumi.Input[_builtins.str] git_provider: case insensitive name of the Git provider.  Following values are supported right now (could be a subject for a change, consult [Git Credentials API documentation](https://docs.databricks.com/dev-tools/api/latest/gitcredentials.html)): `gitHub`, `gitHubEnterprise`, `bitbucketCloud`, `bitbucketServer`, `azureDevOpsServices`, `gitLab`, `gitLabEnterpriseEdition`, `awsCodeCommit`, `azureDevOpsServicesAad`.
        :param pulumi.Input[_builtins.bool] force: specify if settings need to be enforced (i.e., to overwrite previously set credential for service principals).
        :param pulumi.Input[_builtins.str] git_email: The email associated with your Git provider user account. Used for authentication with the remote repository and also sets the author & committer identity for commits.
        :param pulumi.Input[_builtins.str] git_username: user name at Git provider.  For most Git providers it is only used to set the Git committer & author names for commits, however it may be required for authentication depending on your Git provider / token requirements.
        :param pulumi.Input[_builtins.bool] is_default_for_provider: boolean flag specifying if the credential is the default for the given provider type.
        :param pulumi.Input[_builtins.str] name: the name of the git credential, used for identification and ease of lookup.
        :param pulumi.Input[_builtins.str] personal_access_token: The personal access token used to authenticate to the corresponding Git provider. If value is not provided, it's sourced from the first environment variable of `GITHUB_TOKEN`, `GITLAB_TOKEN`, or `AZDO_PERSONAL_ACCESS_TOKEN`, that has a non-empty value.
        """
        pulumi.set(__self__, "git_provider", git_provider)
        if force is not None:
            pulumi.set(__self__, "force", force)
        if git_email is not None:
            pulumi.set(__self__, "git_email", git_email)
        if git_username is not None:
            pulumi.set(__self__, "git_username", git_username)
        if is_default_for_provider is not None:
            pulumi.set(__self__, "is_default_for_provider", is_default_for_provider)
        if name is not None:
            pulumi.set(__self__, "name", name)
        if personal_access_token is not None:
            pulumi.set(__self__, "personal_access_token", personal_access_token)
        if principal_id is not None:
            pulumi.set(__self__, "principal_id", principal_id)

    @_builtins.property
    @pulumi.getter(name="gitProvider")
    def git_provider(self) -> pulumi.Input[_builtins.str]:
        """
        case insensitive name of the Git provider.  Following values are supported right now (could be a subject for a change, consult [Git Credentials API documentation](https://docs.databricks.com/dev-tools/api/latest/gitcredentials.html)): `gitHub`, `gitHubEnterprise`, `bitbucketCloud`, `bitbucketServer`, `azureDevOpsServices`, `gitLab`, `gitLabEnterpriseEdition`, `awsCodeCommit`, `azureDevOpsServicesAad`.
        """
        return pulumi.get(self, "git_provider")

    @git_provider.setter
    def git_provider(self, value: pulumi.Input[_builtins.str]):
        pulumi.set(self, "git_provider", value)

    @_builtins.property
    @pulumi.getter
    def force(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        specify if settings need to be enforced (i.e., to overwrite previously set credential for service principals).
        """
        return pulumi.get(self, "force")

    @force.setter
    def force(self, value: Optional[pulumi.Input[_builtins.bool]]):
        pulumi.set(self, "force", value)

    @_builtins.property
    @pulumi.getter(name="gitEmail")
    def git_email(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The email associated with your Git provider user account. Used for authentication with the remote repository and also sets the author & committer identity for commits.
        """
        return pulumi.get(self, "git_email")

    @git_email.setter
    def git_email(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "git_email", value)

    @_builtins.property
    @pulumi.getter(name="gitUsername")
    def git_username(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        user name at Git provider.  For most Git providers it is only used to set the Git committer & author names for commits, however it may be required for authentication depending on your Git provider / token requirements.
        """
        return pulumi.get(self, "git_username")

    @git_username.setter
    def git_username(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "git_username", value)

    @_builtins.property
    @pulumi.getter(name="isDefaultForProvider")
    def is_default_for_provider(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        boolean flag specifying if the credential is the default for the given provider type.
        """
        return pulumi.get(self, "is_default_for_provider")

    @is_default_for_provider.setter
    def is_default_for_provider(self, value: Optional[pulumi.Input[_builtins.bool]]):
        pulumi.set(self, "is_default_for_provider", value)

    @_builtins.property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        the name of the git credential, used for identification and ease of lookup.
        """
        return pulumi.get(self, "name")

    @name.setter
    def name(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "name", value)

    @_builtins.property
    @pulumi.getter(name="personalAccessToken")
    def personal_access_token(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The personal access token used to authenticate to the corresponding Git provider. If value is not provided, it's sourced from the first environment variable of `GITHUB_TOKEN`, `GITLAB_TOKEN`, or `AZDO_PERSONAL_ACCESS_TOKEN`, that has a non-empty value.
        """
        return pulumi.get(self, "personal_access_token")

    @personal_access_token.setter
    def personal_access_token(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "personal_access_token", value)

    @_builtins.property
    @pulumi.getter(name="principalId")
    def principal_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        return pulumi.get(self, "principal_id")

    @principal_id.setter
    def principal_id(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "principal_id", value)


@pulumi.input_type
class _GitCredentialState:
    def __init__(__self__, *,
                 force: Optional[pulumi.Input[_builtins.bool]] = None,
                 git_email: Optional[pulumi.Input[_builtins.str]] = None,
                 git_provider: Optional[pulumi.Input[_builtins.str]] = None,
                 git_username: Optional[pulumi.Input[_builtins.str]] = None,
                 is_default_for_provider: Optional[pulumi.Input[_builtins.bool]] = None,
                 name: Optional[pulumi.Input[_builtins.str]] = None,
                 personal_access_token: Optional[pulumi.Input[_builtins.str]] = None,
                 principal_id: Optional[pulumi.Input[_builtins.str]] = None):
        """
        Input properties used for looking up and filtering GitCredential resources.
        :param pulumi.Input[_builtins.bool] force: specify if settings need to be enforced (i.e., to overwrite previously set credential for service principals).
        :param pulumi.Input[_builtins.str] git_email: The email associated with your Git provider user account. Used for authentication with the remote repository and also sets the author & committer identity for commits.
        :param pulumi.Input[_builtins.str] git_provider: case insensitive name of the Git provider.  Following values are supported right now (could be a subject for a change, consult [Git Credentials API documentation](https://docs.databricks.com/dev-tools/api/latest/gitcredentials.html)): `gitHub`, `gitHubEnterprise`, `bitbucketCloud`, `bitbucketServer`, `azureDevOpsServices`, `gitLab`, `gitLabEnterpriseEdition`, `awsCodeCommit`, `azureDevOpsServicesAad`.
        :param pulumi.Input[_builtins.str] git_username: user name at Git provider.  For most Git providers it is only used to set the Git committer & author names for commits, however it may be required for authentication depending on your Git provider / token requirements.
        :param pulumi.Input[_builtins.bool] is_default_for_provider: boolean flag specifying if the credential is the default for the given provider type.
        :param pulumi.Input[_builtins.str] name: the name of the git credential, used for identification and ease of lookup.
        :param pulumi.Input[_builtins.str] personal_access_token: The personal access token used to authenticate to the corresponding Git provider. If value is not provided, it's sourced from the first environment variable of `GITHUB_TOKEN`, `GITLAB_TOKEN`, or `AZDO_PERSONAL_ACCESS_TOKEN`, that has a non-empty value.
        """
        if force is not None:
            pulumi.set(__self__, "force", force)
        if git_email is not None:
            pulumi.set(__self__, "git_email", git_email)
        if git_provider is not None:
            pulumi.set(__self__, "git_provider", git_provider)
        if git_username is not None:
            pulumi.set(__self__, "git_username", git_username)
        if is_default_for_provider is not None:
            pulumi.set(__self__, "is_default_for_provider", is_default_for_provider)
        if name is not None:
            pulumi.set(__self__, "name", name)
        if personal_access_token is not None:
            pulumi.set(__self__, "personal_access_token", personal_access_token)
        if principal_id is not None:
            pulumi.set(__self__, "principal_id", principal_id)

    @_builtins.property
    @pulumi.getter
    def force(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        specify if settings need to be enforced (i.e., to overwrite previously set credential for service principals).
        """
        return pulumi.get(self, "force")

    @force.setter
    def force(self, value: Optional[pulumi.Input[_builtins.bool]]):
        pulumi.set(self, "force", value)

    @_builtins.property
    @pulumi.getter(name="gitEmail")
    def git_email(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The email associated with your Git provider user account. Used for authentication with the remote repository and also sets the author & committer identity for commits.
        """
        return pulumi.get(self, "git_email")

    @git_email.setter
    def git_email(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "git_email", value)

    @_builtins.property
    @pulumi.getter(name="gitProvider")
    def git_provider(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        case insensitive name of the Git provider.  Following values are supported right now (could be a subject for a change, consult [Git Credentials API documentation](https://docs.databricks.com/dev-tools/api/latest/gitcredentials.html)): `gitHub`, `gitHubEnterprise`, `bitbucketCloud`, `bitbucketServer`, `azureDevOpsServices`, `gitLab`, `gitLabEnterpriseEdition`, `awsCodeCommit`, `azureDevOpsServicesAad`.
        """
        return pulumi.get(self, "git_provider")

    @git_provider.setter
    def git_provider(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "git_provider", value)

    @_builtins.property
    @pulumi.getter(name="gitUsername")
    def git_username(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        user name at Git provider.  For most Git providers it is only used to set the Git committer & author names for commits, however it may be required for authentication depending on your Git provider / token requirements.
        """
        return pulumi.get(self, "git_username")

    @git_username.setter
    def git_username(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "git_username", value)

    @_builtins.property
    @pulumi.getter(name="isDefaultForProvider")
    def is_default_for_provider(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        boolean flag specifying if the credential is the default for the given provider type.
        """
        return pulumi.get(self, "is_default_for_provider")

    @is_default_for_provider.setter
    def is_default_for_provider(self, value: Optional[pulumi.Input[_builtins.bool]]):
        pulumi.set(self, "is_default_for_provider", value)

    @_builtins.property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        the name of the git credential, used for identification and ease of lookup.
        """
        return pulumi.get(self, "name")

    @name.setter
    def name(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "name", value)

    @_builtins.property
    @pulumi.getter(name="personalAccessToken")
    def personal_access_token(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The personal access token used to authenticate to the corresponding Git provider. If value is not provided, it's sourced from the first environment variable of `GITHUB_TOKEN`, `GITLAB_TOKEN`, or `AZDO_PERSONAL_ACCESS_TOKEN`, that has a non-empty value.
        """
        return pulumi.get(self, "personal_access_token")

    @personal_access_token.setter
    def personal_access_token(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "personal_access_token", value)

    @_builtins.property
    @pulumi.getter(name="principalId")
    def principal_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        return pulumi.get(self, "principal_id")

    @principal_id.setter
    def principal_id(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "principal_id", value)


@pulumi.type_token("databricks:index/gitCredential:GitCredential")
class GitCredential(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 force: Optional[pulumi.Input[_builtins.bool]] = None,
                 git_email: Optional[pulumi.Input[_builtins.str]] = None,
                 git_provider: Optional[pulumi.Input[_builtins.str]] = None,
                 git_username: Optional[pulumi.Input[_builtins.str]] = None,
                 is_default_for_provider: Optional[pulumi.Input[_builtins.bool]] = None,
                 name: Optional[pulumi.Input[_builtins.str]] = None,
                 personal_access_token: Optional[pulumi.Input[_builtins.str]] = None,
                 principal_id: Optional[pulumi.Input[_builtins.str]] = None,
                 __props__=None):
        """
        This resource allows you to manage credentials for [Databricks Repos](https://docs.databricks.com/repos.html) using [Git Credentials API](https://docs.databricks.com/dev-tools/api/latest/gitcredentials.html).

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

        ## Example Usage

        ### Git credential that uses personal access token

        You can declare Pulumi-managed Git credential using following code:

        ```python
        import pulumi
        import pulumi_databricks as databricks

        ado = databricks.GitCredential("ado",
            git_username="myuser",
            git_provider="azureDevOpsServices",
            personal_access_token="sometoken")
        ```

        ### Git credential configuration for Azure Service Principal and Azure DevOps

        Databricks now supports Azure service principal federation to Azure DevOps.  Follow the [documentation](https://learn.microsoft.com/en-us/azure/databricks/repos/automate-with-ms-entra) on how to configure service principal federation, and after everything is configured, it could be used as simple as:

        ```python
        import pulumi
        import pulumi_databricks as databricks

        ado = databricks.GitCredential("ado", git_provider="azureDevOpsServicesAad")
        ```

        ## Related Resources

        The following resources are often used in the same context:

        * Repo to manage Databricks Repos.

        ## Import

        The resource cluster can be imported using ID of Git credential that could be obtained via REST API:

        hcl

        import {

          to = databricks_git_credential.this

          id = "<git-credential-id>"

        }

        Alternatively, when using `terraform` version 1.4 or earlier, import using the `pulumi import` command:

        bash

        ```sh
        $ pulumi import databricks:index/gitCredential:GitCredential this <git-credential-id>
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[_builtins.bool] force: specify if settings need to be enforced (i.e., to overwrite previously set credential for service principals).
        :param pulumi.Input[_builtins.str] git_email: The email associated with your Git provider user account. Used for authentication with the remote repository and also sets the author & committer identity for commits.
        :param pulumi.Input[_builtins.str] git_provider: case insensitive name of the Git provider.  Following values are supported right now (could be a subject for a change, consult [Git Credentials API documentation](https://docs.databricks.com/dev-tools/api/latest/gitcredentials.html)): `gitHub`, `gitHubEnterprise`, `bitbucketCloud`, `bitbucketServer`, `azureDevOpsServices`, `gitLab`, `gitLabEnterpriseEdition`, `awsCodeCommit`, `azureDevOpsServicesAad`.
        :param pulumi.Input[_builtins.str] git_username: user name at Git provider.  For most Git providers it is only used to set the Git committer & author names for commits, however it may be required for authentication depending on your Git provider / token requirements.
        :param pulumi.Input[_builtins.bool] is_default_for_provider: boolean flag specifying if the credential is the default for the given provider type.
        :param pulumi.Input[_builtins.str] name: the name of the git credential, used for identification and ease of lookup.
        :param pulumi.Input[_builtins.str] personal_access_token: The personal access token used to authenticate to the corresponding Git provider. If value is not provided, it's sourced from the first environment variable of `GITHUB_TOKEN`, `GITLAB_TOKEN`, or `AZDO_PERSONAL_ACCESS_TOKEN`, that has a non-empty value.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: GitCredentialArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        This resource allows you to manage credentials for [Databricks Repos](https://docs.databricks.com/repos.html) using [Git Credentials API](https://docs.databricks.com/dev-tools/api/latest/gitcredentials.html).

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

        ## Example Usage

        ### Git credential that uses personal access token

        You can declare Pulumi-managed Git credential using following code:

        ```python
        import pulumi
        import pulumi_databricks as databricks

        ado = databricks.GitCredential("ado",
            git_username="myuser",
            git_provider="azureDevOpsServices",
            personal_access_token="sometoken")
        ```

        ### Git credential configuration for Azure Service Principal and Azure DevOps

        Databricks now supports Azure service principal federation to Azure DevOps.  Follow the [documentation](https://learn.microsoft.com/en-us/azure/databricks/repos/automate-with-ms-entra) on how to configure service principal federation, and after everything is configured, it could be used as simple as:

        ```python
        import pulumi
        import pulumi_databricks as databricks

        ado = databricks.GitCredential("ado", git_provider="azureDevOpsServicesAad")
        ```

        ## Related Resources

        The following resources are often used in the same context:

        * Repo to manage Databricks Repos.

        ## Import

        The resource cluster can be imported using ID of Git credential that could be obtained via REST API:

        hcl

        import {

          to = databricks_git_credential.this

          id = "<git-credential-id>"

        }

        Alternatively, when using `terraform` version 1.4 or earlier, import using the `pulumi import` command:

        bash

        ```sh
        $ pulumi import databricks:index/gitCredential:GitCredential this <git-credential-id>
        ```

        :param str resource_name: The name of the resource.
        :param GitCredentialArgs args: The arguments to use to populate this resource's properties.
        :param pulumi.ResourceOptions opts: Options for the resource.
        """
        ...
    def __init__(__self__, resource_name: str, *args, **kwargs):
        resource_args, opts = _utilities.get_resource_args_opts(GitCredentialArgs, pulumi.ResourceOptions, *args, **kwargs)
        if resource_args is not None:
            __self__._internal_init(resource_name, opts, **resource_args.__dict__)
        else:
            __self__._internal_init(resource_name, *args, **kwargs)

    def _internal_init(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 force: Optional[pulumi.Input[_builtins.bool]] = None,
                 git_email: Optional[pulumi.Input[_builtins.str]] = None,
                 git_provider: Optional[pulumi.Input[_builtins.str]] = None,
                 git_username: Optional[pulumi.Input[_builtins.str]] = None,
                 is_default_for_provider: Optional[pulumi.Input[_builtins.bool]] = None,
                 name: Optional[pulumi.Input[_builtins.str]] = None,
                 personal_access_token: Optional[pulumi.Input[_builtins.str]] = None,
                 principal_id: Optional[pulumi.Input[_builtins.str]] = None,
                 __props__=None):
        opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        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__ = GitCredentialArgs.__new__(GitCredentialArgs)

            __props__.__dict__["force"] = force
            __props__.__dict__["git_email"] = git_email
            if git_provider is None and not opts.urn:
                raise TypeError("Missing required property 'git_provider'")
            __props__.__dict__["git_provider"] = git_provider
            __props__.__dict__["git_username"] = git_username
            __props__.__dict__["is_default_for_provider"] = is_default_for_provider
            __props__.__dict__["name"] = name
            __props__.__dict__["personal_access_token"] = personal_access_token
            __props__.__dict__["principal_id"] = principal_id
        super(GitCredential, __self__).__init__(
            'databricks:index/gitCredential:GitCredential',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            force: Optional[pulumi.Input[_builtins.bool]] = None,
            git_email: Optional[pulumi.Input[_builtins.str]] = None,
            git_provider: Optional[pulumi.Input[_builtins.str]] = None,
            git_username: Optional[pulumi.Input[_builtins.str]] = None,
            is_default_for_provider: Optional[pulumi.Input[_builtins.bool]] = None,
            name: Optional[pulumi.Input[_builtins.str]] = None,
            personal_access_token: Optional[pulumi.Input[_builtins.str]] = None,
            principal_id: Optional[pulumi.Input[_builtins.str]] = None) -> 'GitCredential':
        """
        Get an existing GitCredential 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 pulumi.Input[str] id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[_builtins.bool] force: specify if settings need to be enforced (i.e., to overwrite previously set credential for service principals).
        :param pulumi.Input[_builtins.str] git_email: The email associated with your Git provider user account. Used for authentication with the remote repository and also sets the author & committer identity for commits.
        :param pulumi.Input[_builtins.str] git_provider: case insensitive name of the Git provider.  Following values are supported right now (could be a subject for a change, consult [Git Credentials API documentation](https://docs.databricks.com/dev-tools/api/latest/gitcredentials.html)): `gitHub`, `gitHubEnterprise`, `bitbucketCloud`, `bitbucketServer`, `azureDevOpsServices`, `gitLab`, `gitLabEnterpriseEdition`, `awsCodeCommit`, `azureDevOpsServicesAad`.
        :param pulumi.Input[_builtins.str] git_username: user name at Git provider.  For most Git providers it is only used to set the Git committer & author names for commits, however it may be required for authentication depending on your Git provider / token requirements.
        :param pulumi.Input[_builtins.bool] is_default_for_provider: boolean flag specifying if the credential is the default for the given provider type.
        :param pulumi.Input[_builtins.str] name: the name of the git credential, used for identification and ease of lookup.
        :param pulumi.Input[_builtins.str] personal_access_token: The personal access token used to authenticate to the corresponding Git provider. If value is not provided, it's sourced from the first environment variable of `GITHUB_TOKEN`, `GITLAB_TOKEN`, or `AZDO_PERSONAL_ACCESS_TOKEN`, that has a non-empty value.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _GitCredentialState.__new__(_GitCredentialState)

        __props__.__dict__["force"] = force
        __props__.__dict__["git_email"] = git_email
        __props__.__dict__["git_provider"] = git_provider
        __props__.__dict__["git_username"] = git_username
        __props__.__dict__["is_default_for_provider"] = is_default_for_provider
        __props__.__dict__["name"] = name
        __props__.__dict__["personal_access_token"] = personal_access_token
        __props__.__dict__["principal_id"] = principal_id
        return GitCredential(resource_name, opts=opts, __props__=__props__)

    @_builtins.property
    @pulumi.getter
    def force(self) -> pulumi.Output[Optional[_builtins.bool]]:
        """
        specify if settings need to be enforced (i.e., to overwrite previously set credential for service principals).
        """
        return pulumi.get(self, "force")

    @_builtins.property
    @pulumi.getter(name="gitEmail")
    def git_email(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        The email associated with your Git provider user account. Used for authentication with the remote repository and also sets the author & committer identity for commits.
        """
        return pulumi.get(self, "git_email")

    @_builtins.property
    @pulumi.getter(name="gitProvider")
    def git_provider(self) -> pulumi.Output[_builtins.str]:
        """
        case insensitive name of the Git provider.  Following values are supported right now (could be a subject for a change, consult [Git Credentials API documentation](https://docs.databricks.com/dev-tools/api/latest/gitcredentials.html)): `gitHub`, `gitHubEnterprise`, `bitbucketCloud`, `bitbucketServer`, `azureDevOpsServices`, `gitLab`, `gitLabEnterpriseEdition`, `awsCodeCommit`, `azureDevOpsServicesAad`.
        """
        return pulumi.get(self, "git_provider")

    @_builtins.property
    @pulumi.getter(name="gitUsername")
    def git_username(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        user name at Git provider.  For most Git providers it is only used to set the Git committer & author names for commits, however it may be required for authentication depending on your Git provider / token requirements.
        """
        return pulumi.get(self, "git_username")

    @_builtins.property
    @pulumi.getter(name="isDefaultForProvider")
    def is_default_for_provider(self) -> pulumi.Output[Optional[_builtins.bool]]:
        """
        boolean flag specifying if the credential is the default for the given provider type.
        """
        return pulumi.get(self, "is_default_for_provider")

    @_builtins.property
    @pulumi.getter
    def name(self) -> pulumi.Output[_builtins.str]:
        """
        the name of the git credential, used for identification and ease of lookup.
        """
        return pulumi.get(self, "name")

    @_builtins.property
    @pulumi.getter(name="personalAccessToken")
    def personal_access_token(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        The personal access token used to authenticate to the corresponding Git provider. If value is not provided, it's sourced from the first environment variable of `GITHUB_TOKEN`, `GITLAB_TOKEN`, or `AZDO_PERSONAL_ACCESS_TOKEN`, that has a non-empty value.
        """
        return pulumi.get(self, "personal_access_token")

    @_builtins.property
    @pulumi.getter(name="principalId")
    def principal_id(self) -> pulumi.Output[Optional[_builtins.str]]:
        return pulumi.get(self, "principal_id")

