|
3 | 3 | from office365.onedrive.workbooks.applications.application import WorkbookApplication |
4 | 4 | from office365.onedrive.workbooks.comments.comment import WorkbookComment |
5 | 5 | from office365.onedrive.workbooks.functions.functions import WorkbookFunctions |
6 | | -from office365.onedrive.workbooks.names.named_item import WorkbookNamedItem |
| 6 | +from office365.onedrive.workbooks.names.collection import WorkbookNamedItemCollection |
7 | 7 | from office365.onedrive.workbooks.operations.workbook import WorkbookOperation |
8 | 8 | from office365.onedrive.workbooks.session_info import WorkbookSessionInfo |
9 | 9 | from office365.onedrive.workbooks.tables.collection import WorkbookTableCollection |
10 | 10 | from office365.onedrive.workbooks.worksheets.collection import ( |
11 | 11 | WorkbookWorksheetCollection, |
12 | 12 | ) |
13 | 13 | from office365.runtime.client_result import ClientResult |
| 14 | +from office365.runtime.http.request_options import RequestOptions |
14 | 15 | from office365.runtime.paths.resource_path import ResourcePath |
15 | 16 | from office365.runtime.queries.function import FunctionQuery |
16 | 17 | from office365.runtime.queries.service_operation import ServiceOperationQuery |
@@ -56,25 +57,20 @@ def refresh_session(self, session_id): |
56 | 57 | self.context.add_query(qry) |
57 | 58 |
|
58 | 59 | def _construct_request(request): |
59 | | - """ |
60 | | - :type request: office365.runtime.http.request_options.RequestOptions |
61 | | - """ |
| 60 | + # type: (RequestOptions) -> None |
62 | 61 | request.set_header("workbook-session-id", session_id) |
63 | 62 |
|
64 | 63 | self.context.before_execute(_construct_request) |
65 | 64 | return self |
66 | 65 |
|
67 | 66 | def close_session(self, session_id): |
68 | 67 | """Use this API to close an existing workbook session. |
69 | | -
|
70 | 68 | :param str session_id: Identifier of the workbook session |
71 | 69 | """ |
72 | 70 | qry = ServiceOperationQuery(self, "closeSession") |
73 | 71 |
|
74 | 72 | def _construct_request(request): |
75 | | - """ |
76 | | - :type request: office365.runtime.http.request_options.RequestOptions |
77 | | - """ |
| 73 | + # type: (RequestOptions) -> None |
78 | 74 | request.set_header("workbook-session-id", session_id) |
79 | 75 |
|
80 | 76 | self.context.before_execute(_construct_request) |
@@ -126,13 +122,12 @@ def tables(self): |
126 | 122 |
|
127 | 123 | @property |
128 | 124 | def names(self): |
129 | | - # type: () -> EntityCollection[WorkbookNamedItem] |
| 125 | + # type: () -> WorkbookNamedItemCollection |
130 | 126 | """Represents a collection of workbook scoped named items (named ranges and constants). Read-only.""" |
131 | 127 | return self.properties.get( |
132 | 128 | "names", |
133 | | - EntityCollection( |
| 129 | + WorkbookNamedItemCollection( |
134 | 130 | self.context, |
135 | | - WorkbookNamedItem, |
136 | 131 | ResourcePath("names", self.resource_path), |
137 | 132 | ), |
138 | 133 | ) |
|
0 commit comments