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,707 @@
|
|
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 PortalBookmark(BaseSDK):
|
13
|
+
def addbookmark(
|
14
|
+
self,
|
15
|
+
*,
|
16
|
+
portal_id: str,
|
17
|
+
accept_language: models.AcceptLanguage,
|
18
|
+
resource_id: Optional[str] = None,
|
19
|
+
user_id: Optional[str] = None,
|
20
|
+
user_type: Optional[models.UserType] = None,
|
21
|
+
bookmark_name: Optional[str] = None,
|
22
|
+
resource_type: Optional[int] = None,
|
23
|
+
resource_name: Optional[str] = None,
|
24
|
+
external_content_id: Optional[str] = None,
|
25
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
26
|
+
server_url: Optional[str] = None,
|
27
|
+
timeout_ms: Optional[int] = None,
|
28
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
29
|
+
):
|
30
|
+
r"""Add a Bookmark
|
31
|
+
|
32
|
+
## Overview
|
33
|
+
* The Add a Bookmark API adds a bookmark from a portal.
|
34
|
+
|
35
|
+
|
36
|
+
: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.
|
37
|
+
:param accept_language: The Language locale accepted by the client (used for locale specific fields in resource representation and in error responses).
|
38
|
+
:param resource_id: The ID of the article or topic associated with this bookmark. A case ID or an article ID is composed of a 2-4 letter prefix, followed by a dash and 15 digits.<br><br>This attribute must be provided if <code>resourceType</code> is set to \"1 - Article\" or \"2 - Topic\".
|
39
|
+
:param user_id: The ID of the user associated with the bookmark.
|
40
|
+
:param user_type: The type of the user associated with the bookmark.
|
41
|
+
:param bookmark_name: The name of the bookmark.
|
42
|
+
:param resource_type: Determines the type of resource: <li>1 - Article</li> <li>2 - Topic</li> <li>3 - External Content</li>
|
43
|
+
:param resource_name: The name of the resource associated with the bookmark.<br><br>This attribute is only available for article and topic bookmarks.
|
44
|
+
:param external_content_id: The ID of the external content.<br><br>This attribute must be provided if <code>resourceType</code> is set to \"3 - External Content\".
|
45
|
+
:param retries: Override the default retry configuration for this method
|
46
|
+
:param server_url: Override the default server URL for this method
|
47
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
48
|
+
:param http_headers: Additional headers to set or replace on requests.
|
49
|
+
"""
|
50
|
+
base_url = None
|
51
|
+
url_variables = None
|
52
|
+
if timeout_ms is None:
|
53
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
54
|
+
|
55
|
+
if server_url is not None:
|
56
|
+
base_url = server_url
|
57
|
+
else:
|
58
|
+
base_url = self._get_url(base_url, url_variables)
|
59
|
+
|
60
|
+
request = models.AddbookmarkRequest(
|
61
|
+
portal_id=portal_id,
|
62
|
+
accept_language=accept_language,
|
63
|
+
create_bookmark=models.CreateBookmark(
|
64
|
+
resource_id=resource_id,
|
65
|
+
user_id=user_id,
|
66
|
+
user_type=user_type,
|
67
|
+
bookmark_name=bookmark_name,
|
68
|
+
resource_type=resource_type,
|
69
|
+
resource_name=resource_name,
|
70
|
+
external_content_id=external_content_id,
|
71
|
+
),
|
72
|
+
)
|
73
|
+
|
74
|
+
req = self._build_request(
|
75
|
+
method="POST",
|
76
|
+
path="/portals/{portalID}/bookmarks",
|
77
|
+
base_url=base_url,
|
78
|
+
url_variables=url_variables,
|
79
|
+
request=request,
|
80
|
+
request_body_required=True,
|
81
|
+
request_has_path_params=True,
|
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
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
88
|
+
request.create_bookmark, False, False, "json", models.CreateBookmark
|
89
|
+
),
|
90
|
+
timeout_ms=timeout_ms,
|
91
|
+
)
|
92
|
+
|
93
|
+
if retries == UNSET:
|
94
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
95
|
+
retries = self.sdk_configuration.retry_config
|
96
|
+
|
97
|
+
retry_config = None
|
98
|
+
if isinstance(retries, utils.RetryConfig):
|
99
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
100
|
+
|
101
|
+
http_res = self.do_request(
|
102
|
+
hook_ctx=HookContext(
|
103
|
+
config=self.sdk_configuration,
|
104
|
+
base_url=base_url or "",
|
105
|
+
operation_id="addbookmark",
|
106
|
+
oauth2_scopes=[],
|
107
|
+
security_source=get_security_from_env(
|
108
|
+
self.sdk_configuration.security, models.Security
|
109
|
+
),
|
110
|
+
),
|
111
|
+
request=req,
|
112
|
+
error_status_codes=[
|
113
|
+
"400",
|
114
|
+
"401",
|
115
|
+
"403",
|
116
|
+
"404",
|
117
|
+
"406",
|
118
|
+
"415",
|
119
|
+
"4XX",
|
120
|
+
"500",
|
121
|
+
"5XX",
|
122
|
+
],
|
123
|
+
retry_config=retry_config,
|
124
|
+
)
|
125
|
+
|
126
|
+
response_data: Any = None
|
127
|
+
if utils.match_response(http_res, "201", "*"):
|
128
|
+
return
|
129
|
+
if utils.match_response(
|
130
|
+
http_res, ["400", "401", "403", "404", "406"], "application/json"
|
131
|
+
):
|
132
|
+
response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
|
133
|
+
raise errors.WSErrorCommon(response_data, http_res)
|
134
|
+
if utils.match_response(http_res, "500", "application/json"):
|
135
|
+
response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
|
136
|
+
raise errors.WSErrorCommon(response_data, http_res)
|
137
|
+
if utils.match_response(http_res, ["415", "4XX"], "*"):
|
138
|
+
http_res_text = utils.stream_to_text(http_res)
|
139
|
+
raise errors.EgainDefaultError(
|
140
|
+
"API error occurred", http_res, http_res_text
|
141
|
+
)
|
142
|
+
if utils.match_response(http_res, "5XX", "*"):
|
143
|
+
http_res_text = utils.stream_to_text(http_res)
|
144
|
+
raise errors.EgainDefaultError(
|
145
|
+
"API error occurred", http_res, http_res_text
|
146
|
+
)
|
147
|
+
|
148
|
+
raise errors.EgainDefaultError("Unexpected response received", http_res)
|
149
|
+
|
150
|
+
async def addbookmark_async(
|
151
|
+
self,
|
152
|
+
*,
|
153
|
+
portal_id: str,
|
154
|
+
accept_language: models.AcceptLanguage,
|
155
|
+
resource_id: Optional[str] = None,
|
156
|
+
user_id: Optional[str] = None,
|
157
|
+
user_type: Optional[models.UserType] = None,
|
158
|
+
bookmark_name: Optional[str] = None,
|
159
|
+
resource_type: Optional[int] = None,
|
160
|
+
resource_name: Optional[str] = None,
|
161
|
+
external_content_id: Optional[str] = None,
|
162
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
163
|
+
server_url: Optional[str] = None,
|
164
|
+
timeout_ms: Optional[int] = None,
|
165
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
166
|
+
):
|
167
|
+
r"""Add a Bookmark
|
168
|
+
|
169
|
+
## Overview
|
170
|
+
* The Add a Bookmark API adds a bookmark from a portal.
|
171
|
+
|
172
|
+
|
173
|
+
: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.
|
174
|
+
:param accept_language: The Language locale accepted by the client (used for locale specific fields in resource representation and in error responses).
|
175
|
+
:param resource_id: The ID of the article or topic associated with this bookmark. A case ID or an article ID is composed of a 2-4 letter prefix, followed by a dash and 15 digits.<br><br>This attribute must be provided if <code>resourceType</code> is set to \"1 - Article\" or \"2 - Topic\".
|
176
|
+
:param user_id: The ID of the user associated with the bookmark.
|
177
|
+
:param user_type: The type of the user associated with the bookmark.
|
178
|
+
:param bookmark_name: The name of the bookmark.
|
179
|
+
:param resource_type: Determines the type of resource: <li>1 - Article</li> <li>2 - Topic</li> <li>3 - External Content</li>
|
180
|
+
:param resource_name: The name of the resource associated with the bookmark.<br><br>This attribute is only available for article and topic bookmarks.
|
181
|
+
:param external_content_id: The ID of the external content.<br><br>This attribute must be provided if <code>resourceType</code> is set to \"3 - External Content\".
|
182
|
+
:param retries: Override the default retry configuration for this method
|
183
|
+
:param server_url: Override the default server URL for this method
|
184
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
185
|
+
:param http_headers: Additional headers to set or replace on requests.
|
186
|
+
"""
|
187
|
+
base_url = None
|
188
|
+
url_variables = None
|
189
|
+
if timeout_ms is None:
|
190
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
191
|
+
|
192
|
+
if server_url is not None:
|
193
|
+
base_url = server_url
|
194
|
+
else:
|
195
|
+
base_url = self._get_url(base_url, url_variables)
|
196
|
+
|
197
|
+
request = models.AddbookmarkRequest(
|
198
|
+
portal_id=portal_id,
|
199
|
+
accept_language=accept_language,
|
200
|
+
create_bookmark=models.CreateBookmark(
|
201
|
+
resource_id=resource_id,
|
202
|
+
user_id=user_id,
|
203
|
+
user_type=user_type,
|
204
|
+
bookmark_name=bookmark_name,
|
205
|
+
resource_type=resource_type,
|
206
|
+
resource_name=resource_name,
|
207
|
+
external_content_id=external_content_id,
|
208
|
+
),
|
209
|
+
)
|
210
|
+
|
211
|
+
req = self._build_request_async(
|
212
|
+
method="POST",
|
213
|
+
path="/portals/{portalID}/bookmarks",
|
214
|
+
base_url=base_url,
|
215
|
+
url_variables=url_variables,
|
216
|
+
request=request,
|
217
|
+
request_body_required=True,
|
218
|
+
request_has_path_params=True,
|
219
|
+
request_has_query_params=True,
|
220
|
+
user_agent_header="user-agent",
|
221
|
+
accept_header_value="application/json",
|
222
|
+
http_headers=http_headers,
|
223
|
+
security=self.sdk_configuration.security,
|
224
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
225
|
+
request.create_bookmark, False, False, "json", models.CreateBookmark
|
226
|
+
),
|
227
|
+
timeout_ms=timeout_ms,
|
228
|
+
)
|
229
|
+
|
230
|
+
if retries == UNSET:
|
231
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
232
|
+
retries = self.sdk_configuration.retry_config
|
233
|
+
|
234
|
+
retry_config = None
|
235
|
+
if isinstance(retries, utils.RetryConfig):
|
236
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
237
|
+
|
238
|
+
http_res = await self.do_request_async(
|
239
|
+
hook_ctx=HookContext(
|
240
|
+
config=self.sdk_configuration,
|
241
|
+
base_url=base_url or "",
|
242
|
+
operation_id="addbookmark",
|
243
|
+
oauth2_scopes=[],
|
244
|
+
security_source=get_security_from_env(
|
245
|
+
self.sdk_configuration.security, models.Security
|
246
|
+
),
|
247
|
+
),
|
248
|
+
request=req,
|
249
|
+
error_status_codes=[
|
250
|
+
"400",
|
251
|
+
"401",
|
252
|
+
"403",
|
253
|
+
"404",
|
254
|
+
"406",
|
255
|
+
"415",
|
256
|
+
"4XX",
|
257
|
+
"500",
|
258
|
+
"5XX",
|
259
|
+
],
|
260
|
+
retry_config=retry_config,
|
261
|
+
)
|
262
|
+
|
263
|
+
response_data: Any = None
|
264
|
+
if utils.match_response(http_res, "201", "*"):
|
265
|
+
return
|
266
|
+
if utils.match_response(
|
267
|
+
http_res, ["400", "401", "403", "404", "406"], "application/json"
|
268
|
+
):
|
269
|
+
response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
|
270
|
+
raise errors.WSErrorCommon(response_data, http_res)
|
271
|
+
if utils.match_response(http_res, "500", "application/json"):
|
272
|
+
response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
|
273
|
+
raise errors.WSErrorCommon(response_data, http_res)
|
274
|
+
if utils.match_response(http_res, ["415", "4XX"], "*"):
|
275
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
276
|
+
raise errors.EgainDefaultError(
|
277
|
+
"API error occurred", http_res, http_res_text
|
278
|
+
)
|
279
|
+
if utils.match_response(http_res, "5XX", "*"):
|
280
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
281
|
+
raise errors.EgainDefaultError(
|
282
|
+
"API error occurred", http_res, http_res_text
|
283
|
+
)
|
284
|
+
|
285
|
+
raise errors.EgainDefaultError("Unexpected response received", http_res)
|
286
|
+
|
287
|
+
def getbookmark(
|
288
|
+
self,
|
289
|
+
*,
|
290
|
+
accept_language: models.AcceptLanguage,
|
291
|
+
portal_id: str,
|
292
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
293
|
+
server_url: Optional[str] = None,
|
294
|
+
timeout_ms: Optional[int] = None,
|
295
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
296
|
+
) -> Optional[models.BookmarkResult]:
|
297
|
+
r"""Get All Bookmarks for a Portal
|
298
|
+
|
299
|
+
## Overview
|
300
|
+
The Get All Bookmarks for a Portal API returns all bookmarks for a portal. Only the topic bookmarks that are available in the scope of the portal are returned.
|
301
|
+
|
302
|
+
## Permissions
|
303
|
+
* The user must have the __View Author Portal__ action to access the authoring view.
|
304
|
+
* The user must have the __View Staging Portal__ action to access the staging view.
|
305
|
+
|
306
|
+
|
307
|
+
:param accept_language: The Language locale accepted by the client (used for locale specific fields in resource representation and in error responses).
|
308
|
+
: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.
|
309
|
+
:param retries: Override the default retry configuration for this method
|
310
|
+
:param server_url: Override the default server URL for this method
|
311
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
312
|
+
:param http_headers: Additional headers to set or replace on requests.
|
313
|
+
"""
|
314
|
+
base_url = None
|
315
|
+
url_variables = None
|
316
|
+
if timeout_ms is None:
|
317
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
318
|
+
|
319
|
+
if server_url is not None:
|
320
|
+
base_url = server_url
|
321
|
+
else:
|
322
|
+
base_url = self._get_url(base_url, url_variables)
|
323
|
+
|
324
|
+
request = models.GetbookmarkRequest(
|
325
|
+
accept_language=accept_language,
|
326
|
+
portal_id=portal_id,
|
327
|
+
)
|
328
|
+
|
329
|
+
req = self._build_request(
|
330
|
+
method="GET",
|
331
|
+
path="/portals/{portalID}/bookmarks",
|
332
|
+
base_url=base_url,
|
333
|
+
url_variables=url_variables,
|
334
|
+
request=request,
|
335
|
+
request_body_required=False,
|
336
|
+
request_has_path_params=True,
|
337
|
+
request_has_query_params=True,
|
338
|
+
user_agent_header="user-agent",
|
339
|
+
accept_header_value="application/json",
|
340
|
+
http_headers=http_headers,
|
341
|
+
security=self.sdk_configuration.security,
|
342
|
+
timeout_ms=timeout_ms,
|
343
|
+
)
|
344
|
+
|
345
|
+
if retries == UNSET:
|
346
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
347
|
+
retries = self.sdk_configuration.retry_config
|
348
|
+
|
349
|
+
retry_config = None
|
350
|
+
if isinstance(retries, utils.RetryConfig):
|
351
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
352
|
+
|
353
|
+
http_res = self.do_request(
|
354
|
+
hook_ctx=HookContext(
|
355
|
+
config=self.sdk_configuration,
|
356
|
+
base_url=base_url or "",
|
357
|
+
operation_id="getbookmark",
|
358
|
+
oauth2_scopes=[],
|
359
|
+
security_source=get_security_from_env(
|
360
|
+
self.sdk_configuration.security, models.Security
|
361
|
+
),
|
362
|
+
),
|
363
|
+
request=req,
|
364
|
+
error_status_codes=["400", "401", "403", "404", "406", "4XX", "500", "5XX"],
|
365
|
+
retry_config=retry_config,
|
366
|
+
)
|
367
|
+
|
368
|
+
response_data: Any = None
|
369
|
+
if utils.match_response(http_res, "200", "application/json"):
|
370
|
+
return unmarshal_json_response(models.BookmarkResult, http_res)
|
371
|
+
if utils.match_response(http_res, "204", "*"):
|
372
|
+
return None
|
373
|
+
if utils.match_response(
|
374
|
+
http_res, ["400", "401", "403", "404", "406"], "application/json"
|
375
|
+
):
|
376
|
+
response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
|
377
|
+
raise errors.WSErrorCommon(response_data, http_res)
|
378
|
+
if utils.match_response(http_res, "500", "application/json"):
|
379
|
+
response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
|
380
|
+
raise errors.WSErrorCommon(response_data, http_res)
|
381
|
+
if utils.match_response(http_res, "4XX", "*"):
|
382
|
+
http_res_text = utils.stream_to_text(http_res)
|
383
|
+
raise errors.EgainDefaultError(
|
384
|
+
"API error occurred", http_res, http_res_text
|
385
|
+
)
|
386
|
+
if utils.match_response(http_res, "5XX", "*"):
|
387
|
+
http_res_text = utils.stream_to_text(http_res)
|
388
|
+
raise errors.EgainDefaultError(
|
389
|
+
"API error occurred", http_res, http_res_text
|
390
|
+
)
|
391
|
+
|
392
|
+
raise errors.EgainDefaultError("Unexpected response received", http_res)
|
393
|
+
|
394
|
+
async def getbookmark_async(
|
395
|
+
self,
|
396
|
+
*,
|
397
|
+
accept_language: models.AcceptLanguage,
|
398
|
+
portal_id: str,
|
399
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
400
|
+
server_url: Optional[str] = None,
|
401
|
+
timeout_ms: Optional[int] = None,
|
402
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
403
|
+
) -> Optional[models.BookmarkResult]:
|
404
|
+
r"""Get All Bookmarks for a Portal
|
405
|
+
|
406
|
+
## Overview
|
407
|
+
The Get All Bookmarks for a Portal API returns all bookmarks for a portal. Only the topic bookmarks that are available in the scope of the portal are returned.
|
408
|
+
|
409
|
+
## Permissions
|
410
|
+
* The user must have the __View Author Portal__ action to access the authoring view.
|
411
|
+
* The user must have the __View Staging Portal__ action to access the staging view.
|
412
|
+
|
413
|
+
|
414
|
+
:param accept_language: The Language locale accepted by the client (used for locale specific fields in resource representation and in error responses).
|
415
|
+
: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.
|
416
|
+
:param retries: Override the default retry configuration for this method
|
417
|
+
:param server_url: Override the default server URL for this method
|
418
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
419
|
+
:param http_headers: Additional headers to set or replace on requests.
|
420
|
+
"""
|
421
|
+
base_url = None
|
422
|
+
url_variables = None
|
423
|
+
if timeout_ms is None:
|
424
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
425
|
+
|
426
|
+
if server_url is not None:
|
427
|
+
base_url = server_url
|
428
|
+
else:
|
429
|
+
base_url = self._get_url(base_url, url_variables)
|
430
|
+
|
431
|
+
request = models.GetbookmarkRequest(
|
432
|
+
accept_language=accept_language,
|
433
|
+
portal_id=portal_id,
|
434
|
+
)
|
435
|
+
|
436
|
+
req = self._build_request_async(
|
437
|
+
method="GET",
|
438
|
+
path="/portals/{portalID}/bookmarks",
|
439
|
+
base_url=base_url,
|
440
|
+
url_variables=url_variables,
|
441
|
+
request=request,
|
442
|
+
request_body_required=False,
|
443
|
+
request_has_path_params=True,
|
444
|
+
request_has_query_params=True,
|
445
|
+
user_agent_header="user-agent",
|
446
|
+
accept_header_value="application/json",
|
447
|
+
http_headers=http_headers,
|
448
|
+
security=self.sdk_configuration.security,
|
449
|
+
timeout_ms=timeout_ms,
|
450
|
+
)
|
451
|
+
|
452
|
+
if retries == UNSET:
|
453
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
454
|
+
retries = self.sdk_configuration.retry_config
|
455
|
+
|
456
|
+
retry_config = None
|
457
|
+
if isinstance(retries, utils.RetryConfig):
|
458
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
459
|
+
|
460
|
+
http_res = await self.do_request_async(
|
461
|
+
hook_ctx=HookContext(
|
462
|
+
config=self.sdk_configuration,
|
463
|
+
base_url=base_url or "",
|
464
|
+
operation_id="getbookmark",
|
465
|
+
oauth2_scopes=[],
|
466
|
+
security_source=get_security_from_env(
|
467
|
+
self.sdk_configuration.security, models.Security
|
468
|
+
),
|
469
|
+
),
|
470
|
+
request=req,
|
471
|
+
error_status_codes=["400", "401", "403", "404", "406", "4XX", "500", "5XX"],
|
472
|
+
retry_config=retry_config,
|
473
|
+
)
|
474
|
+
|
475
|
+
response_data: Any = None
|
476
|
+
if utils.match_response(http_res, "200", "application/json"):
|
477
|
+
return unmarshal_json_response(models.BookmarkResult, http_res)
|
478
|
+
if utils.match_response(http_res, "204", "*"):
|
479
|
+
return None
|
480
|
+
if utils.match_response(
|
481
|
+
http_res, ["400", "401", "403", "404", "406"], "application/json"
|
482
|
+
):
|
483
|
+
response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
|
484
|
+
raise errors.WSErrorCommon(response_data, http_res)
|
485
|
+
if utils.match_response(http_res, "500", "application/json"):
|
486
|
+
response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
|
487
|
+
raise errors.WSErrorCommon(response_data, http_res)
|
488
|
+
if utils.match_response(http_res, "4XX", "*"):
|
489
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
490
|
+
raise errors.EgainDefaultError(
|
491
|
+
"API error occurred", http_res, http_res_text
|
492
|
+
)
|
493
|
+
if utils.match_response(http_res, "5XX", "*"):
|
494
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
495
|
+
raise errors.EgainDefaultError(
|
496
|
+
"API error occurred", http_res, http_res_text
|
497
|
+
)
|
498
|
+
|
499
|
+
raise errors.EgainDefaultError("Unexpected response received", http_res)
|
500
|
+
|
501
|
+
def deletebookmark(
|
502
|
+
self,
|
503
|
+
*,
|
504
|
+
accept_language: models.AcceptLanguage,
|
505
|
+
portal_id: str,
|
506
|
+
bookmark_id: str,
|
507
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
508
|
+
server_url: Optional[str] = None,
|
509
|
+
timeout_ms: Optional[int] = None,
|
510
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
511
|
+
):
|
512
|
+
r"""Delete a Bookmark
|
513
|
+
|
514
|
+
## Overview
|
515
|
+
The Delete a Bookmark API deletes a bookmark from a portal.
|
516
|
+
|
517
|
+
|
518
|
+
:param accept_language: The Language locale accepted by the client (used for locale specific fields in resource representation and in error responses).
|
519
|
+
: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.
|
520
|
+
:param bookmark_id: The ID of the bookmark.
|
521
|
+
:param retries: Override the default retry configuration for this method
|
522
|
+
:param server_url: Override the default server URL for this method
|
523
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
524
|
+
:param http_headers: Additional headers to set or replace on requests.
|
525
|
+
"""
|
526
|
+
base_url = None
|
527
|
+
url_variables = None
|
528
|
+
if timeout_ms is None:
|
529
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
530
|
+
|
531
|
+
if server_url is not None:
|
532
|
+
base_url = server_url
|
533
|
+
else:
|
534
|
+
base_url = self._get_url(base_url, url_variables)
|
535
|
+
|
536
|
+
request = models.DeletebookmarkRequest(
|
537
|
+
accept_language=accept_language,
|
538
|
+
portal_id=portal_id,
|
539
|
+
bookmark_id=bookmark_id,
|
540
|
+
)
|
541
|
+
|
542
|
+
req = self._build_request(
|
543
|
+
method="DELETE",
|
544
|
+
path="/portals/{portalID}/bookmarks/{bookmarkID}",
|
545
|
+
base_url=base_url,
|
546
|
+
url_variables=url_variables,
|
547
|
+
request=request,
|
548
|
+
request_body_required=False,
|
549
|
+
request_has_path_params=True,
|
550
|
+
request_has_query_params=True,
|
551
|
+
user_agent_header="user-agent",
|
552
|
+
accept_header_value="application/json",
|
553
|
+
http_headers=http_headers,
|
554
|
+
security=self.sdk_configuration.security,
|
555
|
+
timeout_ms=timeout_ms,
|
556
|
+
)
|
557
|
+
|
558
|
+
if retries == UNSET:
|
559
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
560
|
+
retries = self.sdk_configuration.retry_config
|
561
|
+
|
562
|
+
retry_config = None
|
563
|
+
if isinstance(retries, utils.RetryConfig):
|
564
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
565
|
+
|
566
|
+
http_res = self.do_request(
|
567
|
+
hook_ctx=HookContext(
|
568
|
+
config=self.sdk_configuration,
|
569
|
+
base_url=base_url or "",
|
570
|
+
operation_id="deletebookmark",
|
571
|
+
oauth2_scopes=[],
|
572
|
+
security_source=get_security_from_env(
|
573
|
+
self.sdk_configuration.security, models.Security
|
574
|
+
),
|
575
|
+
),
|
576
|
+
request=req,
|
577
|
+
error_status_codes=["400", "401", "403", "404", "406", "4XX", "500", "5XX"],
|
578
|
+
retry_config=retry_config,
|
579
|
+
)
|
580
|
+
|
581
|
+
response_data: Any = None
|
582
|
+
if utils.match_response(http_res, "204", "*"):
|
583
|
+
return
|
584
|
+
if utils.match_response(
|
585
|
+
http_res, ["400", "401", "403", "404", "406"], "application/json"
|
586
|
+
):
|
587
|
+
response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
|
588
|
+
raise errors.WSErrorCommon(response_data, http_res)
|
589
|
+
if utils.match_response(http_res, "500", "application/json"):
|
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, "4XX", "*"):
|
593
|
+
http_res_text = utils.stream_to_text(http_res)
|
594
|
+
raise errors.EgainDefaultError(
|
595
|
+
"API error occurred", http_res, http_res_text
|
596
|
+
)
|
597
|
+
if utils.match_response(http_res, "5XX", "*"):
|
598
|
+
http_res_text = utils.stream_to_text(http_res)
|
599
|
+
raise errors.EgainDefaultError(
|
600
|
+
"API error occurred", http_res, http_res_text
|
601
|
+
)
|
602
|
+
|
603
|
+
raise errors.EgainDefaultError("Unexpected response received", http_res)
|
604
|
+
|
605
|
+
async def deletebookmark_async(
|
606
|
+
self,
|
607
|
+
*,
|
608
|
+
accept_language: models.AcceptLanguage,
|
609
|
+
portal_id: str,
|
610
|
+
bookmark_id: str,
|
611
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
612
|
+
server_url: Optional[str] = None,
|
613
|
+
timeout_ms: Optional[int] = None,
|
614
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
615
|
+
):
|
616
|
+
r"""Delete a Bookmark
|
617
|
+
|
618
|
+
## Overview
|
619
|
+
The Delete a Bookmark API deletes a bookmark from a portal.
|
620
|
+
|
621
|
+
|
622
|
+
:param accept_language: The Language locale accepted by the client (used for locale specific fields in resource representation and in error responses).
|
623
|
+
: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.
|
624
|
+
:param bookmark_id: The ID of the bookmark.
|
625
|
+
:param retries: Override the default retry configuration for this method
|
626
|
+
:param server_url: Override the default server URL for this method
|
627
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
628
|
+
:param http_headers: Additional headers to set or replace on requests.
|
629
|
+
"""
|
630
|
+
base_url = None
|
631
|
+
url_variables = None
|
632
|
+
if timeout_ms is None:
|
633
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
634
|
+
|
635
|
+
if server_url is not None:
|
636
|
+
base_url = server_url
|
637
|
+
else:
|
638
|
+
base_url = self._get_url(base_url, url_variables)
|
639
|
+
|
640
|
+
request = models.DeletebookmarkRequest(
|
641
|
+
accept_language=accept_language,
|
642
|
+
portal_id=portal_id,
|
643
|
+
bookmark_id=bookmark_id,
|
644
|
+
)
|
645
|
+
|
646
|
+
req = self._build_request_async(
|
647
|
+
method="DELETE",
|
648
|
+
path="/portals/{portalID}/bookmarks/{bookmarkID}",
|
649
|
+
base_url=base_url,
|
650
|
+
url_variables=url_variables,
|
651
|
+
request=request,
|
652
|
+
request_body_required=False,
|
653
|
+
request_has_path_params=True,
|
654
|
+
request_has_query_params=True,
|
655
|
+
user_agent_header="user-agent",
|
656
|
+
accept_header_value="application/json",
|
657
|
+
http_headers=http_headers,
|
658
|
+
security=self.sdk_configuration.security,
|
659
|
+
timeout_ms=timeout_ms,
|
660
|
+
)
|
661
|
+
|
662
|
+
if retries == UNSET:
|
663
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
664
|
+
retries = self.sdk_configuration.retry_config
|
665
|
+
|
666
|
+
retry_config = None
|
667
|
+
if isinstance(retries, utils.RetryConfig):
|
668
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
669
|
+
|
670
|
+
http_res = await self.do_request_async(
|
671
|
+
hook_ctx=HookContext(
|
672
|
+
config=self.sdk_configuration,
|
673
|
+
base_url=base_url or "",
|
674
|
+
operation_id="deletebookmark",
|
675
|
+
oauth2_scopes=[],
|
676
|
+
security_source=get_security_from_env(
|
677
|
+
self.sdk_configuration.security, models.Security
|
678
|
+
),
|
679
|
+
),
|
680
|
+
request=req,
|
681
|
+
error_status_codes=["400", "401", "403", "404", "406", "4XX", "500", "5XX"],
|
682
|
+
retry_config=retry_config,
|
683
|
+
)
|
684
|
+
|
685
|
+
response_data: Any = None
|
686
|
+
if utils.match_response(http_res, "204", "*"):
|
687
|
+
return
|
688
|
+
if utils.match_response(
|
689
|
+
http_res, ["400", "401", "403", "404", "406"], "application/json"
|
690
|
+
):
|
691
|
+
response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
|
692
|
+
raise errors.WSErrorCommon(response_data, http_res)
|
693
|
+
if utils.match_response(http_res, "500", "application/json"):
|
694
|
+
response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
|
695
|
+
raise errors.WSErrorCommon(response_data, http_res)
|
696
|
+
if utils.match_response(http_res, "4XX", "*"):
|
697
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
698
|
+
raise errors.EgainDefaultError(
|
699
|
+
"API error occurred", http_res, http_res_text
|
700
|
+
)
|
701
|
+
if utils.match_response(http_res, "5XX", "*"):
|
702
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
703
|
+
raise errors.EgainDefaultError(
|
704
|
+
"API error occurred", http_res, http_res_text
|
705
|
+
)
|
706
|
+
|
707
|
+
raise errors.EgainDefaultError("Unexpected response received", http_res)
|