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 (49 lines) | stat: -rw-r--r-- 1,263 bytes parent folder | download
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
from __future__ import annotations

from dateutil.parser import isoparse

from ..core import BaseDomain, DomainIdentityMixin


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

    :param id: int
           ID of the SSH key
    :param name: str
           Name of the SSH key (must be unique per project)
    :param fingerprint: str
           Fingerprint of public key
    :param public_key: str
           Public Key
    :param labels: Dict
            User-defined labels (key-value pairs)
    :param created: datetime
           Point in time when the SSH Key was created
    """

    __api_properties__ = (
        "id",
        "name",
        "fingerprint",
        "public_key",
        "labels",
        "created",
    )
    __slots__ = __api_properties__

    def __init__(
        self,
        id: int | None = None,
        name: str | None = None,
        fingerprint: str | None = None,
        public_key: str | None = None,
        labels: dict[str, str] | None = None,
        created: str | None = None,
    ):
        self.id = id
        self.name = name
        self.fingerprint = fingerprint
        self.public_key = public_key
        self.labels = labels
        self.created = isoparse(created) if created else None