Skip to content

Commit bd1deeb

Browse files
committed
chore: commit pending changes
1 parent 3510d9f commit bd1deeb

15 files changed

Lines changed: 202 additions & 61 deletions

generator/.checkpoints/SharePoint.xml.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

office365/outlook/calendar/calendar.py

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
from typing import Any, Optional
2-
3-
from typing_extensions import Self
1+
from typing import Optional
42

53
from office365.communications.onlinemeetings.provider_type import OnlineMeetingProviderType
64
from office365.directory.extensions.extended_property import (
@@ -21,6 +19,7 @@
2119
from office365.runtime.queries.function import FunctionQuery
2220
from office365.runtime.queries.service_operation import ServiceOperationQuery
2321
from office365.runtime.types.collections import StringCollection
22+
from office365.runtime.types.odata_property import odata
2423

2524

2625
class Calendar(Entity):
@@ -123,8 +122,9 @@ def color(self) -> Optional[str]:
123122
"""
124123
return self.properties.get("color", None)
125124

125+
@odata(name="defaultOnlineMeetingProvider")
126126
@property
127-
def default_online_meeting_provider(self) -> Optional[OnlineMeetingProviderType]:
127+
def default_online_meeting_provider(self) -> OnlineMeetingProviderType:
128128
"""
129129
The default online meeting provider for meetings sent from this calendar.
130130
Possible values are: unknown, skypeForBusiness, skypeForConsumer, teamsForBusiness.
@@ -171,13 +171,15 @@ def events(self) -> EventCollection:
171171
"""The events in the calendar. Navigation property. Read-only."""
172172
return self.properties.get("events", EventCollection(self.context, ResourcePath("events", self.resource_path)))
173173

174+
@odata(name="calendarView")
174175
@property
175176
def calendar_view(self) -> EventCollection:
176177
"""The calendar view for the calendar. Navigation property. Read-only."""
177178
return self.properties.get(
178179
"calendarView", EventCollection(self.context, ResourcePath("calendarView", self.resource_path))
179180
)
180181

182+
@odata(name="calendarPermissions")
181183
@property
182184
def calendar_permissions(self) -> CalendarPermissionCollection:
183185
"""The permissions of the users with whom the calendar is shared."""
@@ -186,6 +188,7 @@ def calendar_permissions(self) -> CalendarPermissionCollection:
186188
CalendarPermissionCollection(self.context, ResourcePath("calendarPermissions", self.resource_path)),
187189
)
188190

191+
@odata(name="multiValueExtendedProperties")
189192
@property
190193
def multi_value_extended_properties(self) -> EntityCollection[MultiValueLegacyExtendedProperty]:
191194
"""The collection of multi-value extended properties defined for the Calendar."""
@@ -198,6 +201,7 @@ def multi_value_extended_properties(self) -> EntityCollection[MultiValueLegacyEx
198201
),
199202
)
200203

204+
@odata(name="singleValueExtendedProperties")
201205
@property
202206
def single_value_extended_properties(self) -> EntityCollection[SingleValueLegacyExtendedProperty]:
203207
"""The collection of single-value extended properties defined for the calendar. Read-only. Nullable."""
@@ -215,18 +219,6 @@ def hex_color(self) -> Optional[str]:
215219
"""Gets the hexColor property"""
216220
return self.properties.get("hexColor", None)
217221

218-
def get_property(self, name: str, default_value: Any = None) -> Self:
219-
if default_value is None:
220-
property_mapping = {
221-
"allowedOnlineMeetingProviders": self.allowed_online_meeting_providers,
222-
"calendarView": self.calendar_view,
223-
"calendarPermissions": self.calendar_permissions,
224-
"multiValueExtendedProperties": self.multi_value_extended_properties,
225-
"singleValueExtendedProperties": self.single_value_extended_properties,
226-
}
227-
default_value = property_mapping.get(name, None)
228-
return super().get_property(name, default_value)
229-
230222
@property
231223
def entity_type_name(self) -> str:
232224
return "microsoft.graph.Calendar"

