# 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 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__ = ['ProviderArgs', 'Provider']

@pulumi.input_type
class ProviderArgs:
    def __init__(__self__, *,
                 delay: Optional[pulumi.Input[int]] = None,
                 environment: Optional[pulumi.Input[str]] = None,
                 key: Optional[pulumi.Input[str]] = None,
                 secret: Optional[pulumi.Input[str]] = None,
                 sos_endpoint: Optional[pulumi.Input[str]] = None,
                 timeout: Optional[pulumi.Input[int]] = None):
        """
        The set of arguments for constructing a Provider resource.
        :param pulumi.Input[str] key: Exoscale API key
        :param pulumi.Input[str] secret: Exoscale API secret
        :param pulumi.Input[int] timeout: Timeout in seconds for waiting on compute resources to become available (by default: 3600)
        """
        if delay is not None:
            warnings.warn("""Does nothing""", DeprecationWarning)
            pulumi.log.warn("""delay is deprecated: Does nothing""")
        if delay is not None:
            pulumi.set(__self__, "delay", delay)
        if environment is not None:
            pulumi.set(__self__, "environment", environment)
        if key is None:
            key = _utilities.get_env('EXOSCALE_API_KEY')
        if key is not None:
            pulumi.set(__self__, "key", key)
        if secret is None:
            secret = _utilities.get_env('EXOSCALE_API_SECRET')
        if secret is not None:
            pulumi.set(__self__, "secret", secret)
        if sos_endpoint is not None:
            pulumi.set(__self__, "sos_endpoint", sos_endpoint)
        if timeout is not None:
            pulumi.set(__self__, "timeout", timeout)

    @property
    @pulumi.getter
    @_utilities.deprecated("""Does nothing""")
    def delay(self) -> Optional[pulumi.Input[int]]:
        return pulumi.get(self, "delay")

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

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

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

    @property
    @pulumi.getter
    def key(self) -> Optional[pulumi.Input[str]]:
        """
        Exoscale API key
        """
        return pulumi.get(self, "key")

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

    @property
    @pulumi.getter
    def secret(self) -> Optional[pulumi.Input[str]]:
        """
        Exoscale API secret
        """
        return pulumi.get(self, "secret")

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

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

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

    @property
    @pulumi.getter
    def timeout(self) -> Optional[pulumi.Input[int]]:
        """
        Timeout in seconds for waiting on compute resources to become available (by default: 3600)
        """
        return pulumi.get(self, "timeout")

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


class Provider(pulumi.ProviderResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 delay: Optional[pulumi.Input[int]] = None,
                 environment: Optional[pulumi.Input[str]] = None,
                 key: Optional[pulumi.Input[str]] = None,
                 secret: Optional[pulumi.Input[str]] = None,
                 sos_endpoint: Optional[pulumi.Input[str]] = None,
                 timeout: Optional[pulumi.Input[int]] = None,
                 __props__=None):
        """
        The provider type for the exoscale 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] key: Exoscale API key
        :param pulumi.Input[str] secret: Exoscale API secret
        :param pulumi.Input[int] timeout: Timeout in seconds for waiting on compute resources to become available (by default: 3600)
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: Optional[ProviderArgs] = None,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        The provider type for the exoscale 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,
                 delay: Optional[pulumi.Input[int]] = None,
                 environment: Optional[pulumi.Input[str]] = None,
                 key: Optional[pulumi.Input[str]] = None,
                 secret: Optional[pulumi.Input[str]] = None,
                 sos_endpoint: Optional[pulumi.Input[str]] = None,
                 timeout: Optional[pulumi.Input[int]] = 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__["delay"] = pulumi.Output.from_input(delay).apply(pulumi.runtime.to_json) if delay is not None else None
            __props__.__dict__["environment"] = environment
            if key is None:
                key = _utilities.get_env('EXOSCALE_API_KEY')
            __props__.__dict__["key"] = None if key is None else pulumi.Output.secret(key)
            if secret is None:
                secret = _utilities.get_env('EXOSCALE_API_SECRET')
            __props__.__dict__["secret"] = None if secret is None else pulumi.Output.secret(secret)
            __props__.__dict__["sos_endpoint"] = sos_endpoint
            __props__.__dict__["timeout"] = pulumi.Output.from_input(timeout).apply(pulumi.runtime.to_json) if timeout is not None else None
        secret_opts = pulumi.ResourceOptions(additional_secret_outputs=["key", "secret"])
        opts = pulumi.ResourceOptions.merge(opts, secret_opts)
        super(Provider, __self__).__init__(
            'exoscale',
            resource_name,
            __props__,
            opts)

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

    @property
    @pulumi.getter
    def key(self) -> pulumi.Output[Optional[str]]:
        """
        Exoscale API key
        """
        return pulumi.get(self, "key")

    @property
    @pulumi.getter
    def secret(self) -> pulumi.Output[Optional[str]]:
        """
        Exoscale API secret
        """
        return pulumi.get(self, "secret")

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

