Skip to content

Commit

Permalink
More API token dataclass linting.
Browse files Browse the repository at this point in the history
  • Loading branch information
WRansohoff committed Sep 9, 2024
1 parent abfa59c commit b7ed013
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions axiom/tokens.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

@dataclass
class TokenDatasetCapabilities:
# pylint: disable=unsubscriptable-object
"""
TokenDatasetCapabilities describes the dataset-level permissions
which a token can be assigned.
Expand All @@ -12,17 +13,22 @@ class TokenDatasetCapabilities:
"""

# Ability to ingest data. Optional.
ingest: list[Literal["create"]] | None = None
ingest: Optional[list[Literal["create"]]] = field(default=None)
# Ability to query data. Optional.
query: list[Literal["read"]] | None = None
query: Optional[list[Literal["read"]]] = field(default=None)
# Ability to use starred queries. Optional.
starredQueries: list[Literal["create", "read", "update", "delete"]] | None = None
starredQueries: Optional[list[Literal["create", "read", "update", "delete"]]] = (
field(default=None)
)
# Ability to use virtual fields. Optional.
virtualFields: list[Literal["create", "read", "update", "delete"]] | None = None
virtualFields: Optional[list[Literal["create", "read", "update", "delete"]]] = (
field(default=None)
)


@dataclass
class TokenOrganizationCapabilities:
# pylint: disable=unsubscriptable-object
"""
TokenOrganizationCapabilities describes the org-level permissions
which a token can be assigned.
Expand Down Expand Up @@ -80,6 +86,7 @@ class TokenOrganizationCapabilities:

@dataclass
class TokenAttributes:
# pylint: disable=unsubscriptable-object
"""
TokenAttributes describes the set of input parameters that the
POST /tokens API accepts.
Expand Down

0 comments on commit b7ed013

Please sign in to comment.