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,975 @@
|
|
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, List, Mapping, Optional
|
10
|
+
|
11
|
+
|
12
|
+
class PortalTopic(BaseSDK):
|
13
|
+
def get_topic_breadcrumb_for_article(
|
14
|
+
self,
|
15
|
+
*,
|
16
|
+
accept_language: models.AcceptLanguage,
|
17
|
+
portal_id: str,
|
18
|
+
article_id: str,
|
19
|
+
language: models.MandatoryLanguageQueryParameter,
|
20
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
21
|
+
server_url: Optional[str] = None,
|
22
|
+
timeout_ms: Optional[int] = None,
|
23
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
24
|
+
) -> models.TopicBreadcrumb:
|
25
|
+
r"""Get Topic Breadcrumb for Article
|
26
|
+
|
27
|
+
## Overview
|
28
|
+
* Use this API to retrieve the topic breadcrumb for an article in a portal. A breadcrumb shows the hierarchical path from the root topic to the article's primary topic.
|
29
|
+
|
30
|
+
|
31
|
+
:param accept_language: The Language locale accepted by the client (used for locale specific fields in resource representation and in error responses).
|
32
|
+
:param portal_id: The ID of the portal being accessed.<br><br>A portal ID is composed of a 2-4 letter prefix, followed by a dash and 4-15 digits.
|
33
|
+
:param article_id: The ID of the Article.<br><br>An Article ID is composed of a 2-4 letter prefix followed by a dash and 4-15 digits.
|
34
|
+
:param language: The language used for fetching the details of a resource. Resources available in different languages may differ from each other.
|
35
|
+
:param retries: Override the default retry configuration for this method
|
36
|
+
:param server_url: Override the default server URL for this method
|
37
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
38
|
+
:param http_headers: Additional headers to set or replace on requests.
|
39
|
+
"""
|
40
|
+
base_url = None
|
41
|
+
url_variables = None
|
42
|
+
if timeout_ms is None:
|
43
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
44
|
+
|
45
|
+
if server_url is not None:
|
46
|
+
base_url = server_url
|
47
|
+
else:
|
48
|
+
base_url = self._get_url(base_url, url_variables)
|
49
|
+
|
50
|
+
request = models.GetTopicBreadcrumbForArticleRequest(
|
51
|
+
accept_language=accept_language,
|
52
|
+
portal_id=portal_id,
|
53
|
+
article_id=article_id,
|
54
|
+
language=language,
|
55
|
+
)
|
56
|
+
|
57
|
+
req = self._build_request(
|
58
|
+
method="GET",
|
59
|
+
path="/portals/{portalID}/articles/{articleID}/breadcrumb",
|
60
|
+
base_url=base_url,
|
61
|
+
url_variables=url_variables,
|
62
|
+
request=request,
|
63
|
+
request_body_required=False,
|
64
|
+
request_has_path_params=True,
|
65
|
+
request_has_query_params=True,
|
66
|
+
user_agent_header="user-agent",
|
67
|
+
accept_header_value="application/json",
|
68
|
+
http_headers=http_headers,
|
69
|
+
security=self.sdk_configuration.security,
|
70
|
+
timeout_ms=timeout_ms,
|
71
|
+
)
|
72
|
+
|
73
|
+
if retries == UNSET:
|
74
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
75
|
+
retries = self.sdk_configuration.retry_config
|
76
|
+
|
77
|
+
retry_config = None
|
78
|
+
if isinstance(retries, utils.RetryConfig):
|
79
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
80
|
+
|
81
|
+
http_res = self.do_request(
|
82
|
+
hook_ctx=HookContext(
|
83
|
+
config=self.sdk_configuration,
|
84
|
+
base_url=base_url or "",
|
85
|
+
operation_id="getTopicBreadcrumbForArticle",
|
86
|
+
oauth2_scopes=[],
|
87
|
+
security_source=get_security_from_env(
|
88
|
+
self.sdk_configuration.security, models.Security
|
89
|
+
),
|
90
|
+
),
|
91
|
+
request=req,
|
92
|
+
error_status_codes=["400", "401", "403", "404", "406", "4XX", "500", "5XX"],
|
93
|
+
retry_config=retry_config,
|
94
|
+
)
|
95
|
+
|
96
|
+
response_data: Any = None
|
97
|
+
if utils.match_response(http_res, "200", "application/json"):
|
98
|
+
return unmarshal_json_response(models.TopicBreadcrumb, http_res)
|
99
|
+
if utils.match_response(
|
100
|
+
http_res, ["400", "401", "403", "404", "406"], "application/json"
|
101
|
+
):
|
102
|
+
response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
|
103
|
+
raise errors.WSErrorCommon(response_data, http_res)
|
104
|
+
if utils.match_response(http_res, "500", "application/json"):
|
105
|
+
response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
|
106
|
+
raise errors.WSErrorCommon(response_data, http_res)
|
107
|
+
if utils.match_response(http_res, "4XX", "*"):
|
108
|
+
http_res_text = utils.stream_to_text(http_res)
|
109
|
+
raise errors.EgainDefaultError(
|
110
|
+
"API error occurred", http_res, http_res_text
|
111
|
+
)
|
112
|
+
if utils.match_response(http_res, "5XX", "*"):
|
113
|
+
http_res_text = utils.stream_to_text(http_res)
|
114
|
+
raise errors.EgainDefaultError(
|
115
|
+
"API error occurred", http_res, http_res_text
|
116
|
+
)
|
117
|
+
|
118
|
+
raise errors.EgainDefaultError("Unexpected response received", http_res)
|
119
|
+
|
120
|
+
async def get_topic_breadcrumb_for_article_async(
|
121
|
+
self,
|
122
|
+
*,
|
123
|
+
accept_language: models.AcceptLanguage,
|
124
|
+
portal_id: str,
|
125
|
+
article_id: str,
|
126
|
+
language: models.MandatoryLanguageQueryParameter,
|
127
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
128
|
+
server_url: Optional[str] = None,
|
129
|
+
timeout_ms: Optional[int] = None,
|
130
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
131
|
+
) -> models.TopicBreadcrumb:
|
132
|
+
r"""Get Topic Breadcrumb for Article
|
133
|
+
|
134
|
+
## Overview
|
135
|
+
* Use this API to retrieve the topic breadcrumb for an article in a portal. A breadcrumb shows the hierarchical path from the root topic to the article's primary topic.
|
136
|
+
|
137
|
+
|
138
|
+
:param accept_language: The Language locale accepted by the client (used for locale specific fields in resource representation and in error responses).
|
139
|
+
:param portal_id: The ID of the portal being accessed.<br><br>A portal ID is composed of a 2-4 letter prefix, followed by a dash and 4-15 digits.
|
140
|
+
:param article_id: The ID of the Article.<br><br>An Article ID is composed of a 2-4 letter prefix followed by a dash and 4-15 digits.
|
141
|
+
:param language: The language used for fetching the details of a resource. Resources available in different languages may differ from each other.
|
142
|
+
:param retries: Override the default retry configuration for this method
|
143
|
+
:param server_url: Override the default server URL for this method
|
144
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
145
|
+
:param http_headers: Additional headers to set or replace on requests.
|
146
|
+
"""
|
147
|
+
base_url = None
|
148
|
+
url_variables = None
|
149
|
+
if timeout_ms is None:
|
150
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
151
|
+
|
152
|
+
if server_url is not None:
|
153
|
+
base_url = server_url
|
154
|
+
else:
|
155
|
+
base_url = self._get_url(base_url, url_variables)
|
156
|
+
|
157
|
+
request = models.GetTopicBreadcrumbForArticleRequest(
|
158
|
+
accept_language=accept_language,
|
159
|
+
portal_id=portal_id,
|
160
|
+
article_id=article_id,
|
161
|
+
language=language,
|
162
|
+
)
|
163
|
+
|
164
|
+
req = self._build_request_async(
|
165
|
+
method="GET",
|
166
|
+
path="/portals/{portalID}/articles/{articleID}/breadcrumb",
|
167
|
+
base_url=base_url,
|
168
|
+
url_variables=url_variables,
|
169
|
+
request=request,
|
170
|
+
request_body_required=False,
|
171
|
+
request_has_path_params=True,
|
172
|
+
request_has_query_params=True,
|
173
|
+
user_agent_header="user-agent",
|
174
|
+
accept_header_value="application/json",
|
175
|
+
http_headers=http_headers,
|
176
|
+
security=self.sdk_configuration.security,
|
177
|
+
timeout_ms=timeout_ms,
|
178
|
+
)
|
179
|
+
|
180
|
+
if retries == UNSET:
|
181
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
182
|
+
retries = self.sdk_configuration.retry_config
|
183
|
+
|
184
|
+
retry_config = None
|
185
|
+
if isinstance(retries, utils.RetryConfig):
|
186
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
187
|
+
|
188
|
+
http_res = await self.do_request_async(
|
189
|
+
hook_ctx=HookContext(
|
190
|
+
config=self.sdk_configuration,
|
191
|
+
base_url=base_url or "",
|
192
|
+
operation_id="getTopicBreadcrumbForArticle",
|
193
|
+
oauth2_scopes=[],
|
194
|
+
security_source=get_security_from_env(
|
195
|
+
self.sdk_configuration.security, models.Security
|
196
|
+
),
|
197
|
+
),
|
198
|
+
request=req,
|
199
|
+
error_status_codes=["400", "401", "403", "404", "406", "4XX", "500", "5XX"],
|
200
|
+
retry_config=retry_config,
|
201
|
+
)
|
202
|
+
|
203
|
+
response_data: Any = None
|
204
|
+
if utils.match_response(http_res, "200", "application/json"):
|
205
|
+
return unmarshal_json_response(models.TopicBreadcrumb, http_res)
|
206
|
+
if utils.match_response(
|
207
|
+
http_res, ["400", "401", "403", "404", "406"], "application/json"
|
208
|
+
):
|
209
|
+
response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
|
210
|
+
raise errors.WSErrorCommon(response_data, http_res)
|
211
|
+
if utils.match_response(http_res, "500", "application/json"):
|
212
|
+
response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
|
213
|
+
raise errors.WSErrorCommon(response_data, http_res)
|
214
|
+
if utils.match_response(http_res, "4XX", "*"):
|
215
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
216
|
+
raise errors.EgainDefaultError(
|
217
|
+
"API error occurred", http_res, http_res_text
|
218
|
+
)
|
219
|
+
if utils.match_response(http_res, "5XX", "*"):
|
220
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
221
|
+
raise errors.EgainDefaultError(
|
222
|
+
"API error occurred", http_res, http_res_text
|
223
|
+
)
|
224
|
+
|
225
|
+
raise errors.EgainDefaultError("Unexpected response received", http_res)
|
226
|
+
|
227
|
+
def getchildtopics(
|
228
|
+
self,
|
229
|
+
*,
|
230
|
+
accept_language: models.AcceptLanguage,
|
231
|
+
portal_id: str,
|
232
|
+
topic_id: str,
|
233
|
+
search_profile_id: Optional[str] = None,
|
234
|
+
level: Optional[int] = None,
|
235
|
+
language: Optional[models.LanguageQueryParameter] = None,
|
236
|
+
topic_additional_attributes: Optional[
|
237
|
+
List[models.TopicAdditionalAttributes]
|
238
|
+
] = None,
|
239
|
+
custom_additional_attributes: Optional[str] = None,
|
240
|
+
pagenum: Optional[int] = 1,
|
241
|
+
pagesize: Optional[int] = 10,
|
242
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
243
|
+
server_url: Optional[str] = None,
|
244
|
+
timeout_ms: Optional[int] = None,
|
245
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
246
|
+
) -> Optional[models.TopicTreeResult]:
|
247
|
+
r"""Get Immediate Child Topics
|
248
|
+
|
249
|
+
## Overview
|
250
|
+
The Get Immediate Child Topics API retrieves details about a topic and it's immediate child topics. The <code>$level</code> attribute determines how deep the topic hierarchy should go, or how many child topics of a topic are returned in the response.
|
251
|
+
|
252
|
+
|
253
|
+
:param accept_language: The Language locale accepted by the client (used for locale specific fields in resource representation and in error responses).
|
254
|
+
:param portal_id: The ID of the portal being accessed.<br><br>A portal ID is composed of a 2-4 letter prefix, followed by a dash and 4-15 digits.
|
255
|
+
:param topic_id: The ID of a topic.<br><br>A topic ID is composed of a 2-4 letter prefix, followed by a dash and 4-15 digits.
|
256
|
+
:param search_profile_id: Search Profile ID
|
257
|
+
:param level: Depth of the topic hierarchy to be returned in the response.
|
258
|
+
:param language: The language that describes the details of a resource. Resources available in different languages may differ from each other.<li>If <code>lang</code> is not passed, then the portal's default language is used.</li>
|
259
|
+
:param topic_additional_attributes: The attributes of a topic to be returned *in addition to* the default list of attributes, listed below. Multiple additional attributes can be specified using a comma-separated list. Passing 'all' returns all attributes. #### Default Attributes These topic attributes are always returned: | Name | Description | ---- | ----------- | id | The ID of the topic. | name | The name of the topic. | articleCountInTopic | Number of articles in this topic. | articleCountInTopicTree | Number of articles in this topic and all sub-topics. | createdBy.id | The ID of the user that created the topic. | createdDate | The date when the topic was created. | departmentId | ID of the department for which this topic belongs to. | topicHomeArticleId | The ID of the article used as the home page of this topic. | modifiedBy.id | The ID of the user that last modified the topic. | modifiedDate | The date when the topic was last modified on. | childCount | Total number of children sub-topis below the current topic | subTopicIds | Array with the list of sub-topics | parentTopicId | ID of the parent topic. -1 if it is the root topic.
|
260
|
+
:param custom_additional_attributes:
|
261
|
+
:param pagenum: Pagination parameter that specifies the page number of results to be returned. Used in conjunction with $pagesize.
|
262
|
+
:param pagesize: Pagination parameter that specifies the number of results per page. Used in conjunction with $pagenum.
|
263
|
+
:param retries: Override the default retry configuration for this method
|
264
|
+
:param server_url: Override the default server URL for this method
|
265
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
266
|
+
:param http_headers: Additional headers to set or replace on requests.
|
267
|
+
"""
|
268
|
+
base_url = None
|
269
|
+
url_variables = None
|
270
|
+
if timeout_ms is None:
|
271
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
272
|
+
|
273
|
+
if server_url is not None:
|
274
|
+
base_url = server_url
|
275
|
+
else:
|
276
|
+
base_url = self._get_url(base_url, url_variables)
|
277
|
+
|
278
|
+
request = models.GetchildtopicsRequest(
|
279
|
+
accept_language=accept_language,
|
280
|
+
portal_id=portal_id,
|
281
|
+
search_profile_id=search_profile_id,
|
282
|
+
topic_id=topic_id,
|
283
|
+
level=level,
|
284
|
+
language=language,
|
285
|
+
topic_additional_attributes=topic_additional_attributes,
|
286
|
+
custom_additional_attributes=custom_additional_attributes,
|
287
|
+
pagenum=pagenum,
|
288
|
+
pagesize=pagesize,
|
289
|
+
)
|
290
|
+
|
291
|
+
req = self._build_request(
|
292
|
+
method="GET",
|
293
|
+
path="/portals/{portalID}/topics/{topicID}",
|
294
|
+
base_url=base_url,
|
295
|
+
url_variables=url_variables,
|
296
|
+
request=request,
|
297
|
+
request_body_required=False,
|
298
|
+
request_has_path_params=True,
|
299
|
+
request_has_query_params=True,
|
300
|
+
user_agent_header="user-agent",
|
301
|
+
accept_header_value="application/json",
|
302
|
+
http_headers=http_headers,
|
303
|
+
security=self.sdk_configuration.security,
|
304
|
+
timeout_ms=timeout_ms,
|
305
|
+
)
|
306
|
+
|
307
|
+
if retries == UNSET:
|
308
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
309
|
+
retries = self.sdk_configuration.retry_config
|
310
|
+
|
311
|
+
retry_config = None
|
312
|
+
if isinstance(retries, utils.RetryConfig):
|
313
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
314
|
+
|
315
|
+
http_res = self.do_request(
|
316
|
+
hook_ctx=HookContext(
|
317
|
+
config=self.sdk_configuration,
|
318
|
+
base_url=base_url or "",
|
319
|
+
operation_id="getchildtopics",
|
320
|
+
oauth2_scopes=[],
|
321
|
+
security_source=get_security_from_env(
|
322
|
+
self.sdk_configuration.security, models.Security
|
323
|
+
),
|
324
|
+
),
|
325
|
+
request=req,
|
326
|
+
error_status_codes=["400", "401", "403", "404", "406", "4XX", "500", "5XX"],
|
327
|
+
retry_config=retry_config,
|
328
|
+
)
|
329
|
+
|
330
|
+
response_data: Any = None
|
331
|
+
if utils.match_response(http_res, "200", "application/json"):
|
332
|
+
return unmarshal_json_response(models.TopicTreeResult, http_res)
|
333
|
+
if utils.match_response(http_res, "204", "*"):
|
334
|
+
return None
|
335
|
+
if utils.match_response(
|
336
|
+
http_res, ["400", "401", "403", "404", "406"], "application/json"
|
337
|
+
):
|
338
|
+
response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
|
339
|
+
raise errors.WSErrorCommon(response_data, http_res)
|
340
|
+
if utils.match_response(http_res, "500", "application/json"):
|
341
|
+
response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
|
342
|
+
raise errors.WSErrorCommon(response_data, http_res)
|
343
|
+
if utils.match_response(http_res, "4XX", "*"):
|
344
|
+
http_res_text = utils.stream_to_text(http_res)
|
345
|
+
raise errors.EgainDefaultError(
|
346
|
+
"API error occurred", http_res, http_res_text
|
347
|
+
)
|
348
|
+
if utils.match_response(http_res, "5XX", "*"):
|
349
|
+
http_res_text = utils.stream_to_text(http_res)
|
350
|
+
raise errors.EgainDefaultError(
|
351
|
+
"API error occurred", http_res, http_res_text
|
352
|
+
)
|
353
|
+
|
354
|
+
raise errors.EgainDefaultError("Unexpected response received", http_res)
|
355
|
+
|
356
|
+
async def getchildtopics_async(
|
357
|
+
self,
|
358
|
+
*,
|
359
|
+
accept_language: models.AcceptLanguage,
|
360
|
+
portal_id: str,
|
361
|
+
topic_id: str,
|
362
|
+
search_profile_id: Optional[str] = None,
|
363
|
+
level: Optional[int] = None,
|
364
|
+
language: Optional[models.LanguageQueryParameter] = None,
|
365
|
+
topic_additional_attributes: Optional[
|
366
|
+
List[models.TopicAdditionalAttributes]
|
367
|
+
] = None,
|
368
|
+
custom_additional_attributes: Optional[str] = None,
|
369
|
+
pagenum: Optional[int] = 1,
|
370
|
+
pagesize: Optional[int] = 10,
|
371
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
372
|
+
server_url: Optional[str] = None,
|
373
|
+
timeout_ms: Optional[int] = None,
|
374
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
375
|
+
) -> Optional[models.TopicTreeResult]:
|
376
|
+
r"""Get Immediate Child Topics
|
377
|
+
|
378
|
+
## Overview
|
379
|
+
The Get Immediate Child Topics API retrieves details about a topic and it's immediate child topics. The <code>$level</code> attribute determines how deep the topic hierarchy should go, or how many child topics of a topic are returned in the response.
|
380
|
+
|
381
|
+
|
382
|
+
:param accept_language: The Language locale accepted by the client (used for locale specific fields in resource representation and in error responses).
|
383
|
+
:param portal_id: The ID of the portal being accessed.<br><br>A portal ID is composed of a 2-4 letter prefix, followed by a dash and 4-15 digits.
|
384
|
+
:param topic_id: The ID of a topic.<br><br>A topic ID is composed of a 2-4 letter prefix, followed by a dash and 4-15 digits.
|
385
|
+
:param search_profile_id: Search Profile ID
|
386
|
+
:param level: Depth of the topic hierarchy to be returned in the response.
|
387
|
+
:param language: The language that describes the details of a resource. Resources available in different languages may differ from each other.<li>If <code>lang</code> is not passed, then the portal's default language is used.</li>
|
388
|
+
:param topic_additional_attributes: The attributes of a topic to be returned *in addition to* the default list of attributes, listed below. Multiple additional attributes can be specified using a comma-separated list. Passing 'all' returns all attributes. #### Default Attributes These topic attributes are always returned: | Name | Description | ---- | ----------- | id | The ID of the topic. | name | The name of the topic. | articleCountInTopic | Number of articles in this topic. | articleCountInTopicTree | Number of articles in this topic and all sub-topics. | createdBy.id | The ID of the user that created the topic. | createdDate | The date when the topic was created. | departmentId | ID of the department for which this topic belongs to. | topicHomeArticleId | The ID of the article used as the home page of this topic. | modifiedBy.id | The ID of the user that last modified the topic. | modifiedDate | The date when the topic was last modified on. | childCount | Total number of children sub-topis below the current topic | subTopicIds | Array with the list of sub-topics | parentTopicId | ID of the parent topic. -1 if it is the root topic.
|
389
|
+
:param custom_additional_attributes:
|
390
|
+
:param pagenum: Pagination parameter that specifies the page number of results to be returned. Used in conjunction with $pagesize.
|
391
|
+
:param pagesize: Pagination parameter that specifies the number of results per page. Used in conjunction with $pagenum.
|
392
|
+
:param retries: Override the default retry configuration for this method
|
393
|
+
:param server_url: Override the default server URL for this method
|
394
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
395
|
+
:param http_headers: Additional headers to set or replace on requests.
|
396
|
+
"""
|
397
|
+
base_url = None
|
398
|
+
url_variables = None
|
399
|
+
if timeout_ms is None:
|
400
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
401
|
+
|
402
|
+
if server_url is not None:
|
403
|
+
base_url = server_url
|
404
|
+
else:
|
405
|
+
base_url = self._get_url(base_url, url_variables)
|
406
|
+
|
407
|
+
request = models.GetchildtopicsRequest(
|
408
|
+
accept_language=accept_language,
|
409
|
+
portal_id=portal_id,
|
410
|
+
search_profile_id=search_profile_id,
|
411
|
+
topic_id=topic_id,
|
412
|
+
level=level,
|
413
|
+
language=language,
|
414
|
+
topic_additional_attributes=topic_additional_attributes,
|
415
|
+
custom_additional_attributes=custom_additional_attributes,
|
416
|
+
pagenum=pagenum,
|
417
|
+
pagesize=pagesize,
|
418
|
+
)
|
419
|
+
|
420
|
+
req = self._build_request_async(
|
421
|
+
method="GET",
|
422
|
+
path="/portals/{portalID}/topics/{topicID}",
|
423
|
+
base_url=base_url,
|
424
|
+
url_variables=url_variables,
|
425
|
+
request=request,
|
426
|
+
request_body_required=False,
|
427
|
+
request_has_path_params=True,
|
428
|
+
request_has_query_params=True,
|
429
|
+
user_agent_header="user-agent",
|
430
|
+
accept_header_value="application/json",
|
431
|
+
http_headers=http_headers,
|
432
|
+
security=self.sdk_configuration.security,
|
433
|
+
timeout_ms=timeout_ms,
|
434
|
+
)
|
435
|
+
|
436
|
+
if retries == UNSET:
|
437
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
438
|
+
retries = self.sdk_configuration.retry_config
|
439
|
+
|
440
|
+
retry_config = None
|
441
|
+
if isinstance(retries, utils.RetryConfig):
|
442
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
443
|
+
|
444
|
+
http_res = await self.do_request_async(
|
445
|
+
hook_ctx=HookContext(
|
446
|
+
config=self.sdk_configuration,
|
447
|
+
base_url=base_url or "",
|
448
|
+
operation_id="getchildtopics",
|
449
|
+
oauth2_scopes=[],
|
450
|
+
security_source=get_security_from_env(
|
451
|
+
self.sdk_configuration.security, models.Security
|
452
|
+
),
|
453
|
+
),
|
454
|
+
request=req,
|
455
|
+
error_status_codes=["400", "401", "403", "404", "406", "4XX", "500", "5XX"],
|
456
|
+
retry_config=retry_config,
|
457
|
+
)
|
458
|
+
|
459
|
+
response_data: Any = None
|
460
|
+
if utils.match_response(http_res, "200", "application/json"):
|
461
|
+
return unmarshal_json_response(models.TopicTreeResult, http_res)
|
462
|
+
if utils.match_response(http_res, "204", "*"):
|
463
|
+
return None
|
464
|
+
if utils.match_response(
|
465
|
+
http_res, ["400", "401", "403", "404", "406"], "application/json"
|
466
|
+
):
|
467
|
+
response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
|
468
|
+
raise errors.WSErrorCommon(response_data, http_res)
|
469
|
+
if utils.match_response(http_res, "500", "application/json"):
|
470
|
+
response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
|
471
|
+
raise errors.WSErrorCommon(response_data, http_res)
|
472
|
+
if utils.match_response(http_res, "4XX", "*"):
|
473
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
474
|
+
raise errors.EgainDefaultError(
|
475
|
+
"API error occurred", http_res, http_res_text
|
476
|
+
)
|
477
|
+
if utils.match_response(http_res, "5XX", "*"):
|
478
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
479
|
+
raise errors.EgainDefaultError(
|
480
|
+
"API error occurred", http_res, http_res_text
|
481
|
+
)
|
482
|
+
|
483
|
+
raise errors.EgainDefaultError("Unexpected response received", http_res)
|
484
|
+
|
485
|
+
def getancestortopics(
|
486
|
+
self,
|
487
|
+
*,
|
488
|
+
accept_language: models.AcceptLanguage,
|
489
|
+
portal_id: str,
|
490
|
+
topic_id: str,
|
491
|
+
language: Optional[models.LanguageQueryParameter] = None,
|
492
|
+
topic_additional_attributes: Optional[
|
493
|
+
List[models.TopicAdditionalAttributes]
|
494
|
+
] = None,
|
495
|
+
custom_additional_attributes: Optional[str] = None,
|
496
|
+
pagenum: Optional[int] = 1,
|
497
|
+
pagesize: Optional[int] = 10,
|
498
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
499
|
+
server_url: Optional[str] = None,
|
500
|
+
timeout_ms: Optional[int] = None,
|
501
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
502
|
+
) -> Optional[models.TopicResult]:
|
503
|
+
r"""Get All Ancestor Topics
|
504
|
+
|
505
|
+
## Overview
|
506
|
+
The Get All Ancestor Topics API retrieves the hierarchy from the root topic down to the given topic.
|
507
|
+
|
508
|
+
|
509
|
+
:param accept_language: The Language locale accepted by the client (used for locale specific fields in resource representation and in error responses).
|
510
|
+
:param portal_id: The ID of the portal being accessed.<br><br>A portal ID is composed of a 2-4 letter prefix, followed by a dash and 4-15 digits.
|
511
|
+
:param topic_id: The ID of a topic.<br><br>A topic ID is composed of a 2-4 letter prefix, followed by a dash and 4-15 digits.
|
512
|
+
:param language: The language that describes the details of a resource. Resources available in different languages may differ from each other.<li>If <code>lang</code> is not passed, then the portal's default language is used.</li>
|
513
|
+
:param topic_additional_attributes: The attributes of a topic to be returned *in addition to* the default list of attributes, listed below. Multiple additional attributes can be specified using a comma-separated list. Passing 'all' returns all attributes. #### Default Attributes These topic attributes are always returned: | Name | Description | ---- | ----------- | id | The ID of the topic. | name | The name of the topic. | articleCountInTopic | Number of articles in this topic. | articleCountInTopicTree | Number of articles in this topic and all sub-topics. | createdBy.id | The ID of the user that created the topic. | createdDate | The date when the topic was created. | departmentId | ID of the department for which this topic belongs to. | topicHomeArticleId | The ID of the article used as the home page of this topic. | modifiedBy.id | The ID of the user that last modified the topic. | modifiedDate | The date when the topic was last modified on. | childCount | Total number of children sub-topis below the current topic | subTopicIds | Array with the list of sub-topics | parentTopicId | ID of the parent topic. -1 if it is the root topic.
|
514
|
+
:param custom_additional_attributes:
|
515
|
+
:param pagenum: Pagination parameter that specifies the page number of results to be returned. Used in conjunction with $pagesize.
|
516
|
+
:param pagesize: Pagination parameter that specifies the number of results per page. Used in conjunction with $pagenum.
|
517
|
+
:param retries: Override the default retry configuration for this method
|
518
|
+
:param server_url: Override the default server URL for this method
|
519
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
520
|
+
:param http_headers: Additional headers to set or replace on requests.
|
521
|
+
"""
|
522
|
+
base_url = None
|
523
|
+
url_variables = None
|
524
|
+
if timeout_ms is None:
|
525
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
526
|
+
|
527
|
+
if server_url is not None:
|
528
|
+
base_url = server_url
|
529
|
+
else:
|
530
|
+
base_url = self._get_url(base_url, url_variables)
|
531
|
+
|
532
|
+
request = models.GetancestortopicsRequest(
|
533
|
+
accept_language=accept_language,
|
534
|
+
portal_id=portal_id,
|
535
|
+
topic_id=topic_id,
|
536
|
+
language=language,
|
537
|
+
topic_additional_attributes=topic_additional_attributes,
|
538
|
+
custom_additional_attributes=custom_additional_attributes,
|
539
|
+
pagenum=pagenum,
|
540
|
+
pagesize=pagesize,
|
541
|
+
)
|
542
|
+
|
543
|
+
req = self._build_request(
|
544
|
+
method="GET",
|
545
|
+
path="/portals/{portalID}/topics/{topicID}/parents",
|
546
|
+
base_url=base_url,
|
547
|
+
url_variables=url_variables,
|
548
|
+
request=request,
|
549
|
+
request_body_required=False,
|
550
|
+
request_has_path_params=True,
|
551
|
+
request_has_query_params=True,
|
552
|
+
user_agent_header="user-agent",
|
553
|
+
accept_header_value="application/json",
|
554
|
+
http_headers=http_headers,
|
555
|
+
security=self.sdk_configuration.security,
|
556
|
+
timeout_ms=timeout_ms,
|
557
|
+
)
|
558
|
+
|
559
|
+
if retries == UNSET:
|
560
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
561
|
+
retries = self.sdk_configuration.retry_config
|
562
|
+
|
563
|
+
retry_config = None
|
564
|
+
if isinstance(retries, utils.RetryConfig):
|
565
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
566
|
+
|
567
|
+
http_res = self.do_request(
|
568
|
+
hook_ctx=HookContext(
|
569
|
+
config=self.sdk_configuration,
|
570
|
+
base_url=base_url or "",
|
571
|
+
operation_id="getancestortopics",
|
572
|
+
oauth2_scopes=[],
|
573
|
+
security_source=get_security_from_env(
|
574
|
+
self.sdk_configuration.security, models.Security
|
575
|
+
),
|
576
|
+
),
|
577
|
+
request=req,
|
578
|
+
error_status_codes=["400", "401", "403", "404", "406", "4XX", "500", "5XX"],
|
579
|
+
retry_config=retry_config,
|
580
|
+
)
|
581
|
+
|
582
|
+
response_data: Any = None
|
583
|
+
if utils.match_response(http_res, "200", "application/json"):
|
584
|
+
return unmarshal_json_response(models.TopicResult, http_res)
|
585
|
+
if utils.match_response(http_res, "204", "*"):
|
586
|
+
return None
|
587
|
+
if utils.match_response(
|
588
|
+
http_res, ["400", "401", "403", "404", "406"], "application/json"
|
589
|
+
):
|
590
|
+
response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
|
591
|
+
raise errors.WSErrorCommon(response_data, http_res)
|
592
|
+
if utils.match_response(http_res, "500", "application/json"):
|
593
|
+
response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
|
594
|
+
raise errors.WSErrorCommon(response_data, http_res)
|
595
|
+
if utils.match_response(http_res, "4XX", "*"):
|
596
|
+
http_res_text = utils.stream_to_text(http_res)
|
597
|
+
raise errors.EgainDefaultError(
|
598
|
+
"API error occurred", http_res, http_res_text
|
599
|
+
)
|
600
|
+
if utils.match_response(http_res, "5XX", "*"):
|
601
|
+
http_res_text = utils.stream_to_text(http_res)
|
602
|
+
raise errors.EgainDefaultError(
|
603
|
+
"API error occurred", http_res, http_res_text
|
604
|
+
)
|
605
|
+
|
606
|
+
raise errors.EgainDefaultError("Unexpected response received", http_res)
|
607
|
+
|
608
|
+
async def getancestortopics_async(
|
609
|
+
self,
|
610
|
+
*,
|
611
|
+
accept_language: models.AcceptLanguage,
|
612
|
+
portal_id: str,
|
613
|
+
topic_id: str,
|
614
|
+
language: Optional[models.LanguageQueryParameter] = None,
|
615
|
+
topic_additional_attributes: Optional[
|
616
|
+
List[models.TopicAdditionalAttributes]
|
617
|
+
] = None,
|
618
|
+
custom_additional_attributes: Optional[str] = None,
|
619
|
+
pagenum: Optional[int] = 1,
|
620
|
+
pagesize: Optional[int] = 10,
|
621
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
622
|
+
server_url: Optional[str] = None,
|
623
|
+
timeout_ms: Optional[int] = None,
|
624
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
625
|
+
) -> Optional[models.TopicResult]:
|
626
|
+
r"""Get All Ancestor Topics
|
627
|
+
|
628
|
+
## Overview
|
629
|
+
The Get All Ancestor Topics API retrieves the hierarchy from the root topic down to the given topic.
|
630
|
+
|
631
|
+
|
632
|
+
:param accept_language: The Language locale accepted by the client (used for locale specific fields in resource representation and in error responses).
|
633
|
+
:param portal_id: The ID of the portal being accessed.<br><br>A portal ID is composed of a 2-4 letter prefix, followed by a dash and 4-15 digits.
|
634
|
+
:param topic_id: The ID of a topic.<br><br>A topic ID is composed of a 2-4 letter prefix, followed by a dash and 4-15 digits.
|
635
|
+
:param language: The language that describes the details of a resource. Resources available in different languages may differ from each other.<li>If <code>lang</code> is not passed, then the portal's default language is used.</li>
|
636
|
+
:param topic_additional_attributes: The attributes of a topic to be returned *in addition to* the default list of attributes, listed below. Multiple additional attributes can be specified using a comma-separated list. Passing 'all' returns all attributes. #### Default Attributes These topic attributes are always returned: | Name | Description | ---- | ----------- | id | The ID of the topic. | name | The name of the topic. | articleCountInTopic | Number of articles in this topic. | articleCountInTopicTree | Number of articles in this topic and all sub-topics. | createdBy.id | The ID of the user that created the topic. | createdDate | The date when the topic was created. | departmentId | ID of the department for which this topic belongs to. | topicHomeArticleId | The ID of the article used as the home page of this topic. | modifiedBy.id | The ID of the user that last modified the topic. | modifiedDate | The date when the topic was last modified on. | childCount | Total number of children sub-topis below the current topic | subTopicIds | Array with the list of sub-topics | parentTopicId | ID of the parent topic. -1 if it is the root topic.
|
637
|
+
:param custom_additional_attributes:
|
638
|
+
:param pagenum: Pagination parameter that specifies the page number of results to be returned. Used in conjunction with $pagesize.
|
639
|
+
:param pagesize: Pagination parameter that specifies the number of results per page. Used in conjunction with $pagenum.
|
640
|
+
:param retries: Override the default retry configuration for this method
|
641
|
+
:param server_url: Override the default server URL for this method
|
642
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
643
|
+
:param http_headers: Additional headers to set or replace on requests.
|
644
|
+
"""
|
645
|
+
base_url = None
|
646
|
+
url_variables = None
|
647
|
+
if timeout_ms is None:
|
648
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
649
|
+
|
650
|
+
if server_url is not None:
|
651
|
+
base_url = server_url
|
652
|
+
else:
|
653
|
+
base_url = self._get_url(base_url, url_variables)
|
654
|
+
|
655
|
+
request = models.GetancestortopicsRequest(
|
656
|
+
accept_language=accept_language,
|
657
|
+
portal_id=portal_id,
|
658
|
+
topic_id=topic_id,
|
659
|
+
language=language,
|
660
|
+
topic_additional_attributes=topic_additional_attributes,
|
661
|
+
custom_additional_attributes=custom_additional_attributes,
|
662
|
+
pagenum=pagenum,
|
663
|
+
pagesize=pagesize,
|
664
|
+
)
|
665
|
+
|
666
|
+
req = self._build_request_async(
|
667
|
+
method="GET",
|
668
|
+
path="/portals/{portalID}/topics/{topicID}/parents",
|
669
|
+
base_url=base_url,
|
670
|
+
url_variables=url_variables,
|
671
|
+
request=request,
|
672
|
+
request_body_required=False,
|
673
|
+
request_has_path_params=True,
|
674
|
+
request_has_query_params=True,
|
675
|
+
user_agent_header="user-agent",
|
676
|
+
accept_header_value="application/json",
|
677
|
+
http_headers=http_headers,
|
678
|
+
security=self.sdk_configuration.security,
|
679
|
+
timeout_ms=timeout_ms,
|
680
|
+
)
|
681
|
+
|
682
|
+
if retries == UNSET:
|
683
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
684
|
+
retries = self.sdk_configuration.retry_config
|
685
|
+
|
686
|
+
retry_config = None
|
687
|
+
if isinstance(retries, utils.RetryConfig):
|
688
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
689
|
+
|
690
|
+
http_res = await self.do_request_async(
|
691
|
+
hook_ctx=HookContext(
|
692
|
+
config=self.sdk_configuration,
|
693
|
+
base_url=base_url or "",
|
694
|
+
operation_id="getancestortopics",
|
695
|
+
oauth2_scopes=[],
|
696
|
+
security_source=get_security_from_env(
|
697
|
+
self.sdk_configuration.security, models.Security
|
698
|
+
),
|
699
|
+
),
|
700
|
+
request=req,
|
701
|
+
error_status_codes=["400", "401", "403", "404", "406", "4XX", "500", "5XX"],
|
702
|
+
retry_config=retry_config,
|
703
|
+
)
|
704
|
+
|
705
|
+
response_data: Any = None
|
706
|
+
if utils.match_response(http_res, "200", "application/json"):
|
707
|
+
return unmarshal_json_response(models.TopicResult, http_res)
|
708
|
+
if utils.match_response(http_res, "204", "*"):
|
709
|
+
return None
|
710
|
+
if utils.match_response(
|
711
|
+
http_res, ["400", "401", "403", "404", "406"], "application/json"
|
712
|
+
):
|
713
|
+
response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
|
714
|
+
raise errors.WSErrorCommon(response_data, http_res)
|
715
|
+
if utils.match_response(http_res, "500", "application/json"):
|
716
|
+
response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
|
717
|
+
raise errors.WSErrorCommon(response_data, http_res)
|
718
|
+
if utils.match_response(http_res, "4XX", "*"):
|
719
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
720
|
+
raise errors.EgainDefaultError(
|
721
|
+
"API error occurred", http_res, http_res_text
|
722
|
+
)
|
723
|
+
if utils.match_response(http_res, "5XX", "*"):
|
724
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
725
|
+
raise errors.EgainDefaultError(
|
726
|
+
"API error occurred", http_res, http_res_text
|
727
|
+
)
|
728
|
+
|
729
|
+
raise errors.EgainDefaultError("Unexpected response received", http_res)
|
730
|
+
|
731
|
+
def getalltopics(
|
732
|
+
self,
|
733
|
+
*,
|
734
|
+
accept_language: models.AcceptLanguage,
|
735
|
+
portal_id: str,
|
736
|
+
level: Optional[int] = None,
|
737
|
+
language: Optional[models.LanguageQueryParameter] = None,
|
738
|
+
topic_additional_attributes: Optional[
|
739
|
+
List[models.TopicAdditionalAttributes]
|
740
|
+
] = None,
|
741
|
+
custom_additional_attributes: Optional[str] = None,
|
742
|
+
pagenum: Optional[int] = 1,
|
743
|
+
pagesize: Optional[int] = 10,
|
744
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
745
|
+
server_url: Optional[str] = None,
|
746
|
+
timeout_ms: Optional[int] = None,
|
747
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
748
|
+
) -> Optional[models.TopicTreeResult]:
|
749
|
+
r"""Get All Topics
|
750
|
+
|
751
|
+
## Overview
|
752
|
+
The Get All Topics API retrieves the topic tree for a portal. The <code>$level</code> attribute determines how deep the topic hierarchy should go, or how many child topics of a topic are returned in the response.
|
753
|
+
|
754
|
+
|
755
|
+
:param accept_language: The Language locale accepted by the client (used for locale specific fields in resource representation and in error responses).
|
756
|
+
:param portal_id: The ID of the portal being accessed.<br><br>A portal ID is composed of a 2-4 letter prefix, followed by a dash and 4-15 digits.
|
757
|
+
:param level: Depth of the topic hierarchy to be returned in the response.
|
758
|
+
:param language: The language that describes the details of a resource. Resources available in different languages may differ from each other.<li>If <code>lang</code> is not passed, then the portal's default language is used.</li>
|
759
|
+
:param topic_additional_attributes: The attributes of a topic to be returned *in addition to* the default list of attributes, listed below. Multiple additional attributes can be specified using a comma-separated list. Passing 'all' returns all attributes. #### Default Attributes These topic attributes are always returned: | Name | Description | ---- | ----------- | id | The ID of the topic. | name | The name of the topic. | articleCountInTopic | Number of articles in this topic. | articleCountInTopicTree | Number of articles in this topic and all sub-topics. | createdBy.id | The ID of the user that created the topic. | createdDate | The date when the topic was created. | departmentId | ID of the department for which this topic belongs to. | topicHomeArticleId | The ID of the article used as the home page of this topic. | modifiedBy.id | The ID of the user that last modified the topic. | modifiedDate | The date when the topic was last modified on. | childCount | Total number of children sub-topis below the current topic | subTopicIds | Array with the list of sub-topics | parentTopicId | ID of the parent topic. -1 if it is the root topic.
|
760
|
+
:param custom_additional_attributes:
|
761
|
+
:param pagenum: Pagination parameter that specifies the page number of results to be returned. Used in conjunction with $pagesize.
|
762
|
+
:param pagesize: Pagination parameter that specifies the number of results per page. Used in conjunction with $pagenum.
|
763
|
+
:param retries: Override the default retry configuration for this method
|
764
|
+
:param server_url: Override the default server URL for this method
|
765
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
766
|
+
:param http_headers: Additional headers to set or replace on requests.
|
767
|
+
"""
|
768
|
+
base_url = None
|
769
|
+
url_variables = None
|
770
|
+
if timeout_ms is None:
|
771
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
772
|
+
|
773
|
+
if server_url is not None:
|
774
|
+
base_url = server_url
|
775
|
+
else:
|
776
|
+
base_url = self._get_url(base_url, url_variables)
|
777
|
+
|
778
|
+
request = models.GetalltopicsRequest(
|
779
|
+
accept_language=accept_language,
|
780
|
+
portal_id=portal_id,
|
781
|
+
level=level,
|
782
|
+
language=language,
|
783
|
+
topic_additional_attributes=topic_additional_attributes,
|
784
|
+
custom_additional_attributes=custom_additional_attributes,
|
785
|
+
pagenum=pagenum,
|
786
|
+
pagesize=pagesize,
|
787
|
+
)
|
788
|
+
|
789
|
+
req = self._build_request(
|
790
|
+
method="GET",
|
791
|
+
path="/portals/{portalID}/topics",
|
792
|
+
base_url=base_url,
|
793
|
+
url_variables=url_variables,
|
794
|
+
request=request,
|
795
|
+
request_body_required=False,
|
796
|
+
request_has_path_params=True,
|
797
|
+
request_has_query_params=True,
|
798
|
+
user_agent_header="user-agent",
|
799
|
+
accept_header_value="application/json",
|
800
|
+
http_headers=http_headers,
|
801
|
+
security=self.sdk_configuration.security,
|
802
|
+
timeout_ms=timeout_ms,
|
803
|
+
)
|
804
|
+
|
805
|
+
if retries == UNSET:
|
806
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
807
|
+
retries = self.sdk_configuration.retry_config
|
808
|
+
|
809
|
+
retry_config = None
|
810
|
+
if isinstance(retries, utils.RetryConfig):
|
811
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
812
|
+
|
813
|
+
http_res = self.do_request(
|
814
|
+
hook_ctx=HookContext(
|
815
|
+
config=self.sdk_configuration,
|
816
|
+
base_url=base_url or "",
|
817
|
+
operation_id="getalltopics",
|
818
|
+
oauth2_scopes=[],
|
819
|
+
security_source=get_security_from_env(
|
820
|
+
self.sdk_configuration.security, models.Security
|
821
|
+
),
|
822
|
+
),
|
823
|
+
request=req,
|
824
|
+
error_status_codes=["400", "401", "403", "404", "406", "4XX", "500", "5XX"],
|
825
|
+
retry_config=retry_config,
|
826
|
+
)
|
827
|
+
|
828
|
+
response_data: Any = None
|
829
|
+
if utils.match_response(http_res, "200", "application/json"):
|
830
|
+
return unmarshal_json_response(models.TopicTreeResult, http_res)
|
831
|
+
if utils.match_response(http_res, "204", "*"):
|
832
|
+
return None
|
833
|
+
if utils.match_response(
|
834
|
+
http_res, ["400", "401", "403", "404", "406"], "application/json"
|
835
|
+
):
|
836
|
+
response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
|
837
|
+
raise errors.WSErrorCommon(response_data, http_res)
|
838
|
+
if utils.match_response(http_res, "500", "application/json"):
|
839
|
+
response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
|
840
|
+
raise errors.WSErrorCommon(response_data, http_res)
|
841
|
+
if utils.match_response(http_res, "4XX", "*"):
|
842
|
+
http_res_text = utils.stream_to_text(http_res)
|
843
|
+
raise errors.EgainDefaultError(
|
844
|
+
"API error occurred", http_res, http_res_text
|
845
|
+
)
|
846
|
+
if utils.match_response(http_res, "5XX", "*"):
|
847
|
+
http_res_text = utils.stream_to_text(http_res)
|
848
|
+
raise errors.EgainDefaultError(
|
849
|
+
"API error occurred", http_res, http_res_text
|
850
|
+
)
|
851
|
+
|
852
|
+
raise errors.EgainDefaultError("Unexpected response received", http_res)
|
853
|
+
|
854
|
+
async def getalltopics_async(
|
855
|
+
self,
|
856
|
+
*,
|
857
|
+
accept_language: models.AcceptLanguage,
|
858
|
+
portal_id: str,
|
859
|
+
level: Optional[int] = None,
|
860
|
+
language: Optional[models.LanguageQueryParameter] = None,
|
861
|
+
topic_additional_attributes: Optional[
|
862
|
+
List[models.TopicAdditionalAttributes]
|
863
|
+
] = None,
|
864
|
+
custom_additional_attributes: Optional[str] = None,
|
865
|
+
pagenum: Optional[int] = 1,
|
866
|
+
pagesize: Optional[int] = 10,
|
867
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
868
|
+
server_url: Optional[str] = None,
|
869
|
+
timeout_ms: Optional[int] = None,
|
870
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
871
|
+
) -> Optional[models.TopicTreeResult]:
|
872
|
+
r"""Get All Topics
|
873
|
+
|
874
|
+
## Overview
|
875
|
+
The Get All Topics API retrieves the topic tree for a portal. The <code>$level</code> attribute determines how deep the topic hierarchy should go, or how many child topics of a topic are returned in the response.
|
876
|
+
|
877
|
+
|
878
|
+
:param accept_language: The Language locale accepted by the client (used for locale specific fields in resource representation and in error responses).
|
879
|
+
:param portal_id: The ID of the portal being accessed.<br><br>A portal ID is composed of a 2-4 letter prefix, followed by a dash and 4-15 digits.
|
880
|
+
:param level: Depth of the topic hierarchy to be returned in the response.
|
881
|
+
:param language: The language that describes the details of a resource. Resources available in different languages may differ from each other.<li>If <code>lang</code> is not passed, then the portal's default language is used.</li>
|
882
|
+
:param topic_additional_attributes: The attributes of a topic to be returned *in addition to* the default list of attributes, listed below. Multiple additional attributes can be specified using a comma-separated list. Passing 'all' returns all attributes. #### Default Attributes These topic attributes are always returned: | Name | Description | ---- | ----------- | id | The ID of the topic. | name | The name of the topic. | articleCountInTopic | Number of articles in this topic. | articleCountInTopicTree | Number of articles in this topic and all sub-topics. | createdBy.id | The ID of the user that created the topic. | createdDate | The date when the topic was created. | departmentId | ID of the department for which this topic belongs to. | topicHomeArticleId | The ID of the article used as the home page of this topic. | modifiedBy.id | The ID of the user that last modified the topic. | modifiedDate | The date when the topic was last modified on. | childCount | Total number of children sub-topis below the current topic | subTopicIds | Array with the list of sub-topics | parentTopicId | ID of the parent topic. -1 if it is the root topic.
|
883
|
+
:param custom_additional_attributes:
|
884
|
+
:param pagenum: Pagination parameter that specifies the page number of results to be returned. Used in conjunction with $pagesize.
|
885
|
+
:param pagesize: Pagination parameter that specifies the number of results per page. Used in conjunction with $pagenum.
|
886
|
+
:param retries: Override the default retry configuration for this method
|
887
|
+
:param server_url: Override the default server URL for this method
|
888
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
889
|
+
:param http_headers: Additional headers to set or replace on requests.
|
890
|
+
"""
|
891
|
+
base_url = None
|
892
|
+
url_variables = None
|
893
|
+
if timeout_ms is None:
|
894
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
895
|
+
|
896
|
+
if server_url is not None:
|
897
|
+
base_url = server_url
|
898
|
+
else:
|
899
|
+
base_url = self._get_url(base_url, url_variables)
|
900
|
+
|
901
|
+
request = models.GetalltopicsRequest(
|
902
|
+
accept_language=accept_language,
|
903
|
+
portal_id=portal_id,
|
904
|
+
level=level,
|
905
|
+
language=language,
|
906
|
+
topic_additional_attributes=topic_additional_attributes,
|
907
|
+
custom_additional_attributes=custom_additional_attributes,
|
908
|
+
pagenum=pagenum,
|
909
|
+
pagesize=pagesize,
|
910
|
+
)
|
911
|
+
|
912
|
+
req = self._build_request_async(
|
913
|
+
method="GET",
|
914
|
+
path="/portals/{portalID}/topics",
|
915
|
+
base_url=base_url,
|
916
|
+
url_variables=url_variables,
|
917
|
+
request=request,
|
918
|
+
request_body_required=False,
|
919
|
+
request_has_path_params=True,
|
920
|
+
request_has_query_params=True,
|
921
|
+
user_agent_header="user-agent",
|
922
|
+
accept_header_value="application/json",
|
923
|
+
http_headers=http_headers,
|
924
|
+
security=self.sdk_configuration.security,
|
925
|
+
timeout_ms=timeout_ms,
|
926
|
+
)
|
927
|
+
|
928
|
+
if retries == UNSET:
|
929
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
930
|
+
retries = self.sdk_configuration.retry_config
|
931
|
+
|
932
|
+
retry_config = None
|
933
|
+
if isinstance(retries, utils.RetryConfig):
|
934
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
935
|
+
|
936
|
+
http_res = await self.do_request_async(
|
937
|
+
hook_ctx=HookContext(
|
938
|
+
config=self.sdk_configuration,
|
939
|
+
base_url=base_url or "",
|
940
|
+
operation_id="getalltopics",
|
941
|
+
oauth2_scopes=[],
|
942
|
+
security_source=get_security_from_env(
|
943
|
+
self.sdk_configuration.security, models.Security
|
944
|
+
),
|
945
|
+
),
|
946
|
+
request=req,
|
947
|
+
error_status_codes=["400", "401", "403", "404", "406", "4XX", "500", "5XX"],
|
948
|
+
retry_config=retry_config,
|
949
|
+
)
|
950
|
+
|
951
|
+
response_data: Any = None
|
952
|
+
if utils.match_response(http_res, "200", "application/json"):
|
953
|
+
return unmarshal_json_response(models.TopicTreeResult, http_res)
|
954
|
+
if utils.match_response(http_res, "204", "*"):
|
955
|
+
return None
|
956
|
+
if utils.match_response(
|
957
|
+
http_res, ["400", "401", "403", "404", "406"], "application/json"
|
958
|
+
):
|
959
|
+
response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
|
960
|
+
raise errors.WSErrorCommon(response_data, http_res)
|
961
|
+
if utils.match_response(http_res, "500", "application/json"):
|
962
|
+
response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
|
963
|
+
raise errors.WSErrorCommon(response_data, http_res)
|
964
|
+
if utils.match_response(http_res, "4XX", "*"):
|
965
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
966
|
+
raise errors.EgainDefaultError(
|
967
|
+
"API error occurred", http_res, http_res_text
|
968
|
+
)
|
969
|
+
if utils.match_response(http_res, "5XX", "*"):
|
970
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
971
|
+
raise errors.EgainDefaultError(
|
972
|
+
"API error occurred", http_res, http_res_text
|
973
|
+
)
|
974
|
+
|
975
|
+
raise errors.EgainDefaultError("Unexpected response received", http_res)
|