Commit 7f617c59 authored by Luc Yriarte's avatar Luc Yriarte
Browse files

Regenerated with no change except generator master backmerge + header template fix

parent 5431a405
Pipeline #41042 passed with stage
in 23 seconds
import inspect
from pydantic import BaseModel
from odes_storage import models
from odes_storage.api_client import ApiClient, AsyncApis, SyncApis # noqa F401
from odes_storage.auth_api_client import AuthApiClient
......@@ -8,4 +10,5 @@ from odes_storage.exceptions import ResponseValidationError, UnexpectedResponse
for model in inspect.getmembers(models, inspect.isclass):
if model[1].__module__ == "odes_storage.models":
model_class = model[1]
model_class.update_forward_refs()
if isinstance(model_class, BaseModel):
model_class.update_forward_refs()
......@@ -3,7 +3,7 @@ from datetime import datetime, timedelta
from typing import Optional
from fastapi.openapi.models import OAuthFlowPassword
from httpx import AsyncRequest, AsyncResponse
from httpx import Request, Response
from pydantic import BaseModel
from odes_storage.api_client import Send
......@@ -55,7 +55,7 @@ class AuthMiddleware:
self.flow_client = PasswordFlowClient(flow)
@staticmethod
def set_access_header(token: str, request: AsyncRequest, *, replace: bool) -> None:
def set_access_header(token: str, request: Request, *, replace: bool) -> None:
key = "authorization"
value = f"bearer {token}"
if replace:
......@@ -85,7 +85,7 @@ class AuthMiddleware:
return token_response
return None
async def __call__(self, request: AsyncRequest, call_next: Send) -> AsyncResponse:
async def __call__(self, request: Request, call_next: Send) -> Response:
if self.auth_state.is_expired():
await self.refresh()
access_token = self.auth_state.access_token
......
......@@ -12,121 +12,49 @@ class AppError(BaseModel):
message: "Optional[str]" = Field(None, alias="message")
from datetime import datetime
from typing import Any # noqa
from typing import Dict, List, Optional
from pydantic import BaseModel, Field
from typing_extensions import Literal
class ConversionStatus(BaseModel):
id: "Optional[str]" = Field(None, alias="id")
status: "Optional[str]" = Field(None, alias="status")
errors: "Optional[List[str]]" = Field(None, alias="errors")
from datetime import datetime
from typing import Any # noqa
from typing import Dict, List, Optional
from pydantic import BaseModel, Field
from typing_extensions import Literal
class CreateUpdateRecordsResponse(BaseModel):
record_count: "Optional[int]" = Field(None, alias="recordCount")
record_ids: "Optional[List[str]]" = Field(None, alias="recordIds")
skipped_record_ids: "Optional[List[str]]" = Field(None, alias="skippedRecordIds")
from datetime import datetime
from typing import Any # noqa
from typing import Dict, List, Optional
from pydantic import BaseModel, Field
from typing_extensions import Literal
class DatastoreQueryResult(BaseModel):
cursor: "Optional[str]" = Field(None, alias="cursor")
results: "Optional[List[str]]" = Field(None, alias="results")
from datetime import datetime
from typing import Any # noqa
from typing import Dict, List, Optional
from pydantic import BaseModel, Field
from typing_extensions import Literal
class Legal(BaseModel):
legaltags: "Optional[List[str]]" = Field(None, alias="legaltags")
other_relevant_data_countries: "Optional[List[str]]" = Field(None, alias="otherRelevantDataCountries")
from datetime import datetime
from typing import Any # noqa
from typing import Dict, List, Optional
from pydantic import BaseModel, Field
from typing_extensions import Literal
class MultiRecordIds(BaseModel):
records: "List[str]" = Field(..., alias="records")
attributes: "Optional[List[str]]" = Field(None, alias="attributes")
from datetime import datetime
from typing import Any # noqa
from typing import Dict, List, Optional
from pydantic import BaseModel, Field
from typing_extensions import Literal
class MultiRecordInfo(BaseModel):
records: "Optional[List[str]]" = Field(None, alias="records")
invalid_records: "Optional[List[str]]" = Field(None, alias="invalidRecords")
retry_records: "Optional[List[str]]" = Field(None, alias="retryRecords")
from datetime import datetime
from typing import Any # noqa
from typing import Dict, List, Optional
from pydantic import BaseModel, Field
from typing_extensions import Literal
class MultiRecordRequest(BaseModel):
records: "List[str]" = Field(..., alias="records")
from datetime import datetime
from typing import Any # noqa
from typing import Dict, List, Optional
from pydantic import BaseModel, Field
from typing_extensions import Literal
class MultiRecordResponse(BaseModel):
records: "Optional[List[str]]" = Field(None, alias="records")
not_found: "Optional[List[str]]" = Field(None, alias="notFound")
conversion_statuses: "Optional[List[ConversionStatus]]" = Field(None, alias="conversionStatuses")
from datetime import datetime
from typing import Any # noqa
from typing import Dict, List, Optional
from pydantic import BaseModel, Field
from typing_extensions import Literal
class Record(BaseModel):
id: "Optional[str]" = Field(None, alias="id")
version: "Optional[int]" = Field(None, alias="version")
......@@ -143,53 +71,21 @@ class Record(BaseModel):
modify_user: "Optional[str]" = Field(None, alias="modifyUser")
from datetime import datetime
from typing import Any # noqa
from typing import Dict, List, Optional
from pydantic import BaseModel, Field
from typing_extensions import Literal
class RecordAncestry(BaseModel):
parents: "Optional[List[str]]" = Field(None, alias="parents")
from datetime import datetime
from typing import Any # noqa
from typing import Dict, List, Optional
from pydantic import BaseModel, Field
from typing_extensions import Literal
class RecordVersions(BaseModel):
record_id: "Optional[str]" = Field(None, alias="recordId")
versions: "Optional[List[int]]" = Field(None, alias="versions")
from datetime import datetime
from typing import Any # noqa
from typing import Dict, List, Optional
from pydantic import BaseModel, Field
from typing_extensions import Literal
class Schema(BaseModel):
kind: "str" = Field(..., alias="kind")
schema_: "Optional[List[SchemaItem]]" = Field(None, alias="schema_")
ext: "Optional[Dict[str, Any]]" = Field(None, alias="ext")
from datetime import datetime
from typing import Any # noqa
from typing import Dict, List, Optional
from pydantic import BaseModel, Field
from typing_extensions import Literal
class SchemaItem(BaseModel):
path: "str" = Field(..., alias="path")
kind: "Literal['string', 'int', 'float', 'double', 'long', 'boolean', 'link', 'datetime']" = Field(
......@@ -198,14 +94,6 @@ class SchemaItem(BaseModel):
ext: "Optional[Dict[str, Any]]" = Field(None, alias="ext")
from datetime import datetime
from typing import Any # noqa
from typing import Dict, List, Optional
from pydantic import BaseModel, Field
from typing_extensions import Literal
class StorageAcl(BaseModel):
viewers: "List[str]" = Field(..., alias="viewers")
owners: "List[str]" = Field(..., alias="owners")
......@@ -7,7 +7,7 @@ from enum import Enum
from typing import Any, Dict, List, Optional, Type, TypeVar, Union
from fastapi.openapi.models import OAuthFlowPassword
from httpx import AsyncClient, AsyncResponse
from httpx import AsyncClient, Response
from pydantic import BaseModel, ValidationError
from typing_extensions import Literal
......@@ -77,7 +77,7 @@ class TokenErrorResponse(BaseModel):
TokenResponse = Union[TokenSuccessResponse, TokenErrorResponse]
def parse_token_response(response: AsyncResponse) -> TokenResponse:
def parse_token_response(response: Response) -> TokenResponse:
with suppress(ValidationError):
if response.status_code == HTTP_200_OK:
return TokenSuccessResponse.parse_raw(response.text)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment