Skip to content

Commit

Permalink
Make TokenResponse typing more explicit
Browse files Browse the repository at this point in the history
  • Loading branch information
andreaso committed Jan 6, 2025
1 parent 524290f commit a50d0c5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions hv4gha/gh.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import requests
from pydantic import BaseModel, Field, TypeAdapter, ValidationError
from typing_extensions import TypedDict
from typing_extensions import NotRequired, TypedDict

PermARW = Literal["admin", "read", "write"]
PermRW = Literal["read", "write"]
Expand Down Expand Up @@ -113,13 +113,13 @@ class AccessToken(BaseModel):
repositories: None | list[Repository] = None


class TokenResponse(TypedDict, total=False):
class TokenResponse(TypedDict):
"""Typing for customized Access Token response"""

access_token: str
expires_at: datetime
permissions: TokenPermissions
repositories: list[str]
repositories: NotRequired[list[str]]


class GitHubApp:
Expand Down

0 comments on commit a50d0c5

Please sign in to comment.