inttegro.secret_key

Models, requests, and enums for the Inttegro secret key resource.

The primary returned object is inttegro.secret_key.SecretKey. Related request types, nested response shapes, and string-backed enums are exported from this singular namespace. Public members load lazily, so importing one resource does not eagerly import the entire SDK.

 1"""Models, requests, and enums for the Inttegro secret key resource.
 2
 3The primary returned object is ``inttegro.secret_key.SecretKey``. Related request types, nested response shapes, and string-backed enums are exported from this singular namespace. Public members load lazily, so importing one resource does not eagerly import the entire SDK."""
 4
 5from importlib import import_module
 6from typing import TYPE_CHECKING, Any
 7
 8if TYPE_CHECKING:
 9    from .auth_result import AuthResult as AuthResult
10    from .destroy_request import DestroyRequest as DestroyRequest
11    from .destroy_response import DestroyResponse as DestroyResponse
12    from .generate_request import GenerateRequest as GenerateRequest
13    from .generate_response import GenerateResponse as GenerateResponse
14    from .generated import Generated as Generated
15    from .lookup_request import LookupRequest as LookupRequest
16    from .lookup_response import LookupResponse as LookupResponse
17    from .page import Page as Page
18    from .page_request import PageRequest as PageRequest
19    from .page_response import PageResponse as PageResponse
20    from .secret_key import SecretKey as SecretKey
21    from .status import Status as Status
22    from .token_type import TokenType as TokenType
23    from .update_request import UpdateRequest as UpdateRequest
24    from .update_response import UpdateResponse as UpdateResponse
25    from .usage import Usage as Usage
26    from .usage_page import UsagePage as UsagePage
27    from .usage_request import UsageRequest as UsageRequest
28    from .usage_row import UsageRow as UsageRow
29
30
31_EXPORTS: dict[str, tuple[str, str]] = {
32    "AuthResult": ("inttegro.secret_key.auth_result", "AuthResult"),
33    "DestroyRequest": ("inttegro.secret_key.destroy_request", "DestroyRequest"),
34    "DestroyResponse": ("inttegro.secret_key.destroy_response", "DestroyResponse"),
35    "GenerateRequest": ("inttegro.secret_key.generate_request", "GenerateRequest"),
36    "GenerateResponse": ("inttegro.secret_key.generate_response", "GenerateResponse"),
37    "Generated": ("inttegro.secret_key.generated", "Generated"),
38    "LookupRequest": ("inttegro.secret_key.lookup_request", "LookupRequest"),
39    "LookupResponse": ("inttegro.secret_key.lookup_response", "LookupResponse"),
40    "Page": ("inttegro.secret_key.page", "Page"),
41    "PageRequest": ("inttegro.secret_key.page_request", "PageRequest"),
42    "PageResponse": ("inttegro.secret_key.page_response", "PageResponse"),
43    "SecretKey": ("inttegro.secret_key.secret_key", "SecretKey"),
44    "Status": ("inttegro.secret_key.status", "Status"),
45    "TokenType": ("inttegro.secret_key.token_type", "TokenType"),
46    "UpdateRequest": ("inttegro.secret_key.update_request", "UpdateRequest"),
47    "UpdateResponse": ("inttegro.secret_key.update_response", "UpdateResponse"),
48    "Usage": ("inttegro.secret_key.usage", "Usage"),
49    "UsagePage": ("inttegro.secret_key.usage_page", "UsagePage"),
50    "UsageRequest": ("inttegro.secret_key.usage_request", "UsageRequest"),
51    "UsageRow": ("inttegro.secret_key.usage_row", "UsageRow"),
52}
53
54__all__ = [
55    "AuthResult",
56    "DestroyRequest",
57    "DestroyResponse",
58    "GenerateRequest",
59    "GenerateResponse",
60    "Generated",
61    "LookupRequest",
62    "LookupResponse",
63    "Page",
64    "PageRequest",
65    "PageResponse",
66    "SecretKey",
67    "Status",
68    "TokenType",
69    "UpdateRequest",
70    "UpdateResponse",
71    "Usage",
72    "UsagePage",
73    "UsageRequest",
74    "UsageRow",
75]
76
77
78def __getattr__(name: str) -> Any:
79    """Load a public resource type on first access."""
80    try:
81        module_name, attribute_name = _EXPORTS[name]
82    except KeyError:
83        raise AttributeError(f"module {__name__!r} has no attribute {name!r}") from None
84    value = getattr(import_module(module_name), attribute_name)
85    globals()[name] = value
86    return value
class AuthResult(inttegro._enum_base.WireEnum):
11class AuthResult(WireEnum):
12    """Typed auth result data in the secret key resource namespace.
13
14    Members are strings as well as enum values, so they compare naturally
15    with API payloads and serialize to the lowercase wire value shown below.
16
17    API contract schema: ``SecretKeyAuthResult``.
18    """
19    SUCCEEDED = "succeeded"
20    """Wire value ``succeeded`` (succeeded)"""
21    FAILED = "failed"
22    """Wire value ``failed`` (failed)"""

Typed auth result data in the secret key resource namespace.

Members are strings as well as enum values, so they compare naturally with API payloads and serialize to the lowercase wire value shown below.

API contract schema: SecretKeyAuthResult.

