mergepythonclient 2.5.0__py3-none-any.whl → 2.6.1__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.
Files changed (31) hide show
  1. merge/core/client_wrapper.py +2 -2
  2. merge/resources/accounting/types/address.py +5 -1
  3. merge/resources/accounting/types/remote_data.py +4 -1
  4. merge/resources/ats/types/remote_data.py +4 -1
  5. merge/resources/chat/__init__.py +6 -0
  6. merge/resources/chat/resources/__init__.py +5 -0
  7. merge/resources/chat/resources/groups/client.py +20 -0
  8. merge/resources/chat/resources/groups/raw_client.py +20 -0
  9. merge/resources/chat/resources/link_token/client.py +2 -2
  10. merge/resources/chat/resources/link_token/raw_client.py +2 -2
  11. merge/resources/chat/resources/messages/__init__.py +31 -0
  12. merge/resources/chat/resources/messages/client.py +58 -0
  13. merge/resources/chat/resources/messages/raw_client.py +42 -0
  14. merge/resources/chat/resources/messages/types/__init__.py +36 -0
  15. merge/resources/chat/resources/messages/types/messages_list_request_order_by.py +21 -0
  16. merge/resources/chat/resources/messages/types/messages_replies_list_request_order_by.py +21 -0
  17. merge/resources/chat/types/conversation.py +10 -0
  18. merge/resources/chat/types/group.py +11 -0
  19. merge/resources/chat/types/member.py +10 -0
  20. merge/resources/chat/types/message.py +10 -0
  21. merge/resources/chat/types/remote_data.py +4 -1
  22. merge/resources/chat/types/user.py +10 -0
  23. merge/resources/crm/types/remote_data.py +4 -1
  24. merge/resources/filestorage/types/remote_data.py +4 -1
  25. merge/resources/hris/types/remote_data.py +4 -1
  26. merge/resources/knowledgebase/types/remote_data.py +4 -1
  27. merge/resources/ticketing/types/remote_data.py +4 -1
  28. {mergepythonclient-2.5.0.dist-info → mergepythonclient-2.6.1.dist-info}/METADATA +22 -1
  29. {mergepythonclient-2.5.0.dist-info → mergepythonclient-2.6.1.dist-info}/RECORD +31 -28
  30. {mergepythonclient-2.5.0.dist-info → mergepythonclient-2.6.1.dist-info}/LICENSE.md +0 -0
  31. {mergepythonclient-2.5.0.dist-info → mergepythonclient-2.6.1.dist-info}/WHEEL +0 -0
@@ -24,10 +24,10 @@ class BaseClientWrapper:
24
24
 
25
25
  def get_headers(self) -> typing.Dict[str, str]:
26
26
  headers: typing.Dict[str, str] = {
27
- "User-Agent": "MergePythonClient/2.5.0",
27
+ "User-Agent": "MergePythonClient/2.6.1",
28
28
  "X-Fern-Language": "Python",
29
29
  "X-Fern-SDK-Name": "MergePythonClient",
30
- "X-Fern-SDK-Version": "2.5.0",
30
+ "X-Fern-SDK-Version": "2.6.1",
31
31
  **(self.get_custom_headers() or {}),
32
32
  }
33
33
  if self._account_token is not None:
@@ -53,7 +53,11 @@ class Address(UncheckedBaseModel):
53
53
  The address's city.
54
54
  """
55
55
 
56
- state: typing.Optional[typing.Optional[typing.Any]] = None
56
+ state: typing.Optional[typing.Optional[typing.Any]] = pydantic.Field(default=None)
57
+ """
58
+ The address's state or region.
59
+ """
60
+
57
61
  country_subdivision: typing.Optional[str] = pydantic.Field(default=None)
58
62
  """
59
63
  The address's state or region.
@@ -22,7 +22,10 @@ class RemoteData(UncheckedBaseModel):
22
22
  The third-party API path that is being called.
23
23
  """
24
24
 
25
- data: typing.Optional[typing.Optional[typing.Any]] = None
25
+ data: typing.Optional[typing.Optional[typing.Any]] = pydantic.Field(default=None)
26
+ """
27
+ The data returned from the third-party for this object in its original, unnormalized format.
28
+ """
26
29
 
27
30
  if IS_PYDANTIC_V2:
28
31
  model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
@@ -22,7 +22,10 @@ class RemoteData(UncheckedBaseModel):
22
22
  The third-party API path that is being called.
23
23
  """
