|
10 | 10 | PageResult: Represents a page of items in a paged response. |
11 | 11 | """ |
12 | 12 | from typing import Any, List, Optional |
| 13 | +from dataclasses import dataclass |
13 | 14 | from __future__ import annotations |
14 | 15 |
|
15 | 16 | from kiota_abstractions.serialization.parsable import Parsable # type: ignore |
|
21 | 22 | T = TypeVar('T') |
22 | 23 |
|
23 | 24 |
|
| 25 | +@dataclass |
24 | 26 | class PageResult(Parsable, Generic[T]): |
25 | 27 | """ |
26 | 28 | Represents a page of items in a paged response. |
27 | 29 | """ |
28 | | - object_type = None |
29 | | - |
30 | | - def __init__(self, object_type: Optional[Any] = None) -> None: |
31 | | - PageResult.object_type = object_type |
32 | | - self._odata_next_link: Optional[str] = None |
33 | | - self._value: Optional[List[T]] = None |
34 | | - |
35 | | - @property |
36 | | - def odata_next_link(self) -> Optional[str]: |
37 | | - """ |
38 | | - Gets the next link for the page. |
39 | | - Returns: |
40 | | - Optional[str]: The next link, or None if there is no next link. |
41 | | - """ |
42 | | - return self._odata_next_link |
43 | | - |
44 | | - @odata_next_link.setter |
45 | | - def odata_next_link(self, next_link: Optional[str]) -> None: |
46 | | - """ |
47 | | - Sets the next link for the page. |
48 | | - Args: |
49 | | - next_link (Optional[str]): The next link to set. |
50 | | - """ |
51 | | - self._odata_next_link = next_link |
52 | | - |
53 | | - @property |
54 | | - def value(self) -> Optional[List[T]]: |
55 | | - """ |
56 | | - Gets the items in the page. |
57 | | - Returns: |
58 | | - Optional[List[Any]]: The items in the page, or None if there |
59 | | - are no items. |
60 | | - """ |
61 | | - return self._value |
62 | | - |
63 | | - @value.setter |
64 | | - def value(self, value: Optional[List[T]]) -> None: |
65 | | - """ |
66 | | - Sets the items in the page. |
67 | | - Args: |
68 | | - value (Optional[List[Any]]): The items to set. |
69 | | - """ |
70 | | - self._value = value |
| 30 | + object_type: Optional[Any] = None |
| 31 | + odata_next_link: Optional[str] = None |
| 32 | + value: Optional[List[T]] = None |
71 | 33 |
|
72 | 34 | @staticmethod |
73 | 35 | def create_from_discriminator_value(parse_node: ParseNode) -> PageResult: # pylint: disable=unused-argument |
|
0 commit comments