archastro.platform.types.oauth

 1# Copyright (c) 2026 ArchAstro Inc. Licensed under the MIT License.
 2# This file is auto-generated by @archastro/sdk-generator. Do not edit.
 3# Content hash: b8bc1f9d598d
 4
 5
 6from pydantic import BaseModel, Field
 7
 8from .users import User
 9
10
11class OAuthTokenResponse(BaseModel):
12    """
13    A successful OAuth 2.0 token response. Issued by the token endpoint after a completed authorization or device-flow grant.
14    """
15
16    access_token: str = Field(
17        ...,
18        description="Bearer token used to authenticate API requests. Include this value in the `Authorization: Bearer <token>` header.",
19    )
20    expires_in: int = Field(..., description="Number of seconds until the access token expires.")
21    refresh_token: str | None = Field(
22        default=None,
23        description="Token that can be exchanged for a new access token once the current one expires. `null` if the grant type does not issue refresh tokens.",
24    )
25    scope: str | None = Field(
26        default=None,
27        description="Space-separated list of scopes granted to the access token. `null` if scope was not included in the grant request.",
28    )
29    token_type: str = Field(..., description='Token type. Always `"Bearer"`.')
30    user: User | None = Field(
31        default=None,
32        description="The authenticated user associated with this token. `null` when the token is not tied to a specific user (e.g. client-credentials grants).",
33    )
class OAuthTokenResponse(pydantic.main.BaseModel):
12class OAuthTokenResponse(BaseModel):
13    """
14    A successful OAuth 2.0 token response. Issued by the token endpoint after a completed authorization or device-flow grant.
15    """
16
17    access_token: str = Field(
18        ...,
19        description="Bearer token used to authenticate API requests. Include this value in the `Authorization: Bearer <token>` header.",
20    )
21    expires_in: int = Field(..., description="Number of seconds until the access token expires.")
22    refresh_token: str | None = Field(
23        default=None,
24        description="Token that can be exchanged for a new access token once the current one expires. `null` if the grant type does not issue refresh tokens.",
25    )
26    scope: str | None = Field(
27        default=None,
28        description="Space-separated list of scopes granted to the access token. `null` if scope was not included in the grant request.",
29    )
30    token_type: str = Field(..., description='Token type. Always `"Bearer"`.')
31    user: User | None = Field(
32        default=None,
33        description="The authenticated user associated with this token. `null` when the token is not tied to a specific user (e.g. client-credentials grants).",
34    )

A successful OAuth 2.0 token response. Issued by the token endpoint after a completed authorization or device-flow grant.

access_token: str = PydanticUndefined

Bearer token used to authenticate API requests. Include this value in the Authorization: Bearer <token> header.

expires_in: int = PydanticUndefined

Number of seconds until the access token expires.

refresh_token: str | None = None

Token that can be exchanged for a new access token once the current one expires. null if the grant type does not issue refresh tokens.

scope: str | None = None

Space-separated list of scopes granted to the access token. null if scope was not included in the grant request.

token_type: str = PydanticUndefined

Token type. Always "Bearer".

The authenticated user associated with this token. null when the token is not tied to a specific user (e.g. client-credentials grants).