-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathapi_schemas.py
More file actions
60 lines (47 loc) · 1.4 KB
/
api_schemas.py
File metadata and controls
60 lines (47 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
"""
This program is free software: you can redistribute it under the terms
of the GNU General Public License, v. 3.0. If a copy of the GNU General
Public License was not distributed with this file, see <https://www.gnu.org/licenses/>.
"""
import datetime
from typing import Optional
from pydantic import BaseModel
class PublicationsCreate(BaseModel):
country_code: Optional[str] = None
platform_name: str
source: str
status: str
gateway_client: Optional[str] = None
date_created: Optional[datetime.datetime] = None
class PublicationsRead(PublicationsCreate):
id: int
class Pagination(BaseModel):
total_records: int
page: int
page_size: int
total_pages: int
class PublicationsResponse(BaseModel):
total_publications: int
total_published: int
total_failed: int
data: list[PublicationsRead]
pagination: Optional[Pagination] = None
class PlatformManifest(BaseModel):
name: str
shortcode: str
protocol_type: str
service_type: str
icon_svg: Optional[str] = None
icon_png: Optional[str] = None
support_url_scheme: Optional[bool] = None
class OAuthClientMetadata(BaseModel):
client_id: str
dpop_bound_access_tokens: bool
application_type: str
redirect_uris: list[str]
grant_types: list[str]
response_types: list[str]
scope: str
token_endpoint_auth_method: str
client_name: str
client_uri: str