SUCCEEDED = <AuthResult.SUCCEEDED: 'succeeded'>

Wire value succeeded (succeeded)

FAILED = <AuthResult.FAILED: 'failed'>

Wire value failed (failed)

@dataclass(frozen=True, slots=True, kw_only=True)
class DestroyRequest(inttegro._request_base.ApiRequest):
12@dataclass(frozen=True, slots=True, kw_only=True)
13class DestroyRequest(ApiRequest):
14    """Parameters accepted by the destroy request operation.
15
16    This is an immutable, keyword-only request object. ``to_dict()`` uses
17    the documented wire names, omits fields left as ``UNSET``, serializes
18    string-backed enums by value, and requires timezone-aware datetimes.
19
20    API contract schema: ``DestroySecretKeyRequest``.
21    """
22    secret_key_id: str
23    """Secret key identifier to revoke. Required. Python type: ``str``; wire name: ``secret_key_id``; JSON type: string"""

Parameters accepted by the destroy request operation.

This is an immutable, keyword-only request object. to_dict() uses the documented wire names, omits fields left as UNSET, serializes string-backed enums by value, and requires timezone-aware datetimes.

API contract schema: DestroySecretKeyRequest.

DestroyRequest(*, secret_key_id: str)
secret_key_id: str

Secret key identifier to revoke. Required. Python type: str; wire name: secret_key_id; JSON type: string

@dataclass(frozen=True, slots=True, init=False, repr=False, eq=False)
class DestroyResponse(inttegro._model_base.ApiModel):
12@dataclass(frozen=True, slots=True, init=False, repr=False, eq=False)
13class DestroyResponse(ApiModel):
14    """Typed response returned by the destroy operation.
15
16    Instances are immutable API responses. ``from_dict()`` decodes nested
17    objects, string-backed enums, and timezone-aware ISO-8601 timestamps;
18    ``to_dict()`` returns the corresponding JSON-compatible wire shape.
19    Fields not returned by the API remain absent and can still be queried
20    through mapping-style access.
21
22    API contract schema: ``DestroySecretKeyResponse``.
23    """
24    key: SecretKey = field(init=False)
25    """Public secret key metadata. The bearer token is never returned by read or mutation endpoints. Required. Python type: ``SecretKey``; wire name: ``key``; JSON type: object (SecretKey)"""

Typed response returned by the destroy operation.

Instances are immutable API responses. from_dict() decodes nested objects, string-backed enums, and timezone-aware ISO-8601 timestamps; to_dict() returns the corresponding JSON-compatible wire shape. Fields not returned by the API remain absent and can still be queried through mapping-style access.

API contract schema: DestroySecretKeyResponse.

key: SecretKey

Public secret key metadata. The bearer token is never returned by read or mutation endpoints. Required. Python type: SecretKey; wire name: key; JSON type: object (SecretKey)

@dataclass(frozen=True, slots=True, kw_only=True)
class GenerateRequest(inttegro._request_base.ApiRequest):
12@dataclass(frozen=True, slots=True, kw_only=True)
13class GenerateRequest(ApiRequest):
14    """Optional public input for secret key generation.
15
16    This is an immutable, keyword-only request object. ``to_dict()`` uses
17    the documented wire names, omits fields left as ``UNSET``, serializes
18    string-backed enums by value, and requires timezone-aware datetimes.
19
20    API contract schema: ``GenerateSecretKeyRequest``.
21    """
22    label: str | UnsetType = field(default=UNSET)
23    """Optional human-readable label. Surrounding whitespace is trimmed; an empty value creates an unlabeled key. Optional. Python type: ``str``; wire name: ``label``; JSON type: string"""

Optional public input for secret key generation.

This is an immutable, keyword-only request object. to_dict() uses the documented wire names, omits fields left as UNSET, serializes string-backed enums by value, and requires timezone-aware datetimes.

API contract schema: GenerateSecretKeyRequest.

GenerateRequest(*, label: str | inttegro._request_base.UnsetType = UNSET)
label: str | inttegro._request_base.UnsetType

Optional human-readable label. Surrounding whitespace is trimmed; an empty value creates an unlabeled key. Optional. Python type: str; wire name: label; JSON type: string

@dataclass(frozen=True, slots=True, init=False, repr=False, eq=False)
class GenerateResponse(inttegro._model_base.ApiModel):
12@dataclass(frozen=True, slots=True, init=False, repr=False, eq=False)
13class GenerateResponse(ApiModel):
14    """Typed response returned by the generate operation.
15
16    Instances are immutable API responses. ``from_dict()`` decodes nested
17    objects, string-backed enums, and timezone-aware ISO-8601 timestamps;
18    ``to_dict()`` returns the corresponding JSON-compatible wire shape.
19    Fields not returned by the API remain absent and can still be queried
20    through mapping-style access.
21
22    API contract schema: ``GenerateSecretKeyResponse``.
23    """
24    key: GeneratedSecretKey = field(init=False)
25    """Newly generated secret key. The token is returned once and cannot be retrieved later. Required. Python type: ``GeneratedSecretKey``; wire name: ``key``; JSON type: object (GeneratedSecretKey)"""

Typed response returned by the generate operation.

