Skip to content

Commit 2b89ff7

Browse files
committed
Fix lint errors
1 parent ae0259c commit 2b89ff7

File tree

4 files changed

+94
-50
lines changed

4 files changed

+94
-50
lines changed

nylas/models/events.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,13 +243,17 @@ def _decode_conferencing(conferencing: dict) -> Union[Conferencing, None]:
243243

244244
if "autocreate" in conferencing:
245245
return Autocreate.from_dict(conferencing)
246-
246+
247247
# Handle case where provider exists but details/autocreate doesn't
248248
if "provider" in conferencing:
249249
# Create a Details object with empty details
250250
details_dict = {
251251
"provider": conferencing["provider"],
252-
"details": conferencing.get("conf_settings", {}) if "conf_settings" in conferencing else {}
252+
"details": (
253+
conferencing.get("conf_settings", {})
254+
if "conf_settings" in conferencing
255+
else {}
256+
),
253257
}
254258
return Details.from_dict(details_dict)
255259

@@ -299,6 +303,7 @@ class NotetakerMeetingSettings:
299303
audio_recording: When true, Notetaker records the meeting's audio.
300304
transcription: When true, Notetaker transcribes the meeting's audio.
301305
"""
306+
302307
video_recording: Optional[bool] = True
303308
audio_recording: Optional[bool] = True
304309
transcription: Optional[bool] = True
@@ -315,6 +320,7 @@ class EventNotetaker:
315320
name: The display name for the Notetaker bot.
316321
meeting_settings: Notetaker Meeting Settings.
317322
"""
323+
318324
id: Optional[str] = None
319325
name: Optional[str] = "Nylas Notetaker"
320326
meeting_settings: Optional[NotetakerMeetingSettings] = None
@@ -679,6 +685,7 @@ class EventNotetakerSettings(TypedDict):
679685
audio_recording: When true, Notetaker records the meeting's audio.
680686
transcription: When true, Notetaker transcribes the meeting's audio.
681687
"""
688+
682689
video_recording: NotRequired[bool]
683690
audio_recording: NotRequired[bool]
684691
transcription: NotRequired[bool]
@@ -693,6 +700,7 @@ class EventNotetakerRequest(TypedDict):
693700
name: The display name for the Notetaker bot.
694701
meeting_settings: Notetaker Meeting Settings.
695702
"""
703+
696704
id: NotRequired[str]
697705
name: NotRequired[str]
698706
meeting_settings: NotRequired[EventNotetakerSettings]

nylas/models/notetakers.py

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
from dataclasses import dataclass
2-
from typing import Optional, List
32
from enum import Enum
3+
from typing import Optional
44

55
from dataclasses_json import dataclass_json
6-
from typing_extensions import TypedDict, NotRequired
6+
from typing_extensions import NotRequired, TypedDict
77

88
from nylas.models.list_query_params import ListQueryParams
99

1010

