mergepythonclient 4.0.0__py3-none-any.whl → 4.2.0__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 (163) hide show
  1. merge/core/client_wrapper.py +2 -2
  2. merge/resources/accounting/__init__.py +21 -0
  3. merge/resources/accounting/client.py +19 -0
  4. merge/resources/accounting/resources/__init__.py +3 -0
  5. merge/resources/accounting/resources/selective_sync/__init__.py +4 -0
  6. merge/resources/accounting/resources/selective_sync/client.py +104 -0
  7. merge/resources/accounting/resources/selective_sync/raw_client.py +103 -0
  8. merge/resources/accounting/types/__init__.py +18 -0
  9. merge/resources/accounting/types/operator_enum.py +58 -0
  10. merge/resources/accounting/types/selective_sync_condition.py +49 -0
  11. merge/resources/accounting/types/selective_sync_condition_list.py +21 -0
  12. merge/resources/accounting/types/selective_sync_condition_operator.py +7 -0
  13. merge/resources/accounting/types/sync_status.py +7 -0
  14. merge/resources/accounting/types/sync_status_reason_enum.py +20 -0
  15. merge/resources/accounting/types/sync_status_sync_status_reason.py +7 -0
  16. merge/resources/ats/__init__.py +21 -0
  17. merge/resources/ats/client.py +19 -0
  18. merge/resources/ats/resources/__init__.py +3 -0
  19. merge/resources/ats/resources/selective_sync/__init__.py +4 -0
  20. merge/resources/ats/resources/selective_sync/client.py +104 -0
  21. merge/resources/ats/resources/selective_sync/raw_client.py +103 -0
  22. merge/resources/ats/types/__init__.py +18 -0
  23. merge/resources/ats/types/operator_enum.py +58 -0
  24. merge/resources/ats/types/selective_sync_condition.py +49 -0
  25. merge/resources/ats/types/selective_sync_condition_list.py +21 -0
  26. merge/resources/ats/types/selective_sync_condition_operator.py +7 -0
  27. merge/resources/ats/types/sync_status.py +7 -0
  28. merge/resources/ats/types/sync_status_reason_enum.py +20 -0
  29. merge/resources/ats/types/sync_status_sync_status_reason.py +7 -0
  30. merge/resources/calendar/__init__.py +21 -0
  31. merge/resources/calendar/client.py +19 -0
  32. merge/resources/calendar/resources/__init__.py +3 -0
  33. merge/resources/calendar/resources/selective_sync/__init__.py +4 -0
  34. merge/resources/calendar/resources/selective_sync/client.py +104 -0
  35. merge/resources/calendar/resources/selective_sync/raw_client.py +103 -0
  36. merge/resources/calendar/types/__init__.py +18 -0
  37. merge/resources/calendar/types/operator_enum.py +58 -0
  38. merge/resources/calendar/types/selective_sync_condition.py +49 -0
  39. merge/resources/calendar/types/selective_sync_condition_list.py +21 -0
  40. merge/resources/calendar/types/selective_sync_condition_operator.py +7 -0
  41. merge/resources/calendar/types/sync_status.py +7 -0
  42. merge/resources/calendar/types/sync_status_reason_enum.py +20 -0
  43. merge/resources/calendar/types/sync_status_sync_status_reason.py +7 -0
  44. merge/resources/chat/__init__.py +39 -0
  45. merge/resources/chat/client.py +19 -0
  46. merge/resources/chat/resources/__init__.py +3 -0
  47. merge/resources/chat/resources/selective_sync/__init__.py +4 -0
  48. merge/resources/chat/resources/selective_sync/client.py +264 -0
  49. merge/resources/chat/resources/selective_sync/raw_client.py +293 -0
  50. merge/resources/chat/types/__init__.py +36 -0
  51. merge/resources/chat/types/chat_sync_selection.py +50 -0
  52. merge/resources/chat/types/chat_sync_selection_type.py +7 -0
  53. merge/resources/chat/types/chat_sync_selection_type_enum.py +18 -0
  54. merge/resources/chat/types/label_selection.py +43 -0
  55. merge/resources/chat/types/label_selection_list.py +21 -0
  56. merge/resources/chat/types/operator_enum.py +58 -0
  57. merge/resources/chat/types/paginated_chat_sync_selection_list.py +23 -0
  58. merge/resources/chat/types/selective_sync_condition.py +49 -0
  59. merge/resources/chat/types/selective_sync_condition_list.py +21 -0
  60. merge/resources/chat/types/selective_sync_condition_operator.py +7 -0
  61. merge/resources/chat/types/sync_status.py +7 -0
  62. merge/resources/chat/types/sync_status_reason_enum.py +20 -0
  63. merge/resources/chat/types/sync_status_sync_status_reason.py +7 -0
  64. merge/resources/crm/__init__.py +21 -0
  65. merge/resources/crm/client.py +19 -0
  66. merge/resources/crm/resources/__init__.py +3 -0
  67. merge/resources/crm/resources/selective_sync/__init__.py +4 -0
  68. merge/resources/crm/resources/selective_sync/client.py +104 -0
  69. merge/resources/crm/resources/selective_sync/raw_client.py +103 -0
  70. merge/resources/crm/types/__init__.py +18 -0
  71. merge/resources/crm/types/operator_enum.py +58 -0
  72. merge/resources/crm/types/selective_sync_condition.py +49 -0
  73. merge/resources/crm/types/selective_sync_condition_list.py +21 -0
  74. merge/resources/crm/types/selective_sync_condition_operator.py +7 -0
  75. merge/resources/crm/types/sync_status.py +7 -0
  76. merge/resources/crm/types/sync_status_reason_enum.py +20 -0
  77. merge/resources/crm/types/sync_status_sync_status_reason.py +7 -0
  78. merge/resources/email/__init__.py +27 -0
  79. merge/resources/email/client.py +19 -0
  80. merge/resources/email/resources/__init__.py +3 -0
  81. merge/resources/email/resources/selective_sync/__init__.py +4 -0
  82. merge/resources/email/resources/selective_sync/client.py +167 -0
  83. merge/resources/email/resources/selective_sync/raw_client.py +184 -0
  84. merge/resources/email/types/__init__.py +24 -0
  85. merge/resources/email/types/label_selection.py +43 -0
  86. merge/resources/email/types/label_selection_list.py +21 -0
  87. merge/resources/email/types/operator_enum.py +58 -0
  88. merge/resources/email/types/selective_sync_condition.py +49 -0
  89. merge/resources/email/types/selective_sync_condition_list.py +21 -0
  90. merge/resources/email/types/selective_sync_condition_operator.py +7 -0
  91. merge/resources/email/types/sync_status.py +7 -0
  92. merge/resources/email/types/sync_status_reason_enum.py +20 -0
  93. merge/resources/email/types/sync_status_sync_status_reason.py +7 -0
  94. merge/resources/filestorage/__init__.py +39 -0
  95. merge/resources/filestorage/client.py +19 -0
  96. merge/resources/filestorage/resources/__init__.py +3 -0
  97. merge/resources/filestorage/resources/selective_sync/__init__.py +4 -0
  98. merge/resources/filestorage/resources/selective_sync/client.py +264 -0
  99. merge/resources/filestorage/resources/selective_sync/raw_client.py +293 -0
  100. merge/resources/filestorage/types/__init__.py +36 -0
  101. merge/resources/filestorage/types/file_storage_sync_selection.py +50 -0
  102. merge/resources/filestorage/types/file_storage_sync_selection_type.py +7 -0
  103. merge/resources/filestorage/types/file_storage_sync_selection_type_enum.py +26 -0
  104. merge/resources/filestorage/types/label_selection.py +43 -0
  105. merge/resources/filestorage/types/label_selection_list.py +21 -0
  106. merge/resources/filestorage/types/operator_enum.py +58 -0
  107. merge/resources/filestorage/types/paginated_file_storage_sync_selection_list.py +23 -0
  108. merge/resources/filestorage/types/selective_sync_condition.py +49 -0
  109. merge/resources/filestorage/types/selective_sync_condition_list.py +21 -0
  110. merge/resources/filestorage/types/selective_sync_condition_operator.py +7 -0
  111. merge/resources/filestorage/types/sync_status.py +7 -0
  112. merge/resources/filestorage/types/sync_status_reason_enum.py +20 -0
  113. merge/resources/filestorage/types/sync_status_sync_status_reason.py +7 -0
  114. merge/resources/hris/__init__.py +21 -0
  115. merge/resources/hris/client.py +19 -0
  116. merge/resources/hris/resources/__init__.py +3 -0
  117. merge/resources/hris/resources/selective_sync/__init__.py +4 -0
  118. merge/resources/hris/resources/selective_sync/client.py +104 -0
  119. merge/resources/hris/resources/selective_sync/raw_client.py +103 -0
  120. merge/resources/hris/types/__init__.py +18 -0
  121. merge/resources/hris/types/operator_enum.py +58 -0
  122. merge/resources/hris/types/selective_sync_condition.py +49 -0
  123. merge/resources/hris/types/selective_sync_condition_list.py +21 -0
  124. merge/resources/hris/types/selective_sync_condition_operator.py +7 -0
  125. merge/resources/hris/types/sync_status.py +7 -0
  126. merge/resources/hris/types/sync_status_reason_enum.py +20 -0
  127. merge/resources/hris/types/sync_status_sync_status_reason.py +7 -0
  128. merge/resources/knowledgebase/__init__.py +33 -0
  129. merge/resources/knowledgebase/client.py +19 -0
  130. merge/resources/knowledgebase/resources/__init__.py +3 -0
  131. merge/resources/knowledgebase/resources/selective_sync/__init__.py +4 -0
  132. merge/resources/knowledgebase/resources/selective_sync/client.py +201 -0
  133. merge/resources/knowledgebase/resources/selective_sync/raw_client.py +212 -0
  134. merge/resources/knowledgebase/types/__init__.py +30 -0
  135. merge/resources/knowledgebase/types/knowledge_base_sync_selection.py +50 -0
  136. merge/resources/knowledgebase/types/knowledge_base_sync_selection_type.py +7 -0
  137. merge/resources/knowledgebase/types/knowledge_base_sync_selection_type_enum.py +18 -0
  138. merge/resources/knowledgebase/types/operator_enum.py +58 -0
  139. merge/resources/knowledgebase/types/paginated_knowledge_base_sync_selection_list.py +23 -0
  140. merge/resources/knowledgebase/types/selective_sync_condition.py +49 -0
  141. merge/resources/knowledgebase/types/selective_sync_condition_list.py +21 -0
  142. merge/resources/knowledgebase/types/selective_sync_condition_operator.py +7 -0
  143. merge/resources/knowledgebase/types/sync_status.py +7 -0
  144. merge/resources/knowledgebase/types/sync_status_reason_enum.py +20 -0
  145. merge/resources/knowledgebase/types/sync_status_sync_status_reason.py +7 -0
  146. merge/resources/ticketing/__init__.py +21 -0
  147. merge/resources/ticketing/client.py +19 -0
  148. merge/resources/ticketing/resources/__init__.py +3 -0
  149. merge/resources/ticketing/resources/selective_sync/__init__.py +4 -0
  150. merge/resources/ticketing/resources/selective_sync/client.py +104 -0
  151. merge/resources/ticketing/resources/selective_sync/raw_client.py +103 -0
  152. merge/resources/ticketing/types/__init__.py +18 -0
  153. merge/resources/ticketing/types/operator_enum.py +58 -0
  154. merge/resources/ticketing/types/selective_sync_condition.py +49 -0
  155. merge/resources/ticketing/types/selective_sync_condition_list.py +21 -0
  156. merge/resources/ticketing/types/selective_sync_condition_operator.py +7 -0
  157. merge/resources/ticketing/types/sync_status.py +7 -0
  158. merge/resources/ticketing/types/sync_status_reason_enum.py +20 -0
  159. merge/resources/ticketing/types/sync_status_sync_status_reason.py +7 -0
  160. {mergepythonclient-4.0.0.dist-info → mergepythonclient-4.2.0.dist-info}/METADATA +2 -1
  161. {mergepythonclient-4.0.0.dist-info → mergepythonclient-4.2.0.dist-info}/RECORD +163 -55
  162. {mergepythonclient-4.0.0.dist-info → mergepythonclient-4.2.0.dist-info}/LICENSE.md +0 -0
  163. {mergepythonclient-4.0.0.dist-info → mergepythonclient-4.2.0.dist-info}/WHEEL +0 -0
