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
@@ -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()
@@ -0,0 +1,7 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ from .sync_status_reason_enum import SyncStatusReasonEnum
6
+
7
+ SyncStatusSyncStatusReason = typing.Union[SyncStatusReasonEnum, str]
@@ -59,6 +59,8 @@ if typing.TYPE_CHECKING:
59
59
  Issue,
60
60
  IssueStatus,
61
61
  IssueStatusEnum,
62
+ LabelSelection,
63
+ LabelSelectionList,
62
64
  LanguageEnum,
63
65
  LastSyncResultEnum,
64
66
  LinkToken,
@@ -73,6 +75,7 @@ if typing.TYPE_CHECKING:
73
75
  ModelPermissionDeserializerRequest,
74
76
  MultipartFormFieldRequest,
75
77
  MultipartFormFieldRequestEncoding,
78
+ OperatorEnum,
76
79
  PaginatedAccountDetailsAndActionsList,
77
80
  PaginatedAuditLogEventList,
78
81
  PaginatedEmailAddressList,
@@ -99,11 +102,16 @@ if typing.TYPE_CHECKING:
99
102
  RequestFormatEnum,
100
103
  ResponseTypeEnum,
101
104
  RoleEnum,
105
+ SelectiveSyncCondition,
106
+ SelectiveSyncConditionList,
107
+ SelectiveSyncConditionOperator,
102
108
  SelectiveSyncConfigurationsUsageEnum,
103
109
  StatusFd5Enum,
104
110
  SyncStatus,
105
111
  SyncStatusLastSyncResult,
112
+ SyncStatusReasonEnum,
106
113
  SyncStatusStatus,
114
+ SyncStatusSyncStatusReason,
107
115
  User,
108
116
  UserFieldMappings,
109
117
  UserType,
@@ -150,6 +158,7 @@ if typing.TYPE_CHECKING:
150
158
  passthrough,
151
159
  regenerate_key,
152
160
  scopes,
161
+ selective_sync,
153
162
  sync_status,
154
163
  users,
155
164
  webhook_receivers,