Instances are immutable API responses. from_dict() decodes nested objects, string-backed enums, and timezone-aware ISO-8601 timestamps; to_dict() returns the corresponding JSON-compatible wire shape. Fields not returned by the API remain absent and can still be queried through mapping-style access.

API contract schema: GenerateSecretKeyResponse.

key: Generated

Newly generated secret key. The token is returned once and cannot be retrieved later. Required. Python type: GeneratedSecretKey; wire name: key; JSON type: object (GeneratedSecretKey)

@dataclass(frozen=True, slots=True, init=False, repr=False, eq=False)
class Generated(inttegro._model_base.ApiModel):
14@dataclass(frozen=True, slots=True, init=False, repr=False, eq=False)
15class Generated(ApiModel):
16    """Newly generated secret key. The token is returned once and cannot be retrieved later.
17
18    Instances are immutable API responses. ``from_dict()`` decodes nested
19    objects, string-backed enums, and timezone-aware ISO-8601 timestamps;
20    ``to_dict()`` returns the corresponding JSON-compatible wire shape.
21    Fields not returned by the API remain absent and can still be queried
22    through mapping-style access.
23
24    API contract schema: ``GeneratedSecretKey``.
25    """
26    id: str = field(init=False)
27    """Secret key identifier. Required. Python type: ``str``; wire name: ``id``; JSON type: string"""
28    label: str | None = field(init=False)
29    """Optional human-readable label for the secret key. Optional; nullable. Python type: ``str | None``; wire name: ``label``; JSON type: string"""
30    token_type: Literal['bearer'] = field(init=False)
31    """The token type associated with this generated. Required. Python type: ``Literal['bearer']``; wire name: ``token_type``; JSON type: string. Constraints: allowed values ``bearer``"""
32    issued_at: datetime = field(init=False)
33    """Timestamp for issued at. Required. Python type: ``datetime``; wire name: ``issued_at``; JSON type: string (date-time)"""
34    token: str = field(init=False)
35    """One-time bearer token for the generated key. Required. Python type: ``str``; wire name: ``token``; JSON type: string"""

Newly generated secret key. The token is returned once and cannot be retrieved later.

Instances are immutable API responses. from_dict() decodes nested objects, string-backed enums, and timezone-aware ISO-8601 timestamps; to_dict() returns the corresponding JSON-compatible wire shape. Fields not returned by the API remain absent and can still be queried through mapping-style access.

API contract schema: GeneratedSecretKey.

id: str

Secret key identifier. Required. Python type: str; wire name: id; JSON type: string

label: str | None

Optional human-readable label for the secret key. Optional; nullable. Python type: str | None; wire name: label; JSON type: string

token_type: Literal['bearer']

The token type associated with this generated. Required. Python type: Literal['bearer']; wire name: token_type; JSON type: string. Constraints: allowed values bearer

issued_at: datetime.datetime

Timestamp for issued at. Required. Python type: datetime; wire name: issued_at; JSON type: string (date-time)

token: str

One-time bearer token for the generated key. Required. Python type: str; wire name: token; JSON type: string

@dataclass(frozen=True, slots=True, kw_only=True)
class LookupRequest(inttegro._request_base.ApiRequest):
12@dataclass(frozen=True, slots=True, kw_only=True)
13class LookupRequest(ApiRequest):
14    """Parameters accepted by the lookup request operation.
15
16    This is an immutable, keyword-only request object. ``to_dict()`` uses
17    the documented wire names, omits fields left as ``UNSET``, serializes
18    string-backed enums by value, and requires timezone-aware datetimes.
19
20    API contract schema: ``LookupSecretKeyRequest``.
21    """
22    secret_key_id: str
23    """Secret key identifier. Typed `sk_...` IDs are accepted. Required. Python type: ``str``; wire name: ``secret_key_id``; JSON type: string"""

Parameters accepted by the lookup request operation.

This is an immutable, keyword-only request object. to_dict() uses the documented wire names, omits fields left as UNSET, serializes string-backed enums by value, and requires timezone-aware datetimes.

API contract schema: LookupSecretKeyRequest.

LookupRequest(*, secret_key_id: str)
secret_key_id: str

Secret key identifier. Typed sk_... IDs are accepted. Required. Python type: str; wire name: secret_key_id; JSON type: string

@dataclass(frozen=True, slots=True, init=False, repr=False, eq=False)
class LookupResponse(inttegro._model_base.ApiModel):
12@dataclass(frozen=True, slots=True, init=False, repr=False, eq=False)
13class LookupResponse(ApiModel):
14    """Typed response returned by the lookup operation.
15
16    Instances are immutable API responses. ``from_dict()`` decodes nested
17    objects, string-backed enums, and timezone-aware ISO-8601 timestamps;
18    ``to_dict()`` returns the corresponding JSON-compatible wire shape.
19    Fields not returned by the API remain absent and can still be queried
20    through mapping-style access.
21
22    API contract schema: ``LookupSecretKeyResponse``.
23    """
24    key: SecretKey = field(init=False)
25    """Public secret key metadata. The bearer token is never returned by read or mutation endpoints. Required. Python type: ``SecretKey``; wire name: ``key``; JSON type: object (SecretKey)"""

Typed response returned by the lookup operation.

