fathom-python 0.0.30__py3-none-any.whl → 0.0.33__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
fathom_python/_version.py CHANGED
@@ -3,10 +3,10 @@
3
3
  import importlib.metadata
4
4
 
5
5
  __title__: str = "fathom-python"
6
- __version__: str = "0.0.30"
6
+ __version__: str = "0.0.33"
7
7
  __openapi_doc_version__: str = "1.0.0"
8
- __gen_version__: str = "2.669.0"
9
- __user_agent__: str = "speakeasy-sdk/python 0.0.30 2.669.0 1.0.0 fathom-python"
8
+ __gen_version__: str = "2.698.4"
9
+ __user_agent__: str = "speakeasy-sdk/python 0.0.33 2.698.4 1.0.0 fathom-python"
10
10
 
11
11
  try:
12
12
  if __package__ is not None:
fathom_python/basesdk.py CHANGED
@@ -15,9 +15,19 @@ from urllib.parse import parse_qs, urlparse
15
15
 
16
16
  class BaseSDK:
17
17
  sdk_configuration: SDKConfiguration
18
+ parent_ref: Optional[object] = None
19
+ """
20
+ Reference to the root SDK instance, if any. This will prevent it from
21
+ being garbage collected while there are active streams.
22
+ """
18
23
 
19
- def __init__(self, sdk_config: SDKConfiguration) -> None:
24
+ def __init__(
25
+ self,
26
+ sdk_config: SDKConfiguration,
27
+ parent_ref: Optional[object] = None,
28
+ ) -> None:
20
29
  self.sdk_configuration = sdk_config
30
+ self.parent_ref = parent_ref
21
31
 
22
32
  def _get_url(self, base_url, url_variables):
23
33
  sdk_url, sdk_variables = self.sdk_configuration.get_server_details()
@@ -1,11 +1,13 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
+ from .fathomerror import FathomError
3
4
  from typing import TYPE_CHECKING
4
5
  from importlib import import_module
6
+ import builtins
7
+ import sys
5
8
 
6
9
  if TYPE_CHECKING:
7
10
  from .apierror import APIError
8
- from .fathomerror import FathomError
9
11
  from .no_response_error import NoResponseError
10
12
  from .responsevalidationerror import ResponseValidationError
11
13
 
@@ -13,12 +15,23 @@ __all__ = ["APIError", "FathomError", "NoResponseError", "ResponseValidationErro
13
15
 
14
16
  _dynamic_imports: dict[str, str] = {
15
17
  "APIError": ".apierror",
16
- "FathomError": ".fathomerror",
17
18
  "NoResponseError": ".no_response_error",
18
19
  "ResponseValidationError": ".responsevalidationerror",
19
20
  }
20
21
 
21
22
 
23
+ def dynamic_import(modname, retries=3):
24
+ for attempt in range(retries):
25
+ try:
26
+ return import_module(modname, __package__)
27
+ except KeyError:
28
+ # Clear any half-initialized module and retry
29
+ sys.modules.pop(modname, None)
30
+ if attempt == retries - 1:
31
+ break
32
+ raise KeyError(f"Failed to import module '{modname}' after {retries} attempts")
33
+
34
+
22
35
  def __getattr__(attr_name: str) -> object:
23
36
  module_name = _dynamic_imports.get(attr_name)
24
37
  if module_name is None:
@@ -27,7 +40,7 @@ def __getattr__(attr_name: str) -> object:
27
40
  )
28
41
 
29
42
  try:
30
- module = import_module(module_name, __package__)
43
+ module = dynamic_import(module_name)
31
44
  result = getattr(module, attr_name)
32
45
  return result
33
46
  except ImportError as e:
@@ -41,5 +54,5 @@ def __getattr__(attr_name: str) -> object:
41
54
 
42
55
 
43
56
  def __dir__():