24
24
 
25
- data: typing.Optional[typing.Optional[typing.Any]] = None
25
+ data: typing.Optional[typing.Optional[typing.Any]] = pydantic.Field(default=None)
26
+ """
27
+ The data returned from the third-party for this object in its original, unnormalized format.
28
+ """
26
29
 
27
30
  if IS_PYDANTIC_V2:
28
31
  model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
@@ -104,6 +104,8 @@ if typing.TYPE_CHECKING:
104
104
  EndUserDetailsRequestLanguage,
105
105
  IssuesListRequestStatus,
106
106
  LinkedAccountsListRequestCategory,
107
+ MessagesListRequestOrderBy,
108
+ MessagesRepliesListRequestOrderBy,
107
109
  account_details,
108
110
  account_token,
109
111
  async_passthrough,
@@ -185,6 +187,8 @@ _dynamic_imports: typing.Dict[str, str] = {
185
187
  "LinkedAccountsListRequestCategory": ".resources",
186
188
  "Member": ".types",
187
189
  "Message": ".types",
190
+ "MessagesListRequestOrderBy": ".resources",
191
+ "MessagesRepliesListRequestOrderBy": ".resources",
188
192
  "MethodEnum": ".types",
189
193
  "ModelOperation": ".types",
190
194
  "ModelPermissionDeserializer": ".types",
@@ -324,6 +328,8 @@ __all__ = [
324
328
  "LinkedAccountsListRequestCategory",
325
329
  "Member",
326
330
  "Message",
331
+ "MessagesListRequestOrderBy",
332
+ "MessagesRepliesListRequestOrderBy",
327
333
  "MethodEnum",
328
334
  "ModelOperation",
329
335
  "ModelPermissionDeserializer",
@@ -34,6 +34,7 @@ if typing.TYPE_CHECKING:
34
34
  from .issues import IssuesListRequestStatus
35
35
  from .link_token import EndUserDetailsRequestCompletedAccountInitialScreen, EndUserDetailsRequestLanguage
36
36
  from .linked_accounts import LinkedAccountsListRequestCategory
37
+ from .messages import MessagesListRequestOrderBy, MessagesRepliesListRequestOrderBy
37
38
  _dynamic_imports: typing.Dict[str, str] = {
38
39
  "AsyncPassthroughRetrieveResponse": ".async_passthrough",
39
40
  "ConversationsMembersListRequestExpand": ".conversations",
@@ -41,6 +42,8 @@ _dynamic_imports: typing.Dict[str, str] = {
41
42
  "EndUserDetailsRequestLanguage": ".link_token",
42
43
  "IssuesListRequestStatus": ".issues",
43
44
  "LinkedAccountsListRequestCategory": ".linked_accounts",
45
+ "MessagesListRequestOrderBy": ".messages",
46
+ "MessagesRepliesListRequestOrderBy": ".messages",
44
47
  "account_details": ".",
45
48
  "account_token": ".",
46
49
  "async_passthrough": ".",
@@ -91,6 +94,8 @@ __all__ = [
91
94
  "EndUserDetailsRequestLanguage",
92
95
  "IssuesListRequestStatus",
93
96
  "LinkedAccountsListRequestCategory",
97
+ "MessagesListRequestOrderBy",
98
+ "MessagesRepliesListRequestOrderBy",
94
99
  "account_details",
95
100
  "account_token",
96
101
  "async_passthrough",
@@ -31,6 +31,7 @@ class GroupsClient:
31
31
  created_after: typing.Optional[dt.datetime] = None,
32
32
  created_before: typing.Optional[dt.datetime] = None,
33
33
  cursor: typing.Optional[str] = None,
34
+ expand: typing.Optional[typing.Literal["users"]] = None,
34
35
  include_deleted_data: typing.Optional[bool] = None,
35
36
  include_remote_data: typing.Optional[bool] = None,
36
37
  include_shell_data: typing.Optional[bool] = None,
@@ -54,6 +55,9 @@ class GroupsClient:
54
55
  cursor : typing.Optional[str]
55
56
  The pagination cursor value.
56
57
 
58
+ expand : typing.Optional[typing.Literal["users"]]
59
+ Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
60
+
57
61
  include_deleted_data : typing.Optional[bool]
58
62
  Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/).
59
63
 
@@ -118,6 +122,7 @@ class GroupsClient:
118
122
  created_after=created_after,
119
123
  created_before=created_before,
120
124
  cursor=cursor,
125
+ expand=expand,
121
126
  include_deleted_data=include_deleted_data,
122
127
  include_remote_data=include_remote_data,
123
128
  include_shell_data=include_shell_data,
@@ -133,6 +138,7 @@ class GroupsClient:
133
138
  self,
134
139
  id: str,
135
140
  *,
141
+ expand: typing.Optional[typing.Literal["users"]] = None,
136
142
  include_remote_data: typing.Optional[bool] = None,
137
143
  include_shell_data: typing.Optional[bool] = None,
138
144
  request_options: typing.Optional[RequestOptions] = None,
@@ -144,6 +150,9 @@ class GroupsClient:
144
150
  ----------
145
151
  id : str
146
152
 
153
+ expand : typing.Optional[typing.Literal["users"]]
154
+ Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
155
+
147
156
  include_remote_data : typing.Optional[bool]
148
157
  Whether to include the original data Merge fetched from the third-party to produce these models.
149
158
 
@@ -174,6 +183,7 @@ class GroupsClient:
174
183
  """
175
184
  _response = self._raw_client.retrieve(
176
185
  id,
186
+ expand=expand,
177
187
  include_remote_data=include_remote_data,
178
188
  include_shell_data=include_shell_data,
179
189
  request_options=request_options,
@@ -202,6 +212,7 @@ class AsyncGroupsClient:
202
212
  created_after: typing.Optional[dt.datetime] = None,
203
213
  created_before: typing.Optional[dt.datetime] = None,
204
214
  cursor: typing.Optional[str] = None,
215
+ expand: typing.Optional[typing.Literal["users"]] = None,
205
216
  include_deleted_data: typing.Optional[bool] = None,
206
217
  include_remote_data: typing.Optional[bool] = None,
207
218
  include_shell_data: typing.Optional[bool] = None,
@@ -225,6 +236,9 @@ class AsyncGroupsClient:
225
236
  cursor : typing.Optional[str]
226
237
  The pagination cursor value.
227
238
 
239
+ expand : typing.Optional[typing.Literal["users"]]
240
+ Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
241
+
228
242
  include_deleted_data : typing.Optional[bool]
229
243
  Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/).
230
244
 
@@ -296,6 +310,7 @@ class AsyncGroupsClient:
296
310
  created_after=created_after,
297
311
  created_before=created_before,
298
312
  cursor=cursor,
313
+ expand=expand,
299
314
  include_deleted_data=include_deleted_data,
300
315
  include_remote_data=include_remote_data,
301
316
  include_shell_data=include_shell_data,
@@ -311,6 +326,7 @@ class AsyncGroupsClient:
311
326
  self,
312
327
  id: str,
313
328
  *,
329
+ expand: typing.Optional[typing.Literal["users"]] = None,
314
330
  include_remote_data: typing.Optional[bool] = None,
315
331
  include_shell_data: typing.Optional[bool] = None,
316
332
  request_options: typing.Optional[RequestOptions] = None,
@@ -322,6 +338,9 @@ class AsyncGroupsClient:
322
338
  ----------
323
339
  id : str
324
340
 
341
+ expand : typing.Optional[typing.Literal["users"]]
342
+ Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
343
+
325
344
  include_remote_data : typing.Optional[bool]
326
345
  Whether to include the original data Merge fetched from the third-party to produce these models.
327
346
 
@@ -360,6 +379,7 @@ class AsyncGroupsClient:
360
379
  """
361
380
  _response = await self._raw_client.retrieve(
362
381
  id,
382
+ expand=expand,
363
383
  include_remote_data=include_remote_data,
364
384
  include_shell_data=include_shell_data,
365
385
  request_options=request_options,
@@ -25,6 +25,7 @@ class RawGroupsClient:
25
25
  created_after: typing.Optional[dt.datetime] = None,
26
26
  created_before: typing.Optional[dt.datetime] = None,
27
27
  cursor: typing.Optional[str] = None,
28
+ expand: typing.Optional[typing.Literal["users"]] = None,
28
29
  include_deleted_data: typing.Optional[bool] = None,
29
30
  include_remote_data: typing.Optional[bool] = None,
30
31
  include_shell_data: typing.Optional[bool] = None,
@@ -48,6 +49,9 @@ class RawGroupsClient:
48
49
  cursor : typing.Optional[str]
49
50
  The pagination cursor value.
50
51
 
52
+ expand : typing.Optional[typing.Literal["users"]]
53
+ Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
54
+
51
55
  include_deleted_data : typing.Optional[bool]
52
56
  Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/).
53
57
 
@@ -84,6 +88,7 @@ class RawGroupsClient:
84
88
  "created_after": serialize_datetime(created_after) if created_after is not None else None,
85
89
  "created_before": serialize_datetime(created_before) if created_before is not None else None,
86
90
  "cursor": cursor,
91
+ "expand": expand,
87
92
  "include_deleted_data": include_deleted_data,
88
93
  "include_remote_data": include_remote_data,
89
94
  "include_shell_data": include_shell_data,
@@ -113,6 +118,7 @@ class RawGroupsClient:
113
118
  self,
114
119
  id: str,
115
120
  *,
121
+ expand: typing.Optional[typing.Literal["users"]] = None,
116
122
  include_remote_data: typing.Optional[bool] = None,
117
123
  include_shell_data: typing.Optional[bool] = None,
118
124
  request_options: typing.Optional[RequestOptions] = None,
@@ -124,6 +130,9 @@ class RawGroupsClient:
124
130
  ----------
125
131
  id : str
126
132
 
133
+ expand : typing.Optional[typing.Literal["users"]]
134
+ Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
135
+
127
136
  include_remote_data : typing.Optional[bool]
128
137
  Whether to include the original data Merge fetched from the third-party to produce these models.
129
138
 
@@ -142,6 +151,7 @@ class RawGroupsClient:
142
151
  f"chat/v1/groups/{jsonable_encoder(id)}",
143
152
  method="GET",
144
153
  params={
154
+ "expand": expand,
145
155
  "include_remote_data": include_remote_data,
146
156
  "include_shell_data": include_shell_data,
147
157
  },
@@ -173,6 +183,7 @@ class AsyncRawGroupsClient:
173
183
  created_after: typing.Optional[dt.datetime] = None,
174
184
  created_before: typing.Optional[dt.datetime] = None,
175
185
  cursor: typing.Optional[str] = None,
186
+ expand: typing.Optional[typing.Literal["users"]] = None,
176
187
  include_deleted_data: typing.Optional[bool] = None,
177
188
  include_remote_data: typing.Optional[bool] = None,
178
189
  include_shell_data: typing.Optional[bool] = None,
@@ -196,6 +207,9 @@ class AsyncRawGroupsClient:
196
207
  cursor : typing.Optional[str]
197
208
  The pagination cursor value.
198
209
 
210
+ expand : typing.Optional[typing.Literal["users"]]
211
+ Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
212
+
199
213
  include_deleted_data : typing.Optional[bool]
200
214
  Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/).
201
215
 
@@ -232,6 +246,7 @@ class AsyncRawGroupsClient:
232
246
  "created_after": serialize_datetime(created_after) if created_after is not None else None,
233
247
  "created_before": serialize_datetime(created_before) if created_before is not None else None,
234
248
  "cursor": cursor,
249
+ "expand": expand,
235
250
  "include_deleted_data": include_deleted_data,
236
251
  "include_remote_data": include_remote_data,
237
252
  "include_shell_data": include_shell_data,
@@ -261,6 +276,7 @@ class AsyncRawGroupsClient:
261
276
  self,
262
277
  id: str,
263
278
  *,
279
+ expand: typing.Optional[typing.Literal["users"]] = None,
264
280
  include_remote_data: typing.Optional[bool] = None,
265
281
  include_shell_data: typing.Optional[bool] = None,
266
282
  request_options: typing.Optional[RequestOptions] = None,
@@ -272,6 +288,9 @@ class AsyncRawGroupsClient:
272
288
  ----------
273
289
  id : str
274
290
 
291
+ expand : typing.Optional[typing.Literal["users"]]
292
+ Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
293
+
275
294
  include_remote_data : typing.Optional[bool]
276
295
  Whether to include the original data Merge fetched from the third-party to produce these models.
277
296
 
@@ -290,6 +309,7 @@ class AsyncRawGroupsClient:
290
309
  f"chat/v1/groups/{jsonable_encoder(id)}",
291
310
  method="GET",
292
311
  params={
312
+ "expand": expand,
293
313
  "include_remote_data": include_remote_data,
294
314
  "include_shell_data": include_shell_data,
295
315
  },
@@ -55,7 +55,7 @@ class LinkTokenClient:
55
55
  request_options: typing.Optional[RequestOptions] = None,
56
56
  ) -> LinkToken:
57
57
  """
58
- Creates a link token to be used when linking a new end user.
58
+ Creates a link token to be used when linking a new end user. The link token expires after single use.
59
59
 
60
60
  Parameters
61
61
  ----------
@@ -187,7 +187,7 @@ class AsyncLinkTokenClient:
187
187
  request_options: typing.Optional[RequestOptions] = None,
188
188
  ) -> LinkToken:
189
189
  """
190
- Creates a link token to be used when linking a new end user.
190
+ Creates a link token to be used when linking a new end user. The link token expires after single use.
191
191
 
192
192
  Parameters
193
193
  ----------
@@ -47,7 +47,7 @@ class RawLinkTokenClient:
47
47
  request_options: typing.Optional[RequestOptions] = None,
48
48
  ) -> HttpResponse[LinkToken]:
49
49
  """
50
- Creates a link token to be used when linking a new end user.
50
+ Creates a link token to be used when linking a new end user. The link token expires after single use.
51
51
 
52
52
  Parameters
53
53
  ----------
@@ -173,7 +173,7 @@ class AsyncRawLinkTokenClient:
173
173
  request_options: typing.Optional[RequestOptions] = None,
174
174
  ) -> AsyncHttpResponse[LinkToken]:
175
175
  """
176
- Creates a link token to be used when linking a new end user.
176
+ Creates a link token to be used when linking a new end user. The link token expires after single use.
177
177
 
178
178
  Parameters
179
179
  ----------
@@ -2,3 +2,34 @@
2
2
 
3
3
  # isort: skip_file
4
4
 
5
+ import typing
6
+ from importlib import import_module
7
+
8
+ if typing.TYPE_CHECKING:
9
+ from .types import MessagesListRequestOrderBy, MessagesRepliesListRequestOrderBy
10
+ _dynamic_imports: typing.Dict[str, str] = {
11
+ "MessagesListRequestOrderBy": ".types",
12
+ "MessagesRepliesListRequestOrderBy": ".types",
13
+ }
14
+
15
+
16
+ def __getattr__(attr_name: str) -> typing.Any:
17
+ module_name = _dynamic_imports.get(attr_name)
18
+ if module_name is None:
19
+ raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
20
+ try:
21
+ module = import_module(module_name, __package__)
22
+ result = getattr(module, attr_name)
23
+ return result
24
+ except ImportError as e:
25
+ raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
26
+ except AttributeError as e:
27
+ raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
28
+
29
+
30
+ def __dir__():
31
+ lazy_attrs = list(_dynamic_imports.keys())
32
+ return sorted(lazy_attrs)
33
+
34
+
35
+ __all__ = ["MessagesListRequestOrderBy", "MessagesRepliesListRequestOrderBy"]
@@ -8,6 +8,8 @@ from .....core.request_options import RequestOptions
8
8
  from ...types.message import Message
9
9
  from ...types.paginated_message_list import PaginatedMessageList
10
10
  from .raw_client import AsyncRawMessagesClient, RawMessagesClient
11
+ from .types.messages_list_request_order_by import MessagesListRequestOrderBy
12
+ from .types.messages_replies_list_request_order_by import MessagesRepliesListRequestOrderBy
11
13
 
12
14
 
13
15
  class MessagesClient:
@@ -28,6 +30,7 @@ class MessagesClient:
28
30
  def list(
29
31
  self,
30
32
  *,
33
+ conversation_id: typing.Optional[str] = None,
31
34
  created_after: typing.Optional[dt.datetime] = None,
32
35
  created_before: typing.Optional[dt.datetime] = None,
33
36
  cursor: typing.Optional[str] = None,
@@ -36,8 +39,10 @@ class MessagesClient:
36
39
  include_shell_data: typing.Optional[bool] = None,
37
40
  modified_after: typing.Optional[dt.datetime] = None,
38
41
  modified_before: typing.Optional[dt.datetime] = None,
42
+ order_by: typing.Optional[MessagesListRequestOrderBy] = None,
39
43
  page_size: typing.Optional[int] = None,
40
44
  remote_id: typing.Optional[str] = None,
45
+ root_message: typing.Optional[str] = None,
41
46
  request_options: typing.Optional[RequestOptions] = None,
42
47
  ) -> PaginatedMessageList:
43
48
  """
@@ -45,6 +50,9 @@ class MessagesClient:
45
50
 
46
51
  Parameters
47
52
  ----------
53
+ conversation_id : typing.Optional[str]
54
+ Filter messages by conversation ID.
55
+
48
56
  created_after : typing.Optional[dt.datetime]
49
57
  If provided, will only return objects created after this datetime.
50
58
 
@@ -69,12 +77,18 @@ class MessagesClient:
69
77
  modified_before : typing.Optional[dt.datetime]
70
78
  If provided, only objects synced by Merge before this date time will be returned.
71
79
 
80
+ order_by : typing.Optional[MessagesListRequestOrderBy]
81
+ Overrides the default ordering for this endpoint. Possible values include: remote_created_at, -remote_created_at.
82
+
72
83
  page_size : typing.Optional[int]
73
84
  Number of results to return per page. The maximum limit is 100.
74
85
 
75
86
  remote_id : typing.Optional[str]
76
87
  The API provider's ID for the given object.
77
88
 
89
+ root_message : typing.Optional[str]
90
+ If provided as 'true', will only return root messages (messages without a parent message).
91
+
78
92
  request_options : typing.Optional[RequestOptions]
79
93
  Request-specific configuration.
80
94
 
@@ -88,12 +102,14 @@ class MessagesClient:
88
102
  import datetime
89
103
 
90
104
  from merge import Merge
105
+ from merge.resources.chat.resources.messages import MessagesListRequestOrderBy
91
106
 
92
107
  client = Merge(
93
108
  account_token="YOUR_ACCOUNT_TOKEN",
94
109
  api_key="YOUR_API_KEY",
95
110
  )
96
111
  client.chat.messages.list(
112
+ conversation_id="conversation_id",
97
113
  created_after=datetime.datetime.fromisoformat(
98
114
  "2024-01-15 09:30:00+00:00",
99
115
  ),
@@ -110,11 +126,14 @@ class MessagesClient:
110
126
  modified_before=datetime.datetime.fromisoformat(
111
127
  "2024-01-15 09:30:00+00:00",
112
128
  ),
129
+ order_by=MessagesListRequestOrderBy.REMOTE_CREATED_AT_DESCENDING,
113
130
  page_size=1,
114
131
  remote_id="remote_id",
132
+ root_message="root_message",
115
133
  )
116
134
  """
117
135
  _response = self._raw_client.list(
136
+ conversation_id=conversation_id,
118
137
  created_after=created_after,
119
138
  created_before=created_before,
120
139
  cursor=cursor,
@@ -123,8 +142,10 @@ class MessagesClient:
123
142
  include_shell_data=include_shell_data,
124
143
  modified_after=modified_after,
125
144
  modified_before=modified_before,
145
+ order_by=order_by,
126
146
  page_size=page_size,
127
147
  remote_id=remote_id,
148
+ root_message=root_message,
128
149
  request_options=request_options,
129
150
  )
130
151
  return _response.data
@@ -188,6 +209,7 @@ class MessagesClient:
188
209
  include_deleted_data: typing.Optional[bool] = None,
189
210
  include_remote_data: typing.Optional[bool] = None,
190
211
  include_shell_data: typing.Optional[bool] = None,
212
+ order_by: typing.Optional[MessagesRepliesListRequestOrderBy] = None,
191
213
  page_size: typing.Optional[int] = None,
192
214
  request_options: typing.Optional[RequestOptions] = None,
193
215
  ) -> PaginatedMessageList:
@@ -210,6 +232,9 @@ class MessagesClient:
210
232
  include_shell_data : typing.Optional[bool]
211
233
  Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).
212
234
 
235
+ order_by : typing.Optional[MessagesRepliesListRequestOrderBy]
236
+ Overrides the default ordering for this endpoint. Possible values include: remote_created_at, -remote_created_at.
237
+
213
238
  page_size : typing.Optional[int]
214
239
  Number of results to return per page. The maximum limit is 100.
215
240
 
@@ -224,6 +249,9 @@ class MessagesClient:
224
249
  Examples
225
250
  --------
226
251
  from merge import Merge
252
+ from merge.resources.chat.resources.messages import (
253
+ MessagesRepliesListRequestOrderBy,
254
+ )
227
255
 
228
256
  client = Merge(
229
257
  account_token="YOUR_ACCOUNT_TOKEN",
@@ -235,6 +263,7 @@ class MessagesClient:
235
263
  include_deleted_data=True,
236
264
  include_remote_data=True,
237
265
  include_shell_data=True,
266
+ order_by=MessagesRepliesListRequestOrderBy.REMOTE_CREATED_AT_DESCENDING,
238
267
  page_size=1,
239
268
  )
240
269
  """
@@ -244,6 +273,7 @@ class MessagesClient:
244
273
  include_deleted_data=include_deleted_data,
245
274
  include_remote_data=include_remote_data,
246
275
  include_shell_data=include_shell_data,
276
+ order_by=order_by,
247
277
  page_size=page_size,
248
278
  request_options=request_options,
249
279
  )
@@ -268,6 +298,7 @@ class AsyncMessagesClient:
268
298
  async def list(
269
299
  self,
270
300
  *,
301
+ conversation_id: typing.Optional[str] = None,
271
302
  created_after: typing.Optional[dt.datetime] = None,
272
303
  created_before: typing.Optional[dt.datetime] = None,
273
304
  cursor: typing.Optional[str] = None,
@@ -276,8 +307,10 @@ class AsyncMessagesClient:
276
307
  include_shell_data: typing.Optional[bool] = None,
277
308
  modified_after: typing.Optional[dt.datetime] = None,
278
309
  modified_before: typing.Optional[dt.datetime] = None,
310
+ order_by: typing.Optional[MessagesListRequestOrderBy] = None,
279
311
  page_size: typing.Optional[int] = None,
280
312
  remote_id: typing.Optional[str] = None,
313
+ root_message: typing.Optional[str] = None,
281
314
  request_options: typing.Optional[RequestOptions] = None,
282
315
  ) -> PaginatedMessageList:
283
316
  """
