egain-api-python 0.1.1__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.
- egain_api_python/__init__.py +17 -0
- egain_api_python/_hooks/__init__.py +5 -0
- egain_api_python/_hooks/registration.py +13 -0
- egain_api_python/_hooks/sdkhooks.py +76 -0
- egain_api_python/_hooks/types.py +112 -0
- egain_api_python/_version.py +15 -0
- egain_api_python/aiservices.py +23 -0
- egain_api_python/answers.py +281 -0
- egain_api_python/articlelists.py +469 -0
- egain_api_python/basesdk.py +368 -0
- egain_api_python/connectorssearchevents.py +537 -0
- egain_api_python/content.py +23 -0
- egain_api_python/errors/__init__.py +78 -0
- egain_api_python/errors/egaindefaulterror.py +40 -0
- egain_api_python/errors/egainerror.py +30 -0
- egain_api_python/errors/gethealthop.py +74 -0
- egain_api_python/errors/no_response_error.py +17 -0
- egain_api_python/errors/responsevalidationerror.py +27 -0
- egain_api_python/errors/schemas_wserrorcommon.py +51 -0
- egain_api_python/errors/wserrorcommon.py +49 -0
- egain_api_python/escalation.py +955 -0
- egain_api_python/export.py +487 -0
- egain_api_python/federatedsearchevent.py +287 -0
- egain_api_python/general.py +925 -0
- egain_api_python/guidedhelp.py +3373 -0
- egain_api_python/health.py +253 -0
- egain_api_python/httpclient.py +125 -0
- egain_api_python/import_.py +1161 -0
- egain_api_python/models/__init__.py +2136 -0
- egain_api_python/models/acceptghsolutionop.py +52 -0
- egain_api_python/models/acceptlanguage.py +23 -0
- egain_api_python/models/accessibleportal.py +37 -0
- egain_api_python/models/action.py +56 -0
- egain_api_python/models/actionsearch.py +92 -0
- egain_api_python/models/addasreferenceop.py +52 -0
- egain_api_python/models/addbookmarkop.py +43 -0
- egain_api_python/models/additionalsnippets.py +57 -0
- egain_api_python/models/addtoreplyop.py +52 -0
- egain_api_python/models/aisearchop.py +131 -0
- egain_api_python/models/aisearchresponse.py +67 -0
- egain_api_python/models/allaccessibleportals.py +28 -0
- egain_api_python/models/answer.py +21 -0
- egain_api_python/models/answeredquestion.py +125 -0
- egain_api_python/models/answerrange.py +41 -0
- egain_api_python/models/answersrequest.py +78 -0
- egain_api_python/models/answersresponse.py +93 -0
- egain_api_python/models/article.py +241 -0
- egain_api_python/models/articleactivitylink.py +62 -0
- egain_api_python/models/articleadditionalattributes.py +23 -0
- egain_api_python/models/articleaisearchresult.py +254 -0
- egain_api_python/models/articleattachment.py +44 -0
- egain_api_python/models/articlelist.py +48 -0
- egain_api_python/models/articlelistresult.py +38 -0
- egain_api_python/models/articlelistsresult.py +22 -0
- egain_api_python/models/articlepermissions.py +25 -0
- egain_api_python/models/articlepermissionsresult.py +27 -0
- egain_api_python/models/articlerating.py +51 -0
- egain_api_python/models/articleratingsresponse.py +28 -0
- egain_api_python/models/articleresult.py +159 -0
- egain_api_python/models/articleresultadditionalattributes.py +22 -0
- egain_api_python/models/articleresults.py +32 -0
- egain_api_python/models/articlesearchresult.py +243 -0
- egain_api_python/models/articlesearchresults.py +32 -0
- egain_api_python/models/articlesort.py +11 -0
- egain_api_python/models/articlesortorder.py +11 -0
- egain_api_python/models/articletype.py +56 -0
- egain_api_python/models/articlewitheditions.py +227 -0
- egain_api_python/models/attachment.py +31 -0
- egain_api_python/models/attachmentadditionalattributes.py +10 -0
- egain_api_python/models/attachmentcontent.py +57 -0
- egain_api_python/models/attachmentcontentresult.py +22 -0
- egain_api_python/models/attachmentforcreatesuggestion.py +25 -0
- egain_api_python/models/attachments.py +35 -0
- egain_api_python/models/attachmentsummary.py +37 -0
- egain_api_python/models/attachmentupload.py +20 -0
- egain_api_python/models/avertcustomerescalationop.py +44 -0
- egain_api_python/models/bookmark.py +57 -0
- egain_api_python/models/bookmarkresult.py +26 -0
- egain_api_python/models/bookmarkstatus.py +34 -0
- egain_api_python/models/case.py +158 -0
- egain_api_python/models/caseadditionalattributes.py +11 -0
- egain_api_python/models/caseanswer.py +21 -0
- egain_api_python/models/casebase.py +67 -0
- egain_api_python/models/casebaseresult.py +28 -0
- egain_api_python/models/casebasesearchsettings.py +26 -0
- egain_api_python/models/caselistresult.py +74 -0
- egain_api_python/models/caselistresults.py +28 -0
- egain_api_python/models/casequestion.py +16 -0
- egain_api_python/models/casequestiondetail.py +29 -0
- egain_api_python/models/casesearch.py +80 -0
- egain_api_python/models/clusterid.py +16 -0
- egain_api_python/models/clusterresult.py +37 -0
- egain_api_python/models/clusterresults.py +28 -0
- egain_api_python/models/comment.py +33 -0
- egain_api_python/models/comments.py +26 -0
- egain_api_python/models/completecustomerescalationop.py +44 -0
- egain_api_python/models/compliancearticleresult.py +166 -0
- egain_api_python/models/compliancearticleresultadditionalattributes.py +22 -0
- egain_api_python/models/compliancearticleresults.py +35 -0
- egain_api_python/models/complianceforarticle.py +59 -0
- egain_api_python/models/complyarticleop.py +40 -0
- egain_api_python/models/components_schemas_tag.py +25 -0
- egain_api_python/models/components_schemas_tagcategory.py +39 -0
- egain_api_python/models/components_schemas_taggroup.py +25 -0
- egain_api_python/models/configurableattribute.py +25 -0
- egain_api_python/models/configurableattributes.py +15 -0
- egain_api_python/models/contactperson.py +43 -0
- egain_api_python/models/contacts.py +21 -0
- egain_api_python/models/createbookmark.py +64 -0
- egain_api_python/models/createdby.py +37 -0
- egain_api_python/models/createfederatedsearchevent.py +85 -0
- egain_api_python/models/createfederatedsearchresulteventop.py +46 -0
- egain_api_python/models/createimportop.py +20 -0
- egain_api_python/models/createimportvalidationop.py +20 -0
- egain_api_python/models/createquickpick.py +34 -0
- egain_api_python/models/createquickpickop.py +55 -0
- egain_api_python/models/createsearchresulteventforconnectors.py +71 -0
- egain_api_python/models/createsearchresulteventforconnectorsop.py +48 -0
- egain_api_python/models/createsignedurlop.py +29 -0
- egain_api_python/models/createsuggestion.py +126 -0
- egain_api_python/models/createviewedsearchresulteventforconnectors.py +76 -0
- egain_api_python/models/createviewedsearchresultseventforconnectorsop.py +48 -0
- egain_api_python/models/customattribute.py +35 -0
- egain_api_python/models/deletebookmarkop.py +40 -0
- egain_api_python/models/deletesuggestionop.py +40 -0
- egain_api_python/models/department.py +21 -0
- egain_api_python/models/detailfield.py +32 -0
- egain_api_python/models/displayfield.py +27 -0
- egain_api_python/models/dynamiccluster.py +21 -0
- egain_api_python/models/dynamicsearch.py +40 -0
- egain_api_python/models/edition.py +79 -0
- egain_api_python/models/editionwithcontent.py +68 -0
- egain_api_python/models/email.py +21 -0
- egain_api_python/models/exportcontentop.py +14 -0
- egain_api_python/models/exportstatus.py +106 -0
- egain_api_python/models/exportstatusop.py +31 -0
- egain_api_python/models/feedbackarticleforsuggestion.py +34 -0
- egain_api_python/models/folderbreadcrumb.py +24 -0
- egain_api_python/models/foldersummary.py +29 -0
- egain_api_python/models/getacknowledgedcompliancearticlesop.py +119 -0
- egain_api_python/models/getallarticlelistsop.py +47 -0
- egain_api_python/models/getallcasebasesreleasesop.py +65 -0
- egain_api_python/models/getallcasesop.py +83 -0
- egain_api_python/models/getallportalsop.py +60 -0
- egain_api_python/models/getallprofilesinportalop.py +64 -0
- egain_api_python/models/getallquickpicksop.py +83 -0
- egain_api_python/models/getalltopicsop.py +132 -0
- egain_api_python/models/getalluserprofilesop.py +47 -0
- egain_api_python/models/getancestortopicsop.py +133 -0
- egain_api_python/models/getannouncementarticlesop.py +134 -0
- egain_api_python/models/getarticleattachmentbyidop.py +31 -0
- egain_api_python/models/getarticlebyidop.py +257 -0
- egain_api_python/models/getarticlebyidwitheditionsop.py +46 -0
- egain_api_python/models/getarticleeditiondetailsop.py +55 -0
- egain_api_python/models/getarticlelistdetailsop.py +115 -0
- egain_api_python/models/getarticlepermissionsbyidop.py +40 -0
- egain_api_python/models/getarticlepersonalizationop.py +73 -0
- egain_api_python/models/getarticleratingsop.py +74 -0
- egain_api_python/models/getarticlesintopicop.py +172 -0
- egain_api_python/models/getattachmentbyidinportalop.py +56 -0
- egain_api_python/models/getbookmarkop.py +31 -0
- egain_api_python/models/getcasebasereleasebyidop.py +64 -0
- egain_api_python/models/getcasebyidop.py +75 -0
- egain_api_python/models/getchildtopicsop.py +150 -0
- egain_api_python/models/getclusterbycasebasereleaseidop.py +74 -0
- egain_api_python/models/gethealthop.py +130 -0
- egain_api_python/models/getimportcontentop.py +46 -0
- egain_api_python/models/getmyportalsop.py +97 -0
- egain_api_python/models/getmysubscriptionop.py +115 -0
- egain_api_python/models/getpendingcompliancearticlesop.py +119 -0
- egain_api_python/models/getpopulararticlesop.py +133 -0
- egain_api_python/models/getportaldetailsbyidop.py +47 -0
- egain_api_python/models/getrelatedarticlesforsuggestionop.py +96 -0
- egain_api_python/models/getrelatedarticlesop.py +143 -0
- egain_api_python/models/getsuggestionattachmentbyidop.py +76 -0
- egain_api_python/models/getsuggestionattachmentsop.py +40 -0
- egain_api_python/models/getsuggestioncommentsop.py +40 -0
- egain_api_python/models/getsuggestionop.py +107 -0
- egain_api_python/models/gettagcategoriesforinterestforportalop.py +46 -0
- egain_api_python/models/gettopicbreadcrumbforarticleop.py +55 -0
- egain_api_python/models/getuserdetailsop.py +22 -0
- egain_api_python/models/getusermilestonesop.py +22 -0
- egain_api_python/models/ghsearchrequest.py +67 -0
- egain_api_python/models/ghsearchresult.py +75 -0
- egain_api_python/models/ghstepsearchrequest.py +64 -0
- egain_api_python/models/image.py +17 -0
- egain_api_python/models/importcontent.py +79 -0
- egain_api_python/models/importstatus.py +29 -0
- egain_api_python/models/kblanguage.py +63 -0
- egain_api_python/models/kblanguagecode.py +48 -0
- egain_api_python/models/kblanguages.py +22 -0
- egain_api_python/models/knowledgeexport.py +237 -0
- egain_api_python/models/l10nstring.py +22 -0
- egain_api_python/models/languagecode.py +39 -0
- egain_api_python/models/languagecode_parameter.py +39 -0
- egain_api_python/models/languagequeryparameter.py +39 -0
- egain_api_python/models/link.py +25 -0
- egain_api_python/models/makesuggestionop.py +44 -0
- egain_api_python/models/mandatorylanguagequeryparameter.py +38 -0
- egain_api_python/models/metadata.py +29 -0
- egain_api_python/models/milestone.py +21 -0
- egain_api_python/models/milestonename.py +26 -0
- egain_api_python/models/milestones.py +21 -0
- egain_api_python/models/modifiedby.py +37 -0
- egain_api_python/models/modifysuggestion.py +78 -0
- egain_api_python/models/modifysuggestionsop.py +44 -0
- egain_api_python/models/optionalarticleattributes.py +20 -0
- egain_api_python/models/order.py +10 -0
- egain_api_python/models/ownedby.py +37 -0
- egain_api_python/models/paginationinfo.py +32 -0
- egain_api_python/models/patchimportcontentvalidationop.py +46 -0
- egain_api_python/models/personalization.py +67 -0
- egain_api_python/models/phone.py +21 -0
- egain_api_python/models/portal.py +102 -0
- egain_api_python/models/portalresult.py +28 -0
- egain_api_python/models/portalsettings.py +398 -0
- egain_api_python/models/post_portalid_answersop.py +88 -0
- egain_api_python/models/post_portalid_retrieveop.py +88 -0
- egain_api_python/models/profile.py +26 -0
- egain_api_python/models/profileresult.py +24 -0
- egain_api_python/models/publishprofile.py +30 -0
- egain_api_python/models/publishview.py +38 -0
- egain_api_python/models/question.py +101 -0
- egain_api_python/models/questionandanswer.py +26 -0
- egain_api_python/models/quickpickrating.py +32 -0
- egain_api_python/models/quickpickresult.py +38 -0
- egain_api_python/models/quickpickresults.py +28 -0
- egain_api_python/models/ratearticleop.py +71 -0
- egain_api_python/models/referenceresponse.py +80 -0
- egain_api_python/models/rejectghsolutionop.py +52 -0
- egain_api_python/models/relatedquestions.py +28 -0
- egain_api_python/models/resourcetype_parameter.py +10 -0
- egain_api_python/models/restorequickpickop.py +63 -0
- egain_api_python/models/retrieverequest.py +47 -0
- egain_api_python/models/retrieveresponse.py +96 -0
- egain_api_python/models/role.py +26 -0
- egain_api_python/models/roletemplate.py +25 -0
- egain_api_python/models/schemas_answer.py +94 -0
- egain_api_python/models/schemas_customattribute.py +35 -0
- egain_api_python/models/schemas_link.py +27 -0
- egain_api_python/models/schemas_tag.py +21 -0
- egain_api_python/models/schemas_tagcategory.py +75 -0
- egain_api_python/models/schemas_taggroup.py +31 -0
- egain_api_python/models/schemas_tags.py +19 -0
- egain_api_python/models/schemas_wserrorcommon.py +17 -0
- egain_api_python/models/searchfilterattribute.py +61 -0
- egain_api_python/models/searchpriortoescalationop.py +108 -0
- egain_api_python/models/searchresult.py +101 -0
- egain_api_python/models/searchsuggestionop.py +93 -0
- egain_api_python/models/security.py +25 -0
- egain_api_python/models/selectuserprofileop.py +44 -0
- egain_api_python/models/sessioncontextvariable.py +17 -0
- egain_api_python/models/shorturl.py +32 -0
- egain_api_python/models/sortidname.py +10 -0
- egain_api_python/models/sortidnamedepartment.py +11 -0
- egain_api_python/models/stage.py +26 -0
- egain_api_python/models/startcustomerescalationop.py +66 -0
- egain_api_python/models/startescalationrequest.py +94 -0
- egain_api_python/models/startghsearchop.py +74 -0
- egain_api_python/models/startquestionandanswer.py +26 -0
- egain_api_python/models/stepghsearchop.py +62 -0
- egain_api_python/models/stringattributevalue.py +30 -0
- egain_api_python/models/structuredauthoringfields.py +33 -0
- egain_api_python/models/subscribearticleop.py +40 -0
- egain_api_python/models/suggestion.py +190 -0
- egain_api_python/models/suggestionadditionalattributes.py +11 -0
- egain_api_python/models/suggestionattachment.py +46 -0
- egain_api_python/models/suggestions.py +28 -0
- egain_api_python/models/tag.py +17 -0
- egain_api_python/models/tagcategoriesforinterest.py +22 -0
- egain_api_python/models/tagcategory.py +34 -0
- egain_api_python/models/taggroup.py +17 -0
- egain_api_python/models/taggroups.py +20 -0
- egain_api_python/models/tags.py +17 -0
- egain_api_python/models/topic.py +113 -0
- egain_api_python/models/topicadditionalattributes.py +20 -0
- egain_api_python/models/topicaisearchresult.py +67 -0
- egain_api_python/models/topicbreadcrumb.py +24 -0
- egain_api_python/models/topicresult.py +26 -0
- egain_api_python/models/topicsummary.py +31 -0
- egain_api_python/models/topictreenode.py +27 -0
- egain_api_python/models/topictreeresult.py +28 -0
- egain_api_python/models/unsubscribearticleop.py +55 -0
- egain_api_python/models/uploadattachmentop.py +36 -0
- egain_api_python/models/userdetails.py +44 -0
- egain_api_python/models/userprofile.py +33 -0
- egain_api_python/models/userprofiles.py +21 -0
- egain_api_python/models/userview.py +33 -0
- egain_api_python/models/validateimportcontent.py +58 -0
- egain_api_python/models/virtualcase.py +52 -0
- egain_api_python/models/workflow.py +21 -0
- egain_api_python/models/workflowmilestone.py +11 -0
- egain_api_python/models/wserrorcommon.py +17 -0
- egain_api_python/populararticles.py +287 -0
- egain_api_python/portal_article.py +4935 -0
- egain_api_python/portal_attachment.py +494 -0
- egain_api_python/portal_bookmark.py +707 -0
- egain_api_python/portal_sdk.py +88 -0
- egain_api_python/portal_suggestion.py +2283 -0
- egain_api_python/portal_topic.py +975 -0
- egain_api_python/portal_userdetails.py +211 -0
- egain_api_python/portal_userprofile.py +431 -0
- egain_api_python/py.typed +1 -0
- egain_api_python/retrieve.py +265 -0
- egain_api_python/sdk.py +216 -0
- egain_api_python/sdkconfiguration.py +50 -0
- egain_api_python/search.py +251 -0
- egain_api_python/types/__init__.py +21 -0
- egain_api_python/types/basemodel.py +39 -0
- egain_api_python/usermilestones.py +219 -0
- egain_api_python/utils/__init__.py +200 -0
- egain_api_python/utils/annotations.py +79 -0
- egain_api_python/utils/datetimes.py +23 -0
- egain_api_python/utils/enums.py +74 -0
- egain_api_python/utils/eventstreaming.py +248 -0
- egain_api_python/utils/forms.py +223 -0
- egain_api_python/utils/headers.py +136 -0
- egain_api_python/utils/logger.py +27 -0
- egain_api_python/utils/metadata.py +118 -0
- egain_api_python/utils/queryparams.py +205 -0
- egain_api_python/utils/requestbodies.py +66 -0
- egain_api_python/utils/retries.py +217 -0
- egain_api_python/utils/security.py +192 -0
- egain_api_python/utils/serializers.py +249 -0
- egain_api_python/utils/unmarshal_json_response.py +24 -0
- egain_api_python/utils/url.py +155 -0
- egain_api_python/utils/values.py +137 -0
- egain_api_python-0.1.1.dist-info/METADATA +827 -0
- egain_api_python-0.1.1.dist-info/RECORD +332 -0
- egain_api_python-0.1.1.dist-info/WHEEL +5 -0
- egain_api_python-0.1.1.dist-info/licenses/LICENSE +21 -0
- egain_api_python-0.1.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,253 @@
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
2
|
+
|
3
|
+
from .basesdk import BaseSDK
|
4
|
+
from egain_api_python import errors, models, utils
|
5
|
+
from egain_api_python._hooks import HookContext
|
6
|
+
from egain_api_python.types import OptionalNullable, UNSET
|
7
|
+
from egain_api_python.utils import get_security_from_env
|
8
|
+
from egain_api_python.utils.unmarshal_json_response import unmarshal_json_response
|
9
|
+
from typing import Any, Mapping, Optional
|
10
|
+
|
11
|
+
|
12
|
+
class Health(BaseSDK):
|
13
|
+
def get_health(
|
14
|
+
self,
|
15
|
+
*,
|
16
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
17
|
+
server_url: Optional[str] = None,
|
18
|
+
timeout_ms: Optional[int] = None,
|
19
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
20
|
+
) -> models.GetHealthResponse:
|
21
|
+
r"""Check service health status
|
22
|
+
|
23
|
+
# Service Health Check
|
24
|
+
|
25
|
+
## Overview
|
26
|
+
This API provides comprehensive health status information for the Import Content service. It's designed for infrastructure monitoring, load balancer health checks, and operational monitoring to ensure service availability and performance.
|
27
|
+
|
28
|
+
## Health Check Features
|
29
|
+
- **Service Status**: Overall service health (healthy/unhealthy)
|
30
|
+
- **Version Information**: Current API version and build details
|
31
|
+
|
32
|
+
## Monitoring Use Cases
|
33
|
+
- **Load Balancers**: Automatic health checks for traffic routing
|
34
|
+
- **Alerting Systems**: Automated notifications for service issues
|
35
|
+
|
36
|
+
## Health Status Values
|
37
|
+
- **Healthy**: Service is operating normally
|
38
|
+
- **Unhealthy**: Service is experiencing critical issues
|
39
|
+
- **Maintenance**: Service is under planned maintenance
|
40
|
+
|
41
|
+
## Response Components
|
42
|
+
- **Status**: Current health state
|
43
|
+
- **Timestamp**: When health check was performed
|
44
|
+
- **Version**: API version information
|
45
|
+
- **Uptime**: Service uptime since last restart
|
46
|
+
|
47
|
+
## Monitoring Best Practices
|
48
|
+
- **Check Frequency**: Monitor every 1-2 minutes for production
|
49
|
+
- **Response Time**: Track health check response times
|
50
|
+
|
51
|
+
## Permissions
|
52
|
+
| Actor | Permission |
|
53
|
+
| ------- | --------|
|
54
|
+
| System |<ul><li>No authentication required for basic health checks.</li><li>This endpoint is designed for infrastructure monitoring.</li><li>Rate limiting applies to prevent abuse.</li></ul>|
|
55
|
+
|
56
|
+
|
57
|
+
:param retries: Override the default retry configuration for this method
|
58
|
+
:param server_url: Override the default server URL for this method
|
59
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
60
|
+
:param http_headers: Additional headers to set or replace on requests.
|
61
|
+
"""
|
62
|
+
base_url = None
|
63
|
+
url_variables = None
|
64
|
+
if timeout_ms is None:
|
65
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
66
|
+
|
67
|
+
if server_url is not None:
|
68
|
+
base_url = server_url
|
69
|
+
else:
|
70
|
+
base_url = models.GET_HEALTH_OP_SERVERS[0]
|
71
|
+
url_variables = {
|
72
|
+
"API_DOMAIN": "api.egain.cloud",
|
73
|
+
}
|
74
|
+
req = self._build_request(
|
75
|
+
method="GET",
|
76
|
+
path="/import/content/health",
|
77
|
+
base_url=base_url,
|
78
|
+
url_variables=url_variables,
|
79
|
+
request=None,
|
80
|
+
request_body_required=False,
|
81
|
+
request_has_path_params=False,
|
82
|
+
request_has_query_params=True,
|
83
|
+
user_agent_header="user-agent",
|
84
|
+
accept_header_value="application/json",
|
85
|
+
http_headers=http_headers,
|
86
|
+
security=self.sdk_configuration.security,
|
87
|
+
timeout_ms=timeout_ms,
|
88
|
+
)
|
89
|
+
|
90
|
+
if retries == UNSET:
|
91
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
92
|
+
retries = self.sdk_configuration.retry_config
|
93
|
+
|
94
|
+
retry_config = None
|
95
|
+
if isinstance(retries, utils.RetryConfig):
|
96
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
97
|
+
|
98
|
+
http_res = self.do_request(
|
99
|
+
hook_ctx=HookContext(
|
100
|
+
config=self.sdk_configuration,
|
101
|
+
base_url=base_url or "",
|
102
|
+
operation_id="getHealth",
|
103
|
+
oauth2_scopes=[],
|
104
|
+
security_source=get_security_from_env(
|
105
|
+
self.sdk_configuration.security, models.Security
|
106
|
+
),
|
107
|
+
),
|
108
|
+
request=req,
|
109
|
+
error_status_codes=["4XX", "503", "5XX"],
|
110
|
+
retry_config=retry_config,
|
111
|
+
)
|
112
|
+
|
113
|
+
response_data: Any = None
|
114
|
+
if utils.match_response(http_res, "200", "application/json"):
|
115
|
+
return unmarshal_json_response(models.GetHealthResponse, http_res)
|
116
|
+
if utils.match_response(http_res, "503", "application/json"):
|
117
|
+
response_data = unmarshal_json_response(
|
118
|
+
errors.ServiceUnavailableErrorData, http_res
|
119
|
+
)
|
120
|
+
raise errors.ServiceUnavailableError(response_data, http_res)
|
121
|
+
if utils.match_response(http_res, "4XX", "*"):
|
122
|
+
http_res_text = utils.stream_to_text(http_res)
|
123
|
+
raise errors.EgainDefaultError(
|
124
|
+
"API error occurred", http_res, http_res_text
|
125
|
+
)
|
126
|
+
if utils.match_response(http_res, "5XX", "*"):
|
127
|
+
http_res_text = utils.stream_to_text(http_res)
|
128
|
+
raise errors.EgainDefaultError(
|
129
|
+
"API error occurred", http_res, http_res_text
|
130
|
+
)
|
131
|
+
|
132
|
+
raise errors.EgainDefaultError("Unexpected response received", http_res)
|
133
|
+
|
134
|
+
async def get_health_async(
|
135
|
+
self,
|
136
|
+
*,
|
137
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
138
|
+
server_url: Optional[str] = None,
|
139
|
+
timeout_ms: Optional[int] = None,
|
140
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
141
|
+
) -> models.GetHealthResponse:
|
142
|
+
r"""Check service health status
|
143
|
+
|
144
|
+
# Service Health Check
|
145
|
+
|
146
|
+
## Overview
|
147
|
+
This API provides comprehensive health status information for the Import Content service. It's designed for infrastructure monitoring, load balancer health checks, and operational monitoring to ensure service availability and performance.
|
148
|
+
|
149
|
+
## Health Check Features
|
150
|
+
- **Service Status**: Overall service health (healthy/unhealthy)
|
151
|
+
- **Version Information**: Current API version and build details
|
152
|
+
|
153
|
+
## Monitoring Use Cases
|
154
|
+
- **Load Balancers**: Automatic health checks for traffic routing
|
155
|
+
- **Alerting Systems**: Automated notifications for service issues
|
156
|
+
|
157
|
+
## Health Status Values
|
158
|
+
- **Healthy**: Service is operating normally
|
159
|
+
- **Unhealthy**: Service is experiencing critical issues
|
160
|
+
- **Maintenance**: Service is under planned maintenance
|
161
|
+
|
162
|
+
## Response Components
|
163
|
+
- **Status**: Current health state
|
164
|
+
- **Timestamp**: When health check was performed
|
165
|
+
- **Version**: API version information
|
166
|
+
- **Uptime**: Service uptime since last restart
|
167
|
+
|
168
|
+
## Monitoring Best Practices
|
169
|
+
- **Check Frequency**: Monitor every 1-2 minutes for production
|
170
|
+
- **Response Time**: Track health check response times
|
171
|
+
|
172
|
+
## Permissions
|
173
|
+
| Actor | Permission |
|
174
|
+
| ------- | --------|
|
175
|
+
| System |<ul><li>No authentication required for basic health checks.</li><li>This endpoint is designed for infrastructure monitoring.</li><li>Rate limiting applies to prevent abuse.</li></ul>|
|
176
|
+
|
177
|
+
|
178
|
+
:param retries: Override the default retry configuration for this method
|
179
|
+
:param server_url: Override the default server URL for this method
|
180
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
181
|
+
:param http_headers: Additional headers to set or replace on requests.
|
182
|
+
"""
|
183
|
+
base_url = None
|
184
|
+
url_variables = None
|
185
|
+
if timeout_ms is None:
|
186
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
187
|
+
|
188
|
+
if server_url is not None:
|
189
|
+
base_url = server_url
|
190
|
+
else:
|
191
|
+
base_url = models.GET_HEALTH_OP_SERVERS[0]
|
192
|
+
url_variables = {
|
193
|
+
"API_DOMAIN": "api.egain.cloud",
|
194
|
+
}
|
195
|
+
req = self._build_request_async(
|
196
|
+
method="GET",
|
197
|
+
path="/import/content/health",
|
198
|
+
base_url=base_url,
|
199
|
+
url_variables=url_variables,
|
200
|
+
request=None,
|
201
|
+
request_body_required=False,
|
202
|
+
request_has_path_params=False,
|
203
|
+
request_has_query_params=True,
|
204
|
+
user_agent_header="user-agent",
|
205
|
+
accept_header_value="application/json",
|
206
|
+
http_headers=http_headers,
|
207
|
+
security=self.sdk_configuration.security,
|
208
|
+
timeout_ms=timeout_ms,
|
209
|
+
)
|
210
|
+
|
211
|
+
if retries == UNSET:
|
212
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
213
|
+
retries = self.sdk_configuration.retry_config
|
214
|
+
|
215
|
+
retry_config = None
|
216
|
+
if isinstance(retries, utils.RetryConfig):
|
217
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
218
|
+
|
219
|
+
http_res = await self.do_request_async(
|
220
|
+
hook_ctx=HookContext(
|
221
|
+
config=self.sdk_configuration,
|
222
|
+
base_url=base_url or "",
|
223
|
+
operation_id="getHealth",
|
224
|
+
oauth2_scopes=[],
|
225
|
+
security_source=get_security_from_env(
|
226
|
+
self.sdk_configuration.security, models.Security
|
227
|
+
),
|
228
|
+
),
|
229
|
+
request=req,
|
230
|
+
error_status_codes=["4XX", "503", "5XX"],
|
231
|
+
retry_config=retry_config,
|
232
|
+
)
|
233
|
+
|
234
|
+
response_data: Any = None
|
235
|
+
if utils.match_response(http_res, "200", "application/json"):
|
236
|
+
return unmarshal_json_response(models.GetHealthResponse, http_res)
|
237
|
+
if utils.match_response(http_res, "503", "application/json"):
|
238
|
+
response_data = unmarshal_json_response(
|
239
|
+
errors.ServiceUnavailableErrorData, http_res
|
240
|
+
)
|
241
|
+
raise errors.ServiceUnavailableError(response_data, http_res)
|
242
|
+
if utils.match_response(http_res, "4XX", "*"):
|
243
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
244
|
+
raise errors.EgainDefaultError(
|
245
|
+
"API error occurred", http_res, http_res_text
|
246
|
+
)
|
247
|
+
if utils.match_response(http_res, "5XX", "*"):
|
248
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
249
|
+
raise errors.EgainDefaultError(
|
250
|
+
"API error occurred", http_res, http_res_text
|
251
|
+
)
|
252
|
+
|
253
|
+
raise errors.EgainDefaultError("Unexpected response received", http_res)
|
@@ -0,0 +1,125 @@
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
2
|
+
|
3
|
+
# pyright: reportReturnType = false
|
4
|
+
import asyncio
|
5
|
+
from typing_extensions import Protocol, runtime_checkable
|
6
|
+
import httpx
|
7
|
+
from typing import Any, Optional, Union
|
8
|
+
|
9
|
+
|
10
|
+
@runtime_checkable
|
11
|
+
class HttpClient(Protocol):
|
12
|
+
def send(
|
13
|
+
self,
|
14
|
+
request: httpx.Request,
|
15
|
+
*,
|
16
|
+
stream: bool = False,
|
17
|
+
auth: Union[
|
18
|
+
httpx._types.AuthTypes, httpx._client.UseClientDefault, None
|
19
|
+
] = httpx.USE_CLIENT_DEFAULT,
|
20
|
+
follow_redirects: Union[
|
21
|
+
bool, httpx._client.UseClientDefault
|
22
|
+
] = httpx.USE_CLIENT_DEFAULT,
|
23
|
+
) -> httpx.Response:
|
24
|
+
pass
|
25
|
+
|
26
|
+
def build_request(
|
27
|
+
self,
|
28
|
+
method: str,
|
29
|
+
url: httpx._types.URLTypes,
|
30
|
+
*,
|
31
|
+
content: Optional[httpx._types.RequestContent] = None,
|
32
|
+
data: Optional[httpx._types.RequestData] = None,
|
33
|
+
files: Optional[httpx._types.RequestFiles] = None,
|
34
|
+
json: Optional[Any] = None,
|
35
|
+
params: Optional[httpx._types.QueryParamTypes] = None,
|
36
|
+
headers: Optional[httpx._types.HeaderTypes] = None,
|
37
|
+
cookies: Optional[httpx._types.CookieTypes] = None,
|
38
|
+
timeout: Union[
|
39
|
+
httpx._types.TimeoutTypes, httpx._client.UseClientDefault
|
40
|
+
] = httpx.USE_CLIENT_DEFAULT,
|
41
|
+
extensions: Optional[httpx._types.RequestExtensions] = None,
|
42
|
+
) -> httpx.Request:
|
43
|
+
pass
|
44
|
+
|
45
|
+
def close(self) -> None:
|
46
|
+
pass
|
47
|
+
|
48
|
+
|
49
|
+
@runtime_checkable
|
50
|
+
class AsyncHttpClient(Protocol):
|
51
|
+
async def send(
|
52
|
+
self,
|
53
|
+
request: httpx.Request,
|
54
|
+
*,
|
55
|
+
stream: bool = False,
|
56
|
+
auth: Union[
|
57
|
+
httpx._types.AuthTypes, httpx._client.UseClientDefault, None
|
58
|
+
] = httpx.USE_CLIENT_DEFAULT,
|
59
|
+
follow_redirects: Union[
|
60
|
+
bool, httpx._client.UseClientDefault
|
61
|
+
] = httpx.USE_CLIENT_DEFAULT,
|
62
|
+
) -> httpx.Response:
|
63
|
+
pass
|
64
|
+
|
65
|
+
def build_request(
|
66
|
+
self,
|
67
|
+
method: str,
|
68
|
+
url: httpx._types.URLTypes,
|
69
|
+
*,
|
70
|
+
content: Optional[httpx._types.RequestContent] = None,
|
71
|
+
data: Optional[httpx._types.RequestData] = None,
|
72
|
+
files: Optional[httpx._types.RequestFiles] = None,
|
73
|
+
json: Optional[Any] = None,
|
74
|
+
params: Optional[httpx._types.QueryParamTypes] = None,
|
75
|
+
headers: Optional[httpx._types.HeaderTypes] = None,
|
76
|
+
cookies: Optional[httpx._types.CookieTypes] = None,
|
77
|
+
timeout: Union[
|
78
|
+
httpx._types.TimeoutTypes, httpx._client.UseClientDefault
|
79
|
+
] = httpx.USE_CLIENT_DEFAULT,
|
80
|
+
extensions: Optional[httpx._types.RequestExtensions] = None,
|
81
|
+
) -> httpx.Request:
|
82
|
+
pass
|
83
|
+
|
84
|
+
async def aclose(self) -> None:
|
85
|
+
pass
|
86
|
+
|
87
|
+
|
88
|
+
class ClientOwner(Protocol):
|
89
|
+
client: Union[HttpClient, None]
|
90
|
+
async_client: Union[AsyncHttpClient, None]
|
91
|
+
|
92
|
+
|
93
|
+
def close_clients(
|
94
|
+
owner: ClientOwner,
|
95
|
+
sync_client: Union[HttpClient, None],
|
96
|
+
sync_client_supplied: bool,
|
97
|
+
async_client: Union[AsyncHttpClient, None],
|
98
|
+
async_client_supplied: bool,
|
99
|
+
) -> None:
|
100
|
+
"""
|
101
|
+
A finalizer function that is meant to be used with weakref.finalize to close
|
102
|
+
httpx clients used by an SDK so that underlying resources can be garbage
|
103
|
+
collected.
|
104
|
+
"""
|
105
|
+
|
106
|
+
# Unset the client/async_client properties so there are no more references
|
107
|
+
# to them from the owning SDK instance and they can be reaped.
|
108
|
+
owner.client = None
|
109
|
+
owner.async_client = None
|
110
|
+
if sync_client is not None and not sync_client_supplied:
|
111
|
+
try:
|
112
|
+
sync_client.close()
|
113
|
+
except Exception:
|
114
|
+
pass
|
115
|
+
|
116
|
+
if async_client is not None and not async_client_supplied:
|
117
|
+
try:
|
118
|
+
loop = asyncio.get_running_loop()
|
119
|
+
asyncio.run_coroutine_threadsafe(async_client.aclose(), loop)
|
120
|
+
except RuntimeError:
|
121
|
+
try:
|
122
|
+
asyncio.run(async_client.aclose())
|
123
|
+
except RuntimeError:
|
124
|
+
# best effort
|
125
|
+
pass
|