44
- lazy_attrs = list(_dynamic_imports.keys())
45
- return sorted(lazy_attrs)
57
+ lazy_attrs = builtins.list(_dynamic_imports.keys())
58
+ return builtins.sorted(lazy_attrs)
@@ -2,12 +2,14 @@
2
2
 
3
3
  import httpx
4
4
  from typing import Optional
5
+ from dataclasses import dataclass
5
6
 
6
7
  from fathom_python.errors import FathomError
7
8
 
8
9
  MAX_MESSAGE_LEN = 10_000
9
10
 
10
11
 
12
+ @dataclass(frozen=True)
11
13
  class APIError(FathomError):
12
14
  """The fallback error class if no more specific error class is matched."""
13
15
 
@@ -2,25 +2,29 @@
2
2
 
3
3
  import httpx
4
4
  from typing import Optional
5
+ from dataclasses import dataclass, field
5
6
 
6
7
 
8
+ @dataclass(frozen=True)
7
9
  class FathomError(Exception):
8
10
  """The base class for all HTTP error responses."""
9
11
 
10
12
  message: str
11
13
  status_code: int
12
14
  body: str
13
- headers: httpx.Headers
14
- raw_response: httpx.Response
15
+ headers: httpx.Headers = field(hash=False)
16
+ raw_response: httpx.Response = field(hash=False)
15
17
 
16
18
  def __init__(
17
19
  self, message: str, raw_response: httpx.Response, body: Optional[str] = None
18
20
  ):
19
- self.message = message
20
- self.status_code = raw_response.status_code
21
- self.body = body if body is not None else raw_response.text
22
- self.headers = raw_response.headers
23
- self.raw_response = raw_response
21
+ object.__setattr__(self, "message", message)
22
+ object.__setattr__(self, "status_code", raw_response.status_code)
23
+ object.__setattr__(
24
+ self, "body", body if body is not None else raw_response.text
25
+ )
26
+ object.__setattr__(self, "headers", raw_response.headers)
27
+ object.__setattr__(self, "raw_response", raw_response)
24
28
 
25
29
  def __str__(self):
26
30
  return self.message
@@ -1,12 +1,16 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
+ from dataclasses import dataclass
4
+
5
+
6
+ @dataclass(frozen=True)
3
7
  class NoResponseError(Exception):
4
8
  """Error raised when no HTTP response is received from the server."""
5
9
 
6
10
  message: str
7
11
 
8
12
  def __init__(self, message: str = "No response received"):
9
- self.message = message
13
+ object.__setattr__(self, "message", message)
10
14
  super().__init__(message)
11
15
 
12
16
  def __str__(self):
@@ -2,10 +2,12 @@
2
2
 
3
3
  import httpx
4
4
  from typing import Optional
5
+ from dataclasses import dataclass
5
6
 
6
7
  from fathom_python.errors import FathomError
7
8
 
8
9
 
10
+ @dataclass(frozen=True)
9
11
  class ResponseValidationError(FathomError):
10
12
  """Error raised when there is a type mismatch between the response data and the expected Pydantic model."""
11
13
 
@@ -2,46 +2,64 @@
2
2
 
3
3
  from typing import TYPE_CHECKING
4
4
  from importlib import import_module
5
+ import builtins
6
+ import sys
5
7
 
6
8
  if TYPE_CHECKING:
7
9
  from .actionitem import ActionItem, ActionItemTypedDict
8
10
  from .assignee import Assignee, AssigneeTypedDict
9
- from .createwebhookop import CreateWebhookRequest, CreateWebhookRequestTypedDict
11
+ from .callbackresponse import CallbackResponse, CallbackResponseTypedDict
12
+ from .createwebhookop import (
13
+ CreateWebhookRequest,
14
+ CreateWebhookRequestTypedDict,
15
+ CreateWebhookTriggeredFor,
16
+ )
10
17
  from .crmcompanymatch import CRMCompanyMatch, CRMCompanyMatchTypedDict