@@ -29,12 +29,12 @@ class BaseClientWrapper:
29
29
  import platform
30
30
 
31
31
  headers: typing.Dict[str, str] = {
32
- "User-Agent": "MergePythonClient/4.0.0",
32
+ "User-Agent": "MergePythonClient/4.2.0",
33
33
  "X-Fern-Language": "Python",
34
34
  "X-Fern-Runtime": f"python/{platform.python_version()}",
35
35
  "X-Fern-Platform": f"{platform.system().lower()}/{platform.release()}",
36
36
  "X-Fern-SDK-Name": "MergePythonClient",
37
- "X-Fern-SDK-Version": "4.0.0",
37
+ "X-Fern-SDK-Version": "4.2.0",
38
38
  **(self.get_custom_headers() or {}),
39
39
  }
40
40
  if self._account_token is not None:
@@ -400,6 +400,7 @@ if typing.TYPE_CHECKING:
400
400
  ModelPermissionDeserializerRequest,
401
401
  MultipartFormFieldRequest,
402
402
  MultipartFormFieldRequestEncoding,
403
+ OperatorEnum,
403
404
  PaginatedAccountDetailsAndActionsList,
404
405
  PaginatedAccountList,
405
406
  PaginatedAccountingAttachmentList,
@@ -571,13 +572,18 @@ if typing.TYPE_CHECKING:
571
572
  SalesOrderStatus,