1111
class NotetakerState(str, Enum):
1212
"""
1313
Enum representing the possible states of a Notetaker bot.
14-
14+
1515
Values:
1616
SCHEDULED: The Notetaker is scheduled to join a meeting.
1717
CONNECTING: The Notetaker is connecting to the meeting.
@@ -23,6 +23,7 @@ class NotetakerState(str, Enum):
2323
MEDIA_ERROR: An error occurred while processing the media.
2424
MEDIA_DELETED: The meeting media has been deleted.
2525
"""
26+
2627
SCHEDULED = "scheduled"
2728
CONNECTING = "connecting"
2829
WAITING_FOR_ENTRY = "waiting_for_entry"
@@ -37,12 +38,13 @@ class NotetakerState(str, Enum):
3738
class MeetingProvider(str, Enum):
3839
"""
3940
Enum representing the possible meeting providers for Notetaker.
40-
41+
4142
Values:
4243
GOOGLE_MEET: Google Meet meetings
4344
ZOOM: Zoom meetings
4445
MICROSOFT_TEAMS: Microsoft Teams meetings
4546
"""
47+
4648
GOOGLE_MEET = "Google Meet"
4749
ZOOM = "Zoom Meeting"
4850
MICROSOFT_TEAMS = "Microsoft Teams"
@@ -57,8 +59,10 @@ class NotetakerMeetingSettings:
5759
Attributes:
5860
video_recording: When true, Notetaker records the meeting's video.
5961
audio_recording: When true, Notetaker records the meeting's audio.
60-
transcription: When true, Notetaker transcribes the meeting's audio. If transcription is true, audio_recording must also be true.
62+
transcription: When true, Notetaker transcribes the meeting's audio.
63+
If transcription is true, audio_recording must also be true.
6164
"""
65+
6266
video_recording: Optional[bool] = True
6367
audio_recording: Optional[bool] = True
6468
transcription: Optional[bool] = True
@@ -74,6 +78,7 @@ class NotetakerMediaRecording:
7478
url: A link to the meeting recording.
7579
size: The size of the file, in MB.
7680
"""
81+
7782
url: str
7883
size: int
7984

@@ -88,6 +93,7 @@ class NotetakerMedia:
8893
recording: The meeting recording.
8994
transcript: The meeting transcript.
9095
"""
96+
9197
recording: Optional[NotetakerMediaRecording] = None
9298
transcript: Optional[NotetakerMediaRecording] = None
9399

@@ -108,6 +114,7 @@ class Notetaker:
108114
meeting_settings: Notetaker Meeting Settings.
109115
message: A message describing the API response (only included in some responses).
110116
"""
117+
111118
id: str
112119
name: str
113120
join_time: int
@@ -117,27 +124,27 @@ class Notetaker:
117124
meeting_provider: Optional[MeetingProvider] = None
118125
message: Optional[str] = None
119126
object: str = "notetaker"
120-
127+
121128
def is_state(self, state: NotetakerState) -> bool:
122129
"""
123130
Check if the notetaker is in a specific state.
124-
131+
125132
Args:
126133
state: The NotetakerState to check against.
127-
134+
128135
Returns:
129136
True if the notetaker is in the specified state, False otherwise.
130137
"""
131138
return self.state == state
132-
139+
133140
def is_scheduled(self) -> bool:
134141
"""Check if the notetaker is in the scheduled state."""
135142
return self.is_state(NotetakerState.SCHEDULED)
136-
143+
137144
def is_attending(self) -> bool:
138145
"""Check if the notetaker is currently attending a meeting."""
139146
return self.is_state(NotetakerState.ATTENDING)
140-
147+
141148
def has_media_available(self) -> bool:
142149
"""Check if the notetaker has media available for download."""
143150
return self.is_state(NotetakerState.MEDIA_AVAILABLE)
@@ -149,10 +156,12 @@ class InviteNotetakerRequest(TypedDict):
149156
150157
Attributes:
151158
meeting_link: A meeting invitation link that Notetaker uses to join the meeting.
152-
join_time: When Notetaker should join the meeting, in Unix timestamp format. If empty, Notetaker joins the meeting immediately.
159+
join_time: When Notetaker should join the meeting, in Unix timestamp format.
160+
If empty, Notetaker joins the meeting immediately.
153161
name: The display name for the Notetaker bot.
154162
meeting_settings: Notetaker Meeting Settings.
155163
"""
164+
156165
meeting_link: str
157166
join_time: NotRequired[int]
158167
name: NotRequired[str]
@@ -168,6 +177,7 @@ class UpdateNotetakerRequest(TypedDict):
168177
name: The display name for the Notetaker bot.
169178
meeting_settings: Notetaker Meeting Settings.
170179
"""
180+
171181
join_time: NotRequired[int]
172182
name: NotRequired[str]
173183
meeting_settings: NotRequired[dict]
@@ -187,15 +197,16 @@ class ListNotetakerQueryParams(ListQueryParams):
187197
page_token: An identifier that specifies which page of data to return.
188198
prev_page_token: An identifier that specifies which page of data to return.
189199
"""
200+
190201
state: NotRequired[NotetakerState]
191202
join_time_from: NotRequired[int]
192203
join_time_until: NotRequired[int]
193-
204+
194205
def __post_init__(self):
195206
"""Convert NotetakerState enum to string value for API requests."""
196207
super().__post_init__()
197208
# Convert state enum to string if present
198-
if hasattr(self, 'state') and isinstance(self.state, NotetakerState):
209+
if hasattr(self, "state") and isinstance(self.state, NotetakerState):
199210
self.state = self.state.value
200211

201212

@@ -207,4 +218,5 @@ class FindNotetakerQueryParams(TypedDict):
207218
select: Comma-separated list of fields to return in the response.
208219
Use this to limit the fields returned in the response.
209220
"""
210-
select: NotRequired[str]
221+
222+
select: NotRequired[str]