@@ -217,6 +226,8 @@ _dynamic_imports: typing.Dict[str, str] = {
217
226
  "IssueStatus": ".types",
218
227
  "IssueStatusEnum": ".types",
219
228
  "IssuesListRequestStatus": ".resources",
229
+ "LabelSelection": ".types",
230
+ "LabelSelectionList": ".types",
220
231
  "LanguageEnum": ".types",
221
232
  "LastSyncResultEnum": ".types",
222
233
  "LinkToken": ".types",
@@ -236,6 +247,7 @@ _dynamic_imports: typing.Dict[str, str] = {
236
247
  "ModelPermissionDeserializerRequest": ".types",
237
248
  "MultipartFormFieldRequest": ".types",
238
249
  "MultipartFormFieldRequestEncoding": ".types",
250
+ "OperatorEnum": ".types",
239
251
  "PaginatedAccountDetailsAndActionsList": ".types",
240
252
  "PaginatedAuditLogEventList": ".types",
241
253
  "PaginatedEmailAddressList": ".types",
@@ -262,11 +274,16 @@ _dynamic_imports: typing.Dict[str, str] = {
262
274
  "RequestFormatEnum": ".types",
263
275
  "ResponseTypeEnum": ".types",
264
276
  "RoleEnum": ".types",
277
+ "SelectiveSyncCondition": ".types",
278
+ "SelectiveSyncConditionList": ".types",
279
+ "SelectiveSyncConditionOperator": ".types",
265
280
  "SelectiveSyncConfigurationsUsageEnum": ".types",
266
281
  "StatusFd5Enum": ".types",
267
282
  "SyncStatus": ".types",
268
283
  "SyncStatusLastSyncResult": ".types",
284
+ "SyncStatusReasonEnum": ".types",
269
285
  "SyncStatusStatus": ".types",
286
+ "SyncStatusSyncStatusReason": ".types",
270
287
  "User": ".types",
271
288
  "UserFieldMappings": ".types",
272
289
  "UserType": ".types",
@@ -296,6 +313,7 @@ _dynamic_imports: typing.Dict[str, str] = {
296
313
  "passthrough": ".resources",
297
314
  "regenerate_key": ".resources",
298
315
  "scopes": ".resources",
316
+ "selective_sync": ".resources",
299
317
  "sync_status": ".resources",
300
318
  "users": ".resources",
301
319
  "webhook_receivers": ".resources",
@@ -386,6 +404,8 @@ __all__ = [
386
404
  "IssueStatus",
387
405
  "IssueStatusEnum",
388
406
  "IssuesListRequestStatus",
407
+ "LabelSelection",
408
+ "LabelSelectionList",
389
409
  "LanguageEnum",
390
410
  "LastSyncResultEnum",
391
411
  "LinkToken",
@@ -405,6 +425,7 @@ __all__ = [
405
425
  "ModelPermissionDeserializerRequest",
406
426
  "MultipartFormFieldRequest",
407
427
  "MultipartFormFieldRequestEncoding",
428
+ "OperatorEnum",
408
429
  "PaginatedAccountDetailsAndActionsList",
409
430
  "PaginatedAuditLogEventList",
410
431
  "PaginatedEmailAddressList",
@@ -431,11 +452,16 @@ __all__ = [
431
452
  "RequestFormatEnum",
432
453
  "ResponseTypeEnum",
433
454
  "RoleEnum",
455
+ "SelectiveSyncCondition",
456
+ "SelectiveSyncConditionList",
457
+ "SelectiveSyncConditionOperator",
434
458
  "SelectiveSyncConfigurationsUsageEnum",
435
459
  "StatusFd5Enum",
436
460
  "SyncStatus",
437
461
  "SyncStatusLastSyncResult",
462
+ "SyncStatusReasonEnum",
438
463
  "SyncStatusStatus",
464
+ "SyncStatusSyncStatusReason",
439
465
  "User",
440
466
  "UserFieldMappings",
441
467
  "UserType",
@@ -465,6 +491,7 @@ __all__ = [
465
491
  "passthrough",
466
492
  "regenerate_key",
467
493
  "scopes",
494
+ "selective_sync",
468
495
  "sync_status",
469
496
  "users",
470
497
  "webhook_receivers",
@@ -34,6 +34,7 @@ if typing.TYPE_CHECKING:
34
34
  from .resources.passthrough.client import PassthroughClient
35
35
  from .resources.regenerate_key.client import AsyncRegenerateKeyClient, RegenerateKeyClient
36
36
  from .resources.scopes.client import AsyncScopesClient, ScopesClient
37
+ from .resources.selective_sync.client import AsyncSelectiveSyncClient, SelectiveSyncClient
37
38
  from .resources.sync_status.client import AsyncSyncStatusClient, SyncStatusClient
38
39
  from .resources.users.client import AsyncUsersClient, UsersClient
39
40
  from .resources.webhook_receivers.client import AsyncWebhookReceiversClient, WebhookReceiversClient
@@ -64,6 +65,7 @@ class EmailClient:
64
65
  self._messages: typing.Optional[MessagesClient] = None
65
66
  self._passthrough: typing.Optional[PassthroughClient] = None
66
67
  self._regenerate_key: typing.Optional[RegenerateKeyClient] = None
68
+ self._selective_sync: typing.Optional[SelectiveSyncClient] = None
67
69
  self._sync_status: typing.Optional[SyncStatusClient] = None
68
70
  self._force_resync: typing.Optional[ForceResyncClient] = None
69
71
  self._users: typing.Optional[UsersClient] = None
@@ -236,6 +238,14 @@ class EmailClient:
236
238
  self._regenerate_key = RegenerateKeyClient(client_wrapper=self._client_wrapper)
237
239
  return self._regenerate_key
238
240
 
241
+ @property
242
+ def selective_sync(self):
243
+ if self._selective_sync is None:
244
+ from .resources.selective_sync.client import SelectiveSyncClient # noqa: E402
245
+
246
+ self._selective_sync = SelectiveSyncClient(client_wrapper=self._client_wrapper)
247
+ return self._selective_sync
248
+
239
249
  @property
240
250
  def sync_status(self):
241
251
  if self._sync_status is None:
@@ -292,6 +302,7 @@ class AsyncEmailClient:
292
302
  self._messages: typing.Optional[AsyncMessagesClient] = None
293
303
  self._passthrough: typing.Optional[resources_email_resources_passthrough_client_AsyncPassthroughClient] = None
294
304
  self._regenerate_key: typing.Optional[AsyncRegenerateKeyClient] = None
305
+ self._selective_sync: typing.Optional[AsyncSelectiveSyncClient] = None
295
306
  self._sync_status: typing.Optional[AsyncSyncStatusClient] = None
296
307
  self._force_resync: typing.Optional[AsyncForceResyncClient] = None
297
308
  self._users: typing.Optional[AsyncUsersClient] = None
@@ -464,6 +475,14 @@ class AsyncEmailClient:
464
475
  self._regenerate_key = AsyncRegenerateKeyClient(client_wrapper=self._client_wrapper)
465
476
  return self._regenerate_key
466
477
 
478
+ @property
479
+ def selective_sync(self):
480
+ if self._selective_sync is None:
481
+ from .resources.selective_sync.client import AsyncSelectiveSyncClient # noqa: E402
482
+
483
+ self._selective_sync = AsyncSelectiveSyncClient(client_wrapper=self._client_wrapper)
484
+ return self._selective_sync
485
+
467
486
  @property
468
487
  def sync_status(self):
469
488
  if self._sync_status is None:
@@ -27,6 +27,7 @@ if typing.TYPE_CHECKING:
27
27
  passthrough,
28
28
  regenerate_key,
29
29
  scopes,
30
+ selective_sync,
30
31
  sync_status,
31
32
  users,
32
33
  webhook_receivers,
@@ -79,6 +80,7 @@ _dynamic_imports: typing.Dict[str, str] = {
79
80
  "passthrough": ".passthrough",
80
81
  "regenerate_key": ".regenerate_key",
81
82
  "scopes": ".scopes",
83
+ "selective_sync": ".selective_sync",
82
84
  "sync_status": ".sync_status",
83
85
  "users": ".users",
84
86
  "webhook_receivers": ".webhook_receivers",
@@ -144,6 +146,7 @@ __all__ = [
144
146
  "passthrough",
145
147
  "regenerate_key",
146
148
  "scopes",
149
+ "selective_sync",
147
150
  "sync_status",
148
151
  "users",
149
152
  "webhook_receivers",
@@ -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,167 @@
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.label_selection_list import LabelSelectionList
8
+ from ...types.selective_sync_condition_list import SelectiveSyncConditionList
9
+ from .raw_client import AsyncRawSelectiveSyncClient, RawSelectiveSyncClient
10
+
11
+
12
+ class SelectiveSyncClient:
13
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
14
+ self._raw_client = RawSelectiveSyncClient(client_wrapper=client_wrapper)
15
+
16
+ @property
17
+ def with_raw_response(self) -> RawSelectiveSyncClient:
18
+ """
19
+ Retrieves a raw implementation of this client that returns raw responses.
20
+
21
+ Returns
22
+ -------
23
+ RawSelectiveSyncClient
24
+ """
25
+ return self._raw_client
26
+
27
+ def conditions_list(self, *, request_options: typing.Optional[RequestOptions] = None) -> SelectiveSyncConditionList:
28
+ """
29
+ Returns a list of `SelectiveSyncCondition` objects.
30
+
31
+ Parameters
32
+ ----------
33
+ request_options : typing.Optional[RequestOptions]
34
+ Request-specific configuration.
35
+
36
+ Returns
37
+ -------
38
+ SelectiveSyncConditionList
39
+
40
+
41
+ Examples
42
+ --------
43
+ from merge import Merge
44
+
45
+ client = Merge(
46
+ account_token="YOUR_ACCOUNT_TOKEN",
47
+ api_key="YOUR_API_KEY",
48
+ )
49
+ client.email.selective_sync.conditions_list()
50
+ """
51
+ _response = self._raw_client.conditions_list(request_options=request_options)
52
+ return _response.data
53
+
54
+ def labels_list(self, *, request_options: typing.Optional[RequestOptions] = None) -> LabelSelectionList:
55
+ """
56
+ Returns a list of `LabelSelection` objects.
57
+
58
+ Parameters
59
+ ----------
60
+ request_options : typing.Optional[RequestOptions]
61
+ Request-specific configuration.
62
+
63
+ Returns
64
+ -------
65
+ LabelSelectionList
66
+
67
+
68
+ Examples
69
+ --------
70
+ from merge import Merge
71
+
72
+ client = Merge(
73
+ account_token="YOUR_ACCOUNT_TOKEN",
74
+ api_key="YOUR_API_KEY",
75
+ )
76
+ client.email.selective_sync.labels_list()
77
+ """
78
+ _response = self._raw_client.labels_list(request_options=request_options)
79
+ return _response.data
80
+
81
+
82
+ class AsyncSelectiveSyncClient:
83
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
84
+ self._raw_client = AsyncRawSelectiveSyncClient(client_wrapper=client_wrapper)
85
+
86
+ @property
87
+ def with_raw_response(self) -> AsyncRawSelectiveSyncClient:
88
+ """
89
+ Retrieves a raw implementation of this client that returns raw responses.
90
+
91
+ Returns
92
+ -------
93
+ AsyncRawSelectiveSyncClient
94
+ """
95
+ return self._raw_client
96
+
97
+ async def conditions_list(
98
+ self, *, request_options: typing.Optional[RequestOptions] = None
99
+ ) -> SelectiveSyncConditionList:
100
+ """
101
+ Returns a list of `SelectiveSyncCondition` objects.
102
+
103
+ Parameters
104
+ ----------
105
+ request_options : typing.Optional[RequestOptions]
106
+ Request-specific configuration.
107
+
108
+ Returns
109
+ -------
110
+ SelectiveSyncConditionList
111
+
112
+
113
+ Examples
114
+ --------
115
+ import asyncio
116
+
117
+ from merge import AsyncMerge
118
+
119
+ client = AsyncMerge(
120
+ account_token="YOUR_ACCOUNT_TOKEN",
121
+ api_key="YOUR_API_KEY",
122
+ )
123
+
124
+
125
+ async def main() -> None:
126
+ await client.email.selective_sync.conditions_list()
127
+
128
+
129
+ asyncio.run(main())
130
+ """
131
+ _response = await self._raw_client.conditions_list(request_options=request_options)
132
+ return _response.data
133
+
134
+ async def labels_list(self, *, request_options: typing.Optional[RequestOptions] = None) -> LabelSelectionList:
135
+ """
136
+ Returns a list of `LabelSelection` objects.
137
+
138
+ Parameters
139
+ ----------
140
+ request_options : typing.Optional[RequestOptions]
141
+ Request-specific configuration.
142
+
143
+ Returns
144
+ -------
145
+ LabelSelectionList
146
+
147
+
148
+ Examples
149
+ --------
150
+ import asyncio
151
+
152
+ from merge import AsyncMerge
153
+
154
+ client = AsyncMerge(
155
+ account_token="YOUR_ACCOUNT_TOKEN",
156
+ api_key="YOUR_API_KEY",
157
+ )
158
+
159
+
160
+ async def main() -> None:
161
+ await client.email.selective_sync.labels_list()
162
+
163
+
164
+ asyncio.run(main())
165
+ """
166
+ _response = await self._raw_client.labels_list(request_options=request_options)
167
+ return _response.data
@@ -0,0 +1,184 @@
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.label_selection_list import LabelSelectionList
13
+ from ...types.selective_sync_condition_list import SelectiveSyncConditionList
14
+ from pydantic import ValidationError
15
+
16
+
17
+ class RawSelectiveSyncClient:
18
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
19
+ self._client_wrapper = client_wrapper
20
+
21
+ def conditions_list(
22
+ self, *, request_options: typing.Optional[RequestOptions] = None
23
+ ) -> HttpResponse[SelectiveSyncConditionList]:
24
+ """
25
+ Returns a list of `SelectiveSyncCondition` objects.
26
+
27
+ Parameters
28
+ ----------
29
+ request_options : typing.Optional[RequestOptions]
30
+ Request-specific configuration.
31
+
32
+ Returns
33
+ -------
34
+ HttpResponse[SelectiveSyncConditionList]
35
+
36
+ """
37
+ _response = self._client_wrapper.httpx_client.request(
38
+ "email/v1/selective-sync/conditions",
39
+ method="GET",
40
+ request_options=request_options,
41
+ )
42
+ try:
43
+ if 200 <= _response.status_code < 300:
44
+ _data = typing.cast(
45
+ SelectiveSyncConditionList,
46
+ construct_type(
47
+ type_=SelectiveSyncConditionList, # type: ignore
48
+ object_=_response.json(),
49
+ ),
50
+ )
51
+ return HttpResponse(response=_response, data=_data)
52
+ _response_json = _response.json()
53
+ except JSONDecodeError:
54
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
55
+ except ValidationError as e:
56
+ raise ParsingError(
57
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
58
+ )
59
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
60
+
61
+ def labels_list(
62
+ self, *, request_options: typing.Optional[RequestOptions] = None
63
+ ) -> HttpResponse[LabelSelectionList]:
64
+ """
65
+ Returns a list of `LabelSelection` objects.
66
+
67
+ Parameters
68
+ ----------
69
+ request_options : typing.Optional[RequestOptions]
70
+ Request-specific configuration.
71
+
72
+ Returns
73
+ -------
74
+ HttpResponse[LabelSelectionList]
75
+
76
+ """
77
+ _response = self._client_wrapper.httpx_client.request(
78
+ "email/v1/selective-sync/labels",
79
+ method="GET",
80
+ request_options=request_options,
81
+ )
82
+ try:
83
+ if 200 <= _response.status_code < 300:
84
+ _data = typing.cast(
85
+ LabelSelectionList,
86
+ construct_type(
87
+ type_=LabelSelectionList, # type: ignore
88
+ object_=_response.json(),
89
+ ),
90
+ )
91
+ return HttpResponse(response=_response, data=_data)
92
+ _response_json = _response.json()
93
+ except JSONDecodeError:
94
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
95
+ except ValidationError as e:
96
+ raise ParsingError(
97
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
98
+ )
99
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
100
+
101
+
102
+ class AsyncRawSelectiveSyncClient:
103
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
104
+ self._client_wrapper = client_wrapper
105
+
106
+ async def conditions_list(
107
+ self, *, request_options: typing.Optional[RequestOptions] = None
108
+ ) -> AsyncHttpResponse[SelectiveSyncConditionList]:
109
+ """
110
+ Returns a list of `SelectiveSyncCondition` objects.
111
+
112
+ Parameters
113
+ ----------
114
+ request_options : typing.Optional[RequestOptions]
115
+ Request-specific configuration.
116
+
117
+ Returns
118
+ -------
119
+ AsyncHttpResponse[SelectiveSyncConditionList]
120
+
121
+ """
122
+ _response = await self._client_wrapper.httpx_client.request(
123
+ "email/v1/selective-sync/conditions",
124
+ method="GET",
125
+ request_options=request_options,
126
+ )
127
+ try:
128
+ if 200 <= _response.status_code < 300:
129
+ _data = typing.cast(
130
+ SelectiveSyncConditionList,
131
+ construct_type(
132
+ type_=SelectiveSyncConditionList, # type: ignore
133
+ object_=_response.json(),
134
+ ),
135
+ )
136
+ return AsyncHttpResponse(response=_response, data=_data)
137
+ _response_json = _response.json()
138
+ except JSONDecodeError:
139
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
140
+ except ValidationError as e:
141
+ raise ParsingError(
142
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
143
+ )
144
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
145
+
146
+ async def labels_list(
147
+ self, *, request_options: typing.Optional[RequestOptions] = None
148
+ ) -> AsyncHttpResponse[LabelSelectionList]:
149
+ """
150
+ Returns a list of `LabelSelection` objects.
151
+
152
+ Parameters
153
+ ----------
154
+ request_options : typing.Optional[RequestOptions]
155
+ Request-specific configuration.
156
+
157
+ Returns
158
+ -------
159
+ AsyncHttpResponse[LabelSelectionList]
160
+
161
+ """
162
+ _response = await self._client_wrapper.httpx_client.request(
163
+ "email/v1/selective-sync/labels",
164
+ method="GET",
165
+ request_options=request_options,
166
+ )
167
+ try:
168
+ if 200 <= _response.status_code < 300:
169
+ _data = typing.cast(
170
+ LabelSelectionList,
171
+ construct_type(
172
+ type_=LabelSelectionList, # type: ignore
173
+ object_=_response.json(),
174
+ ),
175
+ )
176
+ return AsyncHttpResponse(response=_response, data=_data)
177
+ _response_json = _response.json()
178
+ except JSONDecodeError:
179
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
180
+ except ValidationError as e:
181
+ raise ParsingError(
182
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
183
+ )
184
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)