forked from sns-sdks/python-facebook
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathalbum.py
More file actions
56 lines (45 loc) · 1.66 KB
/
album.py
File metadata and controls
56 lines (45 loc) · 1.66 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
"""
Model class for album.
Refer: https://developers.facebook.com/docs/graph-api/reference/album/
"""
from dataclasses import dataclass
from typing import List, Optional
from dataclasses_json import config
from pyfacebook.models.base import BaseModel, field
from pyfacebook.models.extensions import Paging
@dataclass
class Album(BaseModel):
"""
A class representing the Album.
"""
id: Optional[str] = field(repr=True, compare=True)
backdated_time: Optional[str] = field()
backdated_time_granularity: Optional[str] = field()
can_upload: Optional[bool] = field()
count: Optional[int] = field()
cover_photo: Optional[dict] = (
field()
) # TODO Refer: https://developers.facebook.com/docs/graph-api/reference/photo/
created_time: Optional[str] = field()
description: Optional[str] = field()
event: Optional[dict] = (
field()
) # TODO Refer: https://developers.facebook.com/docs/graph-api/reference/event/
_from: Optional[dict] = field(metadata=config(field_name="from"))
link: Optional[str] = field()
location: Optional[str] = field()
name: Optional[str] = field(repr=True)
place: Optional[dict] = (
field()
) # TODO Refer: https://developers.facebook.com/docs/graph-api/reference/place/
privacy: Optional[str] = field()
type: Optional[str] = field()
updated_time: Optional[str] = field()
@dataclass
class AlbumResponse(BaseModel):
"""
A class representing the result for albums edge.
Refer: https://developers.facebook.com/docs/graph-api/reference/page/albums
"""
data: List[Album] = field(repr=True, compare=True)
paging: Optional[Paging] = field()