ansible-collection-hetzner-.../plugins/module_utils/vendor/hcloud/deprecation/domain.py
renovate[bot] ff539800aa
deps: update dependency hcloud to v1.27.1 (#290)
* deps: update dependency hcloud to v1.27.1

* chore: update vendored files

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: jo <ljonas@riseup.net>
2023-08-08 18:17:22 +02:00

36 lines
1.2 KiB
Python

from __future__ import annotations
try:
from dateutil.parser import isoparse
except ImportError:
isoparse = None
from ..core import BaseDomain
class DeprecationInfo(BaseDomain):
"""Describes if, when & how the resources was deprecated. If this field is set to ``None`` the resource is not
deprecated. If it has a value, it is considered deprecated.
:param announced: datetime
Date of when the deprecation was announced.
:param unavailable_after: datetime
After the time in this field, the resource will not be available from the general listing endpoint of the
resource type, and it can not be used in new resources. For example, if this is an image, you can not create
new servers with this image after the mentioned date.
"""
__slots__ = (
"announced",
"unavailable_after",
)
def __init__(
self,
announced: str | None = None,
unavailable_after: str | None = None,
):
self.announced = isoparse(announced) if announced else None
self.unavailable_after = (
isoparse(unavailable_after) if unavailable_after else None
)