|
9 | 9 | Generic,
|
10 | 10 | List,
|
11 | 11 | Optional,
|
| 12 | + Tuple, |
12 | 13 | Type,
|
13 | 14 | TypeVar,
|
14 | 15 | Union,
|
@@ -67,7 +68,7 @@ def _convert_dict(d, return_type: Type[BaseData]):
|
67 | 68 | T = TypeVar("T", bound=BaseData)
|
68 | 69 |
|
69 | 70 |
|
70 |
| -@dataclass |
| 71 | +@dataclass(frozen=True) |
71 | 72 | class Request(Generic[T]):
|
72 | 73 | base = "https://api-v2.soundcloud.com"
|
73 | 74 | format_url: str
|
@@ -107,7 +108,7 @@ def __call__(
|
107 | 108 | return _convert_dict(r.json(), self.return_type)
|
108 | 109 |
|
109 | 110 |
|
110 |
| -@dataclass |
| 111 | +@dataclass(frozen=True) |
111 | 112 | class CollectionRequest(Request, Generic[T]):
|
112 | 113 | def __call__(
|
113 | 114 | self,
|
@@ -149,7 +150,7 @@ def __call__(
|
149 | 150 | resource_url = urljoin(resource_url, parsed.path)
|
150 | 151 |
|
151 | 152 |
|
152 |
| -@dataclass |
| 153 | +@dataclass(frozen=True) |
153 | 154 | class ListRequest(Request, Generic[T]):
|
154 | 155 | """
|
155 | 156 | Requests the resource list at the given url with
|
@@ -181,7 +182,7 @@ class DataclassInstance(Protocol):
|
181 | 182 | Q = TypeVar("Q", bound=DataclassInstance)
|
182 | 183 |
|
183 | 184 |
|
184 |
| -@dataclass |
| 185 | +@dataclass(frozen=True) |
185 | 186 | class GraphQLRequest(Generic[Q, T]):
|
186 | 187 | base = "https://graph.soundcloud.com/graphql"
|
187 | 188 | operation_name: str
|
@@ -322,13 +323,13 @@ def __call__(
|
322 | 323 | """
|
323 | 324 |
|
324 | 325 |
|
325 |
| -@dataclass |
| 326 | +@dataclass(frozen=True) |
326 | 327 | class UserInteractionsQueryResult(BaseData):
|
327 |
| - user: List[UserInteraction] |
328 |
| - creator: List[UserInteraction] |
| 328 | + user: Tuple[UserInteraction, ...] |
| 329 | + creator: Tuple[UserInteraction, ...] |
329 | 330 |
|
330 | 331 |
|
331 |
| -@dataclass |
| 332 | +@dataclass(frozen=True) |
332 | 333 | class UserInteractionsQueryParams:
|
333 | 334 | createdByProfileUrn: str
|
334 | 335 | interactionTypeUrn: str
|
|
0 commit comments