Instances are immutable API responses. from_dict() decodes nested objects, string-backed enums, and timezone-aware ISO-8601 timestamps; to_dict() returns the corresponding JSON-compatible wire shape. Fields not returned by the API remain absent and can still be queried through mapping-style access.

API contract schema: LookupSecretKeyResponse.

key: SecretKey

Public secret key metadata. The bearer token is never returned by read or mutation endpoints. Required. Python type: SecretKey; wire name: key; JSON type: object (SecretKey)

@dataclass(frozen=True, slots=True, init=False, repr=False, eq=False)
class Page(inttegro._model_base.ApiModel):
12@dataclass(frozen=True, slots=True, init=False, repr=False, eq=False)
13class Page(ApiModel):
14    """One page of page resources.
15
16    Instances are immutable API responses. ``from_dict()`` decodes nested
17    objects, string-backed enums, and timezone-aware ISO-8601 timestamps;
18    ``to_dict()`` returns the corresponding JSON-compatible wire shape.
19    Fields not returned by the API remain absent and can still be queried
20    through mapping-style access.
21
22    API contract schema: ``SecretKeyPage``.
23    """
24    number: int = field(init=False)
25    """Human-readable number assigned to the page. Required. Python type: ``int``; wire name: ``number``; JSON type: integer. Constraints: minimum 1"""
26    size: int = field(init=False)
27    """Numeric size used by this operation. Required. Python type: ``int``; wire name: ``size``; JSON type: integer. Constraints: minimum 0"""
28    count: int = field(init=False)
29    """The count associated with this page. Required. Python type: ``int``; wire name: ``count``; JSON type: integer. Constraints: minimum 0"""
30    total: int = field(init=False)
31    """Monetary total, represented by a currency and an integer minor-unit value. Required. Python type: ``int``; wire name: ``total``; JSON type: integer. Constraints: minimum 0"""
32    has_more: bool = field(init=False)
33    """Whether has more. Required. Python type: ``bool``; wire name: ``has_more``; JSON type: boolean"""
34    keys: list[SecretKey] = field(init=False)
35    """The keys associated with this page. Required. Python type: ``list[SecretKey]``; wire name: ``keys``; JSON type: array of object (SecretKey) values"""

One page of page resources.

Instances are immutable API responses. from_dict() decodes nested objects, string-backed enums, and timezone-aware ISO-8601 timestamps; to_dict() returns the corresponding JSON-compatible wire shape. Fields not returned by the API remain absent and can still be queried through mapping-style access.

API contract schema: SecretKeyPage.

number: int

Human-readable number assigned to the page. Required. Python type: int; wire name: number; JSON type: integer. Constraints: minimum 1

size: int

Numeric size used by this operation. Required. Python type: int; wire name: size; JSON type: integer. Constraints: minimum 0

count: int

The count associated with this page. Required. Python type: int; wire name: count; JSON type: integer. Constraints: minimum 0

total: int

Monetary total, represented by a currency and an integer minor-unit value. Required. Python type: int; wire name: total; JSON type: integer. Constraints: minimum 0

has_more: bool

Whether has more. Required. Python type: bool; wire name: has_more; JSON type: boolean

keys: list[SecretKey]

The keys associated with this page. Required. Python type: list[SecretKey]; wire name: keys; JSON type: array of object (SecretKey) values

@dataclass(frozen=True, slots=True, kw_only=True)
class PageRequest(inttegro._request_base.ApiRequest):
12@dataclass(frozen=True, slots=True, kw_only=True)
13class PageRequest(ApiRequest):
14    """Parameters accepted by the page request operation.
15
16    This is an immutable, keyword-only request object. ``to_dict()`` uses
17    the documented wire names, omits fields left as ``UNSET``, serializes
18    string-backed enums by value, and requires timezone-aware datetimes.
19
20    API contract schema: ``PageSecretKeysRequest``.
21    """
22    page: int | UnsetType = field(default=UNSET)
23    """Page number alias. Omitted or 0 is normalized to 1. Optional. Python type: ``int``; wire name: ``page``; JSON type: integer. Constraints: minimum 0"""
24    number: int | UnsetType = field(default=UNSET)
25    """Page number. Omitted or 0 is normalized to 1. Optional. Python type: ``int``; wire name: ``number``; JSON type: integer. Constraints: minimum 0"""
26    size: int | UnsetType = field(default=UNSET)
27    """Requested page size. Omitted or 0 becomes 50; values above 100 are capped at 100. Optional. Python type: ``int``; wire name: ``size``; JSON type: integer. Constraints: minimum 0"""

Parameters accepted by the page request operation.

This is an immutable, keyword-only request object. to_dict() uses the documented wire names, omits fields left as UNSET, serializes string-backed enums by value, and requires timezone-aware datetimes.

API contract schema: PageSecretKeysRequest.

PageRequest( *, page: int | inttegro._request_base.UnsetType = UNSET, number: int | inttegro._request_base.UnsetType = UNSET, size: int | inttegro._request_base.UnsetType = UNSET)
page: int | inttegro._request_base.UnsetType

Page number alias. Omitted or 0 is normalized to 1. Optional. Python type: int; wire name: page; JSON type: integer. Constraints: minimum 0

number: int | inttegro._request_base.UnsetType