office365/runtime/types/duration.py

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,19 @@
33
from dataclasses import dataclass
44
from datetime import timedelta
55

6-
from office365.runtime.client_value import ClientValue
7-
86

97
@dataclass
10-
class Duration(ClientValue):
8+
class Duration:
119
"""Represents an Edm.Duration value (ISO 8601 duration format, e.g. PT1H)."""
1210

13-
value: str | None = None
14-
1511
@staticmethod
16-
def parse(value: str | timedelta) -> Duration:
17-
if isinstance(value, timedelta):
18-
total_sec = int(value.total_seconds())
19-
h, r = divmod(total_sec, 3600)
20-
m = r // 60
21-
result = "PT"
22-
if h:
23-
result += f"{h}H"
24-
if m:
25-
result += f"{m}M"
26-
return Duration(value=result or "PT0M")
27-
return Duration(value=value)
28-
29-
@property
30-
def entity_type_name(self):
31-
return None
12+
def parse(value: timedelta) -> str:
13+
total_sec = int(value.total_seconds())
14+
h, r = divmod(total_sec, 3600)
15+
m = r // 60
16+
result = "PT"
17+
if h:
18+
result += f"{h}H"
19+
if m:
20+
result += f"{m}M"
21+
return result or "PT0M"
Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
from __future__ import annotations
22

33
from dataclasses import dataclass, field
4+
from datetime import datetime
5+
from uuid import UUID
46

57
from office365.runtime.client_value import ClientValue
68
from office365.sharepoint.tenant.administration.audit.data import AuditData
@@ -9,13 +11,13 @@
911
@dataclass
1012
class UnifiedAuditRecord(ClientValue):
1113
AuditData: AuditData = field(default_factory=AuditData)
12-
CreationDate = None
13-
Operation = None
14-
RecordId = None
15-
RecordType = None
16-
UserId = None
1714
RawAuditData: str | None = None
15+
CreationDate: datetime | None = field(default_factory=lambda: datetime.min)
16+
Operation: str | None = None
17+
RecordId: UUID | None = None
18+
RecordType: int | None = None
19+
UserId: str | None = None
1820

1921
@property
20-
def entity_type_name(self): # type: ignore[override]
22+
def entity_type_name(self):
2123
return "Microsoft.SharePoint.Administration.TenantAdmin.UnifiedAuditRecord"
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
from __future__ import annotations
2+
3+
from dataclasses import field
4+
from datetime import datetime
5+
6+
from office365.runtime.client_value import ClientValue
7+
from office365.runtime.types.collections import StringCollection
8+
9+
10+
class CatalogManagementCustomPropertyMap(ClientValue):
11+
lastUpdatedTimeUtc: datetime | None = field(default_factory=lambda: datetime.min)
12+
maxSiteCount: int | None = None
13+
pendingScanSlots: StringCollection = field(default_factory=StringCollection)
14+
sitePropertyDisplayNames: dict | None = field(default_factory=dict)
15+
sitePropertyMapping: dict | None = field(default_factory=dict)
16+
17+
@property
18+
def entity_type_name(self) -> str:
19+
return "Microsoft.SharePoint.Administration.TenantAdmin.CatalogManagement.CatalogManagementCustomPropertyMap"

office365/sharepoint/tenant/administration/copilot/base_raw_data_sources.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ class BaseRawDataSources(ClientValue):
1212
Metadata: BaseMetadata = field(default_factory=BaseMetadata)
1313

1414
@property
15-
def entity_type_name(self): # type: ignore[override]
15+
def entity_type_name(self) -> str:
1616
return "Microsoft.SharePoint.Administration.TenantAdmin.Copilot.BaseRawDataSources"
Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,20 @@
1-
from typing import Optional
1+
from __future__ import annotations
2+
3+
from dataclasses import field
24

