inttegro.resources.keys

Generated public typing surface. Do not edit by hand.

  1"""Secret key management resource."""
  2
  3from __future__ import annotations
  4
  5from ..http_client import HttpClient
  6
  7
  8class Keys:
  9    """Secret key generation, lookup, update, revocation, and usage operations.
 10
 11    Access this service as ``InttegroClient.keys``. Methods use the client's shared transport and return the typed resource shapes documented below.
 12    """
 13
 14    def __init__(self, http: HttpClient):
 15        self.http = http
 16
 17    def generate(self, payload: dict | None = None):
 18        """Generate a new active secret key. The token is returned only once.
 19
 20        API endpoint: ``/keys/generate``.
 21
 22        Args:
 23            payload (dict | None): Typed request object or equivalent request mapping for this operation.
 24
 25        Returns:
 26            ``Generated`` decoded from the documented response shape.
 27
 28        Raises:
 29            APIError: The API rejected the request or could not complete it.
 30            NetworkError: The request could not reach the Inttegro API.
 31            TimeoutError: The configured request deadline elapsed.
 32        """
 33        return self.http.post("/keys/generate", payload or {})
 34
 35    def page(self, payload: dict | None = None):
 36        """List safe secret key metadata.
 37
 38        API endpoint: ``/keys/page``.
 39
 40        Args:
 41            payload (dict | None): Typed request object or equivalent request mapping for this operation.
 42
 43        Returns:
 44            ``Page`` decoded from the documented response shape.
 45
 46        Raises:
 47            APIError: The API rejected the request or could not complete it.
 48            NetworkError: The request could not reach the Inttegro API.
 49            TimeoutError: The configured request deadline elapsed.
 50        """
 51        return self.http.post("/keys/page", payload or {})
 52
 53    def lookup(self, secret_key_id: str):
 54        """Retrieve safe metadata for a secret key by ID.
 55
 56        Args:
 57            secret_key_id (str): Unique identifier of the secret key.
 58
 59        Returns:
 60            ``SecretKey`` decoded from the documented response shape.
 61        """
 62        return self.lookup_with_params({"secret_key_id": secret_key_id})
 63
 64    def lookup_with_params(self, payload: dict):
 65        """Retrieve safe metadata using any supported ID alias.
 66
 67        API endpoint: ``/keys/lookup``.
 68
 69        Args:
 70            payload (dict): Typed request object or equivalent request mapping for this operation.
 71
 72        Returns:
 73            ``SecretKey`` decoded from the documented response shape.
 74
 75        Raises:
 76            APIError: The API rejected the request or could not complete it.
 77            NetworkError: The request could not reach the Inttegro API.
 78            TimeoutError: The configured request deadline elapsed.
 79        """
 80        return self.http.post("/keys/lookup", payload)
 81
 82    def update(self, payload: dict):
 83        """Update safe mutable metadata for a secret key.
 84
 85        API endpoint: ``/keys/update``.
 86
 87        Args:
 88            payload (dict): Typed request object or equivalent request mapping for this operation.
 89
 90        Returns:
 91            ``SecretKey`` decoded from the documented response shape.
 92
 93        Raises:
 94            APIError: The API rejected the request or could not complete it.
 95            NetworkError: The request could not reach the Inttegro API.
 96            TimeoutError: The configured request deadline elapsed.
 97        """
 98        return self.http.post("/keys/update", payload)
 99