Page number. Omitted or 0 is normalized to 1. Optional. Python type: int; wire name: number; JSON type: integer. Constraints: minimum 0

size: int | inttegro._request_base.UnsetType

Requested page size. Omitted or 0 becomes 50; values above 100 are capped at 100. Optional. Python type: int; wire name: size; JSON type: integer. Constraints: minimum 0

@dataclass(frozen=True, slots=True, init=False, repr=False, eq=False)
class PageResponse(inttegro._model_base.ApiModel):
12@dataclass(frozen=True, slots=True, init=False, repr=False, eq=False)
13class PageResponse(ApiModel):
14    """Typed response returned by the page operation.
15
16    Instances are immutable API responses. ``from_dict()`` decodes nested
17    objects, string-backed enums, and timezone-aware ISO-8601 timestamps;
18    ``to_dict()`` returns the corresponding JSON-compatible wire shape.
19    Fields not returned by the API remain absent and can still be queried
20    through mapping-style access.
21
22    API contract schema: ``PageSecretKeysResponse``.
23    """
24    page: SecretKeyPage = field(init=False)
25    """Numeric page used by this operation. Required. Python type: ``SecretKeyPage``; wire name: ``page``; JSON type: object (SecretKeyPage)"""

Typed response returned by the page operation.

Instances are immutable API responses. from_dict() decodes nested objects, string-backed enums, and timezone-aware ISO-8601 timestamps; to_dict() returns the corresponding JSON-compatible wire shape. Fields not returned by the API remain absent and can still be queried through mapping-style access.

API contract schema: PageSecretKeysResponse.

page: Page

Numeric page used by this operation. Required. Python type: SecretKeyPage; wire name: page; JSON type: object (SecretKeyPage)

@dataclass(frozen=True, slots=True, init=False, repr=False, eq=False)
class SecretKey(inttegro._model_base.ApiModel):
14@dataclass(frozen=True, slots=True, init=False, repr=False, eq=False)
15class SecretKey(ApiModel):
16    """Public secret key metadata. The bearer token is never returned by read or mutation endpoints.
17
18    Instances are immutable API responses. ``from_dict()`` decodes nested
19    objects, string-backed enums, and timezone-aware ISO-8601 timestamps;
20    ``to_dict()`` returns the corresponding JSON-compatible wire shape.
21    Fields not returned by the API remain absent and can still be queried
22    through mapping-style access.
23    """
24    id: str = field(init=False)
25    """Application-scoped secret key identifier. Required. Python type: ``str``; wire name: ``id``; JSON type: string"""
26    label: str | None = field(init=False)
27    """Optional human-readable label for the secret key. Optional; nullable. Python type: ``str | None``; wire name: ``label``; JSON type: string"""
28    token_type: Literal['bearer'] = field(init=False)
29    """The token type associated with this secret key. Required. Python type: ``Literal['bearer']``; wire name: ``token_type``; JSON type: string. Constraints: allowed values ``bearer``"""
30    issued_at: datetime = field(init=False)
31    """Timestamp for issued at. Required. Python type: ``datetime``; wire name: ``issued_at``; JSON type: string (date-time)"""
32    updated_at: datetime | None = field(init=False)
33    """Omitted until the label is changed. Optional; nullable. Python type: ``datetime | None``; wire name: ``updated_at``; JSON type: string (date-time)"""
34    expires_at: datetime | None = field(init=False)
35    """Omitted for keys without a fixed expiry. Optional; nullable. Python type: ``datetime | None``; wire name: ``expires_at``; JSON type: string (date-time)"""
36    status: Literal['active', 'revoked', 'expired'] = field(init=False)
37    """Current lifecycle status of the secret key. Required. Python type: ``Literal['active', 'revoked', 'expired']``; wire name: ``status``; JSON type: string. Constraints: allowed values ``active``, ``revoked``, ``expired``"""
38    active: bool = field(init=False)
39    """Whether the secret key is active. Required. Python type: ``bool``; wire name: ``active``; JSON type: boolean"""
40    revoked_at: datetime | None = field(init=False)
41    """Omitted until the key is revoked. Optional; nullable. Python type: ``datetime | None``; wire name: ``revoked_at``; JSON type: string (date-time)"""
42    last_used_at: datetime | None = field(init=False)
43    """Most recent recorded authentication when available; otherwise omitted. Optional; nullable. Python type: ``datetime | None``; wire name: ``last_used_at``; JSON type: string (date-time)"""
44    usage_count: int | None = field(init=False)
45    """Number of recorded authentications when available; omitted when zero. Optional; nullable. Python type: ``int | None``; wire name: ``usage_count``; JSON type: integer. Constraints: minimum 0"""

Public secret key metadata. The bearer token is never returned by read or mutation endpoints.

Instances are immutable API responses. from_dict() decodes nested objects, string-backed enums, and timezone-aware ISO-8601 timestamps; to_dict() returns the corresponding JSON-compatible wire shape. Fields not returned by the API remain absent and can still be queried through mapping-style access.

id: str

Application-scoped secret key identifier. Required. Python type: str; wire name: id; JSON type: string

label: str | None

Optional human-readable label for the secret key. Optional; nullable. Python type: str | None; wire name: label; JSON type: string

token_type: Literal['bearer']

