mergepythonclient 4.1.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.
- merge/core/client_wrapper.py +2 -2
- merge/resources/accounting/__init__.py +15 -0
- merge/resources/accounting/client.py +19 -0
- merge/resources/accounting/resources/__init__.py +3 -0
- merge/resources/accounting/resources/selective_sync/__init__.py +4 -0
- merge/resources/accounting/resources/selective_sync/client.py +104 -0
- merge/resources/accounting/resources/selective_sync/raw_client.py +103 -0
- merge/resources/accounting/types/__init__.py +12 -0
- merge/resources/accounting/types/operator_enum.py +58 -0
- merge/resources/accounting/types/selective_sync_condition.py +49 -0
- merge/resources/accounting/types/selective_sync_condition_list.py +21 -0
- merge/resources/accounting/types/selective_sync_condition_operator.py +7 -0
- merge/resources/ats/__init__.py +15 -0
- merge/resources/ats/client.py +19 -0
- merge/resources/ats/resources/__init__.py +3 -0
- merge/resources/ats/resources/selective_sync/__init__.py +4 -0
- merge/resources/ats/resources/selective_sync/client.py +104 -0
- merge/resources/ats/resources/selective_sync/raw_client.py +103 -0
- merge/resources/ats/types/__init__.py +12 -0
- merge/resources/ats/types/operator_enum.py +58 -0
- merge/resources/ats/types/selective_sync_condition.py +49 -0
- merge/resources/ats/types/selective_sync_condition_list.py +21 -0
- merge/resources/ats/types/selective_sync_condition_operator.py +7 -0
- merge/resources/calendar/__init__.py +15 -0
- merge/resources/calendar/client.py +19 -0
- merge/resources/calendar/resources/__init__.py +3 -0
- merge/resources/calendar/resources/selective_sync/__init__.py +4 -0
- merge/resources/calendar/resources/selective_sync/client.py +104 -0
- merge/resources/calendar/resources/selective_sync/raw_client.py +103 -0
- merge/resources/calendar/types/__init__.py +12 -0
- merge/resources/calendar/types/operator_enum.py +58 -0
- merge/resources/calendar/types/selective_sync_condition.py +49 -0
- merge/resources/calendar/types/selective_sync_condition_list.py +21 -0
- merge/resources/calendar/types/selective_sync_condition_operator.py +7 -0
- merge/resources/chat/__init__.py +33 -0
- merge/resources/chat/client.py +19 -0
- merge/resources/chat/resources/__init__.py +3 -0
- merge/resources/chat/resources/selective_sync/__init__.py +4 -0
- merge/resources/chat/resources/selective_sync/client.py +264 -0
- merge/resources/chat/resources/selective_sync/raw_client.py +293 -0
- merge/resources/chat/types/__init__.py +30 -0
- merge/resources/chat/types/chat_sync_selection.py +50 -0
- merge/resources/chat/types/chat_sync_selection_type.py +7 -0
- merge/resources/chat/types/chat_sync_selection_type_enum.py +18 -0
- merge/resources/chat/types/label_selection.py +43 -0
- merge/resources/chat/types/label_selection_list.py +21 -0
- merge/resources/chat/types/operator_enum.py +58 -0
- merge/resources/chat/types/paginated_chat_sync_selection_list.py +23 -0
- merge/resources/chat/types/selective_sync_condition.py +49 -0
- merge/resources/chat/types/selective_sync_condition_list.py +21 -0
- merge/resources/chat/types/selective_sync_condition_operator.py +7 -0
- merge/resources/crm/__init__.py +15 -0
- merge/resources/crm/client.py +19 -0
- merge/resources/crm/resources/__init__.py +3 -0
- merge/resources/crm/resources/selective_sync/__init__.py +4 -0
- merge/resources/crm/resources/selective_sync/client.py +104 -0
- merge/resources/crm/resources/selective_sync/raw_client.py +103 -0
- merge/resources/crm/types/__init__.py +12 -0
- merge/resources/crm/types/operator_enum.py +58 -0
- merge/resources/crm/types/selective_sync_condition.py +49 -0
- merge/resources/crm/types/selective_sync_condition_list.py +21 -0
- merge/resources/crm/types/selective_sync_condition_operator.py +7 -0
- merge/resources/email/__init__.py +21 -0
- merge/resources/email/client.py +19 -0
- merge/resources/email/resources/__init__.py +3 -0
- merge/resources/email/resources/selective_sync/__init__.py +4 -0
- merge/resources/email/resources/selective_sync/client.py +167 -0
- merge/resources/email/resources/selective_sync/raw_client.py +184 -0
- merge/resources/email/types/__init__.py +18 -0
- merge/resources/email/types/label_selection.py +43 -0
- merge/resources/email/types/label_selection_list.py +21 -0
- merge/resources/email/types/operator_enum.py +58 -0
- merge/resources/email/types/selective_sync_condition.py +49 -0
- merge/resources/email/types/selective_sync_condition_list.py +21 -0
- merge/resources/email/types/selective_sync_condition_operator.py +7 -0
- merge/resources/filestorage/__init__.py +33 -0
- merge/resources/filestorage/client.py +19 -0
- merge/resources/filestorage/resources/__init__.py +3 -0
- merge/resources/filestorage/resources/selective_sync/__init__.py +4 -0
- merge/resources/filestorage/resources/selective_sync/client.py +264 -0
- merge/resources/filestorage/resources/selective_sync/raw_client.py +293 -0
- merge/resources/filestorage/types/__init__.py +30 -0
- merge/resources/filestorage/types/file_storage_sync_selection.py +50 -0
- merge/resources/filestorage/types/file_storage_sync_selection_type.py +7 -0
- merge/resources/filestorage/types/file_storage_sync_selection_type_enum.py +26 -0
- merge/resources/filestorage/types/label_selection.py +43 -0
- merge/resources/filestorage/types/label_selection_list.py +21 -0
- merge/resources/filestorage/types/operator_enum.py +58 -0
- merge/resources/filestorage/types/paginated_file_storage_sync_selection_list.py +23 -0
- merge/resources/filestorage/types/selective_sync_condition.py +49 -0
- merge/resources/filestorage/types/selective_sync_condition_list.py +21 -0
- merge/resources/filestorage/types/selective_sync_condition_operator.py +7 -0
- merge/resources/hris/__init__.py +15 -0
- merge/resources/hris/client.py +19 -0
- merge/resources/hris/resources/__init__.py +3 -0
- merge/resources/hris/resources/selective_sync/__init__.py +4 -0
- merge/resources/hris/resources/selective_sync/client.py +104 -0
- merge/resources/hris/resources/selective_sync/raw_client.py +103 -0
- merge/resources/hris/types/__init__.py +12 -0
- merge/resources/hris/types/operator_enum.py +58 -0
- merge/resources/hris/types/selective_sync_condition.py +49 -0
- merge/resources/hris/types/selective_sync_condition_list.py +21 -0
- merge/resources/hris/types/selective_sync_condition_operator.py +7 -0
- merge/resources/knowledgebase/__init__.py +27 -0
- merge/resources/knowledgebase/client.py +19 -0
- merge/resources/knowledgebase/resources/__init__.py +3 -0
- merge/resources/knowledgebase/resources/selective_sync/__init__.py +4 -0
- merge/resources/knowledgebase/resources/selective_sync/client.py +201 -0
- merge/resources/knowledgebase/resources/selective_sync/raw_client.py +212 -0
- merge/resources/knowledgebase/types/__init__.py +24 -0
- merge/resources/knowledgebase/types/knowledge_base_sync_selection.py +50 -0
- merge/resources/knowledgebase/types/knowledge_base_sync_selection_type.py +7 -0
- merge/resources/knowledgebase/types/knowledge_base_sync_selection_type_enum.py +18 -0
- merge/resources/knowledgebase/types/operator_enum.py +58 -0
- merge/resources/knowledgebase/types/paginated_knowledge_base_sync_selection_list.py +23 -0
- merge/resources/knowledgebase/types/selective_sync_condition.py +49 -0
- merge/resources/knowledgebase/types/selective_sync_condition_list.py +21 -0
- merge/resources/knowledgebase/types/selective_sync_condition_operator.py +7 -0
- merge/resources/ticketing/__init__.py +15 -0
- merge/resources/ticketing/client.py +19 -0
- merge/resources/ticketing/resources/__init__.py +3 -0
- merge/resources/ticketing/resources/selective_sync/__init__.py +4 -0
- merge/resources/ticketing/resources/selective_sync/client.py +104 -0
- merge/resources/ticketing/resources/selective_sync/raw_client.py +103 -0
- merge/resources/ticketing/types/__init__.py +12 -0
- merge/resources/ticketing/types/operator_enum.py +58 -0
- merge/resources/ticketing/types/selective_sync_condition.py +49 -0
- merge/resources/ticketing/types/selective_sync_condition_list.py +21 -0
- merge/resources/ticketing/types/selective_sync_condition_operator.py +7 -0
- {mergepythonclient-4.1.0.dist-info → mergepythonclient-4.2.0.dist-info}/METADATA +2 -1
- {mergepythonclient-4.1.0.dist-info → mergepythonclient-4.2.0.dist-info}/RECORD +133 -45
- {mergepythonclient-4.1.0.dist-info → mergepythonclient-4.2.0.dist-info}/LICENSE.md +0 -0
- {mergepythonclient-4.1.0.dist-info → mergepythonclient-4.2.0.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,201 @@
|
|
|
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.paginated_knowledge_base_sync_selection_list import PaginatedKnowledgeBaseSyncSelectionList
|
|
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.knowledgebase.selective_sync.conditions_list()
|
|
50
|
+
"""
|
|
51
|
+
_response = self._raw_client.conditions_list(request_options=request_options)
|
|
52
|
+
return _response.data
|
|
53
|
+
|
|
54
|
+
def selections_list(
|
|
55
|
+
self,
|
|
56
|
+
*,
|
|
57
|
+
cursor: typing.Optional[str] = None,
|
|
58
|
+
page_size: typing.Optional[int] = None,
|
|
59
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
60
|
+
) -> PaginatedKnowledgeBaseSyncSelectionList:
|
|
61
|
+
"""
|
|
62
|
+
Returns a list of `KnowledgeBaseSyncSelection` objects.
|
|
63
|
+
|
|
64
|
+
Parameters
|
|
65
|
+
----------
|
|
66
|
+
cursor : typing.Optional[str]
|
|
67
|
+
The pagination cursor value.
|
|
68
|
+
|
|
69
|
+
page_size : typing.Optional[int]
|
|
70
|
+
Number of results to return per page. The maximum limit is 100.
|
|
71
|
+
|
|
72
|
+
request_options : typing.Optional[RequestOptions]
|
|
73
|
+
Request-specific configuration.
|
|
74
|
+
|
|
75
|
+
Returns
|
|
76
|
+
-------
|
|
77
|
+
PaginatedKnowledgeBaseSyncSelectionList
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
Examples
|
|
81
|
+
--------
|
|
82
|
+
from merge import Merge
|
|
83
|
+
|
|
84
|
+
client = Merge(
|
|
85
|
+
account_token="YOUR_ACCOUNT_TOKEN",
|
|
86
|
+
api_key="YOUR_API_KEY",
|
|
87
|
+
)
|
|
88
|
+
client.knowledgebase.selective_sync.selections_list(
|
|
89
|
+
cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw",
|
|
90
|
+
page_size=1,
|
|
91
|
+
)
|
|
92
|
+
"""
|
|
93
|
+
_response = self._raw_client.selections_list(
|
|
94
|
+
cursor=cursor, page_size=page_size, request_options=request_options
|
|
95
|
+
)
|
|
96
|
+
return _response.data
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
class AsyncSelectiveSyncClient:
|
|
100
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
101
|
+
self._raw_client = AsyncRawSelectiveSyncClient(client_wrapper=client_wrapper)
|
|
102
|
+
|
|
103
|
+
@property
|
|
104
|
+
def with_raw_response(self) -> AsyncRawSelectiveSyncClient:
|
|
105
|
+
"""
|
|
106
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
107
|
+
|
|
108
|
+
Returns
|
|
109
|
+
-------
|
|
110
|
+
AsyncRawSelectiveSyncClient
|
|
111
|
+
"""
|
|
112
|
+
return self._raw_client
|
|
113
|
+
|
|
114
|
+
async def conditions_list(
|
|
115
|
+
self, *, request_options: typing.Optional[RequestOptions] = None
|
|
116
|
+
) -> SelectiveSyncConditionList:
|
|
117
|
+
"""
|
|
118
|
+
Returns a list of `SelectiveSyncCondition` objects.
|
|
119
|
+
|
|
120
|
+
Parameters
|
|
121
|
+
----------
|
|
122
|
+
request_options : typing.Optional[RequestOptions]
|
|
123
|
+
Request-specific configuration.
|
|
124
|
+
|
|
125
|
+
Returns
|
|
126
|
+
-------
|
|
127
|
+
SelectiveSyncConditionList
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
Examples
|
|
131
|
+
--------
|
|
132
|
+
import asyncio
|
|
133
|
+
|
|
134
|
+
from merge import AsyncMerge
|
|
135
|
+
|
|
136
|
+
client = AsyncMerge(
|
|
137
|
+
account_token="YOUR_ACCOUNT_TOKEN",
|
|
138
|
+
api_key="YOUR_API_KEY",
|
|
139
|
+
)
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
async def main() -> None:
|
|
143
|
+
await client.knowledgebase.selective_sync.conditions_list()
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
asyncio.run(main())
|
|
147
|
+
"""
|
|
148
|
+
_response = await self._raw_client.conditions_list(request_options=request_options)
|
|
149
|
+
return _response.data
|
|
150
|
+
|
|
151
|
+
async def selections_list(
|
|
152
|
+
self,
|
|
153
|
+
*,
|
|
154
|
+
cursor: typing.Optional[str] = None,
|
|
155
|
+
page_size: typing.Optional[int] = None,
|
|
156
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
157
|
+
) -> PaginatedKnowledgeBaseSyncSelectionList:
|
|
158
|
+
"""
|
|
159
|
+
Returns a list of `KnowledgeBaseSyncSelection` objects.
|
|
160
|
+
|
|
161
|
+
Parameters
|
|
162
|
+
----------
|
|
163
|
+
cursor : typing.Optional[str]
|
|
164
|
+
The pagination cursor value.
|
|
165
|
+
|
|
166
|
+
page_size : typing.Optional[int]
|
|
167
|
+
Number of results to return per page. The maximum limit is 100.
|
|
168
|
+
|
|
169
|
+
request_options : typing.Optional[RequestOptions]
|
|
170
|
+
Request-specific configuration.
|
|
171
|
+
|
|
172
|
+
Returns
|
|
173
|
+
-------
|
|
174
|
+
PaginatedKnowledgeBaseSyncSelectionList
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
Examples
|
|
178
|
+
--------
|
|
179
|
+
import asyncio
|
|
180
|
+
|
|
181
|
+
from merge import AsyncMerge
|
|
182
|
+
|
|
183
|
+
client = AsyncMerge(
|
|
184
|
+
account_token="YOUR_ACCOUNT_TOKEN",
|
|
185
|
+
api_key="YOUR_API_KEY",
|
|
186
|
+
)
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
async def main() -> None:
|
|
190
|
+
await client.knowledgebase.selective_sync.selections_list(
|
|
191
|
+
cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw",
|
|
192
|
+
page_size=1,
|
|
193
|
+
)
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
asyncio.run(main())
|
|
197
|
+
"""
|
|
198
|
+
_response = await self._raw_client.selections_list(
|
|
199
|
+
cursor=cursor, page_size=page_size, request_options=request_options
|
|
200
|
+
)
|
|
201
|
+
return _response.data
|
|
@@ -0,0 +1,212 @@
|
|
|
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.paginated_knowledge_base_sync_selection_list import PaginatedKnowledgeBaseSyncSelectionList
|
|
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
|
+
"knowledgebase/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 selections_list(
|
|
62
|
+
self,
|
|
63
|
+
*,
|
|
64
|
+
cursor: typing.Optional[str] = None,
|
|
65
|
+
page_size: typing.Optional[int] = None,
|
|
66
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
67
|
+
) -> HttpResponse[PaginatedKnowledgeBaseSyncSelectionList]:
|
|
68
|
+
"""
|
|
69
|
+
Returns a list of `KnowledgeBaseSyncSelection` objects.
|
|
70
|
+
|
|
71
|
+
Parameters
|
|
72
|
+
----------
|
|
73
|
+
cursor : typing.Optional[str]
|
|
74
|
+
The pagination cursor value.
|
|
75
|
+
|
|
76
|
+
page_size : typing.Optional[int]
|
|
77
|
+
Number of results to return per page. The maximum limit is 100.
|
|
78
|
+
|
|
79
|
+
request_options : typing.Optional[RequestOptions]
|
|
80
|
+
Request-specific configuration.
|
|
81
|
+
|
|
82
|
+
Returns
|
|
83
|
+
-------
|
|
84
|
+
HttpResponse[PaginatedKnowledgeBaseSyncSelectionList]
|
|
85
|
+
|
|
86
|
+
"""
|
|
87
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
88
|
+
"knowledgebase/v1/selective-sync/selections",
|
|
89
|
+
method="GET",
|
|
90
|
+
params={
|
|
91
|
+
"cursor": cursor,
|
|
92
|
+
"page_size": page_size,
|
|
93
|
+
},
|
|
94
|
+
request_options=request_options,
|
|
95
|
+
)
|
|
96
|
+
try:
|
|
97
|
+
if 200 <= _response.status_code < 300:
|
|
98
|
+
_data = typing.cast(
|
|
99
|
+
PaginatedKnowledgeBaseSyncSelectionList,
|
|
100
|
+
construct_type(
|
|
101
|
+
type_=PaginatedKnowledgeBaseSyncSelectionList, # type: ignore
|
|
102
|
+
object_=_response.json(),
|
|
103
|
+
),
|
|
104
|
+
)
|
|
105
|
+
return HttpResponse(response=_response, data=_data)
|
|
106
|
+
_response_json = _response.json()
|
|
107
|
+
except JSONDecodeError:
|
|
108
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
109
|
+
except ValidationError as e:
|
|
110
|
+
raise ParsingError(
|
|
111
|
+
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
|
|
112
|
+
)
|
|
113
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
class AsyncRawSelectiveSyncClient:
|
|
117
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
118
|
+
self._client_wrapper = client_wrapper
|
|
119
|
+
|
|
120
|
+
async def conditions_list(
|
|
121
|
+
self, *, request_options: typing.Optional[RequestOptions] = None
|
|
122
|
+
) -> AsyncHttpResponse[SelectiveSyncConditionList]:
|
|
123
|
+
"""
|
|
124
|
+
Returns a list of `SelectiveSyncCondition` objects.
|
|
125
|
+
|
|
126
|
+
Parameters
|
|
127
|
+
----------
|
|
128
|
+
request_options : typing.Optional[RequestOptions]
|
|
129
|
+
Request-specific configuration.
|
|
130
|
+
|
|
131
|
+
Returns
|
|
132
|
+
-------
|
|
133
|
+
AsyncHttpResponse[SelectiveSyncConditionList]
|
|
134
|
+
|
|
135
|
+
"""
|
|
136
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
137
|
+
"knowledgebase/v1/selective-sync/conditions",
|
|
138
|
+
method="GET",
|
|
139
|
+
request_options=request_options,
|
|
140
|
+
)
|
|
141
|
+
try:
|
|
142
|
+
if 200 <= _response.status_code < 300:
|
|
143
|
+
_data = typing.cast(
|
|
144
|
+
SelectiveSyncConditionList,
|
|
145
|
+
construct_type(
|
|
146
|
+
type_=SelectiveSyncConditionList, # type: ignore
|
|
147
|
+
object_=_response.json(),
|
|
148
|
+
),
|
|
149
|
+
)
|
|
150
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
151
|
+
_response_json = _response.json()
|
|
152
|
+
except JSONDecodeError:
|
|
153
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
154
|
+
except ValidationError as e:
|
|
155
|
+
raise ParsingError(
|
|
156
|
+
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
|
|
157
|
+
)
|
|
158
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
159
|
+
|
|
160
|
+
async def selections_list(
|
|
161
|
+
self,
|
|
162
|
+
*,
|
|
163
|
+
cursor: typing.Optional[str] = None,
|
|
164
|
+
page_size: typing.Optional[int] = None,
|
|
165
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
166
|
+
) -> AsyncHttpResponse[PaginatedKnowledgeBaseSyncSelectionList]:
|
|
167
|
+
"""
|
|
168
|
+
Returns a list of `KnowledgeBaseSyncSelection` objects.
|
|
169
|
+
|
|
170
|
+
Parameters
|
|
171
|
+
----------
|
|
172
|
+
cursor : typing.Optional[str]
|
|
173
|
+
The pagination cursor value.
|
|
174
|
+
|
|
175
|
+
page_size : typing.Optional[int]
|
|
176
|
+
Number of results to return per page. The maximum limit is 100.
|
|
177
|
+
|
|
178
|
+
request_options : typing.Optional[RequestOptions]
|
|
179
|
+
Request-specific configuration.
|
|
180
|
+
|
|
181
|
+
Returns
|
|
182
|
+
-------
|
|
183
|
+
AsyncHttpResponse[PaginatedKnowledgeBaseSyncSelectionList]
|
|
184
|
+
|
|
185
|
+
"""
|
|
186
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
187
|
+
"knowledgebase/v1/selective-sync/selections",
|
|
188
|
+
method="GET",
|
|
189
|
+
params={
|
|
190
|
+
"cursor": cursor,
|
|
191
|
+
"page_size": page_size,
|
|
192
|
+
},
|
|
193
|
+
request_options=request_options,
|
|
194
|
+
)
|
|
195
|
+
try:
|
|
196
|
+
if 200 <= _response.status_code < 300:
|
|
197
|
+
_data = typing.cast(
|
|
198
|
+
PaginatedKnowledgeBaseSyncSelectionList,
|
|
199
|
+
construct_type(
|
|
200
|
+
type_=PaginatedKnowledgeBaseSyncSelectionList, # type: ignore
|
|
201
|
+
object_=_response.json(),
|
|
202
|
+
),
|
|
203
|
+
)
|
|
204
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
205
|
+
_response_json = _response.json()
|
|
206
|
+
except JSONDecodeError:
|
|
207
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
208
|
+
except ValidationError as e:
|
|
209
|
+
raise ParsingError(
|
|
210
|
+
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
|
|
211
|
+
)
|
|
212
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
@@ -78,6 +78,9 @@ if typing.TYPE_CHECKING:
|
|
|
78
78
|
from .issue import Issue
|
|
79
79
|
from .issue_status import IssueStatus
|
|
80
80
|
from .issue_status_enum import IssueStatusEnum
|
|
81
|
+
from .knowledge_base_sync_selection import KnowledgeBaseSyncSelection
|
|
82
|
+
from .knowledge_base_sync_selection_type import KnowledgeBaseSyncSelectionType
|
|
83
|
+
from .knowledge_base_sync_selection_type_enum import KnowledgeBaseSyncSelectionTypeEnum
|
|
81
84
|
from .language_enum import LanguageEnum
|
|
82
85
|
from .last_sync_result_enum import LastSyncResultEnum
|
|
83
86
|
from .link_token import LinkToken
|
|
@@ -87,6 +90,7 @@ if typing.TYPE_CHECKING:
|
|
|
87
90
|
from .model_permission_deserializer_request import ModelPermissionDeserializerRequest
|
|
88
91
|
from .multipart_form_field_request import MultipartFormFieldRequest
|
|
89
92
|
from .multipart_form_field_request_encoding import MultipartFormFieldRequestEncoding
|
|
93
|
+
from .operator_enum import OperatorEnum
|
|
90
94
|
from .paginated_account_details_and_actions_list import PaginatedAccountDetailsAndActionsList
|
|
91
95
|
from .paginated_article_list import PaginatedArticleList
|
|
92
96
|
from .paginated_attachment_list import PaginatedAttachmentList
|
|
@@ -94,6 +98,7 @@ if typing.TYPE_CHECKING:
|
|
|
94
98
|
from .paginated_container_list import PaginatedContainerList
|
|
95
99
|
from .paginated_group_list import PaginatedGroupList
|
|
96
100
|
from .paginated_issue_list import PaginatedIssueList
|
|
101
|
+
from .paginated_knowledge_base_sync_selection_list import PaginatedKnowledgeBaseSyncSelectionList
|
|
97
102
|
from .paginated_sync_status_list import PaginatedSyncStatusList
|
|
98
103
|
from .paginated_user_list import PaginatedUserList
|
|
99
104
|
from .permission import Permission
|
|
@@ -116,6 +121,9 @@ if typing.TYPE_CHECKING:
|
|
|
116
121
|
from .response_type_enum import ResponseTypeEnum
|
|
117
122
|
from .role_enum import RoleEnum
|
|
118
123
|
from .roles_enum import RolesEnum
|
|
124
|
+
from .selective_sync_condition import SelectiveSyncCondition
|
|
125
|
+
from .selective_sync_condition_list import SelectiveSyncConditionList
|
|
126
|
+
from .selective_sync_condition_operator import SelectiveSyncConditionOperator
|
|
119
127
|
from .selective_sync_configurations_usage_enum import SelectiveSyncConfigurationsUsageEnum
|
|
120
128
|
from .status_3_c_6_enum import Status3C6Enum
|
|
121
129
|
from .status_fd_5_enum import StatusFd5Enum
|
|
@@ -201,6 +209,9 @@ _dynamic_imports: typing.Dict[str, str] = {
|
|
|
201
209
|
"Issue": ".issue",
|
|
202
210
|
"IssueStatus": ".issue_status",
|
|
203
211
|
"IssueStatusEnum": ".issue_status_enum",
|
|
212
|
+
"KnowledgeBaseSyncSelection": ".knowledge_base_sync_selection",
|
|
213
|
+
"KnowledgeBaseSyncSelectionType": ".knowledge_base_sync_selection_type",
|
|
214
|
+
"KnowledgeBaseSyncSelectionTypeEnum": ".knowledge_base_sync_selection_type_enum",
|
|
204
215
|
"LanguageEnum": ".language_enum",
|
|
205
216
|
"LastSyncResultEnum": ".last_sync_result_enum",
|
|
206
217
|
"LinkToken": ".link_token",
|
|
@@ -210,6 +221,7 @@ _dynamic_imports: typing.Dict[str, str] = {
|
|
|
210
221
|
"ModelPermissionDeserializerRequest": ".model_permission_deserializer_request",
|
|
211
222
|
"MultipartFormFieldRequest": ".multipart_form_field_request",
|
|
212
223
|
"MultipartFormFieldRequestEncoding": ".multipart_form_field_request_encoding",
|
|
224
|
+
"OperatorEnum": ".operator_enum",
|
|
213
225
|
"PaginatedAccountDetailsAndActionsList": ".paginated_account_details_and_actions_list",
|
|
214
226
|
"PaginatedArticleList": ".paginated_article_list",
|
|
215
227
|
"PaginatedAttachmentList": ".paginated_attachment_list",
|
|
@@ -217,6 +229,7 @@ _dynamic_imports: typing.Dict[str, str] = {
|
|
|
217
229
|
"PaginatedContainerList": ".paginated_container_list",
|
|
218
230
|
"PaginatedGroupList": ".paginated_group_list",
|
|
219
231
|
"PaginatedIssueList": ".paginated_issue_list",
|
|
232
|
+
"PaginatedKnowledgeBaseSyncSelectionList": ".paginated_knowledge_base_sync_selection_list",
|
|
220
233
|
"PaginatedSyncStatusList": ".paginated_sync_status_list",
|
|
221
234
|
"PaginatedUserList": ".paginated_user_list",
|
|
222
235
|
"Permission": ".permission",
|
|
@@ -239,6 +252,9 @@ _dynamic_imports: typing.Dict[str, str] = {
|
|
|
239
252
|
"ResponseTypeEnum": ".response_type_enum",
|
|
240
253
|
"RoleEnum": ".role_enum",
|
|
241
254
|
"RolesEnum": ".roles_enum",
|
|
255
|
+
"SelectiveSyncCondition": ".selective_sync_condition",
|
|
256
|
+
"SelectiveSyncConditionList": ".selective_sync_condition_list",
|
|
257
|
+
"SelectiveSyncConditionOperator": ".selective_sync_condition_operator",
|
|
242
258
|
"SelectiveSyncConfigurationsUsageEnum": ".selective_sync_configurations_usage_enum",
|
|
243
259
|
"Status3C6Enum": ".status_3_c_6_enum",
|
|
244
260
|
"StatusFd5Enum": ".status_fd_5_enum",
|
|
@@ -348,6 +364,9 @@ __all__ = [
|
|
|
348
364
|
"Issue",
|
|
349
365
|
"IssueStatus",
|
|
350
366
|
"IssueStatusEnum",
|
|
367
|
+
"KnowledgeBaseSyncSelection",
|
|
368
|
+
"KnowledgeBaseSyncSelectionType",
|
|
369
|
+
"KnowledgeBaseSyncSelectionTypeEnum",
|
|
351
370
|
"LanguageEnum",
|
|
352
371
|
"LastSyncResultEnum",
|
|
353
372
|
"LinkToken",
|
|
@@ -357,6 +376,7 @@ __all__ = [
|
|
|
357
376
|
"ModelPermissionDeserializerRequest",
|
|
358
377
|
"MultipartFormFieldRequest",
|
|
359
378
|
"MultipartFormFieldRequestEncoding",
|
|
379
|
+
"OperatorEnum",
|
|
360
380
|
"PaginatedAccountDetailsAndActionsList",
|
|
361
381
|
"PaginatedArticleList",
|
|
362
382
|
"PaginatedAttachmentList",
|
|
@@ -364,6 +384,7 @@ __all__ = [
|
|
|
364
384
|
"PaginatedContainerList",
|
|
365
385
|
"PaginatedGroupList",
|
|
366
386
|
"PaginatedIssueList",
|
|
387
|
+
"PaginatedKnowledgeBaseSyncSelectionList",
|
|
367
388
|
"PaginatedSyncStatusList",
|
|
368
389
|
"PaginatedUserList",
|
|
369
390
|
"Permission",
|
|
@@ -386,6 +407,9 @@ __all__ = [
|
|
|
386
407
|
"ResponseTypeEnum",
|
|
387
408
|
"RoleEnum",
|
|
388
409
|
"RolesEnum",
|
|
410
|
+
"SelectiveSyncCondition",
|
|
411
|
+
"SelectiveSyncConditionList",
|
|
412
|
+
"SelectiveSyncConditionOperator",
|
|
389
413
|
"SelectiveSyncConfigurationsUsageEnum",
|
|
390
414
|
"Status3C6Enum",
|
|
391
415
|
"StatusFd5Enum",
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import datetime as dt
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
import pydantic
|
|
7
|
+
from ....core.pydantic_utilities import IS_PYDANTIC_V2
|
|
8
|
+
from ....core.unchecked_base_model import UncheckedBaseModel
|
|
9
|
+
from .knowledge_base_sync_selection_type import KnowledgeBaseSyncSelectionType
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class KnowledgeBaseSyncSelection(UncheckedBaseModel):
|
|
13
|
+
id: typing.Optional[str] = pydantic.Field(default=None)
|
|
14
|
+
"""
|
|
15
|
+
The Merge ID of the selected object.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
remote_id: typing.Optional[str] = pydantic.Field(default=None)
|
|
19
|
+
"""
|
|
20
|
+
The third-party API ID of the selected object.
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
name: typing.Optional[str] = pydantic.Field(default=None)
|
|
24
|
+
"""
|
|
25
|
+
The name of the selected object.
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
type: KnowledgeBaseSyncSelectionType = pydantic.Field()
|
|
29
|
+
"""
|
|
30
|
+
The type of the selected object.
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
url: typing.Optional[str] = pydantic.Field(default=None)
|
|
34
|
+
"""
|
|
35
|
+
A link to the selected object in the third party.
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
created_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
|
|
39
|
+
"""
|
|
40
|
+
When the selection was made.
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
if IS_PYDANTIC_V2:
|
|
44
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
45
|
+
else:
|
|
46
|
+
|
|
47
|
+
class Config:
|
|
48
|
+
frozen = True
|
|
49
|
+
smart_union = True
|
|
50
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,18 @@
|
|
|
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 KnowledgeBaseSyncSelectionTypeEnum(enum.StrEnum):
|
|
11
|
+
ARTICLE = "ARTICLE"
|
|
12
|
+
CONTAINER = "CONTAINER"
|
|
13
|
+
|
|
14
|
+
def visit(self, article: typing.Callable[[], T_Result], container: typing.Callable[[], T_Result]) -> T_Result:
|
|
15
|
+
if self is KnowledgeBaseSyncSelectionTypeEnum.ARTICLE:
|
|
16
|
+
return article()
|
|
17
|
+
if self is KnowledgeBaseSyncSelectionTypeEnum.CONTAINER:
|
|
18
|
+
return container()
|
|
@@ -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,23 @@
|
|
|
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 .knowledge_base_sync_selection import KnowledgeBaseSyncSelection
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class PaginatedKnowledgeBaseSyncSelectionList(UncheckedBaseModel):
|
|
12
|
+
next: typing.Optional[str] = None
|
|
13
|
+
previous: typing.Optional[str] = None
|
|
14
|
+
results: typing.Optional[typing.List[KnowledgeBaseSyncSelection]] = None
|
|
15
|
+
|
|
16
|
+
if IS_PYDANTIC_V2:
|
|
17
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
18
|
+
else:
|
|
19
|
+
|
|
20
|
+
class Config:
|
|
21
|
+
frozen = True
|
|
22
|
+
smart_union = True
|
|
23
|
+
extra = pydantic.Extra.allow
|