100    def destroy(self, secret_key_id: str):
101        """Revoke a secret key by ID.
102
103        Args:
104            secret_key_id (str): Unique identifier of the secret key.
105
106        Returns:
107            ``SecretKey`` decoded from the documented response shape.
108        """
109        return self.destroy_with_params({"secret_key_id": secret_key_id})
110
111    def destroy_with_params(self, payload: dict):
112        """Revoke a secret key using any supported ID alias.
113
114        API endpoint: ``/keys/destroy``.
115
116        Args:
117            payload (dict): Typed request object or equivalent request mapping for this operation.
118
119        Returns:
120            ``SecretKey`` decoded from the documented response shape.
121
122        Raises:
123            APIError: The API rejected the request or could not complete it.
124            NetworkError: The request could not reach the Inttegro API.
125            TimeoutError: The configured request deadline elapsed.
126        """
127        return self.http.post("/keys/destroy", payload)
128
129    def usage(self, payload: dict | str):
130        """Retrieve successful session usage and attributable failed verification attempts.
131
132        API endpoint: ``/keys/usage``.
133
134        Args:
135            payload (dict | str): Typed request object or equivalent request mapping for this operation.
136
137        Returns:
138            ``Usage`` decoded from the documented response shape.
139
140        Raises:
141            APIError: The API rejected the request or could not complete it.
142            NetworkError: The request could not reach the Inttegro API.
143            TimeoutError: The configured request deadline elapsed.
144        """
145        if isinstance(payload, str):
146            payload = {"secret_key_id": payload}
147        return self.http.post("/keys/usage", payload)
class Keys:
  9class Keys:
 10    """Secret key generation, lookup, update, revocation, and usage operations.
 11
 12    Access this service as ``InttegroClient.keys``. Methods use the client's shared transport and return the typed resource shapes documented below.
 13    """
 14
 15    def __init__(self, http: HttpClient):
 16        self.http = http
 17
 18    def generate(self, payload: dict | None = None):
 19        """Generate a new active secret key. The token is returned only once.
 20
 21        API endpoint: ``/keys/generate``.
 22
 23        Args:
 24            payload (dict | None): Typed request object or equivalent request mapping for this operation.
 25
 26        Returns:
 27            ``Generated`` decoded from the documented response shape.
 28
 29        Raises:
 30            APIError: The API rejected the request or could not complete it.
 31            NetworkError: The request could not reach the Inttegro API.
 32            TimeoutError: The configured request deadline elapsed.
 33        """
 34        return self.http.post("/keys/generate", payload or {})
 35
 36    def page(self, payload: dict | None = None):
 37        """List safe secret key metadata.
 38
 39        API endpoint: ``/keys/page``.
 40
 41        Args:
 42            payload (dict | None): Typed request object or equivalent request mapping for this operation.
 43
 44        Returns:
 45            ``Page`` decoded from the documented response shape.
 46
 47        Raises:
 48            APIError: The API rejected the request or could not complete it.
 49            NetworkError: The request could not reach the Inttegro API.
 50            TimeoutError: The configured request deadline elapsed.
 51        """
 52        return self.http.post("/keys/page", payload or {})
 53
 54    def lookup(self, secret_key_id: str):
 55        """Retrieve safe metadata for a secret key by ID.
 56
 57        Args:
 58            secret_key_id (str): Unique identifier of the secret key.
 59
 60        Returns:
 61            ``SecretKey`` decoded from the documented response shape.
 62        """
 63        return self.lookup_with_params({"secret_key_id": secret_key_id})
 64
 65    def lookup_with_params(self, payload: dict):
 66        """Retrieve safe metadata using any supported ID alias.
 67
 68        API endpoint: ``/keys/lookup``.
 69
 70        Args:
 71            payload (dict): Typed request object or equivalent request mapping for this operation.
 72
 73        Returns:
 74            ``SecretKey`` decoded from the documented response shape.
 75
 76        Raises:
 77            APIError: The API rejected the request or could not complete it.
 78            NetworkError: The request could not reach the Inttegro API.
 79            TimeoutError: The configured request deadline elapsed.
 80        """
 81        return self.http.post("/keys/lookup", payload)
 82
 83    def update(self, payload: dict):
 84        """Update safe mutable metadata for a secret key.
 85
 86        API endpoint: ``/keys/update``.
 87
 88        Args:
 89            payload (dict): Typed request object or equivalent request mapping for this operation.
 90
 91        Returns:
 92            ``SecretKey`` decoded from the documented response shape.
 93
 94        Raises:
 95            APIError: The API rejected the request or could not complete it.
 96            NetworkError: The request could not reach the Inttegro API.
 97            TimeoutError: The configured request deadline elapsed.
 98        """
 99        return self.http.post("/keys/update", payload)