35
from office365.runtime.client_value_collection import ClientValueCollection
46
from office365.runtime.types.collections import StringCollection
5-
from office365.sharepoint.tenant.administration.copilot.base_raw_data_sources import (
6-
BaseRawDataSources,
7-
)
7+
from office365.sharepoint.tenant.administration.copilot.base_raw_data_sources import BaseRawDataSources
88
from office365.sharepoint.tenant.administration.copilot.reportrow import ReportRow
99

1010

1111
class ReportDetails(BaseRawDataSources):
12-
def __init__(
13-
self,
14-
headers: Optional[StringCollection] = None,
15-
report_download_url: Optional[str] = None,
16-
report_rows: ClientValueCollection[ReportRow] = ClientValueCollection(ReportRow),
17-
):
18-
super().__init__()
19-
self.Headers = headers
20-
self.ReportDownloadUrl = report_download_url
21-
self.ReportRows = report_rows
12+
""" """
2213

23-
" "
14+
Headers: StringCollection = field(default_factory=StringCollection)
15+
ReportDownloadUrl: str | None = None
16+
ReportRows: ClientValueCollection[ReportRow] = field(default_factory=lambda: ClientValueCollection(ReportRow))
2417

2518
@property
26-
def entity_type_name(self): # type: ignore[override]
19+
def entity_type_name(self) -> str:
2720
return "Microsoft.SharePoint.Administration.TenantAdmin.Copilot.ReportDetails"
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from __future__ import annotations
2+
3+
from office365.runtime.client_value import ClientValue
4+
5+
6+
class DatasetMetadataInfo(ClientValue):
7+
createdDate: str | None = None
8+
createdInADLSDate: str | None = None
9+
downloadUrl: str | None = None
10+
id: str | None = None
11+
lastSyncedDate: str | None = None
12+
lastSyncedInADLSDate: str | None = None
13+
subType: str | None = None
14+
uploadFileToADLSProgressStatus: str | None = None
15+
16+
@property
17+
def entity_type_name(self) -> str:
18+
return "Microsoft.SharePoint.Administration.TenantAdmin.SPOAdminReportInsights.Models.DatasetMetadataInfo"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from __future__ import annotations
2+
3+
from dataclasses import field
4+
5+
from office365.runtime.client_value import ClientValue
6+
from office365.runtime.types.collections import StringCollection
7+
8+
9+
class DatasetMetadataRequestInfo(ClientValue):
10+
feature: str | None = None
11+
subTypes: StringCollection = field(default_factory=StringCollection)
12+
13+
@property
14+
def entity_type_name(self) -> str:
15+
return "Microsoft.SharePoint.Administration.TenantAdmin.SPOAdminReportInsights.Models.DatasetMetadataRequestInfo"
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
from __future__ import annotations
2+
3+
from dataclasses import field
4+
5+
from office365.runtime.client_value import ClientValue
6+
from office365.runtime.client_value_collection import ClientValueCollection
7+
from office365.sharepoint.tenant.administration.dataset_metadata_info import DatasetMetadataInfo
8+
9+
10+
class DatasetMetadataResponse(ClientValue):
11+
featureId: str | None = None
12+
sitePermissions: ClientValueCollection[DatasetMetadataInfo] = field(
13+
default_factory=lambda: ClientValueCollection(DatasetMetadataInfo)
14+
)
15+
TenantAdminSiteLifeCycle: ClientValueCollection[DatasetMetadataInfo] = field(
16+
default_factory=lambda: ClientValueCollection(DatasetMetadataInfo)
17+
)
18+
19+
@property
20+
def entity_type_name(self) -> str:
21+
return "Microsoft.SharePoint.Administration.TenantAdmin.SPOAdminReportInsights.Models.DatasetMetadataResponse"

0 commit comments

Comments
 (0)