The token type associated with this secret key. Required. Python type: Literal['bearer']; wire name: token_type; JSON type: string. Constraints: allowed values bearer

issued_at: datetime.datetime

Timestamp for issued at. Required. Python type: datetime; wire name: issued_at; JSON type: string (date-time)

updated_at: datetime.datetime | None

Omitted until the label is changed. Optional; nullable. Python type: datetime | None; wire name: updated_at; JSON type: string (date-time)

expires_at: datetime.datetime | None

Omitted for keys without a fixed expiry. Optional; nullable. Python type: datetime | None; wire name: expires_at; JSON type: string (date-time)

status: Literal['active', 'revoked', 'expired']

Current lifecycle status of the secret key. Required. Python type: Literal['active', 'revoked', 'expired']; wire name: status; JSON type: string. Constraints: allowed values active, revoked, expired

active: bool

Whether the secret key is active. Required. Python type: bool; wire name: active; JSON type: boolean

revoked_at: datetime.datetime | None

Omitted until the key is revoked. Optional; nullable. Python type: datetime | None; wire name: revoked_at; JSON type: string (date-time)

last_used_at: datetime.datetime | None

Most recent recorded authentication when available; otherwise omitted. Optional; nullable. Python type: datetime | None; wire name: last_used_at; JSON type: string (date-time)

usage_count: int | None

Number of recorded authentications when available; omitted when zero. Optional; nullable. Python type: int | None; wire name: usage_count; JSON type: integer. Constraints: minimum 0

class Status(inttegro._enum_base.WireEnum):
11class Status(WireEnum):
12    """Typed status data in the secret key resource namespace.
13
14    Members are strings as well as enum values, so they compare naturally
15    with API payloads and serialize to the lowercase wire value shown below.
16
17    API contract schema: ``SecretKeyStatus``.
18    """
19    ACTIVE = "active"
20    """Wire value ``active`` (active)"""
21    REVOKED = "revoked"
22    """Wire value ``revoked`` (revoked)"""
23    EXPIRED = "expired"
24    """Wire value ``expired`` (expired)"""

Typed status data in the secret key resource namespace.

Members are strings as well as enum values, so they compare naturally with API payloads and serialize to the lowercase wire value shown below.

API contract schema: SecretKeyStatus.

ACTIVE = <Status.ACTIVE: 'active'>

Wire value active (active)

REVOKED = <Status.REVOKED: 'revoked'>

Wire value revoked (revoked)

EXPIRED = <Status.EXPIRED: 'expired'>

Wire value expired (expired)

class TokenType(inttegro._enum_base.WireEnum):
11class TokenType(WireEnum):
12    """Typed token type data in the secret key resource namespace.
13
14    Members are strings as well as enum values, so they compare naturally
15    with API payloads and serialize to the lowercase wire value shown below.
16
17    API contract schema: ``SecretKeyTokenType``.
18    """
19    BEARER = "bearer"
20    """Wire value ``bearer`` (bearer)"""

Typed token type data in the secret key resource namespace.

Members are strings as well as enum values, so they compare naturally with API payloads and serialize to the lowercase wire value shown below.

API contract schema: SecretKeyTokenType.

BEARER = <TokenType.BEARER: 'bearer'>

Wire value bearer (bearer)

@dataclass(frozen=True, slots=True, kw_only=True)
class UpdateRequest(inttegro._request_base.ApiRequest):
12@dataclass(frozen=True, slots=True, kw_only=True)
13class UpdateRequest(ApiRequest):
14    """Parameters accepted by the update request operation.
15
16    This is an immutable, keyword-only request object. ``to_dict()`` uses
17    the documented wire names, omits fields left as ``UNSET``, serializes
18    string-backed enums by value, and requires timezone-aware datetimes.
19
20    API contract schema: ``UpdateSecretKeyRequest``.
21    """
22    label: str
23    """Human-readable label for the secret key. Send an empty string to clear the label. Required. Python type: ``str``; wire name: ``label``; JSON type: string"""
24    secret_key_id: str
25    """Secret key identifier to update. Required. Python type: ``str``; wire name: ``secret_key_id``; JSON type: string"""

Parameters accepted by the update request operation.

This is an immutable, keyword-only request object. to_dict() uses the documented wire names, omits fields left as UNSET, serializes string-backed enums by value, and requires timezone-aware datetimes.

API contract schema: UpdateSecretKeyRequest.

UpdateRequest(*, label: str, secret_key_id: str)
label: str

Human-readable label for the secret key. Send an empty string to clear the label. Required. Python type: str; wire name: label; JSON type: string

secret_key_id: str

Secret key identifier to update. Required. Python type: str; wire name: secret_key_id; JSON type: string

@dataclass(frozen=True, slots=True, init=False, repr=False, eq=False)
class UpdateResponse(inttegro._model_base.ApiModel):
12@dataclass(frozen=True, slots=True, init=False, repr=False, eq=False)
13class UpdateResponse(ApiModel):
14    """Typed response returned by the update operation.
15
16    Instances are immutable API responses. ``from_dict()`` decodes nested
17    objects, string-backed enums, and timezone-aware ISO-8601 timestamps;
18    ``to_dict()`` returns the corresponding JSON-compatible wire shape.
19    Fields not returned by the API remain absent and can still be queried
20    through mapping-style access.
21
22    API contract schema: ``UpdateSecretKeyResponse``.
23    """
24    key: SecretKey = field(init=False)
25    """Public secret key metadata. The bearer token is never returned by read or mutation endpoints. Required. Python type: ``SecretKey``; wire name: ``key``; JSON type: object (SecretKey)"""