11
18
  from .crmcontactmatch import CRMContactMatch, CRMContactMatchTypedDict
12
19
  from .crmdealmatch import CRMDealMatch, CRMDealMatchTypedDict
13
20
  from .crmmatches import CRMMatches, CRMMatchesTypedDict
14
21
  from .deletewebhookop import DeleteWebhookRequest, DeleteWebhookRequestTypedDict
15
22
  from .fathomuser import FathomUser, FathomUserTypedDict
16
- from .gettokenop import (
17
- GET_TOKEN_OP_SERVERS,
18
- GetTokenGrantType,
19
- GetTokenRequest,
20
- GetTokenRequestTypedDict,
21
- GetTokenResponse,
22
- GetTokenResponseTypedDict,
23
+ from .getrecordingsummaryop import (
24
+ GetRecordingSummaryRequest,
25
+ GetRecordingSummaryRequestTypedDict,
26
+ GetRecordingSummaryResponse,
27
+ GetRecordingSummaryResponseBody,
28
+ GetRecordingSummaryResponseBodyTypedDict,
29
+ GetRecordingSummaryResponseTypedDict,
30
+ )
31
+ from .getrecordingtranscriptop import (
32
+ GetRecordingTranscriptRequest,
33
+ GetRecordingTranscriptRequestTypedDict,
34
+ GetRecordingTranscriptResponse,
35
+ GetRecordingTranscriptResponseBody,
36
+ GetRecordingTranscriptResponseBodyTypedDict,
37
+ GetRecordingTranscriptResponseTypedDict,
23
38
  )
24
39
  from .invitee import Invitee, InviteeTypedDict
25
40
  from .listmeetingsop import (
26
- ListMeetingsMeetingType,
41
+ ListMeetingsCalendarInviteesDomainsType,
27
42
  ListMeetingsRequest,
28
43
  ListMeetingsRequestTypedDict,
29
44
  ListMeetingsResponse,
30
45
  ListMeetingsResponseTypedDict,
46
+ MeetingType,
31
47
  )
32
48
  from .listteammembersop import (
33
49
  ListTeamMembersRequest,
34
50
  ListTeamMembersRequestTypedDict,
51
+ ListTeamMembersResponse,
52
+ ListTeamMembersResponseTypedDict,
53
+ )
54
+ from .listteamsop import (
55
+ ListTeamsRequest,
56
+ ListTeamsRequestTypedDict,
57
+ ListTeamsResponse,
58
+ ListTeamsResponseTypedDict,
35
59
  )
36
- from .listteamsop import ListTeamsRequest, ListTeamsRequestTypedDict
37
- from .meeting import Meeting, MeetingType, MeetingTypedDict
60
+ from .meeting import CalendarInviteesDomainsType, Meeting, MeetingTypedDict
38
61
  from .meetinglistresponse import MeetingListResponse, MeetingListResponseTypedDict
39
62
  from .meetingsummary import MeetingSummary, MeetingSummaryTypedDict
40
- from .schemetokenrequeststandalone import (
41
- GrantType,
42
- SchemeTokenRequestStandalone,
43
- SchemeTokenRequestStandaloneTypedDict,
44
- )
45
63
  from .security import Security, SecurityTypedDict
46
64
  from .team import Team, TeamTypedDict
47
65
  from .teamlistresponse import TeamListResponse, TeamListResponseTypedDict
@@ -55,7 +73,7 @@ if TYPE_CHECKING:
55
73
  TranscriptItemSpeaker,
56
74
  TranscriptItemSpeakerTypedDict,
57
75
  )
58
- from .webhook import Webhook, WebhookTypedDict
76
+ from .webhook import TriggeredFor, Webhook, WebhookTypedDict
59
77
 
