# 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 copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import _utilities

__all__ = ['ProviderArgs', 'Provider']

@pulumi.input_type
class ProviderArgs:
    def __init__(__self__, *,
                 access_token: Optional[pulumi.Input[str]] = None,
                 api_key: Optional[pulumi.Input[str]] = None,
                 check_license: Optional[pulumi.Input[bool]] = None,
                 oidc_provider_name: Optional[pulumi.Input[str]] = None,
                 url: Optional[pulumi.Input[str]] = None):
        """
        The set of arguments for constructing a Provider resource.
        :param pulumi.Input[str] access_token: This is a access token that can be given to you by your admin under `User Management > Access Tokens`. If not set, the
               'api_key' attribute value will be used.
        :param pulumi.Input[str] api_key: API key. If `access_token` attribute, `JFROG_ACCESS_TOKEN` or `ARTIFACTORY_ACCESS_TOKEN` environment variable is set,
               the provider will ignore this attribute.
        :param pulumi.Input[bool] check_license: Toggle for pre-flight checking of Artifactory Pro and Enterprise license. Default to `true`.
        :param pulumi.Input[str] oidc_provider_name: OIDC provider name. See [Configure an OIDC
               Integration](https://jfrog.com/help/r/jfrog-platform-administration-documentation/configure-an-oidc-integration) for
               more details.
        :param pulumi.Input[str] url: Artifactory URL.
        """
        if access_token is not None:
            pulumi.set(__self__, "access_token", access_token)
        if api_key is not None:
            warnings.warn("""An upcoming version will support the option to block the usage/creation of API Keys (for admins to set on their platform).
In a future version (scheduled for end of Q3, 2023), the option to disable the usage/creation of API Keys will be available and set to disabled by default. Admins will be able to enable the usage/creation of API Keys.
By end of Q4 2024, API Keys will be deprecated all together and the option to use them will no longer be available. See [JFrog API deprecation process](https://jfrog.com/help/r/jfrog-platform-administration-documentation/jfrog-api-key-deprecation-process) for more details.""", DeprecationWarning)
            pulumi.log.warn("""api_key is deprecated: An upcoming version will support the option to block the usage/creation of API Keys (for admins to set on their platform).
In a future version (scheduled for end of Q3, 2023), the option to disable the usage/creation of API Keys will be available and set to disabled by default. Admins will be able to enable the usage/creation of API Keys.
By end of Q4 2024, API Keys will be deprecated all together and the option to use them will no longer be available. See [JFrog API deprecation process](https://jfrog.com/help/r/jfrog-platform-administration-documentation/jfrog-api-key-deprecation-process) for more details.""")
        if api_key is not None:
            pulumi.set(__self__, "api_key", api_key)
        if check_license is not None:
            warnings.warn("""Remove this attribute from your provider configuration as it is no longer used and the attribute will be removed in the next major version of the provider.""", DeprecationWarning)
            pulumi.log.warn("""check_license is deprecated: Remove this attribute from your provider configuration as it is no longer used and the attribute will be removed in the next major version of the provider.""")
        if check_license is None:
            check_license = False
        if check_license is not None:
            pulumi.set(__self__, "check_license", check_license)
        if oidc_provider_name is not None:
            pulumi.set(__self__, "oidc_provider_name", oidc_provider_name)
        if url is not None:
            pulumi.set(__self__, "url", url)

    @property
    @pulumi.getter(name="accessToken")
    def access_token(self) -> Optional[pulumi.Input[str]]:
        """
        This is a access token that can be given to you by your admin under `User Management > Access Tokens`. If not set, the
        'api_key' attribute value will be used.
        """
        return pulumi.get(self, "access_token")

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

    @property
    @pulumi.getter(name="apiKey")
    @_utilities.deprecated("""An upcoming version will support the option to block the usage/creation of API Keys (for admins to set on their platform).
In a future version (scheduled for end of Q3, 2023), the option to disable the usage/creation of API Keys will be available and set to disabled by default. Admins will be able to enable the usage/creation of API Keys.
By end of Q4 2024, API Keys will be deprecated all together and the option to use them will no longer be available. See [JFrog API deprecation process](https://jfrog.com/help/r/jfrog-platform-administration-documentation/jfrog-api-key-deprecation-process) for more details.""")
    def api_key(self) -> Optional[pulumi.Input[str]]:
        """
        API key. If `access_token` attribute, `JFROG_ACCESS_TOKEN` or `ARTIFACTORY_ACCESS_TOKEN` environment variable is set,
        the provider will ignore this attribute.
        """
        return pulumi.get(self, "api_key")

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

    @property
    @pulumi.getter(name="checkLicense")
    @_utilities.deprecated("""Remove this attribute from your provider configuration as it is no longer used and the attribute will be removed in the next major version of the provider.""")
    def check_license(self) -> Optional[pulumi.Input[bool]]:
        """
        Toggle for pre-flight checking of Artifactory Pro and Enterprise license. Default to `true`.
        """
        return pulumi.get(self, "check_license")

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

    @property
    @pulumi.getter(name="oidcProviderName")
    def oidc_provider_name(self) -> Optional[pulumi.Input[str]]:
        """
        OIDC provider name. See [Configure an OIDC
        Integration](https://jfrog.com/help/r/jfrog-platform-administration-documentation/configure-an-oidc-integration) for
        more details.
        """
        return pulumi.get(self, "oidc_provider_name")

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

    @property
    @pulumi.getter
    def url(self) -> Optional[pulumi.Input[str]]:
        """
        Artifactory URL.
        """
        return pulumi.get(self, "url")

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


