mergepythonclient 2.3.2__py3-none-any.whl → 2.4.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/__init__.py +3 -1
- merge/client.py +49 -30
- merge/core/client_wrapper.py +2 -2
- merge/resources/__init__.py +3 -2
- merge/resources/knowledgebase/__init__.py +472 -0
- merge/resources/knowledgebase/client.py +480 -0
- merge/resources/knowledgebase/raw_client.py +13 -0
- merge/resources/knowledgebase/resources/__init__.py +128 -0
- merge/resources/knowledgebase/resources/account_details/__init__.py +4 -0
- merge/resources/knowledgebase/resources/account_details/client.py +102 -0
- merge/resources/knowledgebase/resources/account_details/raw_client.py +91 -0
- merge/resources/knowledgebase/resources/account_token/__init__.py +4 -0
- merge/resources/knowledgebase/resources/account_token/client.py +112 -0
- merge/resources/knowledgebase/resources/account_token/raw_client.py +98 -0
- merge/resources/knowledgebase/resources/articles/__init__.py +35 -0
- merge/resources/knowledgebase/resources/articles/client.py +378 -0
- merge/resources/knowledgebase/resources/articles/raw_client.py +363 -0
- merge/resources/knowledgebase/resources/articles/types/__init__.py +36 -0
- merge/resources/knowledgebase/resources/articles/types/articles_list_request_expand.py +625 -0
- merge/resources/knowledgebase/resources/articles/types/articles_retrieve_request_expand.py +631 -0
- merge/resources/knowledgebase/resources/async_passthrough/__init__.py +32 -0
- merge/resources/knowledgebase/resources/async_passthrough/client.py +201 -0
- merge/resources/knowledgebase/resources/async_passthrough/raw_client.py +189 -0
- merge/resources/knowledgebase/resources/async_passthrough/types/__init__.py +32 -0
- merge/resources/knowledgebase/resources/async_passthrough/types/async_passthrough_retrieve_response.py +7 -0
- merge/resources/knowledgebase/resources/attachments/__init__.py +4 -0
- merge/resources/knowledgebase/resources/attachments/client.py +326 -0
- merge/resources/knowledgebase/resources/attachments/raw_client.py +311 -0
- merge/resources/knowledgebase/resources/audit_trail/__init__.py +4 -0
- merge/resources/knowledgebase/resources/audit_trail/client.py +178 -0
- merge/resources/knowledgebase/resources/audit_trail/raw_client.py +161 -0
- merge/resources/knowledgebase/resources/available_actions/__init__.py +4 -0
- merge/resources/knowledgebase/resources/available_actions/client.py +102 -0
- merge/resources/knowledgebase/resources/available_actions/raw_client.py +91 -0
- merge/resources/knowledgebase/resources/containers/__init__.py +35 -0
- merge/resources/knowledgebase/resources/containers/client.py +378 -0
- merge/resources/knowledgebase/resources/containers/raw_client.py +363 -0
- merge/resources/knowledgebase/resources/containers/types/__init__.py +36 -0
- merge/resources/knowledgebase/resources/containers/types/containers_list_request_expand.py +41 -0
- merge/resources/knowledgebase/resources/containers/types/containers_retrieve_request_expand.py +41 -0
- merge/resources/knowledgebase/resources/delete_account/__init__.py +4 -0
- merge/resources/knowledgebase/resources/delete_account/client.py +99 -0
- merge/resources/knowledgebase/resources/delete_account/raw_client.py +71 -0
- merge/resources/knowledgebase/resources/field_mapping/__init__.py +4 -0
- merge/resources/knowledgebase/resources/field_mapping/client.py +652 -0
- merge/resources/knowledgebase/resources/field_mapping/raw_client.py +672 -0
- merge/resources/knowledgebase/resources/force_resync/__init__.py +4 -0
- merge/resources/knowledgebase/resources/force_resync/client.py +106 -0
- merge/resources/knowledgebase/resources/force_resync/raw_client.py +93 -0
- merge/resources/knowledgebase/resources/generate_key/__init__.py +4 -0
- merge/resources/knowledgebase/resources/generate_key/client.py +115 -0
- merge/resources/knowledgebase/resources/generate_key/raw_client.py +114 -0
- merge/resources/knowledgebase/resources/groups/__init__.py +32 -0
- merge/resources/knowledgebase/resources/groups/client.py +348 -0
- merge/resources/knowledgebase/resources/groups/raw_client.py +333 -0
- merge/resources/knowledgebase/resources/groups/types/__init__.py +36 -0
- merge/resources/knowledgebase/resources/groups/types/groups_list_request_expand.py +25 -0
- merge/resources/knowledgebase/resources/groups/types/groups_retrieve_request_expand.py +25 -0
- merge/resources/knowledgebase/resources/issues/__init__.py +32 -0
- merge/resources/knowledgebase/resources/issues/client.py +331 -0
- merge/resources/knowledgebase/resources/issues/raw_client.py +336 -0
- merge/resources/knowledgebase/resources/issues/types/__init__.py +32 -0
- merge/resources/knowledgebase/resources/issues/types/issues_list_request_status.py +17 -0
- merge/resources/knowledgebase/resources/link_token/__init__.py +32 -0
- merge/resources/knowledgebase/resources/link_token/client.py +273 -0
- merge/resources/knowledgebase/resources/link_token/raw_client.py +256 -0
- merge/resources/knowledgebase/resources/link_token/types/__init__.py +32 -0
- merge/resources/knowledgebase/resources/link_token/types/end_user_details_request_language.py +7 -0
- merge/resources/knowledgebase/resources/linked_accounts/__init__.py +32 -0
- merge/resources/knowledgebase/resources/linked_accounts/client.py +265 -0
- merge/resources/knowledgebase/resources/linked_accounts/raw_client.py +248 -0
- merge/resources/knowledgebase/resources/linked_accounts/types/__init__.py +34 -0
- merge/resources/knowledgebase/resources/linked_accounts/types/linked_accounts_list_request_category.py +45 -0
- merge/resources/knowledgebase/resources/passthrough/__init__.py +4 -0
- merge/resources/knowledgebase/resources/passthrough/client.py +126 -0
- merge/resources/knowledgebase/resources/passthrough/raw_client.py +111 -0
- merge/resources/knowledgebase/resources/regenerate_key/__init__.py +4 -0
- merge/resources/knowledgebase/resources/regenerate_key/client.py +115 -0
- merge/resources/knowledgebase/resources/regenerate_key/raw_client.py +114 -0
- merge/resources/knowledgebase/resources/scopes/__init__.py +4 -0
- merge/resources/knowledgebase/resources/scopes/client.py +320 -0
- merge/resources/knowledgebase/resources/scopes/raw_client.py +267 -0
- merge/resources/knowledgebase/resources/sync_status/__init__.py +4 -0
- merge/resources/knowledgebase/resources/sync_status/client.py +130 -0
- merge/resources/knowledgebase/resources/sync_status/raw_client.py +121 -0
- merge/resources/knowledgebase/resources/users/__init__.py +4 -0
- merge/resources/knowledgebase/resources/users/client.py +326 -0
- merge/resources/knowledgebase/resources/users/raw_client.py +311 -0
- merge/resources/knowledgebase/resources/webhook_receivers/__init__.py +4 -0
- merge/resources/knowledgebase/resources/webhook_receivers/client.py +201 -0
- merge/resources/knowledgebase/resources/webhook_receivers/raw_client.py +208 -0
- merge/resources/knowledgebase/types/__init__.py +374 -0
- merge/resources/knowledgebase/types/account_details.py +40 -0
- merge/resources/knowledgebase/types/account_details_and_actions.py +54 -0
- merge/resources/knowledgebase/types/account_details_and_actions_category.py +7 -0
- merge/resources/knowledgebase/types/account_details_and_actions_integration.py +29 -0
- merge/resources/knowledgebase/types/account_details_and_actions_status.py +7 -0
- merge/resources/knowledgebase/types/account_details_and_actions_status_enum.py +36 -0
- merge/resources/knowledgebase/types/account_details_category.py +7 -0
- merge/resources/knowledgebase/types/account_integration.py +67 -0
- merge/resources/knowledgebase/types/account_token.py +23 -0
- merge/resources/knowledgebase/types/advanced_metadata.py +25 -0
- merge/resources/knowledgebase/types/article.py +159 -0
- merge/resources/knowledgebase/types/article_attachments_item.py +7 -0
- merge/resources/knowledgebase/types/article_author.py +7 -0
- merge/resources/knowledgebase/types/article_last_edited_by.py +7 -0
- merge/resources/knowledgebase/types/article_parent_article.py +9 -0
- merge/resources/knowledgebase/types/article_parent_container.py +7 -0
- merge/resources/knowledgebase/types/article_permissions_item.py +7 -0
- merge/resources/knowledgebase/types/article_root_container.py +7 -0
- merge/resources/knowledgebase/types/article_status.py +7 -0
- merge/resources/knowledgebase/types/article_type.py +7 -0
- merge/resources/knowledgebase/types/article_type_enum.py +31 -0
- merge/resources/knowledgebase/types/article_visibility.py +7 -0
- merge/resources/knowledgebase/types/async_passthrough_reciept.py +20 -0
- merge/resources/knowledgebase/types/attachment.py +67 -0
- merge/resources/knowledgebase/types/audit_log_event.py +97 -0
- merge/resources/knowledgebase/types/audit_log_event_event_type.py +7 -0
- merge/resources/knowledgebase/types/audit_log_event_role.py +7 -0
- merge/resources/knowledgebase/types/available_actions.py +33 -0
- merge/resources/knowledgebase/types/categories_enum.py +56 -0
- merge/resources/knowledgebase/types/category_enum.py +56 -0
- merge/resources/knowledgebase/types/common_model_scope_api.py +24 -0
- merge/resources/knowledgebase/types/common_model_scopes_body_request.py +23 -0
- merge/resources/knowledgebase/types/completed_account_initial_screen_enum.py +5 -0
- merge/resources/knowledgebase/types/container.py +130 -0
- merge/resources/knowledgebase/types/container_permissions_item.py +7 -0
- merge/resources/knowledgebase/types/container_status.py +7 -0
- merge/resources/knowledgebase/types/container_type.py +7 -0
- merge/resources/knowledgebase/types/container_type_enum.py +46 -0
- merge/resources/knowledgebase/types/container_visibility.py +7 -0
- merge/resources/knowledgebase/types/data_passthrough_request.py +62 -0
- merge/resources/knowledgebase/types/data_passthrough_request_method.py +7 -0
- merge/resources/knowledgebase/types/data_passthrough_request_request_format.py +7 -0
- merge/resources/knowledgebase/types/debug_mode_log.py +23 -0
- merge/resources/knowledgebase/types/debug_model_log_summary.py +22 -0
- merge/resources/knowledgebase/types/enabled_actions_enum.py +22 -0
- merge/resources/knowledgebase/types/encoding_enum.py +31 -0
- merge/resources/knowledgebase/types/error_validation_problem.py +24 -0
- merge/resources/knowledgebase/types/event_type_enum.py +231 -0
- merge/resources/knowledgebase/types/external_target_field_api.py +22 -0
- merge/resources/knowledgebase/types/external_target_field_api_response.py +25 -0
- merge/resources/knowledgebase/types/field_mapping_api_instance.py +26 -0
- merge/resources/knowledgebase/types/field_mapping_api_instance_remote_field.py +27 -0
- merge/resources/knowledgebase/types/field_mapping_api_instance_remote_field_remote_endpoint_info.py +22 -0
- merge/resources/knowledgebase/types/field_mapping_api_instance_response.py +25 -0
- merge/resources/knowledgebase/types/field_mapping_api_instance_target_field.py +22 -0
- merge/resources/knowledgebase/types/field_mapping_instance_response.py +27 -0
- merge/resources/knowledgebase/types/field_permission_deserializer.py +21 -0
- merge/resources/knowledgebase/types/field_permission_deserializer_request.py +21 -0
- merge/resources/knowledgebase/types/group.py +71 -0
- merge/resources/knowledgebase/types/group_parent_group.py +9 -0
- merge/resources/knowledgebase/types/group_users_item.py +7 -0
- merge/resources/knowledgebase/types/individual_common_model_scope_deserializer.py +24 -0
- merge/resources/knowledgebase/types/individual_common_model_scope_deserializer_request.py +24 -0
- merge/resources/knowledgebase/types/issue.py +36 -0
- merge/resources/knowledgebase/types/issue_status.py +7 -0
- merge/resources/knowledgebase/types/issue_status_enum.py +22 -0
- merge/resources/knowledgebase/types/language_enum.py +22 -0
- merge/resources/knowledgebase/types/last_sync_result_enum.py +46 -0
- merge/resources/knowledgebase/types/link_token.py +22 -0
- merge/resources/knowledgebase/types/method_enum.py +51 -0
- merge/resources/knowledgebase/types/model_operation.py +32 -0
- merge/resources/knowledgebase/types/model_permission_deserializer.py +20 -0
- merge/resources/knowledgebase/types/model_permission_deserializer_request.py +20 -0
- merge/resources/knowledgebase/types/multipart_form_field_request.py +57 -0
- merge/resources/knowledgebase/types/multipart_form_field_request_encoding.py +7 -0
- merge/resources/knowledgebase/types/paginated_account_details_and_actions_list.py +23 -0
- merge/resources/knowledgebase/types/paginated_article_list.py +30 -0
- merge/resources/knowledgebase/types/paginated_attachment_list.py +23 -0
- merge/resources/knowledgebase/types/paginated_audit_log_event_list.py +23 -0
- merge/resources/knowledgebase/types/paginated_container_list.py +30 -0
- merge/resources/knowledgebase/types/paginated_group_list.py +29 -0
- merge/resources/knowledgebase/types/paginated_issue_list.py +23 -0
- merge/resources/knowledgebase/types/paginated_sync_status_list.py +23 -0
- merge/resources/knowledgebase/types/paginated_user_list.py +23 -0
- merge/resources/knowledgebase/types/permission.py +77 -0
- merge/resources/knowledgebase/types/permission_group.py +7 -0
- merge/resources/knowledgebase/types/permission_type.py +7 -0
- merge/resources/knowledgebase/types/permission_type_enum.py +36 -0
- merge/resources/knowledgebase/types/permission_user.py +7 -0
- merge/resources/knowledgebase/types/remote_data.py +34 -0
- merge/resources/knowledgebase/types/remote_endpoint_info.py +22 -0
- merge/resources/knowledgebase/types/remote_field_api.py +28 -0
- merge/resources/knowledgebase/types/remote_field_api_advanced_metadata.py +7 -0
- merge/resources/knowledgebase/types/remote_field_api_coverage.py +5 -0
- merge/resources/knowledgebase/types/remote_field_api_response.py +25 -0
- merge/resources/knowledgebase/types/remote_key.py +30 -0
- merge/resources/knowledgebase/types/remote_response.py +36 -0
- merge/resources/knowledgebase/types/remote_response_response_type.py +7 -0
- merge/resources/knowledgebase/types/request_format_enum.py +31 -0
- merge/resources/knowledgebase/types/response_type_enum.py +22 -0
- merge/resources/knowledgebase/types/role_enum.py +46 -0
- merge/resources/knowledgebase/types/roles_enum.py +31 -0
- merge/resources/knowledgebase/types/selective_sync_configurations_usage_enum.py +24 -0
- merge/resources/knowledgebase/types/status_3_c_6_enum.py +36 -0
- merge/resources/knowledgebase/types/status_fd_5_enum.py +46 -0
- merge/resources/knowledgebase/types/sync_status.py +41 -0
- merge/resources/knowledgebase/types/sync_status_last_sync_result.py +7 -0
- merge/resources/knowledgebase/types/sync_status_status.py +7 -0
- merge/resources/knowledgebase/types/user.py +60 -0
- merge/resources/knowledgebase/types/validation_problem_source.py +20 -0
- merge/resources/knowledgebase/types/visibility_enum.py +31 -0
- merge/resources/knowledgebase/types/warning_validation_problem.py +24 -0
- merge/resources/knowledgebase/types/webhook_receiver.py +22 -0
- {mergepythonclient-2.3.2.dist-info → mergepythonclient-2.4.0.dist-info}/METADATA +2 -1
- {mergepythonclient-2.3.2.dist-info → mergepythonclient-2.4.0.dist-info}/RECORD +209 -8
- {mergepythonclient-2.3.2.dist-info → mergepythonclient-2.4.0.dist-info}/LICENSE.md +0 -0
- {mergepythonclient-2.3.2.dist-info → mergepythonclient-2.4.0.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import datetime as dt
|
|
4
|
+
import typing
|
|
5
|
+
from json.decoder import JSONDecodeError
|
|
6
|
+
|
|
7
|
+
from .....core.api_error import ApiError
|
|
8
|
+
from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
9
|
+
from .....core.datetime_utils import serialize_datetime
|
|
10
|
+
from .....core.http_response import AsyncHttpResponse, HttpResponse
|
|
11
|
+
from .....core.jsonable_encoder import jsonable_encoder
|
|
12
|
+
from .....core.request_options import RequestOptions
|
|
13
|
+
from .....core.unchecked_base_model import construct_type
|
|
14
|
+
from ...types.container import Container
|
|
15
|
+
from ...types.paginated_container_list import PaginatedContainerList
|
|
16
|
+
from .types.containers_list_request_expand import ContainersListRequestExpand
|
|
17
|
+
from .types.containers_retrieve_request_expand import ContainersRetrieveRequestExpand
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class RawContainersClient:
|
|
21
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
22
|
+
self._client_wrapper = client_wrapper
|
|
23
|
+
|
|
24
|
+
def list(
|
|
25
|
+
self,
|
|
26
|
+
*,
|
|
27
|
+
created_after: typing.Optional[dt.datetime] = None,
|
|
28
|
+
created_before: typing.Optional[dt.datetime] = None,
|
|
29
|
+
cursor: typing.Optional[str] = None,
|
|
30
|
+
expand: typing.Optional[ContainersListRequestExpand] = None,
|
|
31
|
+
include_deleted_data: typing.Optional[bool] = None,
|
|
32
|
+
include_remote_data: typing.Optional[bool] = None,
|
|
33
|
+
include_shell_data: typing.Optional[bool] = None,
|
|
34
|
+
modified_after: typing.Optional[dt.datetime] = None,
|
|
35
|
+
modified_before: typing.Optional[dt.datetime] = None,
|
|
36
|
+
page_size: typing.Optional[int] = None,
|
|
37
|
+
parent_article_id: typing.Optional[str] = None,
|
|
38
|
+
parent_container_id: typing.Optional[str] = None,
|
|
39
|
+
remote_id: typing.Optional[str] = None,
|
|
40
|
+
type: typing.Optional[str] = None,
|
|
41
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
42
|
+
) -> HttpResponse[PaginatedContainerList]:
|
|
43
|
+
"""
|
|
44
|
+
Returns a list of `Container` objects.
|
|
45
|
+
|
|
46
|
+
Parameters
|
|
47
|
+
----------
|
|
48
|
+
created_after : typing.Optional[dt.datetime]
|
|
49
|
+
If provided, will only return objects created after this datetime.
|
|
50
|
+
|
|
51
|
+
created_before : typing.Optional[dt.datetime]
|
|
52
|
+
If provided, will only return objects created before this datetime.
|
|
53
|
+
|
|
54
|
+
cursor : typing.Optional[str]
|
|
55
|
+
The pagination cursor value.
|
|
56
|
+
|
|
57
|
+
expand : typing.Optional[ContainersListRequestExpand]
|
|
58
|
+
Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
|
|
59
|
+
|
|
60
|
+
include_deleted_data : typing.Optional[bool]
|
|
61
|
+
Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/).
|
|
62
|
+
|
|
63
|
+
include_remote_data : typing.Optional[bool]
|
|
64
|
+
Whether to include the original data Merge fetched from the third-party to produce these models.
|
|
65
|
+
|
|
66
|
+
include_shell_data : typing.Optional[bool]
|
|
67
|
+
Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).
|
|
68
|
+
|
|
69
|
+
modified_after : typing.Optional[dt.datetime]
|
|
70
|
+
If provided, only objects synced by Merge after this date time will be returned.
|
|
71
|
+
|
|
72
|
+
modified_before : typing.Optional[dt.datetime]
|
|
73
|
+
If provided, only objects synced by Merge before this date time will be returned.
|
|
74
|
+
|
|
75
|
+
page_size : typing.Optional[int]
|
|
76
|
+
Number of results to return per page.
|
|
77
|
+
|
|
78
|
+
parent_article_id : typing.Optional[str]
|
|
79
|
+
If provided, will only return sub containers of the parent_article_id.
|
|
80
|
+
|
|
81
|
+
parent_container_id : typing.Optional[str]
|
|
82
|
+
If provided, will only return sub containers of the parent_container_id.
|
|
83
|
+
|
|
84
|
+
remote_id : typing.Optional[str]
|
|
85
|
+
The API provider's ID for the given object.
|
|
86
|
+
|
|
87
|
+
type : typing.Optional[str]
|
|
88
|
+
If provided, will only return containers of the given type.
|
|
89
|
+
|
|
90
|
+
request_options : typing.Optional[RequestOptions]
|
|
91
|
+
Request-specific configuration.
|
|
92
|
+
|
|
93
|
+
Returns
|
|
94
|
+
-------
|
|
95
|
+
HttpResponse[PaginatedContainerList]
|
|
96
|
+
|
|
97
|
+
"""
|
|
98
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
99
|
+
"knowledgebase/v1/containers",
|
|
100
|
+
method="GET",
|
|
101
|
+
params={
|
|
102
|
+
"created_after": serialize_datetime(created_after) if created_after is not None else None,
|
|
103
|
+
"created_before": serialize_datetime(created_before) if created_before is not None else None,
|
|
104
|
+
"cursor": cursor,
|
|
105
|
+
"expand": expand,
|
|
106
|
+
"include_deleted_data": include_deleted_data,
|
|
107
|
+
"include_remote_data": include_remote_data,
|
|
108
|
+
"include_shell_data": include_shell_data,
|
|
109
|
+
"modified_after": serialize_datetime(modified_after) if modified_after is not None else None,
|
|
110
|
+
"modified_before": serialize_datetime(modified_before) if modified_before is not None else None,
|
|
111
|
+
"page_size": page_size,
|
|
112
|
+
"parent_article_id": parent_article_id,
|
|
113
|
+
"parent_container_id": parent_container_id,
|
|
114
|
+
"remote_id": remote_id,
|
|
115
|
+
"type": type,
|
|
116
|
+
},
|
|
117
|
+
request_options=request_options,
|
|
118
|
+
)
|
|
119
|
+
try:
|
|
120
|
+
if 200 <= _response.status_code < 300:
|
|
121
|
+
_data = typing.cast(
|
|
122
|
+
PaginatedContainerList,
|
|
123
|
+
construct_type(
|
|
124
|
+
type_=PaginatedContainerList, # type: ignore
|
|
125
|
+
object_=_response.json(),
|
|
126
|
+
),
|
|
127
|
+
)
|
|
128
|
+
return HttpResponse(response=_response, data=_data)
|
|
129
|
+
_response_json = _response.json()
|
|
130
|
+
except JSONDecodeError:
|
|
131
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
132
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
133
|
+
|
|
134
|
+
def retrieve(
|
|
135
|
+
self,
|
|
136
|
+
id: str,
|
|
137
|
+
*,
|
|
138
|
+
expand: typing.Optional[ContainersRetrieveRequestExpand] = None,
|
|
139
|
+
include_remote_data: typing.Optional[bool] = None,
|
|
140
|
+
include_shell_data: typing.Optional[bool] = None,
|
|
141
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
142
|
+
) -> HttpResponse[Container]:
|
|
143
|
+
"""
|
|
144
|
+
Returns a `Container` object with the given `id`.
|
|
145
|
+
|
|
146
|
+
Parameters
|
|
147
|
+
----------
|
|
148
|
+
id : str
|
|
149
|
+
|
|
150
|
+
expand : typing.Optional[ContainersRetrieveRequestExpand]
|
|
151
|
+
Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
|
|
152
|
+
|
|
153
|
+
include_remote_data : typing.Optional[bool]
|
|
154
|
+
Whether to include the original data Merge fetched from the third-party to produce these models.
|
|
155
|
+
|
|
156
|
+
include_shell_data : typing.Optional[bool]
|
|
157
|
+
Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).
|
|
158
|
+
|
|
159
|
+
request_options : typing.Optional[RequestOptions]
|
|
160
|
+
Request-specific configuration.
|
|
161
|
+
|
|
162
|
+
Returns
|
|
163
|
+
-------
|
|
164
|
+
HttpResponse[Container]
|
|
165
|
+
|
|
166
|
+
"""
|
|
167
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
168
|
+
f"knowledgebase/v1/containers/{jsonable_encoder(id)}",
|
|
169
|
+
method="GET",
|
|
170
|
+
params={
|
|
171
|
+
"expand": expand,
|
|
172
|
+
"include_remote_data": include_remote_data,
|
|
173
|
+
"include_shell_data": include_shell_data,
|
|
174
|
+
},
|
|
175
|
+
request_options=request_options,
|
|
176
|
+
)
|
|
177
|
+
try:
|
|
178
|
+
if 200 <= _response.status_code < 300:
|
|
179
|
+
_data = typing.cast(
|
|
180
|
+
Container,
|
|
181
|
+
construct_type(
|
|
182
|
+
type_=Container, # type: ignore
|
|
183
|
+
object_=_response.json(),
|
|
184
|
+
),
|
|
185
|
+
)
|
|
186
|
+
return HttpResponse(response=_response, data=_data)
|
|
187
|
+
_response_json = _response.json()
|
|
188
|
+
except JSONDecodeError:
|
|
189
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
190
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
class AsyncRawContainersClient:
|
|
194
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
195
|
+
self._client_wrapper = client_wrapper
|
|
196
|
+
|
|
197
|
+
async def list(
|
|
198
|
+
self,
|
|
199
|
+
*,
|
|
200
|
+
created_after: typing.Optional[dt.datetime] = None,
|
|
201
|
+
created_before: typing.Optional[dt.datetime] = None,
|
|
202
|
+
cursor: typing.Optional[str] = None,
|
|
203
|
+
expand: typing.Optional[ContainersListRequestExpand] = None,
|
|
204
|
+
include_deleted_data: typing.Optional[bool] = None,
|
|
205
|
+
include_remote_data: typing.Optional[bool] = None,
|
|
206
|
+
include_shell_data: typing.Optional[bool] = None,
|
|
207
|
+
modified_after: typing.Optional[dt.datetime] = None,
|
|
208
|
+
modified_before: typing.Optional[dt.datetime] = None,
|
|
209
|
+
page_size: typing.Optional[int] = None,
|
|
210
|
+
parent_article_id: typing.Optional[str] = None,
|
|
211
|
+
parent_container_id: typing.Optional[str] = None,
|
|
212
|
+
remote_id: typing.Optional[str] = None,
|
|
213
|
+
type: typing.Optional[str] = None,
|
|
214
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
215
|
+
) -> AsyncHttpResponse[PaginatedContainerList]:
|
|
216
|
+
"""
|
|
217
|
+
Returns a list of `Container` objects.
|
|
218
|
+
|
|
219
|
+
Parameters
|
|
220
|
+
----------
|
|
221
|
+
created_after : typing.Optional[dt.datetime]
|
|
222
|
+
If provided, will only return objects created after this datetime.
|
|
223
|
+
|
|
224
|
+
created_before : typing.Optional[dt.datetime]
|
|
225
|
+
If provided, will only return objects created before this datetime.
|
|
226
|
+
|
|
227
|
+
cursor : typing.Optional[str]
|
|
228
|
+
The pagination cursor value.
|
|
229
|
+
|
|
230
|
+
expand : typing.Optional[ContainersListRequestExpand]
|
|
231
|
+
Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
|
|
232
|
+
|
|
233
|
+
include_deleted_data : typing.Optional[bool]
|
|
234
|
+
Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/).
|
|
235
|
+
|
|
236
|
+
include_remote_data : typing.Optional[bool]
|
|
237
|
+
Whether to include the original data Merge fetched from the third-party to produce these models.
|
|
238
|
+
|
|
239
|
+
include_shell_data : typing.Optional[bool]
|
|
240
|
+
Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).
|
|
241
|
+
|
|
242
|
+
modified_after : typing.Optional[dt.datetime]
|
|
243
|
+
If provided, only objects synced by Merge after this date time will be returned.
|
|
244
|
+
|
|
245
|
+
modified_before : typing.Optional[dt.datetime]
|
|
246
|
+
If provided, only objects synced by Merge before this date time will be returned.
|
|
247
|
+
|
|
248
|
+
page_size : typing.Optional[int]
|
|
249
|
+
Number of results to return per page.
|
|
250
|
+
|
|
251
|
+
parent_article_id : typing.Optional[str]
|
|
252
|
+
If provided, will only return sub containers of the parent_article_id.
|
|
253
|
+
|
|
254
|
+
parent_container_id : typing.Optional[str]
|
|
255
|
+
If provided, will only return sub containers of the parent_container_id.
|
|
256
|
+
|
|
257
|
+
remote_id : typing.Optional[str]
|
|
258
|
+
The API provider's ID for the given object.
|
|
259
|
+
|
|
260
|
+
type : typing.Optional[str]
|
|
261
|
+
If provided, will only return containers of the given type.
|
|
262
|
+
|
|
263
|
+
request_options : typing.Optional[RequestOptions]
|
|
264
|
+
Request-specific configuration.
|
|
265
|
+
|
|
266
|
+
Returns
|
|
267
|
+
-------
|
|
268
|
+
AsyncHttpResponse[PaginatedContainerList]
|
|
269
|
+
|
|
270
|
+
"""
|
|
271
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
272
|
+
"knowledgebase/v1/containers",
|
|
273
|
+
method="GET",
|
|
274
|
+
params={
|
|
275
|
+
"created_after": serialize_datetime(created_after) if created_after is not None else None,
|
|
276
|
+
"created_before": serialize_datetime(created_before) if created_before is not None else None,
|
|
277
|
+
"cursor": cursor,
|
|
278
|
+
"expand": expand,
|
|
279
|
+
"include_deleted_data": include_deleted_data,
|
|
280
|
+
"include_remote_data": include_remote_data,
|
|
281
|
+
"include_shell_data": include_shell_data,
|
|
282
|
+
"modified_after": serialize_datetime(modified_after) if modified_after is not None else None,
|
|
283
|
+
"modified_before": serialize_datetime(modified_before) if modified_before is not None else None,
|
|
284
|
+
"page_size": page_size,
|
|
285
|
+
"parent_article_id": parent_article_id,
|
|
286
|
+
"parent_container_id": parent_container_id,
|
|
287
|
+
"remote_id": remote_id,
|
|
288
|
+
"type": type,
|
|
289
|
+
},
|
|
290
|
+
request_options=request_options,
|
|
291
|
+
)
|
|
292
|
+
try:
|
|
293
|
+
if 200 <= _response.status_code < 300:
|
|
294
|
+
_data = typing.cast(
|
|
295
|
+
PaginatedContainerList,
|
|
296
|
+
construct_type(
|
|
297
|
+
type_=PaginatedContainerList, # type: ignore
|
|
298
|
+
object_=_response.json(),
|
|
299
|
+
),
|
|
300
|
+
)
|
|
301
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
302
|
+
_response_json = _response.json()
|
|
303
|
+
except JSONDecodeError:
|
|
304
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
305
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
306
|
+
|
|
307
|
+
async def retrieve(
|
|
308
|
+
self,
|
|
309
|
+
id: str,
|
|
310
|
+
*,
|
|
311
|
+
expand: typing.Optional[ContainersRetrieveRequestExpand] = None,
|
|
312
|
+
include_remote_data: typing.Optional[bool] = None,
|
|
313
|
+
include_shell_data: typing.Optional[bool] = None,
|
|
314
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
315
|
+
) -> AsyncHttpResponse[Container]:
|
|
316
|
+
"""
|
|
317
|
+
Returns a `Container` object with the given `id`.
|
|
318
|
+
|
|
319
|
+
Parameters
|
|
320
|
+
----------
|
|
321
|
+
id : str
|
|
322
|
+
|
|
323
|
+
expand : typing.Optional[ContainersRetrieveRequestExpand]
|
|
324
|
+
Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
|
|
325
|
+
|
|
326
|
+
include_remote_data : typing.Optional[bool]
|
|
327
|
+
Whether to include the original data Merge fetched from the third-party to produce these models.
|
|
328
|
+
|
|
329
|
+
include_shell_data : typing.Optional[bool]
|
|
330
|
+
Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).
|
|
331
|
+
|
|
332
|
+
request_options : typing.Optional[RequestOptions]
|
|
333
|
+
Request-specific configuration.
|
|
334
|
+
|
|
335
|
+
Returns
|
|
336
|
+
-------
|
|
337
|
+
AsyncHttpResponse[Container]
|
|
338
|
+
|
|
339
|
+
"""
|
|
340
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
341
|
+
f"knowledgebase/v1/containers/{jsonable_encoder(id)}",
|
|
342
|
+
method="GET",
|
|
343
|
+
params={
|
|
344
|
+
"expand": expand,
|
|
345
|
+
"include_remote_data": include_remote_data,
|
|
346
|
+
"include_shell_data": include_shell_data,
|
|
347
|
+
},
|
|
348
|
+
request_options=request_options,
|
|
349
|
+
)
|
|
350
|
+
try:
|
|
351
|
+
if 200 <= _response.status_code < 300:
|
|
352
|
+
_data = typing.cast(
|
|
353
|
+
Container,
|
|
354
|
+
construct_type(
|
|
355
|
+
type_=Container, # type: ignore
|
|
356
|
+
object_=_response.json(),
|
|
357
|
+
),
|
|
358
|
+
)
|
|
359
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
360
|
+
_response_json = _response.json()
|
|
361
|
+
except JSONDecodeError:
|
|
362
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
363
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
# isort: skip_file
|
|
4
|
+
|
|
5
|
+
import typing
|
|
6
|
+
from importlib import import_module
|
|
7
|
+
|
|
8
|
+
if typing.TYPE_CHECKING:
|
|
9
|
+
from .containers_list_request_expand import ContainersListRequestExpand
|
|
10
|
+
from .containers_retrieve_request_expand import ContainersRetrieveRequestExpand
|
|
11
|
+
_dynamic_imports: typing.Dict[str, str] = {
|
|
12
|
+
"ContainersListRequestExpand": ".containers_list_request_expand",
|
|
13
|
+
"ContainersRetrieveRequestExpand": ".containers_retrieve_request_expand",
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def __getattr__(attr_name: str) -> typing.Any:
|
|
18
|
+
module_name = _dynamic_imports.get(attr_name)
|
|
19
|
+
if module_name is None:
|
|
20
|
+
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
|
|
21
|
+
try:
|
|
22
|
+
module = import_module(module_name, __package__)
|
|
23
|
+
result = getattr(module, attr_name)
|
|
24
|
+
return result
|
|
25
|
+
except ImportError as e:
|
|
26
|
+
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
|
|
27
|
+
except AttributeError as e:
|
|
28
|
+
raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def __dir__():
|
|
32
|
+
lazy_attrs = list(_dynamic_imports.keys())
|
|
33
|
+
return sorted(lazy_attrs)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
__all__ = ["ContainersListRequestExpand", "ContainersRetrieveRequestExpand"]
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import enum
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
T_Result = typing.TypeVar("T_Result")
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class ContainersListRequestExpand(str, enum.Enum):
|
|
10
|
+
PARENT_ARTICLE = "parent_article"
|
|
11
|
+
PARENT_ARTICLE_PARENT_CONTAINER = "parent_article,parent_container"
|
|
12
|
+
PARENT_CONTAINER = "parent_container"
|
|
13
|
+
PERMISSIONS = "permissions"
|
|
14
|
+
PERMISSIONS_PARENT_ARTICLE = "permissions,parent_article"
|
|
15
|
+
PERMISSIONS_PARENT_ARTICLE_PARENT_CONTAINER = "permissions,parent_article,parent_container"
|
|
16
|
+
PERMISSIONS_PARENT_CONTAINER = "permissions,parent_container"
|
|
17
|
+
|
|
18
|
+
def visit(
|
|
19
|
+
self,
|
|
20
|
+
parent_article: typing.Callable[[], T_Result],
|
|
21
|
+
parent_article_parent_container: typing.Callable[[], T_Result],
|
|
22
|
+
parent_container: typing.Callable[[], T_Result],
|
|
23
|
+
permissions: typing.Callable[[], T_Result],
|
|
24
|
+
permissions_parent_article: typing.Callable[[], T_Result],
|
|
25
|
+
permissions_parent_article_parent_container: typing.Callable[[], T_Result],
|
|
26
|
+
permissions_parent_container: typing.Callable[[], T_Result],
|
|
27
|
+
) -> T_Result:
|
|
28
|
+
if self is ContainersListRequestExpand.PARENT_ARTICLE:
|
|
29
|
+
return parent_article()
|
|
30
|
+
if self is ContainersListRequestExpand.PARENT_ARTICLE_PARENT_CONTAINER:
|
|
31
|
+
return parent_article_parent_container()
|
|
32
|
+
if self is ContainersListRequestExpand.PARENT_CONTAINER:
|
|
33
|
+
return parent_container()
|
|
34
|
+
if self is ContainersListRequestExpand.PERMISSIONS:
|
|
35
|
+
return permissions()
|
|
36
|
+
if self is ContainersListRequestExpand.PERMISSIONS_PARENT_ARTICLE:
|
|
37
|
+
return permissions_parent_article()
|
|
38
|
+
if self is ContainersListRequestExpand.PERMISSIONS_PARENT_ARTICLE_PARENT_CONTAINER:
|
|
39
|
+
return permissions_parent_article_parent_container()
|
|
40
|
+
if self is ContainersListRequestExpand.PERMISSIONS_PARENT_CONTAINER:
|
|
41
|
+
return permissions_parent_container()
|
merge/resources/knowledgebase/resources/containers/types/containers_retrieve_request_expand.py
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import enum
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
T_Result = typing.TypeVar("T_Result")
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class ContainersRetrieveRequestExpand(str, enum.Enum):
|
|
10
|
+
PARENT_ARTICLE = "parent_article"
|
|
11
|
+
PARENT_ARTICLE_PARENT_CONTAINER = "parent_article,parent_container"
|
|
12
|
+
PARENT_CONTAINER = "parent_container"
|
|
13
|
+
PERMISSIONS = "permissions"
|
|
14
|
+
PERMISSIONS_PARENT_ARTICLE = "permissions,parent_article"
|
|
15
|
+
PERMISSIONS_PARENT_ARTICLE_PARENT_CONTAINER = "permissions,parent_article,parent_container"
|
|
16
|
+
PERMISSIONS_PARENT_CONTAINER = "permissions,parent_container"
|
|
17
|
+
|
|
18
|
+
def visit(
|
|
19
|
+
self,
|
|
20
|
+
parent_article: typing.Callable[[], T_Result],
|
|
21
|
+
parent_article_parent_container: typing.Callable[[], T_Result],
|
|
22
|
+
parent_container: typing.Callable[[], T_Result],
|
|
23
|
+
permissions: typing.Callable[[], T_Result],
|
|
24
|
+
permissions_parent_article: typing.Callable[[], T_Result],
|
|
25
|
+
permissions_parent_article_parent_container: typing.Callable[[], T_Result],
|
|
26
|
+
permissions_parent_container: typing.Callable[[], T_Result],
|
|
27
|
+
) -> T_Result:
|
|
28
|
+
if self is ContainersRetrieveRequestExpand.PARENT_ARTICLE:
|
|
29
|
+
return parent_article()
|
|
30
|
+
if self is ContainersRetrieveRequestExpand.PARENT_ARTICLE_PARENT_CONTAINER:
|
|
31
|
+
return parent_article_parent_container()
|
|
32
|
+
if self is ContainersRetrieveRequestExpand.PARENT_CONTAINER:
|
|
33
|
+
return parent_container()
|
|
34
|
+
if self is ContainersRetrieveRequestExpand.PERMISSIONS:
|
|
35
|
+
return permissions()
|
|
36
|
+
if self is ContainersRetrieveRequestExpand.PERMISSIONS_PARENT_ARTICLE:
|
|
37
|
+
return permissions_parent_article()
|
|
38
|
+
if self is ContainersRetrieveRequestExpand.PERMISSIONS_PARENT_ARTICLE_PARENT_CONTAINER:
|
|
39
|
+
return permissions_parent_article_parent_container()
|
|
40
|
+
if self is ContainersRetrieveRequestExpand.PERMISSIONS_PARENT_CONTAINER:
|
|
41
|
+
return permissions_parent_container()
|
|
@@ -0,0 +1,99 @@
|
|
|
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 .raw_client import AsyncRawDeleteAccountClient, RawDeleteAccountClient
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class DeleteAccountClient:
|
|
11
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
12
|
+
self._raw_client = RawDeleteAccountClient(client_wrapper=client_wrapper)
|
|
13
|
+
|
|
14
|
+
@property
|
|
15
|
+
def with_raw_response(self) -> RawDeleteAccountClient:
|
|
16
|
+
"""
|
|
17
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
18
|
+
|
|
19
|
+
Returns
|
|
20
|
+
-------
|
|
21
|
+
RawDeleteAccountClient
|
|
22
|
+
"""
|
|
23
|
+
return self._raw_client
|
|
24
|
+
|
|
25
|
+
def delete(self, *, request_options: typing.Optional[RequestOptions] = None) -> None:
|
|
26
|
+
"""
|
|
27
|
+
Delete a linked account.
|
|
28
|
+
|
|
29
|
+
Parameters
|
|
30
|
+
----------
|
|
31
|
+
request_options : typing.Optional[RequestOptions]
|
|
32
|
+
Request-specific configuration.
|
|
33
|
+
|
|
34
|
+
Returns
|
|
35
|
+
-------
|
|
36
|
+
None
|
|
37
|
+
|
|
38
|
+
Examples
|
|
39
|
+
--------
|
|
40
|
+
from merge import Merge
|
|
41
|
+
|
|
42
|
+
client = Merge(
|
|
43
|
+
account_token="YOUR_ACCOUNT_TOKEN",
|
|
44
|
+
api_key="YOUR_API_KEY",
|
|
45
|
+
)
|
|
46
|
+
client.knowledgebase.delete_account.delete()
|
|
47
|
+
"""
|
|
48
|
+
_response = self._raw_client.delete(request_options=request_options)
|
|
49
|
+
return _response.data
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
class AsyncDeleteAccountClient:
|
|
53
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
54
|
+
self._raw_client = AsyncRawDeleteAccountClient(client_wrapper=client_wrapper)
|
|
55
|
+
|
|
56
|
+
@property
|
|
57
|
+
def with_raw_response(self) -> AsyncRawDeleteAccountClient:
|
|
58
|
+
"""
|
|
59
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
60
|
+
|
|
61
|
+
Returns
|
|
62
|
+
-------
|
|
63
|
+
AsyncRawDeleteAccountClient
|
|
64
|
+
"""
|
|
65
|
+
return self._raw_client
|
|
66
|
+
|
|
67
|
+
async def delete(self, *, request_options: typing.Optional[RequestOptions] = None) -> None:
|
|
68
|
+
"""
|
|
69
|
+
Delete a linked account.
|
|
70
|
+
|
|
71
|
+
Parameters
|
|
72
|
+
----------
|
|
73
|
+
request_options : typing.Optional[RequestOptions]
|
|
74
|
+
Request-specific configuration.
|
|
75
|
+
|
|
76
|
+
Returns
|
|
77
|
+
-------
|
|
78
|
+
None
|
|
79
|
+
|
|
80
|
+
Examples
|
|
81
|
+
--------
|
|
82
|
+
import asyncio
|
|
83
|
+
|
|
84
|
+
from merge import AsyncMerge
|
|
85
|
+
|
|
86
|
+
client = AsyncMerge(
|
|
87
|
+
account_token="YOUR_ACCOUNT_TOKEN",
|
|
88
|
+
api_key="YOUR_API_KEY",
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
async def main() -> None:
|
|
93
|
+
await client.knowledgebase.delete_account.delete()
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
asyncio.run(main())
|
|
97
|
+
"""
|
|
98
|
+
_response = await self._raw_client.delete(request_options=request_options)
|
|
99
|
+
return _response.data
|
|
@@ -0,0 +1,71 @@
|
|
|
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.request_options import RequestOptions
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class RawDeleteAccountClient:
|
|
13
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
14
|
+
self._client_wrapper = client_wrapper
|
|
15
|
+
|
|
16
|
+
def delete(self, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[None]:
|
|
17
|
+
"""
|
|
18
|
+
Delete a linked account.
|
|
19
|
+
|
|
20
|
+
Parameters
|
|
21
|
+
----------
|
|
22
|
+
request_options : typing.Optional[RequestOptions]
|
|
23
|
+
Request-specific configuration.
|
|
24
|
+
|
|
25
|
+
Returns
|
|
26
|
+
-------
|
|
27
|
+
HttpResponse[None]
|
|
28
|
+
"""
|
|
29
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
30
|
+
"knowledgebase/v1/delete-account",
|
|
31
|
+
method="POST",
|
|
32
|
+
request_options=request_options,
|
|
33
|
+
)
|
|
34
|
+
try:
|
|
35
|
+
if 200 <= _response.status_code < 300:
|
|
36
|
+
return HttpResponse(response=_response, data=None)
|
|
37
|
+
_response_json = _response.json()
|
|
38
|
+
except JSONDecodeError:
|
|
39
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
40
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
class AsyncRawDeleteAccountClient:
|
|
44
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
45
|
+
self._client_wrapper = client_wrapper
|
|
46
|
+
|
|
47
|
+
async def delete(self, *, request_options: typing.Optional[RequestOptions] = None) -> AsyncHttpResponse[None]:
|
|
48
|
+
"""
|
|
49
|
+
Delete a linked account.
|
|
50
|
+
|
|
51
|
+
Parameters
|
|
52
|
+
----------
|
|
53
|
+
request_options : typing.Optional[RequestOptions]
|
|
54
|
+
Request-specific configuration.
|
|
55
|
+
|
|
56
|
+
Returns
|
|
57
|
+
-------
|
|
58
|
+
AsyncHttpResponse[None]
|
|
59
|
+
"""
|
|
60
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
61
|
+
"knowledgebase/v1/delete-account",
|
|
62
|
+
method="POST",
|
|
63
|
+
request_options=request_options,
|
|
64
|
+
)
|
|
65
|
+
try:
|
|
66
|
+
if 200 <= _response.status_code < 300:
|
|
67
|
+
return AsyncHttpResponse(response=_response, data=None)
|
|
68
|
+
_response_json = _response.json()
|
|
69
|
+
except JSONDecodeError:
|
|
70
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
71
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|