File: domain.py

package info (click to toggle)
hcloud-python 2.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,396 kB
  • sloc: python: 15,311; makefile: 43; javascript: 3
file content (62 lines) | stat: -rw-r--r-- 2,186 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
from __future__ import annotations

from typing import TYPE_CHECKING

from ..core import BaseDomain, DomainIdentityMixin

if TYPE_CHECKING:
    from ..locations import Location
    from ..server_types import BoundServerType


class Datacenter(BaseDomain, DomainIdentityMixin):
    """Datacenter Domain

    :param id: int ID of Datacenter
    :param name: str Name of Datacenter
    :param description: str Description of Datacenter
    :param location: :class:`BoundLocation <hcloud.locations.client.BoundLocation>`
    :param server_types: :class:`DatacenterServerTypes <hcloud.datacenters.domain.DatacenterServerTypes>`
    """

    __api_properties__ = ("id", "name", "description", "location", "server_types")
    __slots__ = __api_properties__

    def __init__(
        self,
        id: int | None = None,
        name: str | None = None,
        description: str | None = None,
        location: Location | None = None,
        server_types: DatacenterServerTypes | None = None,
    ):
        self.id = id
        self.name = name
        self.description = description
        self.location = location
        self.server_types = server_types


class DatacenterServerTypes(BaseDomain):
    """DatacenterServerTypes Domain

    :param available: List[:class:`BoundServerTypes <hcloud.server_types.client.BoundServerTypes>`]
           All available server types for this datacenter
    :param supported: List[:class:`BoundServerTypes <hcloud.server_types.client.BoundServerTypes>`]
           All supported server types for this datacenter
    :param available_for_migration: List[:class:`BoundServerTypes <hcloud.server_types.client.BoundServerTypes>`]
           All available for migration (change type) server types for this datacenter
    """

    __api_properties__ = ("available", "supported", "available_for_migration")
    __slots__ = __api_properties__

    def __init__(
        self,
        available: list[BoundServerType],
        supported: list[BoundServerType],
        available_for_migration: list[BoundServerType],
    ):
        self.available = available
        self.supported = supported
        self.available_for_migration = available_for_migration