100
101    def destroy(self, secret_key_id: str):
102        """Revoke a secret key by ID.
103
104        Args:
105            secret_key_id (str): Unique identifier of the secret key.
106
107        Returns:
108            ``SecretKey`` decoded from the documented response shape.
109        """
110        return self.destroy_with_params({"secret_key_id": secret_key_id})
111
112    def destroy_with_params(self, payload: dict):
113        """Revoke a secret key using any supported ID alias.
114
115        API endpoint: ``/keys/destroy``.
116
117        Args:
118            payload (dict): Typed request object or equivalent request mapping for this operation.
119
120        Returns:
121            ``SecretKey`` decoded from the documented response shape.
122
123        Raises:
124            APIError: The API rejected the request or could not complete it.
125            NetworkError: The request could not reach the Inttegro API.
126            TimeoutError: The configured request deadline elapsed.
127        """
128        return self.http.post("/keys/destroy", payload)
129
130    def usage(self, payload: dict | str):
131        """Retrieve successful session usage and attributable failed verification attempts.
132
133        API endpoint: ``/keys/usage``.
134
135        Args:
136            payload (dict | str): Typed request object or equivalent request mapping for this operation.
137
138        Returns:
139            ``Usage`` decoded from the documented response shape.
140
141        Raises:
142            APIError: The API rejected the request or could not complete it.
143            NetworkError: The request could not reach the Inttegro API.
144            TimeoutError: The configured request deadline elapsed.
145        """
146        if isinstance(payload, str):
147            payload = {"secret_key_id": payload}
148        return self.http.post("/keys/usage", payload)

Secret key generation, lookup, update, revocation, and usage operations.

Access this service as InttegroClient.keys. Methods use the client's shared transport and return the typed resource shapes documented below.

Keys(http: inttegro.http_client.HttpClient)
15    def __init__(self, http: HttpClient):
16        self.http = http
http
def generate( self, payload: inttegro.secret_key.GenerateRequest | None = None) -> inttegro.secret_key.Generated:
18    def generate(self, payload: dict | None = None):
19        """Generate a new active secret key. The token is returned only once.
20
21        API endpoint: ``/keys/generate``.
22
23        Args:
24            payload (dict | None): Typed request object or equivalent request mapping for this operation.
25
26        Returns:
27            ``Generated`` decoded from the documented response shape.
28
29        Raises:
30            APIError: The API rejected the request or could not complete it.
31            NetworkError: The request could not reach the Inttegro API.
32            TimeoutError: The configured request deadline elapsed.
33        """
34        return self.http.post("/keys/generate", payload or {})

Generate a new active secret key. The token is returned only once.

API endpoint: /keys/generate.

Arguments:
  • payload (dict | None): Typed request object or equivalent request mapping for this operation.
Returns:

Generated decoded from the documented response shape.

Raises:
  • APIError: The API rejected the request or could not complete it.
  • NetworkError: The request could not reach the Inttegro API.
  • TimeoutError: The configured request deadline elapsed.
def page( self, payload: inttegro.secret_key.PageRequest | None = None) -> inttegro.secret_key.Page:
36    def page(self, payload: dict | None = None):
37        """List safe secret key metadata.
38
39        API endpoint: ``/keys/page``.
40
41        Args:
42            payload (dict | None): Typed request object or equivalent request mapping for this operation.
43
44        Returns:
45            ``Page`` decoded from the documented response shape.
46
47        Raises:
48            APIError: The API rejected the request or could not complete it.
49            NetworkError: The request could not reach the Inttegro API.
50            TimeoutError: The configured request deadline elapsed.
51        """
52        return self.http.post("/keys/page", payload or {})

List safe secret key metadata.

API endpoint: /keys/page.

Arguments:
  • payload (dict | None): Typed request object or equivalent request mapping for this operation.
Returns:

Page decoded from the documented response shape.

Raises:
  • APIError: The API rejected the request or could not complete it.
  • NetworkError: The request could not reach the Inttegro API.
  • TimeoutError: The configured request deadline elapsed.
def lookup(self, secret_key_id: str) -> inttegro.secret_key.SecretKey:
54    def lookup(self, secret_key_id: str):
55        """Retrieve safe metadata for a secret key by ID.
56
57        Args:
58            secret_key_id (str): Unique identifier of the secret key.
59
60        Returns:
61            ``SecretKey`` decoded from the documented response shape.
62        """
63        return self.lookup_with_params({"secret_key_id": secret_key_id})

Retrieve safe metadata for a secret key by ID.

Arguments:
  • secret_key_id (str): Unique identifier of the secret key.
Returns:

SecretKey decoded from the documented response shape.

def lookup_with_params( self, payload: inttegro.secret_key.LookupRequest) -> inttegro.secret_key.SecretKey:
65    def lookup_with_params(self, payload: dict):
66        """Retrieve safe metadata using any supported ID alias.
67
68        API endpoint: ``/keys/lookup``.
69
70        Args:
71            payload (dict): Typed request object or equivalent request mapping for this operation.
72
73        Returns:
74            ``SecretKey`` decoded from the documented response shape.
75
76        Raises:
77            APIError: The API rejected the request or could not complete it.
78            NetworkError: The request could not reach the Inttegro API.
79            TimeoutError: The configured request deadline elapsed.
80        """
81        return self.http.post("/keys/lookup", payload)