60
78
  __all__ = [
61
79
  "ActionItem",
@@ -70,30 +88,43 @@ __all__ = [
70
88
  "CRMDealMatchTypedDict",
71
89
  "CRMMatches",
72
90
  "CRMMatchesTypedDict",
91
+ "CalendarInviteesDomainsType",
92
+ "CallbackResponse",
93
+ "CallbackResponseTypedDict",
73
94
  "CreateWebhookRequest",
74
95
  "CreateWebhookRequestTypedDict",
96
+ "CreateWebhookTriggeredFor",
75
97
  "DeleteWebhookRequest",
76
98
  "DeleteWebhookRequestTypedDict",
77
99
  "FathomUser",
78
100
  "FathomUserTypedDict",
79
- "GET_TOKEN_OP_SERVERS",
80
- "GetTokenGrantType",
81
- "GetTokenRequest",
82
- "GetTokenRequestTypedDict",
83
- "GetTokenResponse",
84
- "GetTokenResponseTypedDict",
85
- "GrantType",
101
+ "GetRecordingSummaryRequest",
102
+ "GetRecordingSummaryRequestTypedDict",
103
+ "GetRecordingSummaryResponse",
104
+ "GetRecordingSummaryResponseBody",
105
+ "GetRecordingSummaryResponseBodyTypedDict",
106
+ "GetRecordingSummaryResponseTypedDict",
107
+ "GetRecordingTranscriptRequest",
108
+ "GetRecordingTranscriptRequestTypedDict",
109
+ "GetRecordingTranscriptResponse",
110
+ "GetRecordingTranscriptResponseBody",
111
+ "GetRecordingTranscriptResponseBodyTypedDict",
112
+ "GetRecordingTranscriptResponseTypedDict",
86
113
  "Invitee",
87
114
  "InviteeTypedDict",
88
- "ListMeetingsMeetingType",
115
+ "ListMeetingsCalendarInviteesDomainsType",
89
116
  "ListMeetingsRequest",
90
117
  "ListMeetingsRequestTypedDict",
91
118
  "ListMeetingsResponse",
92
119
  "ListMeetingsResponseTypedDict",
93
120
  "ListTeamMembersRequest",
94
121
  "ListTeamMembersRequestTypedDict",
122
+ "ListTeamMembersResponse",
123
+ "ListTeamMembersResponseTypedDict",
95
124
  "ListTeamsRequest",
96
125
  "ListTeamsRequestTypedDict",
126
+ "ListTeamsResponse",
127
+ "ListTeamsResponseTypedDict",
97
128
  "Meeting",
98
129
  "MeetingListResponse",
99
130
  "MeetingListResponseTypedDict",
@@ -101,8 +132,6 @@ __all__ = [
101
132
  "MeetingSummaryTypedDict",
102
133
  "MeetingType",
103
134
  "MeetingTypedDict",
104
- "SchemeTokenRequestStandalone",
105
- "SchemeTokenRequestStandaloneTypedDict",
106
135
  "Security",
107
136
  "SecurityTypedDict",
108
137
  "Team",
@@ -117,6 +146,7 @@ __all__ = [
117
146
  "TranscriptItemSpeaker",
118
147
  "TranscriptItemSpeakerTypedDict",
119
148
  "TranscriptItemTypedDict",
149
+ "TriggeredFor",
120
150
  "Webhook",
121
151
  "WebhookTypedDict",
122
152
  ]
@@ -126,8 +156,11 @@ _dynamic_imports: dict[str, str] = {
126
156
  "ActionItemTypedDict": ".actionitem",
127
157
  "Assignee": ".assignee",
128
158
  "AssigneeTypedDict": ".assignee",
159
+ "CallbackResponse": ".callbackresponse",
160
+ "CallbackResponseTypedDict": ".callbackresponse",
129
161
  "CreateWebhookRequest": ".createwebhookop",
130
162
  "CreateWebhookRequestTypedDict": ".createwebhookop",
163
+ "CreateWebhookTriggeredFor": ".createwebhookop",
131
164
  "CRMCompanyMatch": ".crmcompanymatch",
132
165
  "CRMCompanyMatchTypedDict": ".crmcompanymatch",
133
166
  "CRMContactMatch": ".crmcontactmatch",
@@ -140,33 +173,41 @@ _dynamic_imports: dict[str, str] = {
140
173
  "DeleteWebhookRequestTypedDict": ".deletewebhookop",
141
174
  "FathomUser": ".fathomuser",
142
175
  "FathomUserTypedDict": ".fathomuser",
143
- "GET_TOKEN_OP_SERVERS": ".gettokenop",
144
- "GetTokenGrantType": ".gettokenop",
145
- "GetTokenRequest": ".gettokenop",
146
- "GetTokenRequestTypedDict": ".gettokenop",
147
- "GetTokenResponse": ".gettokenop",
148
- "GetTokenResponseTypedDict": ".gettokenop",
176
+ "GetRecordingSummaryRequest": ".getrecordingsummaryop",
177
+ "GetRecordingSummaryRequestTypedDict": ".getrecordingsummaryop",
178
+ "GetRecordingSummaryResponse": ".getrecordingsummaryop",
179
+ "GetRecordingSummaryResponseBody": ".getrecordingsummaryop",
180
+ "GetRecordingSummaryResponseBodyTypedDict": ".getrecordingsummaryop",
181
+ "GetRecordingSummaryResponseTypedDict": ".getrecordingsummaryop",
182
+ "GetRecordingTranscriptRequest": ".getrecordingtranscriptop",
183
+ "GetRecordingTranscriptRequestTypedDict": ".getrecordingtranscriptop",
184
+ "GetRecordingTranscriptResponse": ".getrecordingtranscriptop",
185
+ "GetRecordingTranscriptResponseBody": ".getrecordingtranscriptop",
186
+ "GetRecordingTranscriptResponseBodyTypedDict": ".getrecordingtranscriptop",
187
+ "GetRecordingTranscriptResponseTypedDict": ".getrecordingtranscriptop",
149
188
  "Invitee": ".invitee",
150
189
  "InviteeTypedDict": ".invitee",
151
- "ListMeetingsMeetingType": ".listmeetingsop",
190
+ "ListMeetingsCalendarInviteesDomainsType": ".listmeetingsop",
152
191
  "ListMeetingsRequest": ".listmeetingsop",
153
192
  "ListMeetingsRequestTypedDict": ".listmeetingsop",
154
193
  "ListMeetingsResponse": ".listmeetingsop",
155
194
  "ListMeetingsResponseTypedDict": ".listmeetingsop",
195
+ "MeetingType": ".listmeetingsop",
156
196
  "ListTeamMembersRequest": ".listteammembersop",
157
197
  "ListTeamMembersRequestTypedDict": ".listteammembersop",
198
+ "ListTeamMembersResponse": ".listteammembersop",
199
+ "ListTeamMembersResponseTypedDict": ".listteammembersop",
158
200
  "ListTeamsRequest": ".listteamsop",
159
201
  "ListTeamsRequestTypedDict": ".listteamsop",
202
+ "ListTeamsResponse": ".listteamsop",
203
+ "ListTeamsResponseTypedDict": ".listteamsop",
204
+ "CalendarInviteesDomainsType": ".meeting",
160
205
  "Meeting": ".meeting",
161
- "MeetingType": ".meeting",
162
206
  "MeetingTypedDict": ".meeting",
163
207
  "MeetingListResponse": ".meetinglistresponse",
164
208
  "MeetingListResponseTypedDict": ".meetinglistresponse",
165
209
  "MeetingSummary": ".meetingsummary",
166
210
  "MeetingSummaryTypedDict": ".meetingsummary",
167
- "GrantType": ".schemetokenrequeststandalone",
168
- "SchemeTokenRequestStandalone": ".schemetokenrequeststandalone",
169
- "SchemeTokenRequestStandaloneTypedDict": ".schemetokenrequeststandalone",
170
211
  "Security": ".security",
171
212
  "SecurityTypedDict": ".security",
172
213
  "Team": ".team",
@@ -181,11 +222,24 @@ _dynamic_imports: dict[str, str] = {
181
222
  "TranscriptItemTypedDict": ".transcriptitem",
182
223
  "TranscriptItemSpeaker": ".transcriptitemspeaker",
183
224
  "TranscriptItemSpeakerTypedDict": ".transcriptitemspeaker",
225
+ "TriggeredFor": ".webhook",
184
226
  "Webhook": ".webhook",
185
227
  "WebhookTypedDict": ".webhook",
186
228
  }
187
229
 
188
230
 
231
+ def dynamic_import(modname, retries=3):
232
+ for attempt in range(retries):
233
+ try:
234
+ return import_module(modname, __package__)
235
+ except KeyError:
236
+ # Clear any half-initialized module and retry
237
+ sys.modules.pop(modname, None)
238
+ if attempt == retries - 1:
239
+ break
240
+ raise KeyError(f"Failed to import module '{modname}' after {retries} attempts")
241
+
242
+
189
243
  def __getattr__(attr_name: str) -> object:
190
244
  module_name = _dynamic_imports.get(attr_name)
191
245
  if module_name is None:
@@ -194,7 +248,7 @@ def __getattr__(attr_name: str) -> object:
194
248
  )
195
249
 
196
250
  try:
197
- module = import_module(module_name, __package__)
251
+ module = dynamic_import(module_name)
198
252
  result = getattr(module, attr_name)
199
253
  return result
200
254
  except ImportError as e:
@@ -208,5 +262,5 @@ def __getattr__(attr_name: str) -> object:
208
262
 
209
263
 
210
264
  def __dir__():
211
- lazy_attrs = list(_dynamic_imports.keys())
212
- return sorted(lazy_attrs)
265
+ lazy_attrs = builtins.list(_dynamic_imports.keys())
266
+ return builtins.sorted(lazy_attrs)
@@ -0,0 +1,13 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from fathom_python.types import BaseModel
5
+ from typing_extensions import TypedDict
6
+
7
+
8
+ class CallbackResponseTypedDict(TypedDict):
9
+ destination_url: str
10
+
11
+
12
+ class CallbackResponse(BaseModel):
13
+ destination_url: str
@@ -1,14 +1,30 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
3
  from __future__ import annotations
4
+ from enum import Enum
4
5
  from fathom_python.types import BaseModel
5
- from typing import Optional
6
+ from typing import List, Optional
6
7
  from typing_extensions import NotRequired, TypedDict
7
8
 
8
9
 
10
+ class CreateWebhookTriggeredFor(str, Enum):
11
+ MY_RECORDINGS = "my_recordings"
12
+ SHARED_EXTERNAL_RECORDINGS = "shared_external_recordings"
13
+ MY_SHARED_WITH_TEAM_RECORDINGS = "my_shared_with_team_recordings"
14
+ SHARED_TEAM_RECORDINGS = "shared_team_recordings"
15
+
16
+
9
17
  class CreateWebhookRequestTypedDict(TypedDict):
10
18
  destination_url: str
11
19
  r"""The URL to send the webhook to."""
20
+ triggered_for: List[CreateWebhookTriggeredFor]
21
+ r"""You must send at least one of the following types of recordings to trigger on.
22
+ - `my_recordings`: Your private recordings, as well as those you've shared with individuals. (On Team Plans, this excludes recordings you've shared with any teams.)
23
+ - `shared_external_recordings`: Recordings shared with you by other users. (For Team Plans, this does not include recordings shared by other users on your Team Plan.)
24
+ - `my_shared_with_team_recordings`: (Team Plans only). All recordings that you have shared with other teams (e.g. Marketing or Sales). Recordings you've shared with individuals but not with teams are not included.
25
+ - `shared_team_recordings`: (Team Plans only) All recordings you can access from other users on your Team Plan, whether shared with you individually or with your team.
26
+
27
+ """
12
28
  include_action_items: NotRequired[bool]
13
29
  r"""Include the action items for each meeting."""
14
30
  include_crm_matches: NotRequired[bool]
@@ -23,6 +39,15 @@ class CreateWebhookRequest(BaseModel):
23
39
  destination_url: str
24
40
  r"""The URL to send the webhook to."""
25
41
 
42
+ triggered_for: List[CreateWebhookTriggeredFor]
43
+ r"""You must send at least one of the following types of recordings to trigger on.
44
+ - `my_recordings`: Your private recordings, as well as those you've shared with individuals. (On Team Plans, this excludes recordings you've shared with any teams.)
45
+ - `shared_external_recordings`: Recordings shared with you by other users. (For Team Plans, this does not include recordings shared by other users on your Team Plan.)
46
+ - `my_shared_with_team_recordings`: (Team Plans only). All recordings that you have shared with other teams (e.g. Marketing or Sales). Recordings you've shared with individuals but not with teams are not included.
47
+ - `shared_team_recordings`: (Team Plans only) All recordings you can access from other users on your Team Plan, whether shared with you individually or with your team.
48
+
49
+ """
50
+
26
51
  include_action_items: Optional[bool] = False
27
52
  r"""Include the action items for each meeting."""
28
53
 
@@ -4,7 +4,14 @@ from __future__ import annotations
4
4
  from .crmcompanymatch import CRMCompanyMatch, CRMCompanyMatchTypedDict
5
5
  from .crmcontactmatch import CRMContactMatch, CRMContactMatchTypedDict
6
6
  from .crmdealmatch import CRMDealMatch, CRMDealMatchTypedDict
7
- from fathom_python.types import BaseModel
7
+ from fathom_python.types import (
8
+ BaseModel,
9
+ Nullable,
10
+ OptionalNullable,
11
+ UNSET,
12
+ UNSET_SENTINEL,
13
+ )
14
+ from pydantic import model_serializer
8
15
  from typing import List, Optional
9
16
  from typing_extensions import NotRequired, TypedDict
10
17
 
@@ -18,7 +25,7 @@ class CRMMatchesTypedDict(TypedDict):
18
25
  contacts: NotRequired[List[CRMContactMatchTypedDict]]
19
26
  companies: NotRequired[List[CRMCompanyMatchTypedDict]]
20
27
  deals: NotRequired[List[CRMDealMatchTypedDict]]
21
- error: NotRequired[str]
28
+ error: NotRequired[Nullable[str]]
22
29
 
23
30
 
24
31
  class CRMMatches(BaseModel):
@@ -33,4 +40,34 @@ class CRMMatches(BaseModel):
33
40
 
34
41
  deals: Optional[List[CRMDealMatch]] = None
35
42
 
36
- error: Optional[str] = None
43
+ error: OptionalNullable[str] = UNSET
44
+
45
+ @model_serializer(mode="wrap")
46
+ def serialize_model(self, handler):
47
+ optional_fields = ["contacts", "companies", "deals", "error"]
48
+ nullable_fields = ["error"]
49
+ null_default_fields = []
50
+
51
+ serialized = handler(self)
52
+
53
+ m = {}
54
+
55
+ for n, f in type(self).model_fields.items():
56
+ k = f.alias or n
57
+ val = serialized.get(k)
58
+ serialized.pop(k, None)
59
+
60
+ optional_nullable = k in optional_fields and k in nullable_fields
61
+ is_set = (
62
+ self.__pydantic_fields_set__.intersection({n})
63
+ or k in null_default_fields
64
+ ) # pylint: disable=no-member
65
+
66
+ if val is not None and val != UNSET_SENTINEL:
67
+ m[k] = val
68
+ elif val != UNSET_SENTINEL and (
69
+ not k in optional_fields or (optional_nullable and is_set)
70
+ ):
71
+ m[k] = val
72
+
73
+ return m
@@ -9,6 +9,7 @@ from typing_extensions import TypedDict
9
9
  class FathomUserTypedDict(TypedDict):
10
10
  name: str
11
11
  email: str
12
+ email_domain: str
12
13
  team: Nullable[str]
13
14
 
14
15
 
@@ -17,6 +18,8 @@ class FathomUser(BaseModel):
17
18
 
18
19
  email: str
19
20
 
21
+ email_domain: str
22
+
20
23
  team: Nullable[str]
21
24
 
22
25
  @model_serializer(mode="wrap")
@@ -0,0 +1,82 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from .callbackresponse import CallbackResponse, CallbackResponseTypedDict
5
+ from .meetingsummary import MeetingSummary, MeetingSummaryTypedDict
6
+ from fathom_python.types import BaseModel, Nullable, UNSET_SENTINEL
7
+ from fathom_python.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata
8
+ from pydantic import model_serializer
9
+ from typing import Optional, Union
10
+ from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
11
+
12
+
13
+ class GetRecordingSummaryRequestTypedDict(TypedDict):
14
+ recording_id: int
15
+ r"""The ID of the meeting recording to fetch the call summary for."""
16
+ destination_url: NotRequired[str]
17
+ r"""Destination URL for where we'll POST the call summary. If not sent, this endpoint will return the data directly."""
18
+
19
+
20
+ class GetRecordingSummaryRequest(BaseModel):
21
+ recording_id: Annotated[
22
+ int, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
23
+ ]
24
+ r"""The ID of the meeting recording to fetch the call summary for."""
25
+
26
+ destination_url: Annotated[
27
+ Optional[str],
28
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
29
+ ] = None
30
+ r"""Destination URL for where we'll POST the call summary. If not sent, this endpoint will return the data directly."""
31
+
32
+
33
+ class GetRecordingSummaryResponseBodyTypedDict(TypedDict):
34
+ summary: Nullable[MeetingSummaryTypedDict]
35
+
36
+
37
+ class GetRecordingSummaryResponseBody(BaseModel):
38
+ summary: Nullable[MeetingSummary]
39
+
40
+ @model_serializer(mode="wrap")
41
+ def serialize_model(self, handler):
42
+ optional_fields = []
43
+ nullable_fields = ["summary"]
44
+ null_default_fields = []
45
+
46
+ serialized = handler(self)
47
+
48
+ m = {}
49
+
50
+ for n, f in type(self).model_fields.items():
51
+ k = f.alias or n
52
+ val = serialized.get(k)
53
+ serialized.pop(k, None)
54
+
55
+ optional_nullable = k in optional_fields and k in nullable_fields
56
+ is_set = (
57
+ self.__pydantic_fields_set__.intersection({n})
58
+ or k in null_default_fields
59
+ ) # pylint: disable=no-member
60
+
61
+ if val is not None and val != UNSET_SENTINEL:
62
+ m[k] = val
63
+ elif val != UNSET_SENTINEL and (
64
+ not k in optional_fields or (optional_nullable and is_set)
65
+ ):
66
+ m[k] = val
67
+
68
+ return m
69
+
70
+
71
+ GetRecordingSummaryResponseTypedDict = TypeAliasType(
72
+ "GetRecordingSummaryResponseTypedDict",
73
+ Union[GetRecordingSummaryResponseBodyTypedDict, CallbackResponseTypedDict],
74
+ )
75
+ r"""Either the destination URL for where we'll POST the call summary, or the summary for the recording."""
76
+
77
+
78
+ GetRecordingSummaryResponse = TypeAliasType(
79
+ "GetRecordingSummaryResponse",
80
+ Union[GetRecordingSummaryResponseBody, CallbackResponse],
81
+ )
82
+ r"""Either the destination URL for where we'll POST the call summary, or the summary for the recording."""