class Provider(pulumi.ProviderResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 access_token: Optional[pulumi.Input[str]] = None,
                 api_key: Optional[pulumi.Input[str]] = None,
                 check_license: Optional[pulumi.Input[bool]] = None,
                 oidc_provider_name: Optional[pulumi.Input[str]] = None,
                 url: Optional[pulumi.Input[str]] = None,
                 __props__=None):
        """
        The provider type for the artifactory package. By default, resources use package-wide configuration
        settings, however an explicit `Provider` instance may be created and passed during resource
        construction to achieve fine-grained programmatic control over provider settings. See the
        [documentation](https://www.pulumi.com/docs/reference/programming-model/#providers) for more information.

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] access_token: This is a access token that can be given to you by your admin under `User Management > Access Tokens`. If not set, the
               'api_key' attribute value will be used.
        :param pulumi.Input[str] api_key: API key. If `access_token` attribute, `JFROG_ACCESS_TOKEN` or `ARTIFACTORY_ACCESS_TOKEN` environment variable is set,
               the provider will ignore this attribute.
        :param pulumi.Input[bool] check_license: Toggle for pre-flight checking of Artifactory Pro and Enterprise license. Default to `true`.
        :param pulumi.Input[str] oidc_provider_name: OIDC provider name. See [Configure an OIDC
               Integration](https://jfrog.com/help/r/jfrog-platform-administration-documentation/configure-an-oidc-integration) for
               more details.
        :param pulumi.Input[str] url: Artifactory URL.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: Optional[ProviderArgs] = None,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        The provider type for the artifactory package. By default, resources use package-wide configuration
        settings, however an explicit `Provider` instance may be created and passed during resource
        construction to achieve fine-grained programmatic control over provider settings. See the
        [documentation](https://www.pulumi.com/docs/reference/programming-model/#providers) for more information.

        :param str resource_name: The name of the resource.
        :param ProviderArgs 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(ProviderArgs, 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,
                 access_token: Optional[pulumi.Input[str]] = None,
                 api_key: Optional[pulumi.Input[str]] = None,
                 check_license: Optional[pulumi.Input[bool]] = None,
                 oidc_provider_name: Optional[pulumi.Input[str]] = None,
                 url: Optional[pulumi.Input[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__ = ProviderArgs.__new__(ProviderArgs)

            __props__.__dict__["access_token"] = None if access_token is None else pulumi.Output.secret(access_token)
            __props__.__dict__["api_key"] = None if api_key is None else pulumi.Output.secret(api_key)
            if check_license is None:
                check_license = False
            __props__.__dict__["check_license"] = pulumi.Output.from_input(check_license).apply(pulumi.runtime.to_json) if check_license is not None else None
            __props__.__dict__["oidc_provider_name"] = oidc_provider_name
            __props__.__dict__["url"] = url
        secret_opts = pulumi.ResourceOptions(additional_secret_outputs=["accessToken", "apiKey"])
        opts = pulumi.ResourceOptions.merge(opts, secret_opts)
        super(Provider, __self__).__init__(
            'artifactory',
            resource_name,
            __props__,
            opts)

    @property
    @pulumi.getter(name="accessToken")
    def access_token(self) -> pulumi.Output[Optional[str]]:
        """
        This is a access token that can be given to you by your admin under `User Management > Access Tokens`. If not set, the
        'api_key' attribute value will be used.
        """
        return pulumi.get(self, "access_token")

    @property
    @pulumi.getter(name="apiKey")
    @_utilities.deprecated("""An upcoming version will support the option to block the usage/creation of API Keys (for admins to set on their platform).
In a future version (scheduled for end of Q3, 2023), the option to disable the usage/creation of API Keys will be available and set to disabled by default. Admins will be able to enable the usage/creation of API Keys.
By end of Q4 2024, API Keys will be deprecated all together and the option to use them will no longer be available. See [JFrog API deprecation process](https://jfrog.com/help/r/jfrog-platform-administration-documentation/jfrog-api-key-deprecation-process) for more details.""")
    def api_key(self) -> pulumi.Output[Optional[str]]:
        """
        API key. If `access_token` attribute, `JFROG_ACCESS_TOKEN` or `ARTIFACTORY_ACCESS_TOKEN` environment variable is set,
        the provider will ignore this attribute.
        """
        return pulumi.get(self, "api_key")

    @property
    @pulumi.getter(name="oidcProviderName")
    def oidc_provider_name(self) -> pulumi.Output[Optional[str]]:
        """
        OIDC provider name. See [Configure an OIDC
        Integration](https://jfrog.com/help/r/jfrog-platform-administration-documentation/configure-an-oidc-integration) for
        more details.
        """
        return pulumi.get(self, "oidc_provider_name")

    @property
    @pulumi.getter
    def url(self) -> pulumi.Output[Optional[str]]:
        """
        Artifactory URL.
        """
        return pulumi.get(self, "url")