Typed response returned by the update operation.

Instances are immutable API responses. from_dict() decodes nested objects, string-backed enums, and timezone-aware ISO-8601 timestamps; to_dict() returns the corresponding JSON-compatible wire shape. Fields not returned by the API remain absent and can still be queried through mapping-style access.

API contract schema: UpdateSecretKeyResponse.

key: SecretKey

Public secret key metadata. The bearer token is never returned by read or mutation endpoints. Required. Python type: SecretKey; wire name: key; JSON type: object (SecretKey)

@dataclass(frozen=True, slots=True, init=False, repr=False, eq=False)
class Usage(inttegro._model_base.ApiModel):
12@dataclass(frozen=True, slots=True, init=False, repr=False, eq=False)
13class Usage(ApiModel):
14    """Typed usage data in the secret key resource namespace.
15
16    Instances are immutable API responses. ``from_dict()`` decodes nested
17    objects, string-backed enums, and timezone-aware ISO-8601 timestamps;
18    ``to_dict()`` returns the corresponding JSON-compatible wire shape.
19    Fields not returned by the API remain absent and can still be queried
20    through mapping-style access.
21
22    API contract schema: ``SecretKeyUsage``.
23    """
24    key: SecretKey = field(init=False)
25    """Public secret key metadata. The bearer token is never returned by read or mutation endpoints. Required. Python type: ``SecretKey``; wire name: ``key``; JSON type: object (SecretKey)"""
26    usage: SecretKeyUsagePage = field(init=False)
27    """The usage associated with this usage. Required. Python type: ``SecretKeyUsagePage``; wire name: ``usage``; JSON type: object (SecretKeyUsagePage)"""

Typed usage data in the secret key resource namespace.

Instances are immutable API responses. from_dict() decodes nested objects, string-backed enums, and timezone-aware ISO-8601 timestamps; to_dict() returns the corresponding JSON-compatible wire shape. Fields not returned by the API remain absent and can still be queried through mapping-style access.

API contract schema: SecretKeyUsage.

key: SecretKey

Public secret key metadata. The bearer token is never returned by read or mutation endpoints. Required. Python type: SecretKey; wire name: key; JSON type: object (SecretKey)

usage: UsagePage

The usage associated with this usage. Required. Python type: SecretKeyUsagePage; wire name: usage; JSON type: object (SecretKeyUsagePage)

@dataclass(frozen=True, slots=True, init=False, repr=False, eq=False)
class UsagePage(inttegro._model_base.ApiModel):
12@dataclass(frozen=True, slots=True, init=False, repr=False, eq=False)
13class UsagePage(ApiModel):
14    """One page of usage resources.
15
16    Instances are immutable API responses. ``from_dict()`` decodes nested
17    objects, string-backed enums, and timezone-aware ISO-8601 timestamps;
18    ``to_dict()`` returns the corresponding JSON-compatible wire shape.
19    Fields not returned by the API remain absent and can still be queried
20    through mapping-style access.
21
22    API contract schema: ``SecretKeyUsagePage``.
23    """
24    number: int = field(init=False)
25    """Human-readable number assigned to the usage page. Required. Python type: ``int``; wire name: ``number``; JSON type: integer. Constraints: minimum 1"""
26    size: int = field(init=False)
27    """Numeric size used by this operation. Required. Python type: ``int``; wire name: ``size``; JSON type: integer. Constraints: minimum 0"""
28    count: int = field(init=False)
29    """The count associated with this usage page. Required. Python type: ``int``; wire name: ``count``; JSON type: integer. Constraints: minimum 0"""
30    total: int = field(init=False)
31    """Monetary total, represented by a currency and an integer minor-unit value. Required. Python type: ``int``; wire name: ``total``; JSON type: integer. Constraints: minimum 0"""
32    has_more: bool = field(init=False)
33    """Whether has more. Required. Python type: ``bool``; wire name: ``has_more``; JSON type: boolean"""
34    rows: list[SecretKeyUsageRow] = field(init=False)
35    """The rows associated with this usage page. Required. Python type: ``list[SecretKeyUsageRow]``; wire name: ``rows``; JSON type: array of object (SecretKeyUsageRow) values"""

One page of usage resources.

Instances are immutable API responses. from_dict() decodes nested objects, string-backed enums, and timezone-aware ISO-8601 timestamps; to_dict() returns the corresponding JSON-compatible wire shape. Fields not returned by the API remain absent and can still be queried through mapping-style access.

API contract schema: SecretKeyUsagePage.

number: int

Human-readable number assigned to the usage page. Required. Python type: int; wire name: number; JSON type: integer. Constraints: minimum 1

size: int

Numeric size used by this operation. Required. Python type: int; wire name: size; JSON type: integer. Constraints: minimum 0

count: int

The count associated with this usage page. Required. Python type: int; wire name: count; JSON type: integer. Constraints: minimum 0

total: int

