# 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__ = [
    'SecretEphemeralPolicy',
    'GetSecretEphemeralPolicyResult',
]

@pulumi.output_type
class SecretEphemeralPolicy(dict):
    @staticmethod
    def __key_warning(key: str):
        suggest = None
        if key == "expiresOnceAccessed":
            suggest = "expires_once_accessed"

        if suggest:
            pulumi.log.warn(f"Key '{key}' not found in SecretEphemeralPolicy. Access the value via the '{suggest}' property getter instead.")

    def __getitem__(self, key: str) -> Any:
        SecretEphemeralPolicy.__key_warning(key)
        return super().__getitem__(key)

    def get(self, key: str, default = None) -> Any:
        SecretEphemeralPolicy.__key_warning(key)
        return super().get(key, default)

    def __init__(__self__, *,
                 action: str,
                 expires_once_accessed: Optional[bool] = None,
                 ttl: Optional[str] = None):
        """
        :param str action: Action to perform when the version of a secret expires. Available values can be found in [SDK constants](https://pkg.go.dev/github.com/scaleway/scaleway-sdk-go@master/api/secret/v1beta1#pkg-constants).
        :param bool expires_once_accessed: True if the secret version expires after a single user access.
        :param str ttl: Time frame, from one second and up to one year, during which the secret's versions are valid. Has to be specified in [Go Duration format](https://pkg.go.dev/time#ParseDuration) (ex: "30m", "24h").
        """
        pulumi.set(__self__, "action", action)
        if expires_once_accessed is not None:
            pulumi.set(__self__, "expires_once_accessed", expires_once_accessed)
        if ttl is not None:
            pulumi.set(__self__, "ttl", ttl)

    @property
    @pulumi.getter
    def action(self) -> str:
        """
        Action to perform when the version of a secret expires. Available values can be found in [SDK constants](https://pkg.go.dev/github.com/scaleway/scaleway-sdk-go@master/api/secret/v1beta1#pkg-constants).
        """
        return pulumi.get(self, "action")

    @property
    @pulumi.getter(name="expiresOnceAccessed")
    def expires_once_accessed(self) -> Optional[bool]:
        """
        True if the secret version expires after a single user access.
        """
        return pulumi.get(self, "expires_once_accessed")

    @property
    @pulumi.getter
    def ttl(self) -> Optional[str]:
        """
        Time frame, from one second and up to one year, during which the secret's versions are valid. Has to be specified in [Go Duration format](https://pkg.go.dev/time#ParseDuration) (ex: "30m", "24h").
        """
        return pulumi.get(self, "ttl")


@pulumi.output_type
class GetSecretEphemeralPolicyResult(dict):
    def __init__(__self__, *,
                 action: str,
                 expires_once_accessed: bool,
                 ttl: str):
        """
        :param str action: Action to perform when the version of a secret expires.
        :param bool expires_once_accessed: True if the secret version expires after a single user access.
        :param str ttl: Time frame, from one second and up to one year, during which the secret's versions are valid. Has to be specified in Go Duration format
        """
        pulumi.set(__self__, "action", action)
        pulumi.set(__self__, "expires_once_accessed", expires_once_accessed)
        pulumi.set(__self__, "ttl", ttl)

    @property
    @pulumi.getter
    def action(self) -> str:
        """
        Action to perform when the version of a secret expires.
        """
        return pulumi.get(self, "action")

    @property
    @pulumi.getter(name="expiresOnceAccessed")
    def expires_once_accessed(self) -> bool:
        """
        True if the secret version expires after a single user access.
        """
        return pulumi.get(self, "expires_once_accessed")

    @property
    @pulumi.getter
    def ttl(self) -> str:
        """
        Time frame, from one second and up to one year, during which the secret's versions are valid. Has to be specified in Go Duration format
        """
        return pulumi.get(self, "ttl")


