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,211 @@
|
|
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 PortalUserdetails(BaseSDK):
|
13
|
+
def get_user_details(
|
14
|
+
self,
|
15
|
+
*,
|
16
|
+
accept_language: models.AcceptLanguage,
|
17
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
18
|
+
server_url: Optional[str] = None,
|
19
|
+
timeout_ms: Optional[int] = None,
|
20
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
21
|
+
) -> Optional[models.UserDetails]:
|
22
|
+
r"""Get User Details
|
23
|
+
|
24
|
+
## Overview
|
25
|
+
The Get User Details API retrieves details of a knowledge user.
|
26
|
+
|
27
|
+
|
28
|
+
:param accept_language: The Language locale accepted by the client (used for locale specific fields in resource representation and in error responses).
|
29
|
+
:param retries: Override the default retry configuration for this method
|
30
|
+
:param server_url: Override the default server URL for this method
|
31
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
32
|
+
:param http_headers: Additional headers to set or replace on requests.
|
33
|
+
"""
|
34
|
+
base_url = None
|
35
|
+
url_variables = None
|
36
|
+
if timeout_ms is None:
|
37
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
38
|
+
|
39
|
+
if server_url is not None:
|
40
|
+
base_url = server_url
|
41
|
+
else:
|
42
|
+
base_url = self._get_url(base_url, url_variables)
|
43
|
+
|
44
|
+
request = models.GetUserDetailsRequest(
|
45
|
+
accept_language=accept_language,
|
46
|
+
)
|
47
|
+
|
48
|
+
req = self._build_request(
|
49
|
+
method="GET",
|
50
|
+
path="/portals/user",
|
51
|
+
base_url=base_url,
|
52
|
+
url_variables=url_variables,
|
53
|
+
request=request,
|
54
|
+
request_body_required=False,
|
55
|
+
request_has_path_params=False,
|
56
|
+
request_has_query_params=True,
|
57
|
+
user_agent_header="user-agent",
|
58
|
+
accept_header_value="application/json",
|
59
|
+
http_headers=http_headers,
|
60
|
+
security=self.sdk_configuration.security,
|
61
|
+
timeout_ms=timeout_ms,
|
62
|
+
)
|
63
|
+
|
64
|
+
if retries == UNSET:
|
65
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
66
|
+
retries = self.sdk_configuration.retry_config
|
67
|
+
|
68
|
+
retry_config = None
|
69
|
+
if isinstance(retries, utils.RetryConfig):
|
70
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
71
|
+
|
72
|
+
http_res = self.do_request(
|
73
|
+
hook_ctx=HookContext(
|
74
|
+
config=self.sdk_configuration,
|
75
|
+
base_url=base_url or "",
|
76
|
+
operation_id="getUserDetails",
|
77
|
+
oauth2_scopes=[],
|
78
|
+
security_source=get_security_from_env(
|
79
|
+
self.sdk_configuration.security, models.Security
|
80
|
+
),
|
81
|
+
),
|
82
|
+
request=req,
|
83
|
+
error_status_codes=["400", "401", "403", "406", "4XX", "500", "5XX"],
|
84
|
+
retry_config=retry_config,
|
85
|
+
)
|
86
|
+
|
87
|
+
response_data: Any = None
|
88
|
+
if utils.match_response(http_res, "200", "application/json"):
|
89
|
+
return unmarshal_json_response(models.UserDetails, http_res)
|
90
|
+
if utils.match_response(http_res, "204", "*"):
|
91
|
+
return None
|
92
|
+
if utils.match_response(
|
93
|
+
http_res, ["400", "401", "403", "406"], "application/json"
|
94
|
+
):
|
95
|
+
response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
|
96
|
+
raise errors.WSErrorCommon(response_data, http_res)
|
97
|
+
if utils.match_response(http_res, "500", "application/json"):
|
98
|
+
response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
|
99
|
+
raise errors.WSErrorCommon(response_data, http_res)
|
100
|
+
if utils.match_response(http_res, "4XX", "*"):
|
101
|
+
http_res_text = utils.stream_to_text(http_res)
|
102
|
+
raise errors.EgainDefaultError(
|
103
|
+
"API error occurred", http_res, http_res_text
|
104
|
+
)
|
105
|
+
if utils.match_response(http_res, "5XX", "*"):
|
106
|
+
http_res_text = utils.stream_to_text(http_res)
|
107
|
+
raise errors.EgainDefaultError(
|
108
|
+
"API error occurred", http_res, http_res_text
|
109
|
+
)
|
110
|
+
|
111
|
+
raise errors.EgainDefaultError("Unexpected response received", http_res)
|
112
|
+
|
113
|
+
async def get_user_details_async(
|
114
|
+
self,
|
115
|
+
*,
|
116
|
+
accept_language: models.AcceptLanguage,
|
117
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
118
|
+
server_url: Optional[str] = None,
|
119
|
+
timeout_ms: Optional[int] = None,
|
120
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
121
|
+
) -> Optional[models.UserDetails]:
|
122
|
+
r"""Get User Details
|
123
|
+
|
124
|
+
## Overview
|
125
|
+
The Get User Details API retrieves details of a knowledge user.
|
126
|
+
|
127
|
+
|
128
|
+
:param accept_language: The Language locale accepted by the client (used for locale specific fields in resource representation and in error responses).
|
129
|
+
:param retries: Override the default retry configuration for this method
|
130
|
+
:param server_url: Override the default server URL for this method
|
131
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
132
|
+
:param http_headers: Additional headers to set or replace on requests.
|
133
|
+
"""
|
134
|
+
base_url = None
|
135
|
+
url_variables = None
|
136
|
+
if timeout_ms is None:
|
137
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
138
|
+
|
139
|
+
if server_url is not None:
|
140
|
+
base_url = server_url
|
141
|
+
else:
|
142
|
+
base_url = self._get_url(base_url, url_variables)
|
143
|
+
|
144
|
+
request = models.GetUserDetailsRequest(
|
145
|
+
accept_language=accept_language,
|
146
|
+
)
|
147
|
+
|
148
|
+
req = self._build_request_async(
|
149
|
+
method="GET",
|
150
|
+
path="/portals/user",
|
151
|
+
base_url=base_url,
|
152
|
+
url_variables=url_variables,
|
153
|
+
request=request,
|
154
|
+
request_body_required=False,
|
155
|
+
request_has_path_params=False,
|
156
|
+
request_has_query_params=True,
|
157
|
+
user_agent_header="user-agent",
|
158
|
+
accept_header_value="application/json",
|
159
|
+
http_headers=http_headers,
|
160
|
+
security=self.sdk_configuration.security,
|
161
|
+
timeout_ms=timeout_ms,
|
162
|
+
)
|
163
|
+
|
164
|
+
if retries == UNSET:
|
165
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
166
|
+
retries = self.sdk_configuration.retry_config
|
167
|
+
|
168
|
+
retry_config = None
|
169
|
+
if isinstance(retries, utils.RetryConfig):
|
170
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
171
|
+
|
172
|
+
http_res = await self.do_request_async(
|
173
|
+
hook_ctx=HookContext(
|
174
|
+
config=self.sdk_configuration,
|
175
|
+
base_url=base_url or "",
|
176
|
+
operation_id="getUserDetails",
|
177
|
+
oauth2_scopes=[],
|
178
|
+
security_source=get_security_from_env(
|
179
|
+
self.sdk_configuration.security, models.Security
|
180
|
+
),
|
181
|
+
),
|
182
|
+
request=req,
|
183
|
+
error_status_codes=["400", "401", "403", "406", "4XX", "500", "5XX"],
|
184
|
+
retry_config=retry_config,
|
185
|
+
)
|
186
|
+
|
187
|
+
response_data: Any = None
|
188
|
+
if utils.match_response(http_res, "200", "application/json"):
|
189
|
+
return unmarshal_json_response(models.UserDetails, http_res)
|
190
|
+
if utils.match_response(http_res, "204", "*"):
|
191
|
+
return None
|
192
|
+
if utils.match_response(
|
193
|
+
http_res, ["400", "401", "403", "406"], "application/json"
|
194
|
+
):
|
195
|
+
response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
|
196
|
+
raise errors.WSErrorCommon(response_data, http_res)
|
197
|
+
if utils.match_response(http_res, "500", "application/json"):
|
198
|
+
response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
|
199
|
+
raise errors.WSErrorCommon(response_data, http_res)
|
200
|
+
if utils.match_response(http_res, "4XX", "*"):
|
201
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
202
|
+
raise errors.EgainDefaultError(
|
203
|
+
"API error occurred", http_res, http_res_text
|
204
|
+
)
|
205
|
+
if utils.match_response(http_res, "5XX", "*"):
|
206
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
207
|
+
raise errors.EgainDefaultError(
|
208
|
+
"API error occurred", http_res, http_res_text
|
209
|
+
)
|
210
|
+
|
211
|
+
raise errors.EgainDefaultError("Unexpected response received", http_res)
|
@@ -0,0 +1,431 @@
|
|
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 PortalUserprofile(BaseSDK):
|
13
|
+
def get_all_user_profiles(
|
14
|
+
self,
|
15
|
+
*,
|
16
|
+
accept_language: models.AcceptLanguage,
|
17
|
+
portal_id: str,
|
18
|
+
language: Optional[models.LanguageQueryParameter] = None,
|
19
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
20
|
+
server_url: Optional[str] = None,
|
21
|
+
timeout_ms: Optional[int] = None,
|
22
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
23
|
+
) -> Optional[models.UserProfiles]:
|
24
|
+
r"""Get All User Profiles Assigned to User
|
25
|
+
|
26
|
+
## Overview
|
27
|
+
The Get All User Profiles Assigned to User API retrieves all user profiles in the portal that are assigned to the user, displayed in ascending order of name.
|
28
|
+
|
29
|
+
|
30
|
+
:param accept_language: The Language locale accepted by the client (used for locale specific fields in resource representation and in error responses).
|
31
|
+
: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.
|
32
|
+
: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>
|
33
|
+
:param retries: Override the default retry configuration for this method
|
34
|
+
:param server_url: Override the default server URL for this method
|
35
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
36
|
+
:param http_headers: Additional headers to set or replace on requests.
|
37
|
+
"""
|
38
|
+
base_url = None
|
39
|
+
url_variables = None
|
40
|
+
if timeout_ms is None:
|
41
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
42
|
+
|
43
|
+
if server_url is not None:
|
44
|
+
base_url = server_url
|
45
|
+
else:
|
46
|
+
base_url = self._get_url(base_url, url_variables)
|
47
|
+
|
48
|
+
request = models.GetAllUserProfilesRequest(
|
49
|
+
accept_language=accept_language,
|
50
|
+
portal_id=portal_id,
|
51
|
+
language=language,
|
52
|
+
)
|
53
|
+
|
54
|
+
req = self._build_request(
|
55
|
+
method="GET",
|
56
|
+
path="/portals/{portalID}/userprofiles",
|
57
|
+
base_url=base_url,
|
58
|
+
url_variables=url_variables,
|
59
|
+
request=request,
|
60
|
+
request_body_required=False,
|
61
|
+
request_has_path_params=True,
|
62
|
+
request_has_query_params=True,
|
63
|
+
user_agent_header="user-agent",
|
64
|
+
accept_header_value="application/json",
|
65
|
+
http_headers=http_headers,
|
66
|
+
security=self.sdk_configuration.security,
|
67
|
+
timeout_ms=timeout_ms,
|
68
|
+
)
|
69
|
+
|
70
|
+
if retries == UNSET:
|
71
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
72
|
+
retries = self.sdk_configuration.retry_config
|
73
|
+
|
74
|
+
retry_config = None
|
75
|
+
if isinstance(retries, utils.RetryConfig):
|
76
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
77
|
+
|
78
|
+
http_res = self.do_request(
|
79
|
+
hook_ctx=HookContext(
|
80
|
+
config=self.sdk_configuration,
|
81
|
+
base_url=base_url or "",
|
82
|
+
operation_id="getAllUserProfiles",
|
83
|
+
oauth2_scopes=[],
|
84
|
+
security_source=get_security_from_env(
|
85
|
+
self.sdk_configuration.security, models.Security
|
86
|
+
),
|
87
|
+
),
|
88
|
+
request=req,
|
89
|
+
error_status_codes=["400", "401", "403", "404", "406", "4XX", "500", "5XX"],
|
90
|
+
retry_config=retry_config,
|
91
|
+
)
|
92
|
+
|
93
|
+
response_data: Any = None
|
94
|
+
if utils.match_response(http_res, "200", "application/json"):
|
95
|
+
return unmarshal_json_response(models.UserProfiles, http_res)
|
96
|
+
if utils.match_response(http_res, "204", "*"):
|
97
|
+
return None
|
98
|
+
if utils.match_response(
|
99
|
+
http_res, ["400", "401", "403", "404", "406"], "application/json"
|
100
|
+
):
|
101
|
+
response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
|
102
|
+
raise errors.WSErrorCommon(response_data, http_res)
|
103
|
+
if utils.match_response(http_res, "500", "application/json"):
|
104
|
+
response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
|
105
|
+
raise errors.WSErrorCommon(response_data, http_res)
|
106
|
+
if utils.match_response(http_res, "4XX", "*"):
|
107
|
+
http_res_text = utils.stream_to_text(http_res)
|
108
|
+
raise errors.EgainDefaultError(
|
109
|
+
"API error occurred", http_res, http_res_text
|
110
|
+
)
|
111
|
+
if utils.match_response(http_res, "5XX", "*"):
|
112
|
+
http_res_text = utils.stream_to_text(http_res)
|
113
|
+
raise errors.EgainDefaultError(
|
114
|
+
"API error occurred", http_res, http_res_text
|
115
|
+
)
|
116
|
+
|
117
|
+
raise errors.EgainDefaultError("Unexpected response received", http_res)
|
118
|
+
|
119
|
+
async def get_all_user_profiles_async(
|
120
|
+
self,
|
121
|
+
*,
|
122
|
+
accept_language: models.AcceptLanguage,
|
123
|
+
portal_id: str,
|
124
|
+
language: Optional[models.LanguageQueryParameter] = None,
|
125
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
126
|
+
server_url: Optional[str] = None,
|
127
|
+
timeout_ms: Optional[int] = None,
|
128
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
129
|
+
) -> Optional[models.UserProfiles]:
|
130
|
+
r"""Get All User Profiles Assigned to User
|
131
|
+
|
132
|
+
## Overview
|
133
|
+
The Get All User Profiles Assigned to User API retrieves all user profiles in the portal that are assigned to the user, displayed in ascending order of name.
|
134
|
+
|
135
|
+
|
136
|
+
:param accept_language: The Language locale accepted by the client (used for locale specific fields in resource representation and in error responses).
|
137
|
+
: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.
|
138
|
+
: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>
|
139
|
+
:param retries: Override the default retry configuration for this method
|
140
|
+
:param server_url: Override the default server URL for this method
|
141
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
142
|
+
:param http_headers: Additional headers to set or replace on requests.
|
143
|
+
"""
|
144
|
+
base_url = None
|
145
|
+
url_variables = None
|
146
|
+
if timeout_ms is None:
|
147
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
148
|
+
|
149
|
+
if server_url is not None:
|
150
|
+
base_url = server_url
|
151
|
+
else:
|
152
|
+
base_url = self._get_url(base_url, url_variables)
|
153
|
+
|
154
|
+
request = models.GetAllUserProfilesRequest(
|
155
|
+
accept_language=accept_language,
|
156
|
+
portal_id=portal_id,
|
157
|
+
language=language,
|
158
|
+
)
|
159
|
+
|
160
|
+
req = self._build_request_async(
|
161
|
+
method="GET",
|
162
|
+
path="/portals/{portalID}/userprofiles",
|
163
|
+
base_url=base_url,
|
164
|
+
url_variables=url_variables,
|
165
|
+
request=request,
|
166
|
+
request_body_required=False,
|
167
|
+
request_has_path_params=True,
|
168
|
+
request_has_query_params=True,
|
169
|
+
user_agent_header="user-agent",
|
170
|
+
accept_header_value="application/json",
|
171
|
+
http_headers=http_headers,
|
172
|
+
security=self.sdk_configuration.security,
|
173
|
+
timeout_ms=timeout_ms,
|
174
|
+
)
|
175
|
+
|
176
|
+
if retries == UNSET:
|
177
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
178
|
+
retries = self.sdk_configuration.retry_config
|
179
|
+
|
180
|
+
retry_config = None
|
181
|
+
if isinstance(retries, utils.RetryConfig):
|
182
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
183
|
+
|
184
|
+
http_res = await self.do_request_async(
|
185
|
+
hook_ctx=HookContext(
|
186
|
+
config=self.sdk_configuration,
|
187
|
+
base_url=base_url or "",
|
188
|
+
operation_id="getAllUserProfiles",
|
189
|
+
oauth2_scopes=[],
|
190
|
+
security_source=get_security_from_env(
|
191
|
+
self.sdk_configuration.security, models.Security
|
192
|
+
),
|
193
|
+
),
|
194
|
+
request=req,
|
195
|
+
error_status_codes=["400", "401", "403", "404", "406", "4XX", "500", "5XX"],
|
196
|
+
retry_config=retry_config,
|
197
|
+
)
|
198
|
+
|
199
|
+
response_data: Any = None
|
200
|
+
if utils.match_response(http_res, "200", "application/json"):
|
201
|
+
return unmarshal_json_response(models.UserProfiles, http_res)
|
202
|
+
if utils.match_response(http_res, "204", "*"):
|
203
|
+
return None
|
204
|
+
if utils.match_response(
|
205
|
+
http_res, ["400", "401", "403", "404", "406"], "application/json"
|
206
|
+
):
|
207
|
+
response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
|
208
|
+
raise errors.WSErrorCommon(response_data, http_res)
|
209
|
+
if utils.match_response(http_res, "500", "application/json"):
|
210
|
+
response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
|
211
|
+
raise errors.WSErrorCommon(response_data, http_res)
|
212
|
+
if utils.match_response(http_res, "4XX", "*"):
|
213
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
214
|
+
raise errors.EgainDefaultError(
|
215
|
+
"API error occurred", http_res, http_res_text
|
216
|
+
)
|
217
|
+
if utils.match_response(http_res, "5XX", "*"):
|
218
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
219
|
+
raise errors.EgainDefaultError(
|
220
|
+
"API error occurred", http_res, http_res_text
|
221
|
+
)
|
222
|
+
|
223
|
+
raise errors.EgainDefaultError("Unexpected response received", http_res)
|
224
|
+
|
225
|
+
def select_user_profile(
|
226
|
+
self,
|
227
|
+
*,
|
228
|
+
accept_language: models.AcceptLanguage,
|
229
|
+
portal_id: str,
|
230
|
+
user_profile_id: str,
|
231
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
232
|
+
server_url: Optional[str] = None,
|
233
|
+
timeout_ms: Optional[int] = None,
|
234
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
235
|
+
):
|
236
|
+
r"""Select User Profile
|
237
|
+
|
238
|
+
## Overview
|
239
|
+
The Select User Profile API allows a user to set the user profile for a portal.
|
240
|
+
|
241
|
+
|
242
|
+
:param accept_language: The Language locale accepted by the client (used for locale specific fields in resource representation and in error responses).
|
243
|
+
: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.
|
244
|
+
:param user_profile_id: The ID of the user profile.
|
245
|
+
:param retries: Override the default retry configuration for this method
|
246
|
+
:param server_url: Override the default server URL for this method
|
247
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
248
|
+
:param http_headers: Additional headers to set or replace on requests.
|
249
|
+
"""
|
250
|
+
base_url = None
|
251
|
+
url_variables = None
|
252
|
+
if timeout_ms is None:
|
253
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
254
|
+
|
255
|
+
if server_url is not None:
|
256
|
+
base_url = server_url
|
257
|
+
else:
|
258
|
+
base_url = self._get_url(base_url, url_variables)
|
259
|
+
|
260
|
+
request = models.SelectUserProfileRequest(
|
261
|
+
accept_language=accept_language,
|
262
|
+
portal_id=portal_id,
|
263
|
+
user_profile_id=user_profile_id,
|
264
|
+
)
|
265
|
+
|
266
|
+
req = self._build_request(
|
267
|
+
method="PUT",
|
268
|
+
path="/portals/{portalID}/userprofiles/{userProfileID}/select",
|
269
|
+
base_url=base_url,
|
270
|
+
url_variables=url_variables,
|
271
|
+
request=request,
|
272
|
+
request_body_required=False,
|
273
|
+
request_has_path_params=True,
|
274
|
+
request_has_query_params=True,
|
275
|
+
user_agent_header="user-agent",
|
276
|
+
accept_header_value="application/json",
|
277
|
+
http_headers=http_headers,
|
278
|
+
security=self.sdk_configuration.security,
|
279
|
+
timeout_ms=timeout_ms,
|
280
|
+
)
|
281
|
+
|
282
|
+
if retries == UNSET:
|
283
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
284
|
+
retries = self.sdk_configuration.retry_config
|
285
|
+
|
286
|
+
retry_config = None
|
287
|
+
if isinstance(retries, utils.RetryConfig):
|
288
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
289
|
+
|
290
|
+
http_res = self.do_request(
|
291
|
+
hook_ctx=HookContext(
|
292
|
+
config=self.sdk_configuration,
|
293
|
+
base_url=base_url or "",
|
294
|
+
operation_id="selectUserProfile",
|
295
|
+
oauth2_scopes=[],
|
296
|
+
security_source=get_security_from_env(
|
297
|
+
self.sdk_configuration.security, models.Security
|
298
|
+
),
|
299
|
+
),
|
300
|
+
request=req,
|
301
|
+
error_status_codes=["400", "401", "403", "404", "406", "4XX", "500", "5XX"],
|
302
|
+
retry_config=retry_config,
|
303
|
+
)
|
304
|
+
|
305
|
+
response_data: Any = None
|
306
|
+
if utils.match_response(http_res, "204", "*"):
|
307
|
+
return
|
308
|
+
if utils.match_response(
|
309
|
+
http_res, ["400", "401", "403", "404", "406"], "application/json"
|
310
|
+
):
|
311
|
+
response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
|
312
|
+
raise errors.WSErrorCommon(response_data, http_res)
|
313
|
+
if utils.match_response(http_res, "500", "application/json"):
|
314
|
+
response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
|
315
|
+
raise errors.WSErrorCommon(response_data, http_res)
|
316
|
+
if utils.match_response(http_res, "4XX", "*"):
|
317
|
+
http_res_text = utils.stream_to_text(http_res)
|
318
|
+
raise errors.EgainDefaultError(
|
319
|
+
"API error occurred", http_res, http_res_text
|
320
|
+
)
|
321
|
+
if utils.match_response(http_res, "5XX", "*"):
|
322
|
+
http_res_text = utils.stream_to_text(http_res)
|
323
|
+
raise errors.EgainDefaultError(
|
324
|
+
"API error occurred", http_res, http_res_text
|
325
|
+
)
|
326
|
+
|
327
|
+
raise errors.EgainDefaultError("Unexpected response received", http_res)
|
328
|
+
|
329
|
+
async def select_user_profile_async(
|
330
|
+
self,
|
331
|
+
*,
|
332
|
+
accept_language: models.AcceptLanguage,
|
333
|
+
portal_id: str,
|
334
|
+
user_profile_id: str,
|
335
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
336
|
+
server_url: Optional[str] = None,
|
337
|
+
timeout_ms: Optional[int] = None,
|
338
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
339
|
+
):
|
340
|
+
r"""Select User Profile
|
341
|
+
|
342
|
+
## Overview
|
343
|
+
The Select User Profile API allows a user to set the user profile for a portal.
|
344
|
+
|
345
|
+
|
346
|
+
:param accept_language: The Language locale accepted by the client (used for locale specific fields in resource representation and in error responses).
|
347
|
+
: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.
|
348
|
+
:param user_profile_id: The ID of the user profile.
|
349
|
+
:param retries: Override the default retry configuration for this method
|
350
|
+
:param server_url: Override the default server URL for this method
|
351
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
352
|
+
:param http_headers: Additional headers to set or replace on requests.
|
353
|
+
"""
|
354
|
+
base_url = None
|
355
|
+
url_variables = None
|
356
|
+
if timeout_ms is None:
|
357
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
358
|
+
|
359
|
+
if server_url is not None:
|
360
|
+
base_url = server_url
|
361
|
+
else:
|
362
|
+
base_url = self._get_url(base_url, url_variables)
|
363
|
+
|
364
|
+
request = models.SelectUserProfileRequest(
|
365
|
+
accept_language=accept_language,
|
366
|
+
portal_id=portal_id,
|
367
|
+
user_profile_id=user_profile_id,
|
368
|
+
)
|
369
|
+
|
370
|
+
req = self._build_request_async(
|
371
|
+
method="PUT",
|
372
|
+
path="/portals/{portalID}/userprofiles/{userProfileID}/select",
|
373
|
+
base_url=base_url,
|
374
|
+
url_variables=url_variables,
|
375
|
+
request=request,
|
376
|
+
request_body_required=False,
|
377
|
+
request_has_path_params=True,
|
378
|
+
request_has_query_params=True,
|
379
|
+
user_agent_header="user-agent",
|
380
|
+
accept_header_value="application/json",
|
381
|
+
http_headers=http_headers,
|
382
|
+
security=self.sdk_configuration.security,
|
383
|
+
timeout_ms=timeout_ms,
|
384
|
+
)
|
385
|
+
|
386
|
+
if retries == UNSET:
|
387
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
388
|
+
retries = self.sdk_configuration.retry_config
|
389
|
+
|
390
|
+
retry_config = None
|
391
|
+
if isinstance(retries, utils.RetryConfig):
|
392
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
393
|
+
|
394
|
+
http_res = await self.do_request_async(
|
395
|
+
hook_ctx=HookContext(
|
396
|
+
config=self.sdk_configuration,
|
397
|
+
base_url=base_url or "",
|
398
|
+
operation_id="selectUserProfile",
|
399
|
+
oauth2_scopes=[],
|
400
|
+
security_source=get_security_from_env(
|
401
|
+
self.sdk_configuration.security, models.Security
|
402
|
+
),
|
403
|
+
),
|
404
|
+
request=req,
|
405
|
+
error_status_codes=["400", "401", "403", "404", "406", "4XX", "500", "5XX"],
|
406
|
+
retry_config=retry_config,
|
407
|
+
)
|
408
|
+
|
409
|
+
response_data: Any = None
|
410
|
+
if utils.match_response(http_res, "204", "*"):
|
411
|
+
return
|
412
|
+
if utils.match_response(
|
413
|
+
http_res, ["400", "401", "403", "404", "406"], "application/json"
|
414
|
+
):
|
415
|
+
response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
|
416
|
+
raise errors.WSErrorCommon(response_data, http_res)
|
417
|
+
if utils.match_response(http_res, "500", "application/json"):
|
418
|
+
response_data = unmarshal_json_response(errors.WSErrorCommonData, http_res)
|
419
|
+
raise errors.WSErrorCommon(response_data, http_res)
|
420
|
+
if utils.match_response(http_res, "4XX", "*"):
|
421
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
422
|
+
raise errors.EgainDefaultError(
|
423
|
+
"API error occurred", http_res, http_res_text
|
424
|
+
)
|
425
|
+
if utils.match_response(http_res, "5XX", "*"):
|
426
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
427
|
+
raise errors.EgainDefaultError(
|
428
|
+
"API error occurred", http_res, http_res_text
|
429
|
+
)
|
430
|
+
|
431
|
+
raise errors.EgainDefaultError("Unexpected response received", http_res)
|
@@ -0,0 +1 @@
|
|
1
|
+
# Marker file for PEP 561. The package enables type hints.
|