572
573
  SalesOrderStatusEnum,
573
574
  SalesOrderTrackingCategoriesItem,
575
+ SelectiveSyncCondition,
576
+ SelectiveSyncConditionList,
577
+ SelectiveSyncConditionOperator,
574
578
  SelectiveSyncConfigurationsUsageEnum,
575
579
  Status7D1Enum,
576
580
  Status895Enum,
577
581
  StatusFd5Enum,
578
582
  SyncStatus,
579
583
  SyncStatusLastSyncResult,
584
+ SyncStatusReasonEnum,
580
585
  SyncStatusStatus,
586
+ SyncStatusSyncStatusReason,
581
587
  TaxComponent,
582
588
  TaxComponentComponentType,
583
589
  TaxRate,
@@ -731,6 +737,7 @@ if typing.TYPE_CHECKING:
731
737
  regenerate_key,
732
738
  sales_orders,
733
739
  scopes,
740
+ selective_sync,
734
741
  sync_status,
735
742
  tax_rates,
736
743
  tracking_categories,
@@ -1171,6 +1178,7 @@ _dynamic_imports: typing.Dict[str, str] = {
1171
1178
  "ModelPermissionDeserializerRequest": ".types",
1172
1179
  "MultipartFormFieldRequest": ".types",
1173
1180
  "MultipartFormFieldRequestEncoding": ".types",
1181
+ "OperatorEnum": ".types",
1174
1182
  "PaginatedAccountDetailsAndActionsList": ".types",
1175
1183
  "PaginatedAccountList": ".types",
1176
1184
  "PaginatedAccountingAttachmentList": ".types",
@@ -1350,13 +1358,18 @@ _dynamic_imports: typing.Dict[str, str] = {
1350
1358
  "SalesOrderTrackingCategoriesItem": ".types",
1351
1359
  "SalesOrdersListRequestExpandItem": ".resources",
1352
1360
  "SalesOrdersRetrieveRequestExpandItem": ".resources",
1361
+ "SelectiveSyncCondition": ".types",
1362
+ "SelectiveSyncConditionList": ".types",
1363
+ "SelectiveSyncConditionOperator": ".types",
1353
1364
  "SelectiveSyncConfigurationsUsageEnum": ".types",
1354
1365
  "Status7D1Enum": ".types",
1355
1366
  "Status895Enum": ".types",
1356
1367
  "StatusFd5Enum": ".types",
1357
1368
  "SyncStatus": ".types",
1358
1369
  "SyncStatusLastSyncResult": ".types",
1370
+ "SyncStatusReasonEnum": ".types",
1359
1371
  "SyncStatusStatus": ".types",
1372
+ "SyncStatusSyncStatusReason": ".types",
1360
1373
  "TaxComponent": ".types",
1361
1374
  "TaxComponentComponentType": ".types",
1362
1375
  "TaxRate": ".types",
@@ -1461,6 +1474,7 @@ _dynamic_imports: typing.Dict[str, str] = {
1461
1474
  "regenerate_key": ".resources",
1462
1475
  "sales_orders": ".resources",
1463
1476
  "scopes": ".resources",
1477
+ "selective_sync": ".resources",
1464
1478
  "sync_status": ".resources",
1465
1479
  "tax_rates": ".resources",
1466
1480
  "tracking_categories": ".resources",
@@ -1924,6 +1938,7 @@ __all__ = [
1924
1938
  "ModelPermissionDeserializerRequest",
1925
1939
  "MultipartFormFieldRequest",
1926
1940
  "MultipartFormFieldRequestEncoding",
1941
+ "OperatorEnum",
1927
1942
  "PaginatedAccountDetailsAndActionsList",
1928
1943
  "PaginatedAccountList",
1929
1944
  "PaginatedAccountingAttachmentList",
@@ -2103,13 +2118,18 @@ __all__ = [
2103
2118
  "SalesOrderTrackingCategoriesItem",
2104
2119
  "SalesOrdersListRequestExpandItem",
2105
2120
  "SalesOrdersRetrieveRequestExpandItem",
2121
+ "SelectiveSyncCondition",
2122
+ "SelectiveSyncConditionList",
2123
+ "SelectiveSyncConditionOperator",
2106
2124
  "SelectiveSyncConfigurationsUsageEnum",
2107
2125
  "Status7D1Enum",
2108
2126
  "Status895Enum",
2109
2127
  "StatusFd5Enum",
2110
2128
  "SyncStatus",
2111
2129
  "SyncStatusLastSyncResult",
2130
+ "SyncStatusReasonEnum",
2112
2131
  "SyncStatusStatus",
2132
+ "SyncStatusSyncStatusReason",
2113
2133
  "TaxComponent",
2114
2134
  "TaxComponentComponentType",
2115
2135
  "TaxRate",
@@ -2214,6 +2234,7 @@ __all__ = [
2214
2234
  "regenerate_key",
2215
2235
  "sales_orders",
2216
2236
  "scopes",
2237
+ "selective_sync",
2217
2238
  "sync_status",
2218
2239
  "tax_rates",
2219
2240
  "tracking_categories",
@@ -60,6 +60,7 @@ if typing.TYPE_CHECKING:
60
60
  from .resources.regenerate_key.client import AsyncRegenerateKeyClient, RegenerateKeyClient
61
61
  from .resources.sales_orders.client import AsyncSalesOrdersClient, SalesOrdersClient
62
62
  from .resources.scopes.client import AsyncScopesClient, ScopesClient
63
+ from .resources.selective_sync.client import AsyncSelectiveSyncClient, SelectiveSyncClient
63
64
  from .resources.sync_status.client import AsyncSyncStatusClient, SyncStatusClient
64
65
  from .resources.tax_rates.client import AsyncTaxRatesClient, TaxRatesClient
65
66
  from .resources.tracking_categories.client import AsyncTrackingCategoriesClient, TrackingCategoriesClient
@@ -116,6 +117,7 @@ class AccountingClient:
116
117
  self._purchase_orders: typing.Optional[PurchaseOrdersClient] = None
117
118
  self._regenerate_key: typing.Optional[RegenerateKeyClient] = None
118
119
  self._sales_orders: typing.Optional[SalesOrdersClient] = None
120
+ self._selective_sync: typing.Optional[SelectiveSyncClient] = None
119
121
  self._sync_status: typing.Optional[SyncStatusClient] = None
120
122
  self._force_resync: typing.Optional[ForceResyncClient] = None
121
123
  self._tax_rates: typing.Optional[TaxRatesClient] = None
@@ -475,6 +477,14 @@ class AccountingClient:
475
477
  self._sales_orders = SalesOrdersClient(client_wrapper=self._client_wrapper)
476
478
  return self._sales_orders
477
479
 
480
+ @property
481
+ def selective_sync(self):
482
+ if self._selective_sync is None:
483
+ from .resources.selective_sync.client import SelectiveSyncClient # noqa: E402
484
+
485
+ self._selective_sync = SelectiveSyncClient(client_wrapper=self._client_wrapper)
486
+ return self._selective_sync
487
+
478
488
  @property
479
489
  def sync_status(self):
480
490
  if self._sync_status is None:
@@ -580,6 +590,7 @@ class AsyncAccountingClient:
580
590
  self._purchase_orders: typing.Optional[AsyncPurchaseOrdersClient] = None
581
591
  self._regenerate_key: typing.Optional[AsyncRegenerateKeyClient] = None
582
592
  self._sales_orders: typing.Optional[AsyncSalesOrdersClient] = None
593
+ self._selective_sync: typing.Optional[AsyncSelectiveSyncClient] = None
583
594
  self._sync_status: typing.Optional[AsyncSyncStatusClient] = None
584
595
  self._force_resync: typing.Optional[AsyncForceResyncClient] = None
585
596
  self._tax_rates: typing.Optional[AsyncTaxRatesClient] = None
@@ -941,6 +952,14 @@ class AsyncAccountingClient:
941
952
  self._sales_orders = AsyncSalesOrdersClient(client_wrapper=self._client_wrapper)
942
953
  return self._sales_orders
943
954
 
955
+ @property
956
+ def selective_sync(self):
957
+ if self._selective_sync is None:
958
+ from .resources.selective_sync.client import AsyncSelectiveSyncClient # noqa: E402
959
+
960
+ self._selective_sync = AsyncSelectiveSyncClient(client_wrapper=self._client_wrapper)
961
+ return self._selective_sync
962
+
944
963
  @property
945
964
  def sync_status(self):
946
965
  if self._sync_status is None:
@@ -50,6 +50,7 @@ if typing.TYPE_CHECKING:
50
50
  regenerate_key,
51
51
  sales_orders,
52
52
  scopes,
53
+ selective_sync,
53
54
  sync_status,
54
55
  tax_rates,
55
56
  tracking_categories,
@@ -202,6 +203,7 @@ _dynamic_imports: typing.Dict[str, str] = {
202
203
  "regenerate_key": ".regenerate_key",
203
204
  "sales_orders": ".sales_orders",
204
205
  "scopes": ".scopes",
206
+ "selective_sync": ".selective_sync",
205
207
  "sync_status": ".sync_status",
206
208
  "tax_rates": ".tax_rates",
207
209
  "tracking_categories": ".tracking_categories",
@@ -329,6 +331,7 @@ __all__ = [
329
331
  "regenerate_key",
330
332
  "sales_orders",
331
333
  "scopes",
334
+ "selective_sync",
332
335
  "sync_status",
333
336
  "tax_rates",
334
337
  "tracking_categories",
@@ -0,0 +1,4 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ # isort: skip_file
4
+
@@ -0,0 +1,104 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
6
+ from .....core.request_options import RequestOptions
7
+ from ...types.selective_sync_condition_list import SelectiveSyncConditionList
8
+ from .raw_client import AsyncRawSelectiveSyncClient, RawSelectiveSyncClient
9
+
10
+
11
+ class SelectiveSyncClient:
12
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
13
+ self._raw_client = RawSelectiveSyncClient(client_wrapper=client_wrapper)
14
+
15
+ @property
16
+ def with_raw_response(self) -> RawSelectiveSyncClient:
17
+ """
18
+ Retrieves a raw implementation of this client that returns raw responses.
19
+
20
+ Returns
21
+ -------
22
+ RawSelectiveSyncClient
23
+ """
24
+ return self._raw_client
25
+
26
+ def conditions_list(self, *, request_options: typing.Optional[RequestOptions] = None) -> SelectiveSyncConditionList:
27
+ """
28
+ Returns a list of `SelectiveSyncCondition` objects.
29
+
30
+ Parameters
31
+ ----------
32
+ request_options : typing.Optional[RequestOptions]
33
+ Request-specific configuration.
34
+
35
+ Returns
36
+ -------
37
+ SelectiveSyncConditionList
38
+
39
+
40
+ Examples
41
+ --------
42
+ from merge import Merge
43
+
44
+ client = Merge(
45
+ account_token="YOUR_ACCOUNT_TOKEN",
46
+ api_key="YOUR_API_KEY",
47
+ )
48
+ client.accounting.selective_sync.conditions_list()
49
+ """
50
+ _response = self._raw_client.conditions_list(request_options=request_options)
51
+ return _response.data
52
+
53
+
54
+ class AsyncSelectiveSyncClient:
55
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
56
+ self._raw_client = AsyncRawSelectiveSyncClient(client_wrapper=client_wrapper)
57
+
58
+ @property
59
+ def with_raw_response(self) -> AsyncRawSelectiveSyncClient:
60
+ """
61
+ Retrieves a raw implementation of this client that returns raw responses.
62
+
63
+ Returns
64
+ -------
65
+ AsyncRawSelectiveSyncClient
66
+ """
67
+ return self._raw_client
68
+
69
+ async def conditions_list(
70
+ self, *, request_options: typing.Optional[RequestOptions] = None
71
+ ) -> SelectiveSyncConditionList:
72
+ """
73
+ Returns a list of `SelectiveSyncCondition` objects.
74
+
75
+ Parameters
76
+ ----------
77
+ request_options : typing.Optional[RequestOptions]
78
+ Request-specific configuration.
79
+
80
+ Returns
81
+ -------
82
+ SelectiveSyncConditionList
83
+
84
+
85
+ Examples
86
+ --------
87
+ import asyncio
88
+
89
+ from merge import AsyncMerge
90
+
91
+ client = AsyncMerge(
92
+ account_token="YOUR_ACCOUNT_TOKEN",
93
+ api_key="YOUR_API_KEY",
94
+ )
95
+
96
+
97
+ async def main() -> None:
98
+ await client.accounting.selective_sync.conditions_list()
99
+
100
+
101
+ asyncio.run(main())
102
+ """
103
+ _response = await self._raw_client.conditions_list(request_options=request_options)
104
+ return _response.data
@@ -0,0 +1,103 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+ from json.decoder import JSONDecodeError
5
+
6
+ from .....core.api_error import ApiError
7
+ from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
8
+ from .....core.http_response import AsyncHttpResponse, HttpResponse
9
+ from .....core.parse_error import ParsingError
10
+ from .....core.request_options import RequestOptions
11
+ from .....core.unchecked_base_model import construct_type
12
+ from ...types.selective_sync_condition_list import SelectiveSyncConditionList
13
+ from pydantic import ValidationError
14
+
15
+
16
+ class RawSelectiveSyncClient:
17
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
18
+ self._client_wrapper = client_wrapper
19
+
20
+ def conditions_list(
21
+ self, *, request_options: typing.Optional[RequestOptions] = None
22
+ ) -> HttpResponse[SelectiveSyncConditionList]:
23
+ """
24
+ Returns a list of `SelectiveSyncCondition` objects.
25
+
26
+ Parameters
27
+ ----------
28
+ request_options : typing.Optional[RequestOptions]
29
+ Request-specific configuration.
30
+
31
+ Returns
32
+ -------
33
+ HttpResponse[SelectiveSyncConditionList]
34
+
35
+ """
36
+ _response = self._client_wrapper.httpx_client.request(
37
+ "accounting/v1/selective-sync/conditions",
38
+ method="GET",
39
+ request_options=request_options,
40
+ )
41
+ try:
42
+ if 200 <= _response.status_code < 300:
43
+ _data = typing.cast(
44
+ SelectiveSyncConditionList,
45
+ construct_type(
46
+ type_=SelectiveSyncConditionList, # type: ignore
47
+ object_=_response.json(),
48
+ ),
49
+ )
50
+ return HttpResponse(response=_response, data=_data)
51
+ _response_json = _response.json()
52
+ except JSONDecodeError:
53
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
54
+ except ValidationError as e:
55
+ raise ParsingError(
56
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
57
+ )
58
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
59
+
60
+
61
+ class AsyncRawSelectiveSyncClient:
62
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
63
+ self._client_wrapper = client_wrapper
64
+
65
+ async def conditions_list(
66
+ self, *, request_options: typing.Optional[RequestOptions] = None
67
+ ) -> AsyncHttpResponse[SelectiveSyncConditionList]:
68
+ """
69
+ Returns a list of `SelectiveSyncCondition` objects.
70
+
71
+ Parameters
72
+ ----------
73
+ request_options : typing.Optional[RequestOptions]
74
+ Request-specific configuration.
75
+
76
+ Returns
77
+ -------
78
+ AsyncHttpResponse[SelectiveSyncConditionList]
79
+
80
+ """
81
+ _response = await self._client_wrapper.httpx_client.request(
82
+ "accounting/v1/selective-sync/conditions",
83
+ method="GET",
84
+ request_options=request_options,
85
+ )
86
+ try:
87
+ if 200 <= _response.status_code < 300:
88
+ _data = typing.cast(
89
+ SelectiveSyncConditionList,
90
+ construct_type(
91
+ type_=SelectiveSyncConditionList, # type: ignore
92
+ object_=_response.json(),
93
+ ),
94
+ )
95
+ return AsyncHttpResponse(response=_response, data=_data)
96
+ _response_json = _response.json()
97
+ except JSONDecodeError:
98
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
99
+ except ValidationError as e:
100
+ raise ParsingError(
101
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
102
+ )
103
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
@@ -409,6 +409,7 @@ if typing.TYPE_CHECKING:
409
409
  from .model_permission_deserializer_request import ModelPermissionDeserializerRequest
410
410
  from .multipart_form_field_request import MultipartFormFieldRequest
411
411
  from .multipart_form_field_request_encoding import MultipartFormFieldRequestEncoding
412
+ from .operator_enum import OperatorEnum
412
413
  from .paginated_account_details_and_actions_list import PaginatedAccountDetailsAndActionsList
413
414
  from .paginated_account_list import PaginatedAccountList
414
415
  from .paginated_accounting_attachment_list import PaginatedAccountingAttachmentList
@@ -580,13 +581,18 @@ if typing.TYPE_CHECKING:
580
581
  from .sales_order_status import SalesOrderStatus
581
582
  from .sales_order_status_enum import SalesOrderStatusEnum
582
583
  from .sales_order_tracking_categories_item import SalesOrderTrackingCategoriesItem
584
+ from .selective_sync_condition import SelectiveSyncCondition
585
+ from .selective_sync_condition_list import SelectiveSyncConditionList
586
+ from .selective_sync_condition_operator import SelectiveSyncConditionOperator
583
587
  from .selective_sync_configurations_usage_enum import SelectiveSyncConfigurationsUsageEnum
584
588
  from .status_7_d_1_enum import Status7D1Enum
585
589
  from .status_895_enum import Status895Enum
586
590
  from .status_fd_5_enum import StatusFd5Enum
587
591
  from .sync_status import SyncStatus
588
592
  from .sync_status_last_sync_result import SyncStatusLastSyncResult
593
+ from .sync_status_reason_enum import SyncStatusReasonEnum
589
594
  from .sync_status_status import SyncStatusStatus
595
+ from .sync_status_sync_status_reason import SyncStatusSyncStatusReason
590
596
  from .tax_component import TaxComponent
591
597
  from .tax_component_component_type import TaxComponentComponentType
592
598
  from .tax_rate import TaxRate
@@ -1038,6 +1044,7 @@ _dynamic_imports: typing.Dict[str, str] = {
1038
1044
  "ModelPermissionDeserializerRequest": ".model_permission_deserializer_request",
1039
1045
  "MultipartFormFieldRequest": ".multipart_form_field_request",
1040
1046
  "MultipartFormFieldRequestEncoding": ".multipart_form_field_request_encoding",
1047
+ "OperatorEnum": ".operator_enum",
1041
1048
  "PaginatedAccountDetailsAndActionsList": ".paginated_account_details_and_actions_list",
1042
1049
  "PaginatedAccountList": ".paginated_account_list",
1043
1050
  "PaginatedAccountingAttachmentList": ".paginated_accounting_attachment_list",
@@ -1209,13 +1216,18 @@ _dynamic_imports: typing.Dict[str, str] = {
1209
1216
  "SalesOrderStatus": ".sales_order_status",
1210
1217
  "SalesOrderStatusEnum": ".sales_order_status_enum",
1211
1218
  "SalesOrderTrackingCategoriesItem": ".sales_order_tracking_categories_item",
1219
+ "SelectiveSyncCondition": ".selective_sync_condition",
1220
+ "SelectiveSyncConditionList": ".selective_sync_condition_list",
1221
+ "SelectiveSyncConditionOperator": ".selective_sync_condition_operator",
1212
1222
  "SelectiveSyncConfigurationsUsageEnum": ".selective_sync_configurations_usage_enum",
1213
1223
  "Status7D1Enum": ".status_7_d_1_enum",
1214
1224
  "Status895Enum": ".status_895_enum",
1215
1225
  "StatusFd5Enum": ".status_fd_5_enum",
1216
1226
  "SyncStatus": ".sync_status",
1217
1227
  "SyncStatusLastSyncResult": ".sync_status_last_sync_result",
1228
+ "SyncStatusReasonEnum": ".sync_status_reason_enum",
1218
1229
  "SyncStatusStatus": ".sync_status_status",
1230
+ "SyncStatusSyncStatusReason": ".sync_status_sync_status_reason",
1219
1231
  "TaxComponent": ".tax_component",
1220
1232
  "TaxComponentComponentType": ".tax_component_component_type",
1221
1233
  "TaxRate": ".tax_rate",
@@ -1689,6 +1701,7 @@ __all__ = [
1689
1701
  "ModelPermissionDeserializerRequest",
1690
1702
  "MultipartFormFieldRequest",
1691
1703
  "MultipartFormFieldRequestEncoding",
1704
+ "OperatorEnum",
1692
1705
  "PaginatedAccountDetailsAndActionsList",
1693
1706
  "PaginatedAccountList",
1694
1707
  "PaginatedAccountingAttachmentList",
@@ -1860,13 +1873,18 @@ __all__ = [
1860
1873
  "SalesOrderStatus",
1861
1874
  "SalesOrderStatusEnum",
1862
1875
  "SalesOrderTrackingCategoriesItem",
1876
+ "SelectiveSyncCondition",
1877
+ "SelectiveSyncConditionList",
1878
+ "SelectiveSyncConditionOperator",
1863
1879
  "SelectiveSyncConfigurationsUsageEnum",
1864
1880
  "Status7D1Enum",
1865
1881
  "Status895Enum",
1866
1882
  "StatusFd5Enum",
1867
1883
  "SyncStatus",
1868
1884
  "SyncStatusLastSyncResult",
1885
+ "SyncStatusReasonEnum",
1869
1886
  "SyncStatusStatus",
1887
+ "SyncStatusSyncStatusReason",
1870
1888
  "TaxComponent",
1871
1889
  "TaxComponentComponentType",
1872
1890
  "TaxRate",
@@ -0,0 +1,58 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ from ....core import enum
6
+
7
+ T_Result = typing.TypeVar("T_Result")
8
+
9
+
10
+ class OperatorEnum(enum.StrEnum):
11
+ CONTAINS = "CONTAINS"
12
+ EQUALS = "EQUALS"
13
+ GREATER_THAN = "GREATER_THAN"
14
+ GREATER_THAN_OR_EQUAL_TO = "GREATER_THAN_OR_EQUAL_TO"
15
+ HAS_ALL_OF = "HAS_ALL_OF"
16
+ HAS_NONE_OF = "HAS_NONE_OF"
17
+ IS_ONE_OF = "IS_ONE_OF"
18
+ LESS_THAN = "LESS_THAN"
19
+ LESS_THAN_OR_EQUAL_TO = "LESS_THAN_OR_EQUAL_TO"
20
+ NOT_EQUALS = "NOT_EQUALS"
21
+ WITHIN = "WITHIN"
22
+
23
+ def visit(
24
+ self,
25
+ contains: typing.Callable[[], T_Result],
26
+ equals: typing.Callable[[], T_Result],
27
+ greater_than: typing.Callable[[], T_Result],
28
+ greater_than_or_equal_to: typing.Callable[[], T_Result],
29
+ has_all_of: typing.Callable[[], T_Result],
30
+ has_none_of: typing.Callable[[], T_Result],
31
+ is_one_of: typing.Callable[[], T_Result],
32
+ less_than: typing.Callable[[], T_Result],
33
+ less_than_or_equal_to: typing.Callable[[], T_Result],
34
+ not_equals: typing.Callable[[], T_Result],
35
+ within: typing.Callable[[], T_Result],
36
+ ) -> T_Result:
37
+ if self is OperatorEnum.CONTAINS:
38
+ return contains()
39
+ if self is OperatorEnum.EQUALS:
40
+ return equals()
41
+ if self is OperatorEnum.GREATER_THAN:
42
+ return greater_than()
43
+ if self is OperatorEnum.GREATER_THAN_OR_EQUAL_TO:
44
+ return greater_than_or_equal_to()
45
+ if self is OperatorEnum.HAS_ALL_OF:
46
+ return has_all_of()
47
+ if self is OperatorEnum.HAS_NONE_OF:
48
+ return has_none_of()
49
+ if self is OperatorEnum.IS_ONE_OF:
50
+ return is_one_of()
51
+ if self is OperatorEnum.LESS_THAN:
52
+ return less_than()
53
+ if self is OperatorEnum.LESS_THAN_OR_EQUAL_TO:
54
+ return less_than_or_equal_to()
55
+ if self is OperatorEnum.NOT_EQUALS:
56
+ return not_equals()
57
+ if self is OperatorEnum.WITHIN:
58
+ return within()
@@ -0,0 +1,49 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ....core.pydantic_utilities import IS_PYDANTIC_V2
7
+ from ....core.unchecked_base_model import UncheckedBaseModel
8
+ from .selective_sync_condition_operator import SelectiveSyncConditionOperator
9
+
10
+
11
+ class SelectiveSyncCondition(UncheckedBaseModel):
12
+ id: str = pydantic.Field()
13
+ """
14
+ The Merge ID of the filter.
15
+ """
16
+
17
+ common_model: str = pydantic.Field()
18
+ """
19
+ The common model the filter applies to.
20
+ """
21
+
22
+ normalized_key_name: str = pydantic.Field()
23
+ """
24
+ The Merge field the filter applies to.
25
+ """
26
+
27
+ remote_key_name: typing.Optional[str] = pydantic.Field(default=None)
28
+ """
29
+ The third-party API's name for the filtered field.
30
+ """
31
+
32
+ operator: SelectiveSyncConditionOperator = pydantic.Field()
33
+ """
34
+ How the value is compared.
35
+ """
36
+
37
+ value: typing.Dict[str, typing.Any] = pydantic.Field()
38
+ """
39
+ The value the field is compared against.
40
+ """
41
+
42
+ if IS_PYDANTIC_V2:
43
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
44
+ else:
45
+
46
+ class Config:
47
+ frozen = True
48
+ smart_union = True
49
+ extra = pydantic.Extra.allow
@@ -0,0 +1,21 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ....core.pydantic_utilities import IS_PYDANTIC_V2
7
+ from ....core.unchecked_base_model import UncheckedBaseModel
8
+ from .selective_sync_condition import SelectiveSyncCondition
9
+
10
+
11
+ class SelectiveSyncConditionList(UncheckedBaseModel):
12
+ results: typing.List[SelectiveSyncCondition]
13
+
14
+ if IS_PYDANTIC_V2:
15
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
16
+ else:
17
+
18
+ class Config:
19
+ frozen = True
20
+ smart_union = True
21
+ extra = pydantic.Extra.allow
@@ -0,0 +1,7 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ from .operator_enum import OperatorEnum
6
+
7
+ SelectiveSyncConditionOperator = typing.Union[OperatorEnum, str]
@@ -9,6 +9,7 @@ from ....core.unchecked_base_model import UncheckedBaseModel
9
9
  from .selective_sync_configurations_usage_enum import SelectiveSyncConfigurationsUsageEnum
10
10
  from .sync_status_last_sync_result import SyncStatusLastSyncResult
11
11
  from .sync_status_status import SyncStatusStatus
12
+ from .sync_status_sync_status_reason import SyncStatusSyncStatusReason
12
13
 
13
14
 
14
15
  class SyncStatus(UncheckedBaseModel):
@@ -27,7 +28,13 @@ class SyncStatus(UncheckedBaseModel):
27
28
  next_sync_start: typing.Optional[dt.datetime] = None
28
29
  last_sync_result: typing.Optional[SyncStatusLastSyncResult] = None
29
30
  last_sync_finished: typing.Optional[dt.datetime] = None
31
+ data_fresh_as_of: typing.Optional[dt.datetime] = None
30
32
  status: SyncStatusStatus
33
+ sync_status_reason: typing.Optional[SyncStatusSyncStatusReason] = pydantic.Field(default=None)
34
+ """
35
+ The reason a model with a `SYNCING` status is temporarily not progressing. `RATE_LIMITED` indicates the model is paused to respect the data provider's rate limits. `WAITING_ON_OTHER_MODELS` indicates the model is waiting for other models to finish syncing.
36
+ """
37
+
31
38
  is_initial_sync: bool
32
39
  selective_sync_configurations_usage: typing.Optional[SelectiveSyncConfigurationsUsageEnum] = None
33
40
 
@@ -0,0 +1,20 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ from ....core import enum
6
+
7
+ T_Result = typing.TypeVar("T_Result")
8
+
9
+
10
+ class SyncStatusReasonEnum(enum.StrEnum):
11
+ RATE_LIMITED = "RATE_LIMITED"
12
+ WAITING_ON_OTHER_MODELS = "WAITING_ON_OTHER_MODELS"
13
+
14
+ def visit(
15
+ self, rate_limited: typing.Callable[[], T_Result], waiting_on_other_models: typing.Callable[[], T_Result]
16
+ ) -> T_Result:
17
+ if self is SyncStatusReasonEnum.RATE_LIMITED:
18
+ return rate_limited()
19
+ if self is SyncStatusReasonEnum.WAITING_ON_OTHER_MODELS:
20
+ return waiting_on_other_models()