nylas/models/scheduler.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
from dataclasses import dataclass, field
2-
from typing import Dict, Optional, List, Any, Literal, Union
2+
from typing import Dict, List, Literal, Optional
3+
4+
from dataclasses_json import config, dataclass_json
5+
from typing_extensions import NotRequired, TypedDict
36

4-
from dataclasses_json import dataclass_json, config
5-
from typing_extensions import TypedDict, NotRequired
6-
from nylas.models.events import Conferencing, _decode_conferencing
77
from nylas.models.availability import AvailabilityRules, OpenHours
8+
from nylas.models.events import Conferencing, _decode_conferencing
89

910
BookingType = Literal["booking", "organizer-confirmation"]
1011
BookingReminderType = Literal["email", "webhook"]
@@ -99,7 +100,7 @@ class SchedulerSettings:
99100
confirmation_redirect_url: The custom URL to redirect to once the booking is confirmed.
100101
hide_rescheduling_options: Whether the option to reschedule an event
101102
is hidden in booking confirmations and notifications.
102-
hide_cancellation_options: Whether the option to cancel an event
103+
hide_cancellation_options: Whether the option to cancel an event
103104
is hidden in booking confirmations and notifications.
104105
hide_additional_guests: Whether to hide the additional guests field on the scheduling page.
105106
email_template: Configurable settings for booking emails.
@@ -300,6 +301,7 @@ class UpdateConfigurationRequest(TypedDict):
300301
scheduler: Settings for the Scheduler UI.
301302
appearance: Appearance settings for the Scheduler UI.
302303
"""
304+
303305
participants: NotRequired[List[ConfigParticipant]]
304306
availability: NotRequired[Availability]
305307
event_booking: NotRequired[EventBooking]
@@ -322,6 +324,7 @@ class CreateSessionRequest(TypedDict):
322324
slug is not required.
323325
time_to_live: The time-to-live in seconds for the session
324326
"""
327+
325328
configuration_id: NotRequired[str]
326329
slug: NotRequired[str]
327330
time_to_live: NotRequired[int]
@@ -383,7 +386,7 @@ class CreateBookingRequest:
383386
timezone: The guest's timezone that is used in email notifications.
384387
email_language: The language of the guest email notifications.
385388
additional_guests: List of additional guest email addresses to include in the booking.
386-
additional_fields: Dictionary of additional field keys mapped to
389+
additional_fields: Dictionary of additional field keys mapped to
387390
values populated by the guest in the booking form.
388391
"""
389392

@@ -496,7 +499,7 @@ class CreateBookingQueryParams:
496499
slug: The slug of the Configuration object whose settings are used for calculating availability.
497500
If you're using session authentication (requires_session_auth is set to true) or using configurationId,
498501
slug is not required.
499-
timezone: The timezone to use for the booking.
502+
timezone: The timezone to use for the booking.
500503
If not provided, Nylas uses the timezone from the Configuration object.
501504
"""
502505

0 commit comments

Comments
 (0)