Monetary total, represented by a currency and an integer minor-unit value. Required. Python type: int; wire name: total; JSON type: integer. Constraints: minimum 0

has_more: bool

Whether has more. Required. Python type: bool; wire name: has_more; JSON type: boolean

rows: list[UsageRow]

The rows associated with this usage page. Required. Python type: list[SecretKeyUsageRow]; wire name: rows; JSON type: array of object (SecretKeyUsageRow) values

@dataclass(frozen=True, slots=True, kw_only=True)
class UsageRequest(inttegro._request_base.ApiRequest):
12@dataclass(frozen=True, slots=True, kw_only=True)
13class UsageRequest(ApiRequest):
14    """Parameters accepted by the usage request operation.
15
16    This is an immutable, keyword-only request object. ``to_dict()`` uses
17    the documented wire names, omits fields left as ``UNSET``, serializes
18    string-backed enums by value, and requires timezone-aware datetimes.
19
20    API contract schema: ``SecretKeyUsageRequest``.
21    """
22    number: int | UnsetType = field(default=UNSET)
23    """Page number. Omitted or 0 is normalized to 1. Optional. Python type: ``int``; wire name: ``number``; JSON type: integer. Constraints: minimum 0"""
24    page: int | UnsetType = field(default=UNSET)
25    """Page number alias. Omitted or 0 is normalized to 1. Optional. Python type: ``int``; wire name: ``page``; JSON type: integer. Constraints: minimum 0"""
26    size: int | UnsetType = field(default=UNSET)
27    """Requested page size. Omitted or 0 becomes 50; values above 100 are capped at 100. Optional. Python type: ``int``; wire name: ``size``; JSON type: integer. Constraints: minimum 0"""
28    secret_key_id: str
29    """Secret key identifier whose recent activity should be returned. Required. Python type: ``str``; wire name: ``secret_key_id``; JSON type: string"""

Parameters accepted by the usage request operation.

This is an immutable, keyword-only request object. to_dict() uses the documented wire names, omits fields left as UNSET, serializes string-backed enums by value, and requires timezone-aware datetimes.

API contract schema: SecretKeyUsageRequest.

UsageRequest( *, number: int | inttegro._request_base.UnsetType = UNSET, page: int | inttegro._request_base.UnsetType = UNSET, size: int | inttegro._request_base.UnsetType = UNSET, secret_key_id: str)
number: int | inttegro._request_base.UnsetType

Page number. Omitted or 0 is normalized to 1. Optional. Python type: int; wire name: number; JSON type: integer. Constraints: minimum 0

page: int | inttegro._request_base.UnsetType

Page number alias. Omitted or 0 is normalized to 1. Optional. Python type: int; wire name: page; JSON type: integer. Constraints: minimum 0

size: int | inttegro._request_base.UnsetType

Requested page size. Omitted or 0 becomes 50; values above 100 are capped at 100. Optional. Python type: int; wire name: size; JSON type: integer. Constraints: minimum 0

secret_key_id: str

Secret key identifier whose recent activity should be returned. Required. Python type: str; wire name: secret_key_id; JSON type: string

@dataclass(frozen=True, slots=True, init=False, repr=False, eq=False)
class UsageRow(inttegro._model_base.ApiModel):
14@dataclass(frozen=True, slots=True, init=False, repr=False, eq=False)
15class UsageRow(ApiModel):
16    """Public authentication outcome associated with the selected key.
17
18    Instances are immutable API responses. ``from_dict()`` decodes nested
19    objects, string-backed enums, and timezone-aware ISO-8601 timestamps;
20    ``to_dict()`` returns the corresponding JSON-compatible wire shape.
21    Fields not returned by the API remain absent and can still be queried
22    through mapping-style access.
23
24    API contract schema: ``SecretKeyUsageRow``.
25    """
26    secret_key_id: str = field(init=False)
27    """Identifier of the related secret key. Required. Python type: ``str``; wire name: ``secret_key_id``; JSON type: string"""
28    occurred_at: datetime = field(init=False)
29    """Timestamp for occurred at. Required. Python type: ``datetime``; wire name: ``occurred_at``; JSON type: string (date-time)"""
30    auth_result: Literal['succeeded', 'failed'] = field(init=False)
31    """The auth result associated with this usage row. Required. Python type: ``Literal['succeeded', 'failed']``; wire name: ``auth_result``; JSON type: string. Constraints: allowed values ``succeeded``, ``failed``"""

Public authentication outcome associated with the selected key.

Instances are immutable API responses. from_dict() decodes nested objects, string-backed enums, and timezone-aware ISO-8601 timestamps; to_dict() returns the corresponding JSON-compatible wire shape. Fields not returned by the API remain absent and can still be queried through mapping-style access.

API contract schema: SecretKeyUsageRow.

secret_key_id: str

Identifier of the related secret key. Required. Python type: str; wire name: secret_key_id; JSON type: string

occurred_at: datetime.datetime

Timestamp for occurred at. Required. Python type: datetime; wire name: occurred_at; JSON type: string (date-time)

auth_result: Literal['succeeded', 'failed']

The auth result associated with this usage row. Required. Python type: Literal['succeeded', 'failed']; wire name: auth_result; JSON type: string. Constraints: allowed values succeeded, failed