Skip to content

Commit

Permalink
Lint API token dataclass properties
Browse files Browse the repository at this point in the history
  • Loading branch information
WRansohoff committed Sep 9, 2024
1 parent 1196706 commit eee0e09
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions axiom/tokens.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from dataclasses import dataclass
from typing import Literal
from dataclasses import dataclass, field
from typing import Literal, Optional


@dataclass
Expand Down Expand Up @@ -29,31 +29,31 @@ class TokenOrganizationCapabilities:
"""

# Ability to use annotations. Optional.
annotations: list[Literal["create", "read", "update", "delete"]] | None = None
annotations: Optional[list[Literal["create", "read", "update", "delete"]]] = field(default=None)
# Ability to use api tokens. Optional.
apiTokens: list[Literal["create", "read", "update", "delete"]] | None = None
apiTokens: Optional[list[Literal["create", "read", "update", "delete"]]] = field(default=None)
# Ability to access billing. Optional.
billing: list[Literal["read", "update"]] | None = None
billing: Optional[list[Literal["read", "update"]]] = field(default=None)
# Ability to use dashboards. Optional.
dashboards: list[Literal["create", "read", "update", "delete"]] | None = None
dashboards: Optional[list[Literal["create", "read", "update", "delete"]]] = field(default=None)
# Ability to use datasets. Optional.
datasets: list[Literal["create", "read", "update", "delete"]] | None = None
datasets: Optional[list[Literal["create", "read", "update", "delete"]]] = field(default=None)
# Ability to use endpoints. Optional.
endpoints: list[Literal["create", "read", "update", "delete"]] | None = None
endpoints: Optional[list[Literal["create", "read", "update", "delete"]]] = field(default=None)
# Ability to use flows. Optional.
flows: list[Literal["create", "read", "update", "delete"]] | None = None
flows: Optional[list[Literal["create", "read", "update", "delete"]]] = field(default=None)
# Ability to use integrations. Optional.
integrations: list[Literal["create", "read", "update", "delete"]] | None = None
integrations: Optional[list[Literal["create", "read", "update", "delete"]]] = field(default=None)
# Ability to use monitors. Optional.
monitors: list[Literal["create", "read", "update", "delete"]] | None = None
monitors: Optional[list[Literal["create", "read", "update", "delete"]]] = field(default=None)
# Ability to use notifiers. Optional.
notifiers: list[Literal["create", "read", "update", "delete"]] | None = None
notifiers: Optional[list[Literal["create", "read", "update", "delete"]]] = field(default=None)
# Ability to use role-based access controls. Optional.
rbac: list[Literal["create", "read", "update", "delete"]] | None = None
rbac: Optional[list[Literal["create", "read", "update", "delete"]]] = field(default=None)
# Ability to use shared access keys. Optional.
sharedAccessKeys: list[Literal["read", "update"]] | None = None
sharedAccessKeys: Optional[list[Literal["read", "update"]]] = field(default=None)
# Ability to use users. Optional.
users: list[Literal["create", "read", "update", "delete"]] | None = None
users: Optional[list[Literal["create", "read", "update", "delete"]]] = field(default=None)


@dataclass
Expand All @@ -66,13 +66,13 @@ class TokenAttributes:
# Name for the token. Required.
name: str
# The token's dataset-level capabilities. Keyed on dataset name. Optional.
datasetCapabilities: dict[str, TokenDatasetCapabilities] | None = None
datasetCapabilities: Optional[dict[str, TokenDatasetCapabilities]] = field(default=None)
# Description for the API token. Optional.
description: str | None = None
description: Optional[str] = field(default=None)
# Expiration date for the API token. Optional.
expiresAt: str | None = None
expiresAt: Optional[str] = field(default=None)
# The token's organization-level capabilities. Optional.
orgCapabilities: TokenOrganizationCapabilities | None = None
orgCapabilities: Optional[TokenOrganizationCapabilities] = field(default=None)


@dataclass
Expand Down

0 comments on commit eee0e09

Please sign in to comment.