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,178 @@
|
|
|
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_audit_log_event_list import PaginatedAuditLogEventList
|
|
8
|
+
from .raw_client import AsyncRawAuditTrailClient, RawAuditTrailClient
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class AuditTrailClient:
|
|
12
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
13
|
+
self._raw_client = RawAuditTrailClient(client_wrapper=client_wrapper)
|
|
14
|
+
|
|
15
|
+
@property
|
|
16
|
+
def with_raw_response(self) -> RawAuditTrailClient:
|
|
17
|
+
"""
|
|
18
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
19
|
+
|
|
20
|
+
Returns
|
|
21
|
+
-------
|
|
22
|
+
RawAuditTrailClient
|
|
23
|
+
"""
|
|
24
|
+
return self._raw_client
|
|
25
|
+
|
|
26
|
+
def list(
|
|
27
|
+
self,
|
|
28
|
+
*,
|
|
29
|
+
cursor: typing.Optional[str] = None,
|
|
30
|
+
end_date: typing.Optional[str] = None,
|
|
31
|
+
event_type: typing.Optional[str] = None,
|
|
32
|
+
page_size: typing.Optional[int] = None,
|
|
33
|
+
start_date: typing.Optional[str] = None,
|
|
34
|
+
user_email: typing.Optional[str] = None,
|
|
35
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
36
|
+
) -> PaginatedAuditLogEventList:
|
|
37
|
+
"""
|
|
38
|
+
Gets a list of audit trail events.
|
|
39
|
+
|
|
40
|
+
Parameters
|
|
41
|
+
----------
|
|
42
|
+
cursor : typing.Optional[str]
|
|
43
|
+
The pagination cursor value.
|
|
44
|
+
|
|
45
|
+
end_date : typing.Optional[str]
|
|
46
|
+
If included, will only include audit trail events that occurred before this time
|
|
47
|
+
|
|
48
|
+
event_type : typing.Optional[str]
|
|
49
|
+
If included, will only include events with the given event type. Possible values include: `CREATED_REMOTE_PRODUCTION_API_KEY`, `DELETED_REMOTE_PRODUCTION_API_KEY`, `CREATED_TEST_API_KEY`, `DELETED_TEST_API_KEY`, `REGENERATED_PRODUCTION_API_KEY`, `REGENERATED_WEBHOOK_SIGNATURE`, `INVITED_USER`, `TWO_FACTOR_AUTH_ENABLED`, `TWO_FACTOR_AUTH_DISABLED`, `DELETED_LINKED_ACCOUNT`, `DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT`, `CREATED_DESTINATION`, `DELETED_DESTINATION`, `CHANGED_DESTINATION`, `CHANGED_SCOPES`, `CHANGED_PERSONAL_INFORMATION`, `CHANGED_ORGANIZATION_SETTINGS`, `ENABLED_INTEGRATION`, `DISABLED_INTEGRATION`, `ENABLED_CATEGORY`, `DISABLED_CATEGORY`, `CHANGED_PASSWORD`, `RESET_PASSWORD`, `ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION`, `ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT`, `DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION`, `DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT`, `CREATED_INTEGRATION_WIDE_FIELD_MAPPING`, `CREATED_LINKED_ACCOUNT_FIELD_MAPPING`, `CHANGED_INTEGRATION_WIDE_FIELD_MAPPING`, `CHANGED_LINKED_ACCOUNT_FIELD_MAPPING`, `DELETED_INTEGRATION_WIDE_FIELD_MAPPING`, `DELETED_LINKED_ACCOUNT_FIELD_MAPPING`, `CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `FORCED_LINKED_ACCOUNT_RESYNC`, `MUTED_ISSUE`, `GENERATED_MAGIC_LINK`, `ENABLED_MERGE_WEBHOOK`, `DISABLED_MERGE_WEBHOOK`, `MERGE_WEBHOOK_TARGET_CHANGED`, `END_USER_CREDENTIALS_ACCESSED`
|
|
50
|
+
|
|
51
|
+
page_size : typing.Optional[int]
|
|
52
|
+
Number of results to return per page.
|
|
53
|
+
|
|
54
|
+
start_date : typing.Optional[str]
|
|
55
|
+
If included, will only include audit trail events that occurred after this time
|
|
56
|
+
|
|
57
|
+
user_email : typing.Optional[str]
|
|
58
|
+
If provided, this will return events associated with the specified user email. Please note that the email address reflects the user's email at the time of the event, and may not be their current email.
|
|
59
|
+
|
|
60
|
+
request_options : typing.Optional[RequestOptions]
|
|
61
|
+
Request-specific configuration.
|
|
62
|
+
|
|
63
|
+
Returns
|
|
64
|
+
-------
|
|
65
|
+
PaginatedAuditLogEventList
|
|
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.knowledgebase.audit_trail.list(
|
|
77
|
+
cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw",
|
|
78
|
+
)
|
|
79
|
+
"""
|
|
80
|
+
_response = self._raw_client.list(
|
|
81
|
+
cursor=cursor,
|
|
82
|
+
end_date=end_date,
|
|
83
|
+
event_type=event_type,
|
|
84
|
+
page_size=page_size,
|
|
85
|
+
start_date=start_date,
|
|
86
|
+
user_email=user_email,
|
|
87
|
+
request_options=request_options,
|
|
88
|
+
)
|
|
89
|
+
return _response.data
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
class AsyncAuditTrailClient:
|
|
93
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
94
|
+
self._raw_client = AsyncRawAuditTrailClient(client_wrapper=client_wrapper)
|
|
95
|
+
|
|
96
|
+
@property
|
|
97
|
+
def with_raw_response(self) -> AsyncRawAuditTrailClient:
|
|
98
|
+
"""
|
|
99
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
100
|
+
|
|
101
|
+
Returns
|
|
102
|
+
-------
|
|
103
|
+
AsyncRawAuditTrailClient
|
|
104
|
+
"""
|
|
105
|
+
return self._raw_client
|
|
106
|
+
|
|
107
|
+
async def list(
|
|
108
|
+
self,
|
|
109
|
+
*,
|
|
110
|
+
cursor: typing.Optional[str] = None,
|
|
111
|
+
end_date: typing.Optional[str] = None,
|
|
112
|
+
event_type: typing.Optional[str] = None,
|
|
113
|
+
page_size: typing.Optional[int] = None,
|
|
114
|
+
start_date: typing.Optional[str] = None,
|
|
115
|
+
user_email: typing.Optional[str] = None,
|
|
116
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
117
|
+
) -> PaginatedAuditLogEventList:
|
|
118
|
+
"""
|
|
119
|
+
Gets a list of audit trail events.
|
|
120
|
+
|
|
121
|
+
Parameters
|
|
122
|
+
----------
|
|
123
|
+
cursor : typing.Optional[str]
|
|
124
|
+
The pagination cursor value.
|
|
125
|
+
|
|
126
|
+
end_date : typing.Optional[str]
|
|
127
|
+
If included, will only include audit trail events that occurred before this time
|
|
128
|
+
|
|
129
|
+
event_type : typing.Optional[str]
|
|
130
|
+
If included, will only include events with the given event type. Possible values include: `CREATED_REMOTE_PRODUCTION_API_KEY`, `DELETED_REMOTE_PRODUCTION_API_KEY`, `CREATED_TEST_API_KEY`, `DELETED_TEST_API_KEY`, `REGENERATED_PRODUCTION_API_KEY`, `REGENERATED_WEBHOOK_SIGNATURE`, `INVITED_USER`, `TWO_FACTOR_AUTH_ENABLED`, `TWO_FACTOR_AUTH_DISABLED`, `DELETED_LINKED_ACCOUNT`, `DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT`, `CREATED_DESTINATION`, `DELETED_DESTINATION`, `CHANGED_DESTINATION`, `CHANGED_SCOPES`, `CHANGED_PERSONAL_INFORMATION`, `CHANGED_ORGANIZATION_SETTINGS`, `ENABLED_INTEGRATION`, `DISABLED_INTEGRATION`, `ENABLED_CATEGORY`, `DISABLED_CATEGORY`, `CHANGED_PASSWORD`, `RESET_PASSWORD`, `ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION`, `ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT`, `DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION`, `DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT`, `CREATED_INTEGRATION_WIDE_FIELD_MAPPING`, `CREATED_LINKED_ACCOUNT_FIELD_MAPPING`, `CHANGED_INTEGRATION_WIDE_FIELD_MAPPING`, `CHANGED_LINKED_ACCOUNT_FIELD_MAPPING`, `DELETED_INTEGRATION_WIDE_FIELD_MAPPING`, `DELETED_LINKED_ACCOUNT_FIELD_MAPPING`, `CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `FORCED_LINKED_ACCOUNT_RESYNC`, `MUTED_ISSUE`, `GENERATED_MAGIC_LINK`, `ENABLED_MERGE_WEBHOOK`, `DISABLED_MERGE_WEBHOOK`, `MERGE_WEBHOOK_TARGET_CHANGED`, `END_USER_CREDENTIALS_ACCESSED`
|
|
131
|
+
|
|
132
|
+
page_size : typing.Optional[int]
|
|
133
|
+
Number of results to return per page.
|
|
134
|
+
|
|
135
|
+
start_date : typing.Optional[str]
|
|
136
|
+
If included, will only include audit trail events that occurred after this time
|
|
137
|
+
|
|
138
|
+
user_email : typing.Optional[str]
|
|
139
|
+
If provided, this will return events associated with the specified user email. Please note that the email address reflects the user's email at the time of the event, and may not be their current email.
|
|
140
|
+
|
|
141
|
+
request_options : typing.Optional[RequestOptions]
|
|
142
|
+
Request-specific configuration.
|
|
143
|
+
|
|
144
|
+
Returns
|
|
145
|
+
-------
|
|
146
|
+
PaginatedAuditLogEventList
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
Examples
|
|
150
|
+
--------
|
|
151
|
+
import asyncio
|
|
152
|
+
|
|
153
|
+
from merge import AsyncMerge
|
|
154
|
+
|
|
155
|
+
client = AsyncMerge(
|
|
156
|
+
account_token="YOUR_ACCOUNT_TOKEN",
|
|
157
|
+
api_key="YOUR_API_KEY",
|
|
158
|
+
)
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
async def main() -> None:
|
|
162
|
+
await client.knowledgebase.audit_trail.list(
|
|
163
|
+
cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw",
|
|
164
|
+
)
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
asyncio.run(main())
|
|
168
|
+
"""
|
|
169
|
+
_response = await self._raw_client.list(
|
|
170
|
+
cursor=cursor,
|
|
171
|
+
end_date=end_date,
|
|
172
|
+
event_type=event_type,
|
|
173
|
+
page_size=page_size,
|
|
174
|
+
start_date=start_date,
|
|
175
|
+
user_email=user_email,
|
|
176
|
+
request_options=request_options,
|
|
177
|
+
)
|
|
178
|
+
return _response.data
|
|
@@ -0,0 +1,161 @@
|
|
|
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
|
+
from .....core.unchecked_base_model import construct_type
|
|
11
|
+
from ...types.paginated_audit_log_event_list import PaginatedAuditLogEventList
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class RawAuditTrailClient:
|
|
15
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
16
|
+
self._client_wrapper = client_wrapper
|
|
17
|
+
|
|
18
|
+
def list(
|
|
19
|
+
self,
|
|
20
|
+
*,
|
|
21
|
+
cursor: typing.Optional[str] = None,
|
|
22
|
+
end_date: typing.Optional[str] = None,
|
|
23
|
+
event_type: typing.Optional[str] = None,
|
|
24
|
+
page_size: typing.Optional[int] = None,
|
|
25
|
+
start_date: typing.Optional[str] = None,
|
|
26
|
+
user_email: typing.Optional[str] = None,
|
|
27
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
28
|
+
) -> HttpResponse[PaginatedAuditLogEventList]:
|
|
29
|
+
"""
|
|
30
|
+
Gets a list of audit trail events.
|
|
31
|
+
|
|
32
|
+
Parameters
|
|
33
|
+
----------
|
|
34
|
+
cursor : typing.Optional[str]
|
|
35
|
+
The pagination cursor value.
|
|
36
|
+
|
|
37
|
+
end_date : typing.Optional[str]
|
|
38
|
+
If included, will only include audit trail events that occurred before this time
|
|
39
|
+
|
|
40
|
+
event_type : typing.Optional[str]
|
|
41
|
+
If included, will only include events with the given event type. Possible values include: `CREATED_REMOTE_PRODUCTION_API_KEY`, `DELETED_REMOTE_PRODUCTION_API_KEY`, `CREATED_TEST_API_KEY`, `DELETED_TEST_API_KEY`, `REGENERATED_PRODUCTION_API_KEY`, `REGENERATED_WEBHOOK_SIGNATURE`, `INVITED_USER`, `TWO_FACTOR_AUTH_ENABLED`, `TWO_FACTOR_AUTH_DISABLED`, `DELETED_LINKED_ACCOUNT`, `DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT`, `CREATED_DESTINATION`, `DELETED_DESTINATION`, `CHANGED_DESTINATION`, `CHANGED_SCOPES`, `CHANGED_PERSONAL_INFORMATION`, `CHANGED_ORGANIZATION_SETTINGS`, `ENABLED_INTEGRATION`, `DISABLED_INTEGRATION`, `ENABLED_CATEGORY`, `DISABLED_CATEGORY`, `CHANGED_PASSWORD`, `RESET_PASSWORD`, `ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION`, `ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT`, `DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION`, `DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT`, `CREATED_INTEGRATION_WIDE_FIELD_MAPPING`, `CREATED_LINKED_ACCOUNT_FIELD_MAPPING`, `CHANGED_INTEGRATION_WIDE_FIELD_MAPPING`, `CHANGED_LINKED_ACCOUNT_FIELD_MAPPING`, `DELETED_INTEGRATION_WIDE_FIELD_MAPPING`, `DELETED_LINKED_ACCOUNT_FIELD_MAPPING`, `CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `FORCED_LINKED_ACCOUNT_RESYNC`, `MUTED_ISSUE`, `GENERATED_MAGIC_LINK`, `ENABLED_MERGE_WEBHOOK`, `DISABLED_MERGE_WEBHOOK`, `MERGE_WEBHOOK_TARGET_CHANGED`, `END_USER_CREDENTIALS_ACCESSED`
|
|
42
|
+
|
|
43
|
+
page_size : typing.Optional[int]
|
|
44
|
+
Number of results to return per page.
|
|
45
|
+
|
|
46
|
+
start_date : typing.Optional[str]
|
|
47
|
+
If included, will only include audit trail events that occurred after this time
|
|
48
|
+
|
|
49
|
+
user_email : typing.Optional[str]
|
|
50
|
+
If provided, this will return events associated with the specified user email. Please note that the email address reflects the user's email at the time of the event, and may not be their current email.
|
|
51
|
+
|
|
52
|
+
request_options : typing.Optional[RequestOptions]
|
|
53
|
+
Request-specific configuration.
|
|
54
|
+
|
|
55
|
+
Returns
|
|
56
|
+
-------
|
|
57
|
+
HttpResponse[PaginatedAuditLogEventList]
|
|
58
|
+
|
|
59
|
+
"""
|
|
60
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
61
|
+
"knowledgebase/v1/audit-trail",
|
|
62
|
+
method="GET",
|
|
63
|
+
params={
|
|
64
|
+
"cursor": cursor,
|
|
65
|
+
"end_date": end_date,
|
|
66
|
+
"event_type": event_type,
|
|
67
|
+
"page_size": page_size,
|
|
68
|
+
"start_date": start_date,
|
|
69
|
+
"user_email": user_email,
|
|
70
|
+
},
|
|
71
|
+
request_options=request_options,
|
|
72
|
+
)
|
|
73
|
+
try:
|
|
74
|
+
if 200 <= _response.status_code < 300:
|
|
75
|
+
_data = typing.cast(
|
|
76
|
+
PaginatedAuditLogEventList,
|
|
77
|
+
construct_type(
|
|
78
|
+
type_=PaginatedAuditLogEventList, # type: ignore
|
|
79
|
+
object_=_response.json(),
|
|
80
|
+
),
|
|
81
|
+
)
|
|
82
|
+
return HttpResponse(response=_response, data=_data)
|
|
83
|
+
_response_json = _response.json()
|
|
84
|
+
except JSONDecodeError:
|
|
85
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
86
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
class AsyncRawAuditTrailClient:
|
|
90
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
91
|
+
self._client_wrapper = client_wrapper
|
|
92
|
+
|
|
93
|
+
async def list(
|
|
94
|
+
self,
|
|
95
|
+
*,
|
|
96
|
+
cursor: typing.Optional[str] = None,
|
|
97
|
+
end_date: typing.Optional[str] = None,
|
|
98
|
+
event_type: typing.Optional[str] = None,
|
|
99
|
+
page_size: typing.Optional[int] = None,
|
|
100
|
+
start_date: typing.Optional[str] = None,
|
|
101
|
+
user_email: typing.Optional[str] = None,
|
|
102
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
103
|
+
) -> AsyncHttpResponse[PaginatedAuditLogEventList]:
|
|
104
|
+
"""
|
|
105
|
+
Gets a list of audit trail events.
|
|
106
|
+
|
|
107
|
+
Parameters
|
|
108
|
+
----------
|
|
109
|
+
cursor : typing.Optional[str]
|
|
110
|
+
The pagination cursor value.
|
|
111
|
+
|
|
112
|
+
end_date : typing.Optional[str]
|
|
113
|
+
If included, will only include audit trail events that occurred before this time
|
|
114
|
+
|
|
115
|
+
event_type : typing.Optional[str]
|
|
116
|
+
If included, will only include events with the given event type. Possible values include: `CREATED_REMOTE_PRODUCTION_API_KEY`, `DELETED_REMOTE_PRODUCTION_API_KEY`, `CREATED_TEST_API_KEY`, `DELETED_TEST_API_KEY`, `REGENERATED_PRODUCTION_API_KEY`, `REGENERATED_WEBHOOK_SIGNATURE`, `INVITED_USER`, `TWO_FACTOR_AUTH_ENABLED`, `TWO_FACTOR_AUTH_DISABLED`, `DELETED_LINKED_ACCOUNT`, `DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT`, `CREATED_DESTINATION`, `DELETED_DESTINATION`, `CHANGED_DESTINATION`, `CHANGED_SCOPES`, `CHANGED_PERSONAL_INFORMATION`, `CHANGED_ORGANIZATION_SETTINGS`, `ENABLED_INTEGRATION`, `DISABLED_INTEGRATION`, `ENABLED_CATEGORY`, `DISABLED_CATEGORY`, `CHANGED_PASSWORD`, `RESET_PASSWORD`, `ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION`, `ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT`, `DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION`, `DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT`, `CREATED_INTEGRATION_WIDE_FIELD_MAPPING`, `CREATED_LINKED_ACCOUNT_FIELD_MAPPING`, `CHANGED_INTEGRATION_WIDE_FIELD_MAPPING`, `CHANGED_LINKED_ACCOUNT_FIELD_MAPPING`, `DELETED_INTEGRATION_WIDE_FIELD_MAPPING`, `DELETED_LINKED_ACCOUNT_FIELD_MAPPING`, `CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `FORCED_LINKED_ACCOUNT_RESYNC`, `MUTED_ISSUE`, `GENERATED_MAGIC_LINK`, `ENABLED_MERGE_WEBHOOK`, `DISABLED_MERGE_WEBHOOK`, `MERGE_WEBHOOK_TARGET_CHANGED`, `END_USER_CREDENTIALS_ACCESSED`
|
|
117
|
+
|
|
118
|
+
page_size : typing.Optional[int]
|
|
119
|
+
Number of results to return per page.
|
|
120
|
+
|
|
121
|
+
start_date : typing.Optional[str]
|
|
122
|
+
If included, will only include audit trail events that occurred after this time
|
|
123
|
+
|
|
124
|
+
user_email : typing.Optional[str]
|
|
125
|
+
If provided, this will return events associated with the specified user email. Please note that the email address reflects the user's email at the time of the event, and may not be their current email.
|
|
126
|
+
|
|
127
|
+
request_options : typing.Optional[RequestOptions]
|
|
128
|
+
Request-specific configuration.
|
|
129
|
+
|
|
130
|
+
Returns
|
|
131
|
+
-------
|
|
132
|
+
AsyncHttpResponse[PaginatedAuditLogEventList]
|
|
133
|
+
|
|
134
|
+
"""
|
|
135
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
136
|
+
"knowledgebase/v1/audit-trail",
|
|
137
|
+
method="GET",
|
|
138
|
+
params={
|
|
139
|
+
"cursor": cursor,
|
|
140
|
+
"end_date": end_date,
|
|
141
|
+
"event_type": event_type,
|
|
142
|
+
"page_size": page_size,
|
|
143
|
+
"start_date": start_date,
|
|
144
|
+
"user_email": user_email,
|
|
145
|
+
},
|
|
146
|
+
request_options=request_options,
|
|
147
|
+
)
|
|
148
|
+
try:
|
|
149
|
+
if 200 <= _response.status_code < 300:
|
|
150
|
+
_data = typing.cast(
|
|
151
|
+
PaginatedAuditLogEventList,
|
|
152
|
+
construct_type(
|
|
153
|
+
type_=PaginatedAuditLogEventList, # type: ignore
|
|
154
|
+
object_=_response.json(),
|
|
155
|
+
),
|
|
156
|
+
)
|
|
157
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
158
|
+
_response_json = _response.json()
|
|
159
|
+
except JSONDecodeError:
|
|
160
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
161
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
@@ -0,0 +1,102 @@
|
|
|
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.available_actions import AvailableActions
|
|
8
|
+
from .raw_client import AsyncRawAvailableActionsClient, RawAvailableActionsClient
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class AvailableActionsClient:
|
|
12
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
13
|
+
self._raw_client = RawAvailableActionsClient(client_wrapper=client_wrapper)
|
|
14
|
+
|
|
15
|
+
@property
|
|
16
|
+
def with_raw_response(self) -> RawAvailableActionsClient:
|
|
17
|
+
"""
|
|
18
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
19
|
+
|
|
20
|
+
Returns
|
|
21
|
+
-------
|
|
22
|
+
RawAvailableActionsClient
|
|
23
|
+
"""
|
|
24
|
+
return self._raw_client
|
|
25
|
+
|
|
26
|
+
def retrieve(self, *, request_options: typing.Optional[RequestOptions] = None) -> AvailableActions:
|
|
27
|
+
"""
|
|
28
|
+
Returns a list of models and actions available for an account.
|
|
29
|
+
|
|
30
|
+
Parameters
|
|
31
|
+
----------
|
|
32
|
+
request_options : typing.Optional[RequestOptions]
|
|
33
|
+
Request-specific configuration.
|
|
34
|
+
|
|
35
|
+
Returns
|
|
36
|
+
-------
|
|
37
|
+
AvailableActions
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
Examples
|
|
41
|
+
--------
|
|
42
|
+
from merge import Merge
|
|
43
|
+
|
|
44
|
+
client = Merge(
|
|
45
|
+
account_token="YOUR_ACCOUNT_TOKEN",
|
|
46
|
+
api_key="YOUR_API_KEY",
|
|
47
|
+
)
|
|
48
|
+
client.knowledgebase.available_actions.retrieve()
|
|
49
|
+
"""
|
|
50
|
+
_response = self._raw_client.retrieve(request_options=request_options)
|
|
51
|
+
return _response.data
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
class AsyncAvailableActionsClient:
|
|
55
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
56
|
+
self._raw_client = AsyncRawAvailableActionsClient(client_wrapper=client_wrapper)
|
|
57
|
+
|
|
58
|
+
@property
|
|
59
|
+
def with_raw_response(self) -> AsyncRawAvailableActionsClient:
|
|
60
|
+
"""
|
|
61
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
62
|
+
|
|
63
|
+
Returns
|
|
64
|
+
-------
|
|
65
|
+
AsyncRawAvailableActionsClient
|
|
66
|
+
"""
|
|
67
|
+
return self._raw_client
|
|
68
|
+
|
|
69
|
+
async def retrieve(self, *, request_options: typing.Optional[RequestOptions] = None) -> AvailableActions:
|
|
70
|
+
"""
|
|
71
|
+
Returns a list of models and actions available for an account.
|
|
72
|
+
|
|
73
|
+
Parameters
|
|
74
|
+
----------
|
|
75
|
+
request_options : typing.Optional[RequestOptions]
|
|
76
|
+
Request-specific configuration.
|
|
77
|
+
|
|
78
|
+
Returns
|
|
79
|
+
-------
|
|
80
|
+
AvailableActions
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
Examples
|
|
84
|
+
--------
|
|
85
|
+
import asyncio
|
|
86
|
+
|
|
87
|
+
from merge import AsyncMerge
|
|
88
|
+
|
|
89
|
+
client = AsyncMerge(
|
|
90
|
+
account_token="YOUR_ACCOUNT_TOKEN",
|
|
91
|
+
api_key="YOUR_API_KEY",
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
async def main() -> None:
|
|
96
|
+
await client.knowledgebase.available_actions.retrieve()
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
asyncio.run(main())
|
|
100
|
+
"""
|
|
101
|
+
_response = await self._raw_client.retrieve(request_options=request_options)
|
|
102
|
+
return _response.data
|
|
@@ -0,0 +1,91 @@
|
|
|
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
|
+
from .....core.unchecked_base_model import construct_type
|
|
11
|
+
from ...types.available_actions import AvailableActions
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class RawAvailableActionsClient:
|
|
15
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
16
|
+
self._client_wrapper = client_wrapper
|
|
17
|
+
|
|
18
|
+
def retrieve(self, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[AvailableActions]:
|
|
19
|
+
"""
|
|
20
|
+
Returns a list of models and actions available for an account.
|
|
21
|
+
|
|
22
|
+
Parameters
|
|
23
|
+
----------
|
|
24
|
+
request_options : typing.Optional[RequestOptions]
|
|
25
|
+
Request-specific configuration.
|
|
26
|
+
|
|
27
|
+
Returns
|
|
28
|
+
-------
|
|
29
|
+
HttpResponse[AvailableActions]
|
|
30
|
+
|
|
31
|
+
"""
|
|
32
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
33
|
+
"knowledgebase/v1/available-actions",
|
|
34
|
+
method="GET",
|
|
35
|
+
request_options=request_options,
|
|
36
|
+
)
|
|
37
|
+
try:
|
|
38
|
+
if 200 <= _response.status_code < 300:
|
|
39
|
+
_data = typing.cast(
|
|
40
|
+
AvailableActions,
|
|
41
|
+
construct_type(
|
|
42
|
+
type_=AvailableActions, # type: ignore
|
|
43
|
+
object_=_response.json(),
|
|
44
|
+
),
|
|
45
|
+
)
|
|
46
|
+
return HttpResponse(response=_response, data=_data)
|
|
47
|
+
_response_json = _response.json()
|
|
48
|
+
except JSONDecodeError:
|
|
49
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
50
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
class AsyncRawAvailableActionsClient:
|
|
54
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
55
|
+
self._client_wrapper = client_wrapper
|
|
56
|
+
|
|
57
|
+
async def retrieve(
|
|
58
|
+
self, *, request_options: typing.Optional[RequestOptions] = None
|
|
59
|
+
) -> AsyncHttpResponse[AvailableActions]:
|
|
60
|
+
"""
|
|
61
|
+
Returns a list of models and actions available for an account.
|
|
62
|
+
|
|
63
|
+
Parameters
|
|
64
|
+
----------
|
|
65
|
+
request_options : typing.Optional[RequestOptions]
|
|
66
|
+
Request-specific configuration.
|
|
67
|
+
|
|
68
|
+
Returns
|
|
69
|
+
-------
|
|
70
|
+
AsyncHttpResponse[AvailableActions]
|
|
71
|
+
|
|
72
|
+
"""
|
|
73
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
74
|
+
"knowledgebase/v1/available-actions",
|
|
75
|
+
method="GET",
|
|
76
|
+
request_options=request_options,
|
|
77
|
+
)
|
|
78
|
+
try:
|
|
79
|
+
if 200 <= _response.status_code < 300:
|
|
80
|
+
_data = typing.cast(
|
|
81
|
+
AvailableActions,
|
|
82
|
+
construct_type(
|
|
83
|
+
type_=AvailableActions, # type: ignore
|
|
84
|
+
object_=_response.json(),
|
|
85
|
+
),
|
|
86
|
+
)
|
|
87
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
88
|
+
_response_json = _response.json()
|
|
89
|
+
except JSONDecodeError:
|
|
90
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
91
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
@@ -0,0 +1,35 @@
|
|
|
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 .types import ContainersListRequestExpand, ContainersRetrieveRequestExpand
|
|
10
|
+
_dynamic_imports: typing.Dict[str, str] = {
|
|
11
|
+
"ContainersListRequestExpand": ".types",
|
|
12
|
+
"ContainersRetrieveRequestExpand": ".types",
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def __getattr__(attr_name: str) -> typing.Any:
|
|
17
|
+
module_name = _dynamic_imports.get(attr_name)
|
|
18
|
+
if module_name is None:
|
|
19
|
+
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
|
|
20
|
+
try:
|
|
21
|
+
module = import_module(module_name, __package__)
|
|
22
|
+
result = getattr(module, attr_name)
|
|
23
|
+
return result
|
|
24
|
+
except ImportError as e:
|
|
25
|
+
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
|
|
26
|
+
except AttributeError as e:
|
|
27
|
+
raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def __dir__():
|
|
31
|
+
lazy_attrs = list(_dynamic_imports.keys())
|
|
32
|
+
return sorted(lazy_attrs)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
__all__ = ["ContainersListRequestExpand", "ContainersRetrieveRequestExpand"]
|