Skip to content

Commit

Permalink
Clarify name of AccessToken(Response) BaseModel
Browse files Browse the repository at this point in the history
In contract to the new 298db16 `AccessTokenRequest` BaseModel.
  • Loading branch information
andreaso committed Jan 26, 2025
1 parent 298db16 commit 32807c1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions hv4gha/gh.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class Installation(BaseModel):


class TokenPermissions(TypedDict, total=False):
"""Part of AccessToken and AccessTokenRequest"""
"""Part of AccessTokenResponse and AccessTokenRequest"""

# Repository permissions
actions: PermRW
Expand Down Expand Up @@ -90,12 +90,12 @@ class TokenPermissions(TypedDict, total=False):


class Repository(TypedDict):
"""Part of AccessToken"""
"""Part of AccessTokenResponse"""

name: RepoName


class AccessToken(BaseModel):
class AccessTokenResponse(BaseModel):
"""
https://docs.github.com/en/rest/apps/apps?apiVersion=2022-11-28#create-an-installation-access-token-for-an-app
"""
Expand Down Expand Up @@ -229,7 +229,7 @@ def issue_token(
raise TokenIssueError(http_error.response.text) from http_error

try:
access_token_bm = AccessToken(**response.json())
access_token_bm = AccessTokenResponse(**response.json())
except ValidationError as validation_error:
error_message = "<Failed to parse Token Issue API response>"
raise TokenIssueError(error_message) from validation_error
Expand Down

0 comments on commit 32807c1

Please sign in to comment.