Retrieve safe metadata using any supported ID alias.

API endpoint: /keys/lookup.

Arguments:
  • payload (dict): Typed request object or equivalent request mapping for this operation.
Returns:

SecretKey decoded from the documented response shape.

Raises:
  • APIError: The API rejected the request or could not complete it.
  • NetworkError: The request could not reach the Inttegro API.
  • TimeoutError: The configured request deadline elapsed.
def update( self, payload: inttegro.secret_key.UpdateRequest) -> inttegro.secret_key.SecretKey:
83    def update(self, payload: dict):
84        """Update safe mutable metadata for a secret key.
85
86        API endpoint: ``/keys/update``.
87
88        Args:
89            payload (dict): Typed request object or equivalent request mapping for this operation.
90
91        Returns:
92            ``SecretKey`` decoded from the documented response shape.
93
94        Raises:
95            APIError: The API rejected the request or could not complete it.
96            NetworkError: The request could not reach the Inttegro API.
97            TimeoutError: The configured request deadline elapsed.
98        """
99        return self.http.post("/keys/update", payload)

Update safe mutable metadata for a secret key.

API endpoint: /keys/update.

Arguments:
  • payload (dict): Typed request object or equivalent request mapping for this operation.
Returns:

SecretKey decoded from the documented response shape.

Raises:
  • APIError: The API rejected the request or could not complete it.
  • NetworkError: The request could not reach the Inttegro API.
  • TimeoutError: The configured request deadline elapsed.
def destroy(self, secret_key_id: str) -> inttegro.secret_key.SecretKey:
101    def destroy(self, secret_key_id: str):
102        """Revoke a secret key by ID.
103
104        Args:
105            secret_key_id (str): Unique identifier of the secret key.
106
107        Returns:
108            ``SecretKey`` decoded from the documented response shape.
109        """
110        return self.destroy_with_params({"secret_key_id": secret_key_id})

Revoke a secret key by ID.

Arguments:
  • secret_key_id (str): Unique identifier of the secret key.
Returns:

SecretKey decoded from the documented response shape.

def destroy_with_params( self, payload: inttegro.secret_key.DestroyRequest) -> inttegro.secret_key.SecretKey:
112    def destroy_with_params(self, payload: dict):
113        """Revoke a secret key using any supported ID alias.
114
115        API endpoint: ``/keys/destroy``.
116
117        Args:
118            payload (dict): Typed request object or equivalent request mapping for this operation.
119
120        Returns:
121            ``SecretKey`` decoded from the documented response shape.
122
123        Raises:
124            APIError: The API rejected the request or could not complete it.
125            NetworkError: The request could not reach the Inttegro API.
126            TimeoutError: The configured request deadline elapsed.
127        """
128        return self.http.post("/keys/destroy", payload)

Revoke a secret key using any supported ID alias.

API endpoint: /keys/destroy.

Arguments:
  • payload (dict): Typed request object or equivalent request mapping for this operation.
Returns:

SecretKey decoded from the documented response shape.

Raises:
  • APIError: The API rejected the request or could not complete it.
  • NetworkError: The request could not reach the Inttegro API.
  • TimeoutError: The configured request deadline elapsed.
def usage( self, payload: inttegro.secret_key.UsageRequest | str) -> inttegro.secret_key.Usage:
130    def usage(self, payload: dict | str):
131        """Retrieve successful session usage and attributable failed verification attempts.
132
133        API endpoint: ``/keys/usage``.
134
135        Args:
136            payload (dict | str): Typed request object or equivalent request mapping for this operation.
137
138        Returns:
139            ``Usage`` decoded from the documented response shape.
140
141        Raises:
142            APIError: The API rejected the request or could not complete it.
143            NetworkError: The request could not reach the Inttegro API.
144            TimeoutError: The configured request deadline elapsed.
145        """
146        if isinstance(payload, str):
147            payload = {"secret_key_id": payload}
148        return self.http.post("/keys/usage", payload)

Retrieve successful session usage and attributable failed verification attempts.

API endpoint: /keys/usage.

Arguments:
  • payload (dict | str): Typed request object or equivalent request mapping for this operation.
Returns:

Usage decoded from the documented response shape.

Raises:
  • APIError: The API rejected the request or could not complete it.
  • NetworkError: The request could not reach the Inttegro API.
  • TimeoutError: The configured request deadline elapsed.