# generated by fastapi-codegen:
# filename: openapi.yaml
# timestamp: 2025-06-29T12:18:48+00:00
from __future__ import annotations
from datetime import datetime
from typing import List, Optional
from uuid import UUID
from pydantic import BaseModel, Field, RootModel
class AccessToken(BaseModel):
access_token: Optional[str] = Field(
None, description='access token provided during authentication flow'
)
expires_in: Optional[float] = Field(
None, description='time in milliseconds until access token expires.'
)
id_token: Optional[str] = Field(None, description='Xero unique identifier')
refresh_token: Optional[str] = Field(
None, description='token used to refresh an expired access token'
)
token_type: Optional[str] = Field(None, description='type of token i.e. Bearer')
class Connection(BaseModel):
authEventId: Optional[UUID] = Field(
None,
description='Identifier shared across connections authorised at the same time',
)
createdDateUtc: Optional[datetime] = Field(
None, description='The date when the user connected this tenant to your app'
)
id: Optional[UUID] = Field(None, description='Xero identifier')
tenantId: Optional[UUID] = Field(
None, description='Xero identifier of organisation'
)
tenantName: Optional[str] = Field(None, description='Xero tenant name')
tenantType: Optional[str] = Field(
None, description='Xero tenant type (i.e. ORGANISATION, PRACTICE)'
)
updatedDateUtc: Optional[datetime] = Field(
None,
description='The date when the user most recently connected this tenant to your app. May differ to the created date if the user has disconnected and subsequently reconnected this tenant to your app.',
)
class RefreshToken(BaseModel):
client_id: Optional[str] = Field(None, description='client id for Xero app')
client_secret: Optional[str] = Field(
None, description='client secret for Xero app 2'
)
grant_type: Optional[str] = Field(None, description='Xero grant type')
refresh_token: Optional[str] = Field(
None, description='refresh token provided during authentication flow'
)
class ConnectionsGetResponse(RootModel[List[Connection]]):
root: List[Connection]