@@ -285,6 +318,9 @@ class AsyncMessagesClient:
285
318
 
286
319
  Parameters
287
320
  ----------
321
+ conversation_id : typing.Optional[str]
322
+ Filter messages by conversation ID.
323
+
288
324
  created_after : typing.Optional[dt.datetime]
289
325
  If provided, will only return objects created after this datetime.
290
326
 
@@ -309,12 +345,18 @@ class AsyncMessagesClient:
309
345
  modified_before : typing.Optional[dt.datetime]
310
346
  If provided, only objects synced by Merge before this date time will be returned.
311
347
 
348
+ order_by : typing.Optional[MessagesListRequestOrderBy]
349
+ Overrides the default ordering for this endpoint. Possible values include: remote_created_at, -remote_created_at.
350
+
312
351
  page_size : typing.Optional[int]
313
352
  Number of results to return per page. The maximum limit is 100.
314
353
 
315
354
  remote_id : typing.Optional[str]
316
355
  The API provider's ID for the given object.
317
356
 
357
+ root_message : typing.Optional[str]
358
+ If provided as 'true', will only return root messages (messages without a parent message).
359
+
318
360
  request_options : typing.Optional[RequestOptions]
319
361
  Request-specific configuration.
320
362
 
@@ -329,6 +371,7 @@ class AsyncMessagesClient:
329
371
  import datetime
330
372
 
331
373
  from merge import AsyncMerge
374
+ from merge.resources.chat.resources.messages import MessagesListRequestOrderBy
332
375
 
333
376
  client = AsyncMerge(
334
377
  account_token="YOUR_ACCOUNT_TOKEN",
@@ -338,6 +381,7 @@ class AsyncMessagesClient:
338
381
 
339
382
  async def main() -> None:
340
383
  await client.chat.messages.list(
384
+ conversation_id="conversation_id",
341
385
  created_after=datetime.datetime.fromisoformat(
342
386
  "2024-01-15 09:30:00+00:00",
343
387
  ),
@@ -354,14 +398,17 @@ class AsyncMessagesClient:
354
398
  modified_before=datetime.datetime.fromisoformat(
355
399
  "2024-01-15 09:30:00+00:00",
356
400
  ),
401
+ order_by=MessagesListRequestOrderBy.REMOTE_CREATED_AT_DESCENDING,
357
402
  page_size=1,
358
403
  remote_id="remote_id",
404
+ root_message="root_message",
359
405
  )
360
406
 
361
407
 
362
408
  asyncio.run(main())
363
409
  """
364
410
  _response = await self._raw_client.list(
411
+ conversation_id=conversation_id,
365
412
  created_after=created_after,
366
413
  created_before=created_before,
367
414
  cursor=cursor,
@@ -370,8 +417,10 @@ class AsyncMessagesClient:
370
417
  include_shell_data=include_shell_data,
371
418
  modified_after=modified_after,
372
419
  modified_before=modified_before,
420
+ order_by=order_by,
373
421
  page_size=page_size,
374
422
  remote_id=remote_id,
423
+ root_message=root_message,
375
424
  request_options=request_options,
376
425
  )
377
426
  return _response.data
@@ -443,6 +492,7 @@ class AsyncMessagesClient:
443
492
  include_deleted_data: typing.Optional[bool] = None,
444
493
  include_remote_data: typing.Optional[bool] = None,
445
494
  include_shell_data: typing.Optional[bool] = None,
495
+ order_by: typing.Optional[MessagesRepliesListRequestOrderBy] = None,
446
496
  page_size: typing.Optional[int] = None,
447
497
  request_options: typing.Optional[RequestOptions] = None,
448
498
  ) -> PaginatedMessageList:
@@ -465,6 +515,9 @@ class AsyncMessagesClient:
465
515
  include_shell_data : typing.Optional[bool]
466
516
  Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).
467
517
 
518
+ order_by : typing.Optional[MessagesRepliesListRequestOrderBy]
519
+ Overrides the default ordering for this endpoint. Possible values include: remote_created_at, -remote_created_at.
520
+
468
521
  page_size : typing.Optional[int]
469
522
  Number of results to return per page. The maximum limit is 100.
470
523
 
@@ -481,6 +534,9 @@ class AsyncMessagesClient:
481
534
  import asyncio
482
535
 
483
536
  from merge import AsyncMerge
537
+ from merge.resources.chat.resources.messages import (
538
+ MessagesRepliesListRequestOrderBy,
539
+ )
484
540
 
485
541
  client = AsyncMerge(
486
542
  account_token="YOUR_ACCOUNT_TOKEN",
@@ -495,6 +551,7 @@ class AsyncMessagesClient:
495
551
  include_deleted_data=True,
496
552
  include_remote_data=True,
497
553
  include_shell_data=True,
554
+ order_by=MessagesRepliesListRequestOrderBy.REMOTE_CREATED_AT_DESCENDING,
498
555
  page_size=1,
499
556
  )
500
557
 
@@ -507,6 +564,7 @@ class AsyncMessagesClient:
507
564
  include_deleted_data=include_deleted_data,
508
565
  include_remote_data=include_remote_data,
509
566
  include_shell_data=include_shell_data,
567
+ order_by=order_by,
510
568
  page_size=page_size,
511
569
  request_options=request_options,
512
570
  )