From 1bd9ba348504f6823db67190c13544d6a7c58c1b Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Fri, 1 Aug 2025 00:39:51 +0000 Subject: [PATCH 1/2] ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.595.0 --- .gitignore | 3 + .speakeasy/gen.lock | 465 ++++-- .speakeasy/gen.yaml | 15 +- .speakeasy/workflow.lock | 14 +- README.md | 699 ++++++++- RELEASES.md | 12 +- USAGE.md | 2 + codeSamples.yaml | 558 +++++-- .../operations/archivenamespacerequest.md | 9 + .../operations/archivenamespacerequestbody.md | 10 + .../operations/archivenamespaceresponse.md | 10 + .../operations/createbillingaddonsresponse.md | 11 + .../operations/createorganizationresponse.md | 4 +- .../createpublishingtokenrequestbody.md | 13 + .../createpublishingtokenresponse.md | 11 + docs/models/operations/createresponse.md | 4 +- .../createschemastoreitemrequestbody.md | 11 + .../createschemastoreitemresponse.md | 11 + .../operations/createworkspacetokenrequest.md | 4 +- .../operations/deletebillingaddonrequest.md | 8 + .../operations/deletebillingaddonresponse.md | 10 + .../deletepublishingtokenrequest.md | 8 + .../deletepublishingtokenresponse.md | 10 + .../operations/deleteworkspacetokenrequest.md | 4 +- docs/models/operations/file.md | 4 +- docs/models/operations/format_.md | 11 + .../generatecodesamplepreviewresponse.md | 13 +- .../operations/getaccesstokenresponse.md | 4 +- .../operations/getbillingaddonsresponse.md | 11 + docs/models/operations/getblobresponse.md | 4 +- .../getcodesamplepreviewasyncresponse.md | 5 +- .../operations/getcodesamplesrequest.md | 11 +- .../operations/getgithubactionrequest.md | 4 +- .../operations/getgithubactionresponse.md | 4 +- .../operations/getgithubsetupstateresponse.md | 4 +- docs/models/operations/getmanifestresponse.md | 4 +- .../operations/getnamespacesresponse.md | 4 +- .../operations/getorganizationresponse.md | 4 +- .../operations/getorganizationsresponse.md | 4 +- .../getorganizationusageresponse.md | 4 +- .../getpublishingtokenbyidrequest.md | 8 + .../getpublishingtokenbyidresponse.md | 11 + ...getpublishingtokenpublicmetadatarequest.md | 8 + ...etpublishingtokenpublicmetadataresponse.md | 11 + ...blishingtokenpublicmetadataresponsebody.md | 14 + .../operations/getpublishingtokenresponse.md | 11 + .../getpublishingtokentargetbyidrequest.md | 8 + .../getpublishingtokentargetbyidresponse.md | 11 + .../models/operations/getrevisionsresponse.md | 4 +- .../getschemastoreitemrequestbody.md | 8 + .../operations/getschemastoreitemresponse.md | 11 + docs/models/operations/gettagsresponse.md | 4 +- .../operations/getworkspaceaccessresponse.md | 4 +- .../getworkspaceeventsbytargetrequest.md | 2 +- .../getworkspaceeventsbytargetresponse.md | 4 +- .../githubcheckpublishingprsresponse.md | 4 +- .../githubcheckpublishingsecretsresponse.md | 4 +- .../githubconfigurecodesamplesresponse.md | 4 +- .../grantuseraccesstoworkspacerequest.md | 4 +- .../operations/listremotesourcesresponse.md | 4 +- docs/models/operations/methodpaths.md | 9 + .../operations/postworkspaceeventsrequest.md | 4 +- docs/models/operations/preflightresponse.md | 4 +- .../revokeuseraccesstoworkspacerequest.md | 4 +- docs/models/operations/schema.md | 4 +- .../searchworkspaceeventsresponse.md | 4 +- .../setworkspacefeatureflagsresponse.md | 11 + .../suggestopenapiregistryresponse.md | 4 +- .../operations/suggestopenapirequestbody.md | 4 +- .../operations/suggestopenapiresponse.md | 4 +- docs/models/operations/suggestresponse.md | 4 +- .../updatepublishingtokenexpirationrequest.md | 9 + ...atepublishingtokenexpirationrequestbody.md | 11 + ...updatepublishingtokenexpirationresponse.md | 10 + .../updateworkspacedetailsrequest.md | 4 +- .../updateworkspacesettingsrequest.md | 4 +- .../operations/validateapikeyresponse.md | 4 +- docs/models/shared/accessdetails.md | 4 +- docs/models/shared/accesstoken.md | 2 +- docs/models/shared/apikeydetails.md | 7 +- docs/models/shared/billingaddon.md | 11 + docs/models/shared/clievent.md | 21 +- docs/models/shared/codesampleschemainput.md | 5 +- docs/models/shared/diagnostic.md | 4 +- docs/models/shared/featureflag.md | 8 +- docs/models/shared/format_.md | 9 + .../githubconfigurecodesamplesresponse.md | 4 +- .../shared/githubpublishingprresponse.md | 9 +- .../shared/githubtriggeractionrequest.md | 2 +- docs/models/shared/httpmethod.md | 15 + docs/models/shared/interactiontype.md | 3 +- docs/models/shared/namespace.md | 18 +- docs/models/shared/oasoperation.md | 6 +- docs/models/shared/organization.md | 8 +- .../shared/organizationbillingaddonrequest.md | 10 + .../organizationbillingaddonresponse.md | 10 + .../shared/organizationusageresponse.md | 4 +- docs/models/shared/publishingtoken.md | 21 + docs/models/shared/pullrequestmetadata.md | 18 + .../remotesourcesubscriptionsettings.md | 4 +- docs/models/shared/revision.md | 17 +- .../models/shared/revisioncontentsmetadata.md | 20 + .../shared/revisioncontentsmetadatatype.md | 9 + docs/models/shared/schemafile.md | 4 +- docs/models/shared/schemastoreitem.md | 13 + docs/models/shared/suggestoptsold.md | 4 +- docs/models/shared/targetresource.md | 8 + docs/models/shared/targetsdk.md | 12 +- docs/models/shared/usagesnippet.md | 4 +- docs/models/shared/user.md | 34 +- docs/models/shared/workflowdocument.md | 4 +- docs/models/shared/workspace.md | 6 +- docs/models/shared/workspacefeatureflag.md | 13 + .../shared/workspacefeatureflagrequest.md | 10 + docs/models/shared/workspaceinviteresponse.md | 4 +- docs/models/shared/workspaceteamresponse.md | 4 +- docs/models/shared/workspacetoken.md | 10 +- docs/sdks/artifacts/README.md | 68 + docs/sdks/auth/README.md | 8 + docs/sdks/codesamples/README.md | 60 +- docs/sdks/events/README.md | 32 +- docs/sdks/github/README.md | 24 +- docs/sdks/organizations/README.md | 163 +- docs/sdks/publishingtokens/README.md | 338 +++++ docs/sdks/reports/README.md | 6 + docs/sdks/schemastore/README.md | 104 ++ docs/sdks/shorturls/README.md | 4 +- docs/sdks/subscriptions/README.md | 4 + docs/sdks/suggest/README.md | 32 +- docs/sdks/workspaces/README.md | 139 +- poetry.lock | 426 +++--- pylintrc | 10 +- pyproject.toml | 29 +- .../{prepare-readme.py => prepare_readme.py} | 8 +- scripts/publish.sh | 2 +- src/speakeasy_client_sdk_python/__init__.py | 11 +- .../_hooks/types.py | 25 +- src/speakeasy_client_sdk_python/_version.py | 7 +- src/speakeasy_client_sdk_python/artifacts.py | 693 +++++---- src/speakeasy_client_sdk_python/auth.py | 221 ++- src/speakeasy_client_sdk_python/basesdk.py | 48 +- .../codesamples.py | 348 ++--- src/speakeasy_client_sdk_python/events.py | 285 ++-- src/speakeasy_client_sdk_python/github.py | 551 +++---- src/speakeasy_client_sdk_python/httpclient.py | 42 + .../models/__init__.py | 3 + .../models/errors/__init__.py | 55 +- .../models/errors/error.py | 16 +- .../models/errors/no_response_error.py | 13 + .../models/errors/responsevalidationerror.py | 25 + .../models/errors/sdkerror.py | 44 +- .../models/errors/speakeasyerror.py | 26 + .../models/internal/__init__.py | 37 +- .../models/operations/__init__.py | 1222 ++++++++++----- .../models/operations/archivenamespace.py | 62 + .../models/operations/createbillingaddons.py | 39 + .../operations/createpublishingtoken.py | 57 + .../operations/createschemastoreitem.py | 69 + .../models/operations/deletebillingaddon.py | 50 + .../operations/deletepublishingtoken.py | 42 + .../operations/generatecodesamplepreview.py | 16 +- .../models/operations/getbillingaddons.py | 39 + .../operations/getcodesamplepreviewasync.py | 22 +- .../models/operations/getcodesamples.py | 28 +- .../models/operations/getpublishingtoken.py | 35 + .../operations/getpublishingtokenbyid.py | 51 + .../getpublishingtokenpublicmetadata.py | 73 + .../getpublishingtokentargetbyid.py | 48 + .../models/operations/getschemastoreitem.py | 43 + .../operations/setworkspacefeatureflags.py | 39 + .../updatepublishingtokenexpiration.py | 75 + .../models/shared/__init__.py | 542 +++++-- .../models/shared/apikeydetails.py | 6 + .../models/shared/billingaddon.py | 12 + .../models/shared/clievent.py | 5 + .../models/shared/codesampleschemainput.py | 13 +- .../models/shared/featureflag.py | 15 +- .../shared/githubpublishingprresponse.py | 56 +- .../models/shared/httpmethod.py | 15 + .../models/shared/interactiontype.py | 1 + .../models/shared/namespace.py | 10 + .../models/shared/organization.py | 2 +- .../shared/organizationbillingaddonrequest.py | 21 + .../organizationbillingaddonresponse.py | 21 + .../models/shared/publishingtoken.py | 57 + .../models/shared/revision.py | 11 +- .../models/shared/revisioncontentsmetadata.py | 79 + .../models/shared/schemastoreitem.py | 36 + .../models/shared/usagesnippet.py | 11 + .../models/shared/user.py | 14 +- .../models/shared/workspacefeatureflag.py | 14 + .../shared/workspacefeatureflagrequest.py | 23 + .../models/shared/workspaceinviteresponse.py | 2 +- .../models/shared/workspacetoken.py | 24 +- .../organizations.py | 773 ++++++++-- .../publishingtokens.py | 1315 +++++++++++++++++ src/speakeasy_client_sdk_python/reports.py | 163 +- .../schemastore.py | 413 ++++++ src/speakeasy_client_sdk_python/sdk.py | 148 +- .../sdkconfiguration.py | 31 +- src/speakeasy_client_sdk_python/shorturls.py | 55 +- .../subscriptions.py | 95 +- src/speakeasy_client_sdk_python/suggest.py | 177 ++- .../types/basemodel.py | 6 +- .../utils/__init__.py | 175 ++- .../utils/datetimes.py | 23 + .../utils/enums.py | 94 +- .../utils/forms.py | 77 +- .../utils/serializers.py | 50 +- .../utils/unmarshal_json_response.py | 24 + .../utils/values.py | 5 +- src/speakeasy_client_sdk_python/workspaces.py | 905 ++++++------ 212 files changed, 10556 insertions(+), 3497 deletions(-) create mode 100644 docs/models/operations/archivenamespacerequest.md create mode 100644 docs/models/operations/archivenamespacerequestbody.md create mode 100644 docs/models/operations/archivenamespaceresponse.md create mode 100644 docs/models/operations/createbillingaddonsresponse.md create mode 100644 docs/models/operations/createpublishingtokenrequestbody.md create mode 100644 docs/models/operations/createpublishingtokenresponse.md create mode 100644 docs/models/operations/createschemastoreitemrequestbody.md create mode 100644 docs/models/operations/createschemastoreitemresponse.md create mode 100644 docs/models/operations/deletebillingaddonrequest.md create mode 100644 docs/models/operations/deletebillingaddonresponse.md create mode 100644 docs/models/operations/deletepublishingtokenrequest.md create mode 100644 docs/models/operations/deletepublishingtokenresponse.md create mode 100644 docs/models/operations/format_.md create mode 100644 docs/models/operations/getbillingaddonsresponse.md create mode 100644 docs/models/operations/getpublishingtokenbyidrequest.md create mode 100644 docs/models/operations/getpublishingtokenbyidresponse.md create mode 100644 docs/models/operations/getpublishingtokenpublicmetadatarequest.md create mode 100644 docs/models/operations/getpublishingtokenpublicmetadataresponse.md create mode 100644 docs/models/operations/getpublishingtokenpublicmetadataresponsebody.md create mode 100644 docs/models/operations/getpublishingtokenresponse.md create mode 100644 docs/models/operations/getpublishingtokentargetbyidrequest.md create mode 100644 docs/models/operations/getpublishingtokentargetbyidresponse.md create mode 100644 docs/models/operations/getschemastoreitemrequestbody.md create mode 100644 docs/models/operations/getschemastoreitemresponse.md create mode 100644 docs/models/operations/methodpaths.md create mode 100644 docs/models/operations/setworkspacefeatureflagsresponse.md create mode 100644 docs/models/operations/updatepublishingtokenexpirationrequest.md create mode 100644 docs/models/operations/updatepublishingtokenexpirationrequestbody.md create mode 100644 docs/models/operations/updatepublishingtokenexpirationresponse.md create mode 100644 docs/models/shared/billingaddon.md create mode 100644 docs/models/shared/format_.md create mode 100644 docs/models/shared/httpmethod.md create mode 100644 docs/models/shared/organizationbillingaddonrequest.md create mode 100644 docs/models/shared/organizationbillingaddonresponse.md create mode 100644 docs/models/shared/publishingtoken.md create mode 100644 docs/models/shared/pullrequestmetadata.md create mode 100644 docs/models/shared/revisioncontentsmetadata.md create mode 100644 docs/models/shared/revisioncontentsmetadatatype.md create mode 100644 docs/models/shared/schemastoreitem.md create mode 100644 docs/models/shared/targetresource.md create mode 100644 docs/models/shared/workspacefeatureflag.md create mode 100644 docs/models/shared/workspacefeatureflagrequest.md create mode 100644 docs/sdks/publishingtokens/README.md create mode 100644 docs/sdks/schemastore/README.md rename scripts/{prepare-readme.py => prepare_readme.py} (84%) create mode 100644 src/speakeasy_client_sdk_python/models/__init__.py create mode 100644 src/speakeasy_client_sdk_python/models/errors/no_response_error.py create mode 100644 src/speakeasy_client_sdk_python/models/errors/responsevalidationerror.py create mode 100644 src/speakeasy_client_sdk_python/models/errors/speakeasyerror.py create mode 100644 src/speakeasy_client_sdk_python/models/operations/archivenamespace.py create mode 100644 src/speakeasy_client_sdk_python/models/operations/createbillingaddons.py create mode 100644 src/speakeasy_client_sdk_python/models/operations/createpublishingtoken.py create mode 100644 src/speakeasy_client_sdk_python/models/operations/createschemastoreitem.py create mode 100644 src/speakeasy_client_sdk_python/models/operations/deletebillingaddon.py create mode 100644 src/speakeasy_client_sdk_python/models/operations/deletepublishingtoken.py create mode 100644 src/speakeasy_client_sdk_python/models/operations/getbillingaddons.py create mode 100644 src/speakeasy_client_sdk_python/models/operations/getpublishingtoken.py create mode 100644 src/speakeasy_client_sdk_python/models/operations/getpublishingtokenbyid.py create mode 100644 src/speakeasy_client_sdk_python/models/operations/getpublishingtokenpublicmetadata.py create mode 100644 src/speakeasy_client_sdk_python/models/operations/getpublishingtokentargetbyid.py create mode 100644 src/speakeasy_client_sdk_python/models/operations/getschemastoreitem.py create mode 100644 src/speakeasy_client_sdk_python/models/operations/setworkspacefeatureflags.py create mode 100644 src/speakeasy_client_sdk_python/models/operations/updatepublishingtokenexpiration.py create mode 100644 src/speakeasy_client_sdk_python/models/shared/billingaddon.py create mode 100644 src/speakeasy_client_sdk_python/models/shared/httpmethod.py create mode 100644 src/speakeasy_client_sdk_python/models/shared/organizationbillingaddonrequest.py create mode 100644 src/speakeasy_client_sdk_python/models/shared/organizationbillingaddonresponse.py create mode 100644 src/speakeasy_client_sdk_python/models/shared/publishingtoken.py create mode 100644 src/speakeasy_client_sdk_python/models/shared/revisioncontentsmetadata.py create mode 100644 src/speakeasy_client_sdk_python/models/shared/schemastoreitem.py create mode 100644 src/speakeasy_client_sdk_python/models/shared/workspacefeatureflag.py create mode 100644 src/speakeasy_client_sdk_python/models/shared/workspacefeatureflagrequest.py create mode 100644 src/speakeasy_client_sdk_python/publishingtokens.py create mode 100644 src/speakeasy_client_sdk_python/schemastore.py create mode 100644 src/speakeasy_client_sdk_python/utils/datetimes.py create mode 100644 src/speakeasy_client_sdk_python/utils/unmarshal_json_response.py diff --git a/.gitignore b/.gitignore index 185d84d8..f035fddc 100755 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +**/__pycache__/ +**/.speakeasy/temp/ +**/.speakeasy/logs/ .speakeasy/reports .venv/ README-PYPI.md diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 0527cece..79361c73 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,69 +1,83 @@ lockVersion: 2.0.0 id: b0b519b1-d1d3-43b2-82dd-b4292eadd4b0 management: - docChecksum: 6c6e24cc570ee7f26269ffaf57ab867a + docChecksum: 395456ce9a6dbfbc77fb9bfcd34098ee docVersion: 0.4.0 - speakeasyVersion: 1.462.2 - generationVersion: 2.486.1 - releaseVersion: 7.0.0-rc.2 - configChecksum: 07992011caf9f99ff590ca4c58d854c1 + speakeasyVersion: 1.595.0 + generationVersion: 2.670.1 + releaseVersion: 7.0.0-rc.3 + configChecksum: a9ea5e11b1e0db23015b612c609dbf56 repoURL: https://github.com/speakeasy-api/speakeasy-client-sdk-python.git repoSubDirectory: . installationURL: https://github.com/speakeasy-api/speakeasy-client-sdk-python.git published: true features: python: - acceptHeaders: 3.0.0 additionalDependencies: 1.0.0 - core: 5.7.4 + constsAndDefaults: 1.0.5 + core: 5.19.5 + deepObjectParams: 0.1.0 defaultEnabledRetries: 0.2.0 - deprecations: 3.0.1 + deprecations: 3.0.2 downloadStreams: 1.0.1 enumUnions: 0.1.0 envVarSecurityUsage: 0.3.2 - globalSecurity: 3.0.2 + getRequestBodies: 3.0.0 + globalSecurity: 3.0.3 globalSecurityCallbacks: 1.0.0 - globalServerURLs: 3.1.0 + globalServerURLs: 3.1.1 globals: 3.0.0 multipartFileContentType: 1.0.0 nameOverrides: 3.0.1 - nullables: 1.0.0 - openEnums: 1.0.0 + nullables: 1.0.1 + openEnums: 1.0.1 responseFormat: 1.0.1 retries: 3.0.2 - sdkHooks: 1.0.0 + sdkHooks: 1.1.0 serverIDs: 3.0.0 uploadStreams: 1.0.0 generatedFiles: - .gitattributes - - .python-version - .vscode/settings.json - - CONTRIBUTING.md - USAGE.md - docs/models/errors/error.md - docs/models/internal/globals.md - docs/models/operations/activatesubscriptionnamespacerequest.md - docs/models/operations/activatesubscriptionnamespaceresponse.md + - docs/models/operations/archivenamespacerequest.md + - docs/models/operations/archivenamespacerequestbody.md + - docs/models/operations/archivenamespaceresponse.md - docs/models/operations/checkgithubaccessrequest.md - docs/models/operations/checkgithubaccessresponse.md + - docs/models/operations/createbillingaddonsresponse.md - docs/models/operations/createfreetrialresponse.md - docs/models/operations/createorganizationresponse.md + - docs/models/operations/createpublishingtokenrequestbody.md + - docs/models/operations/createpublishingtokenresponse.md - docs/models/operations/createremotesourceresponse.md - docs/models/operations/createrequestbody.md - docs/models/operations/createresponse.md + - docs/models/operations/createschemastoreitemrequestbody.md + - docs/models/operations/createschemastoreitemresponse.md - docs/models/operations/createworkspaceresponse.md - docs/models/operations/createworkspacetokenglobals.md - docs/models/operations/createworkspacetokenrequest.md - docs/models/operations/createworkspacetokenresponse.md + - docs/models/operations/deletebillingaddonrequest.md + - docs/models/operations/deletebillingaddonresponse.md + - docs/models/operations/deletepublishingtokenrequest.md + - docs/models/operations/deletepublishingtokenresponse.md - docs/models/operations/deleteworkspacetokenglobals.md - docs/models/operations/deleteworkspacetokenrequest.md - docs/models/operations/deleteworkspacetokenresponse.md - docs/models/operations/file.md + - docs/models/operations/format_.md - docs/models/operations/generatecodesamplepreviewasyncresponse.md - docs/models/operations/generatecodesamplepreviewasyncresponsebody.md - docs/models/operations/generatecodesamplepreviewresponse.md - docs/models/operations/getaccesstokenrequest.md - docs/models/operations/getaccesstokenresponse.md + - docs/models/operations/getbillingaddonsresponse.md - docs/models/operations/getblobrequest.md - docs/models/operations/getblobresponse.md - docs/models/operations/getchangesreportsignedurlrequest.md @@ -88,8 +102,18 @@ generatedFiles: - docs/models/operations/getorganizationresponse.md - docs/models/operations/getorganizationsresponse.md - docs/models/operations/getorganizationusageresponse.md + - docs/models/operations/getpublishingtokenbyidrequest.md + - docs/models/operations/getpublishingtokenbyidresponse.md + - docs/models/operations/getpublishingtokenpublicmetadatarequest.md + - docs/models/operations/getpublishingtokenpublicmetadataresponse.md + - docs/models/operations/getpublishingtokenpublicmetadataresponsebody.md + - docs/models/operations/getpublishingtokenresponse.md + - docs/models/operations/getpublishingtokentargetbyidrequest.md + - docs/models/operations/getpublishingtokentargetbyidresponse.md - docs/models/operations/getrevisionsrequest.md - docs/models/operations/getrevisionsresponse.md + - docs/models/operations/getschemastoreitemrequestbody.md + - docs/models/operations/getschemastoreitemresponse.md - docs/models/operations/gettagsrequest.md - docs/models/operations/gettagsresponse.md - docs/models/operations/getuserresponse.md @@ -138,6 +162,7 @@ generatedFiles: - docs/models/operations/linkgithubaccessresponse.md - docs/models/operations/listremotesourcesrequest.md - docs/models/operations/listremotesourcesresponse.md + - docs/models/operations/methodpaths.md - docs/models/operations/posttagsrequest.md - docs/models/operations/posttagsresponse.md - docs/models/operations/postworkspaceeventsglobals.md @@ -154,6 +179,7 @@ generatedFiles: - docs/models/operations/setvisibilityrequest.md - docs/models/operations/setvisibilityrequestbody.md - docs/models/operations/setvisibilityresponse.md + - docs/models/operations/setworkspacefeatureflagsresponse.md - docs/models/operations/suggestitemsresponse.md - docs/models/operations/suggestopenapiregistryrequest.md - docs/models/operations/suggestopenapiregistryresponse.md @@ -162,6 +188,9 @@ generatedFiles: - docs/models/operations/suggestopenapiresponse.md - docs/models/operations/suggestrequest.md - docs/models/operations/suggestresponse.md + - docs/models/operations/updatepublishingtokenexpirationrequest.md + - docs/models/operations/updatepublishingtokenexpirationrequestbody.md + - docs/models/operations/updatepublishingtokenexpirationresponse.md - docs/models/operations/updateworkspacedetailsglobals.md - docs/models/operations/updateworkspacedetailsrequest.md - docs/models/operations/updateworkspacedetailsresponse.md @@ -181,6 +210,7 @@ generatedFiles: - docs/models/shared/annotations.md - docs/models/shared/apikeydetails.md - docs/models/shared/auth.md + - docs/models/shared/billingaddon.md - docs/models/shared/claims.md - docs/models/shared/clievent.md - docs/models/shared/codesampleschemainput.md @@ -188,6 +218,7 @@ generatedFiles: - docs/models/shared/compositespecmetadata.md - docs/models/shared/diagnostic.md - docs/models/shared/featureflag.md + - docs/models/shared/format_.md - docs/models/shared/generatebumptype.md - docs/models/shared/getnamespacesresponse.md - docs/models/shared/getrevisionsresponse.md @@ -202,6 +233,7 @@ generatedFiles: - docs/models/shared/githubsetupstateresponse.md - docs/models/shared/githubstorepublishingsecretsrequest.md - docs/models/shared/githubtriggeractionrequest.md + - docs/models/shared/httpmethod.md - docs/models/shared/interactiontype.md - docs/models/shared/level.md - docs/models/shared/license.md @@ -212,17 +244,24 @@ generatedFiles: - docs/models/shared/oassummary.md - docs/models/shared/openapidiffbumptype.md - docs/models/shared/organization.md + - docs/models/shared/organizationbillingaddonrequest.md + - docs/models/shared/organizationbillingaddonresponse.md - docs/models/shared/organizationusage.md - docs/models/shared/organizationusageresponse.md - docs/models/shared/preflightrequest.md - docs/models/shared/preflighttoken.md + - docs/models/shared/publishingtoken.md + - docs/models/shared/pullrequestmetadata.md - docs/models/shared/relationship.md - docs/models/shared/remotedocument.md - docs/models/shared/remotesource.md - docs/models/shared/remotesourcesubscriptionsettings.md - docs/models/shared/report.md - docs/models/shared/revision.md + - docs/models/shared/revisioncontentsmetadata.md + - docs/models/shared/revisioncontentsmetadatatype.md - docs/models/shared/schemafile.md + - docs/models/shared/schemastoreitem.md - docs/models/shared/secrets.md - docs/models/shared/security.md - docs/models/shared/shorturl.md @@ -233,6 +272,7 @@ generatedFiles: - docs/models/shared/suggestrequestbody.md - docs/models/shared/suggestrequestbodysuggestiontype.md - docs/models/shared/tag.md + - docs/models/shared/targetresource.md - docs/models/shared/targetsdk.md - docs/models/shared/type.md - docs/models/shared/usagesnippet.md @@ -242,6 +282,8 @@ generatedFiles: - docs/models/shared/workflowdocument.md - docs/models/shared/workspace.md - docs/models/shared/workspaceandorganization.md + - docs/models/shared/workspacefeatureflag.md + - docs/models/shared/workspacefeatureflagrequest.md - docs/models/shared/workspacefeatureflagresponse.md - docs/models/shared/workspaceinviteresponse.md - docs/models/shared/workspaces.md @@ -255,7 +297,9 @@ generatedFiles: - docs/sdks/events/README.md - docs/sdks/github/README.md - docs/sdks/organizations/README.md + - docs/sdks/publishingtokens/README.md - docs/sdks/reports/README.md + - docs/sdks/schemastore/README.md - docs/sdks/shorturls/README.md - docs/sdks/speakeasy/README.md - docs/sdks/subscriptions/README.md @@ -265,7 +309,7 @@ generatedFiles: - py.typed - pylintrc - pyproject.toml - - scripts/prepare-readme.py + - scripts/prepare_readme.py - scripts/publish.sh - src/speakeasy_client_sdk_python/__init__.py - src/speakeasy_client_sdk_python/_hooks/__init__.py @@ -279,24 +323,35 @@ generatedFiles: - src/speakeasy_client_sdk_python/events.py - src/speakeasy_client_sdk_python/github.py - src/speakeasy_client_sdk_python/httpclient.py + - src/speakeasy_client_sdk_python/models/__init__.py - src/speakeasy_client_sdk_python/models/errors/__init__.py - src/speakeasy_client_sdk_python/models/errors/error.py + - src/speakeasy_client_sdk_python/models/errors/no_response_error.py + - src/speakeasy_client_sdk_python/models/errors/responsevalidationerror.py - src/speakeasy_client_sdk_python/models/errors/sdkerror.py + - src/speakeasy_client_sdk_python/models/errors/speakeasyerror.py - src/speakeasy_client_sdk_python/models/internal/__init__.py - src/speakeasy_client_sdk_python/models/internal/globals.py - src/speakeasy_client_sdk_python/models/operations/__init__.py - src/speakeasy_client_sdk_python/models/operations/activatesubscriptionnamespace.py + - src/speakeasy_client_sdk_python/models/operations/archivenamespace.py - src/speakeasy_client_sdk_python/models/operations/checkgithubaccess.py - src/speakeasy_client_sdk_python/models/operations/create.py + - src/speakeasy_client_sdk_python/models/operations/createbillingaddons.py - src/speakeasy_client_sdk_python/models/operations/createfreetrial.py - src/speakeasy_client_sdk_python/models/operations/createorganization.py + - src/speakeasy_client_sdk_python/models/operations/createpublishingtoken.py - src/speakeasy_client_sdk_python/models/operations/createremotesource.py + - src/speakeasy_client_sdk_python/models/operations/createschemastoreitem.py - src/speakeasy_client_sdk_python/models/operations/createworkspace.py - src/speakeasy_client_sdk_python/models/operations/createworkspacetoken.py + - src/speakeasy_client_sdk_python/models/operations/deletebillingaddon.py + - src/speakeasy_client_sdk_python/models/operations/deletepublishingtoken.py - src/speakeasy_client_sdk_python/models/operations/deleteworkspacetoken.py - src/speakeasy_client_sdk_python/models/operations/generatecodesamplepreview.py - src/speakeasy_client_sdk_python/models/operations/generatecodesamplepreviewasync.py - src/speakeasy_client_sdk_python/models/operations/getaccesstoken.py + - src/speakeasy_client_sdk_python/models/operations/getbillingaddons.py - src/speakeasy_client_sdk_python/models/operations/getblob.py - src/speakeasy_client_sdk_python/models/operations/getchangesreportsignedurl.py - src/speakeasy_client_sdk_python/models/operations/getcodesamplepreviewasync.py @@ -309,7 +364,12 @@ generatedFiles: - src/speakeasy_client_sdk_python/models/operations/getorganization.py - src/speakeasy_client_sdk_python/models/operations/getorganizations.py - src/speakeasy_client_sdk_python/models/operations/getorganizationusage.py + - src/speakeasy_client_sdk_python/models/operations/getpublishingtoken.py + - src/speakeasy_client_sdk_python/models/operations/getpublishingtokenbyid.py + - src/speakeasy_client_sdk_python/models/operations/getpublishingtokenpublicmetadata.py + - src/speakeasy_client_sdk_python/models/operations/getpublishingtokentargetbyid.py - src/speakeasy_client_sdk_python/models/operations/getrevisions.py + - src/speakeasy_client_sdk_python/models/operations/getschemastoreitem.py - src/speakeasy_client_sdk_python/models/operations/gettags.py - src/speakeasy_client_sdk_python/models/operations/getuser.py - src/speakeasy_client_sdk_python/models/operations/getworkspace.py @@ -340,10 +400,12 @@ generatedFiles: - src/speakeasy_client_sdk_python/models/operations/revokeuseraccesstoworkspace.py - src/speakeasy_client_sdk_python/models/operations/searchworkspaceevents.py - src/speakeasy_client_sdk_python/models/operations/setvisibility.py + - src/speakeasy_client_sdk_python/models/operations/setworkspacefeatureflags.py - src/speakeasy_client_sdk_python/models/operations/suggest.py - src/speakeasy_client_sdk_python/models/operations/suggestitems.py - src/speakeasy_client_sdk_python/models/operations/suggestopenapi.py - src/speakeasy_client_sdk_python/models/operations/suggestopenapiregistry.py + - src/speakeasy_client_sdk_python/models/operations/updatepublishingtokenexpiration.py - src/speakeasy_client_sdk_python/models/operations/updateworkspacedetails.py - src/speakeasy_client_sdk_python/models/operations/updateworkspacesettings.py - src/speakeasy_client_sdk_python/models/operations/uploadreport.py @@ -355,6 +417,7 @@ generatedFiles: - src/speakeasy_client_sdk_python/models/shared/addtags.py - src/speakeasy_client_sdk_python/models/shared/annotations.py - src/speakeasy_client_sdk_python/models/shared/apikeydetails.py + - src/speakeasy_client_sdk_python/models/shared/billingaddon.py - src/speakeasy_client_sdk_python/models/shared/clievent.py - src/speakeasy_client_sdk_python/models/shared/codesampleschemainput.py - src/speakeasy_client_sdk_python/models/shared/codesamplesjobstatus.py @@ -373,6 +436,7 @@ generatedFiles: - src/speakeasy_client_sdk_python/models/shared/githubsetupstateresponse.py - src/speakeasy_client_sdk_python/models/shared/githubstorepublishingsecretsrequest.py - src/speakeasy_client_sdk_python/models/shared/githubtriggeractionrequest.py + - src/speakeasy_client_sdk_python/models/shared/httpmethod.py - src/speakeasy_client_sdk_python/models/shared/interactiontype.py - src/speakeasy_client_sdk_python/models/shared/manifest.py - src/speakeasy_client_sdk_python/models/shared/namespace.py @@ -380,15 +444,20 @@ generatedFiles: - src/speakeasy_client_sdk_python/models/shared/oasoperation.py - src/speakeasy_client_sdk_python/models/shared/oassummary.py - src/speakeasy_client_sdk_python/models/shared/organization.py + - src/speakeasy_client_sdk_python/models/shared/organizationbillingaddonrequest.py + - src/speakeasy_client_sdk_python/models/shared/organizationbillingaddonresponse.py - src/speakeasy_client_sdk_python/models/shared/organizationusage.py - src/speakeasy_client_sdk_python/models/shared/organizationusageresponse.py - src/speakeasy_client_sdk_python/models/shared/preflightrequest.py - src/speakeasy_client_sdk_python/models/shared/preflighttoken.py + - src/speakeasy_client_sdk_python/models/shared/publishingtoken.py - src/speakeasy_client_sdk_python/models/shared/remotedocument.py - src/speakeasy_client_sdk_python/models/shared/remotesource.py - src/speakeasy_client_sdk_python/models/shared/remotesourcesubscriptionsettings.py - src/speakeasy_client_sdk_python/models/shared/report.py - src/speakeasy_client_sdk_python/models/shared/revision.py + - src/speakeasy_client_sdk_python/models/shared/revisioncontentsmetadata.py + - src/speakeasy_client_sdk_python/models/shared/schemastoreitem.py - src/speakeasy_client_sdk_python/models/shared/security.py - src/speakeasy_client_sdk_python/models/shared/shorturl.py - src/speakeasy_client_sdk_python/models/shared/ssometadata.py @@ -404,14 +473,18 @@ generatedFiles: - src/speakeasy_client_sdk_python/models/shared/workflowdocument.py - src/speakeasy_client_sdk_python/models/shared/workspace.py - src/speakeasy_client_sdk_python/models/shared/workspaceandorganization.py + - src/speakeasy_client_sdk_python/models/shared/workspacefeatureflag.py + - src/speakeasy_client_sdk_python/models/shared/workspacefeatureflagrequest.py - src/speakeasy_client_sdk_python/models/shared/workspacefeatureflagresponse.py - src/speakeasy_client_sdk_python/models/shared/workspaceinviteresponse.py - src/speakeasy_client_sdk_python/models/shared/workspacesettings.py - src/speakeasy_client_sdk_python/models/shared/workspaceteamresponse.py - src/speakeasy_client_sdk_python/models/shared/workspacetoken.py - src/speakeasy_client_sdk_python/organizations.py + - src/speakeasy_client_sdk_python/publishingtokens.py - src/speakeasy_client_sdk_python/py.typed - src/speakeasy_client_sdk_python/reports.py + - src/speakeasy_client_sdk_python/schemastore.py - src/speakeasy_client_sdk_python/sdk.py - src/speakeasy_client_sdk_python/sdkconfiguration.py - src/speakeasy_client_sdk_python/shorturls.py @@ -421,6 +494,7 @@ generatedFiles: - src/speakeasy_client_sdk_python/types/basemodel.py - src/speakeasy_client_sdk_python/utils/__init__.py - src/speakeasy_client_sdk_python/utils/annotations.py + - src/speakeasy_client_sdk_python/utils/datetimes.py - src/speakeasy_client_sdk_python/utils/enums.py - src/speakeasy_client_sdk_python/utils/eventstreaming.py - src/speakeasy_client_sdk_python/utils/forms.py @@ -432,6 +506,7 @@ generatedFiles: - src/speakeasy_client_sdk_python/utils/retries.py - src/speakeasy_client_sdk_python/utils/security.py - src/speakeasy_client_sdk_python/utils/serializers.py + - src/speakeasy_client_sdk_python/utils/unmarshal_json_response.py - src/speakeasy_client_sdk_python/utils/url.py - src/speakeasy_client_sdk_python/utils/values.py - src/speakeasy_client_sdk_python/workspaces.py @@ -440,7 +515,7 @@ examples: speakeasy-default-create-remote-source: responses: 4XX: - application/json: {"message": "", "status_code": 580557} + application/json: {"message": "", "status_code": 314779} getBlob: speakeasy-default-get-blob: parameters: @@ -450,8 +525,10 @@ examples: namespace_name: "" digest: "" responses: + 2XX: + application/octet-stream: "x-file: example.file" 4XX: - application/json: {"message": "", "status_code": 115307} + application/json: {"message": "", "status_code": 614230} getManifest: speakeasy-default-get-manifest: parameters: @@ -464,25 +541,24 @@ examples: 2XX: application/vnd.oci.image.manifest.v1+json: {"layers": [{"digest": "sha256:5d20c808ce198565ff70b3ed23a991dd49afac45dece63474b27ce6ed036adc6", "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip", "size": 2107098}], "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "schemaVersion": 2} 4XX: - application/json: {"message": "", "status_code": 707258} + application/json: {"message": "", "status_code": 951684} getNamespaces: speakeasy-default-get-namespaces: responses: 2XX: - application/json: {"items": [{"created_at": "2025-01-19T10:11:46.428Z", "id": "", "name": "", "updated_at": "2023-01-07T04:43:36.873Z"}, {"created_at": "2024-07-05T07:26:30.970Z", "id": "", "name": "", "updated_at": "2025-01-30T11:34:19.590Z"}, {"created_at": "2023-08-10T13:43:30.983Z", "id": "", "name": "", "updated_at": "2023-07-15T08:41:36.371Z"}]} + application/json: {"items": []} 4XX: - application/json: {"message": "", "status_code": 305198} + application/json: {"message": "", "status_code": 442334} getRevisions: speakeasy-default-get-revisions: parameters: path: namespace_name: "" - query: {} responses: 2XX: - application/json: {"items": [{"created_at": "2025-09-16T19:17:04.361Z", "digest": "sha256:6d1ef012b5674ad8a127ecfa9b5e6f5178d171b90ee462846974177fd9bdd39f", "id": "", "namespace_name": "", "tags": [""], "updated_at": "2024-12-05T05:58:38.953Z"}], "next_page_token": ""} + application/json: {"items": [{"created_at": "2024-04-08T17:06:20.340Z", "digest": "sha256:6d1ef012b5674ad8a127ecfa9b5e6f5178d171b90ee462846974177fd9bdd39f", "id": "", "namespace_name": "", "tags": ["", "", ""], "updated_at": "2025-11-19T01:05:11.002Z"}], "next_page_token": ""} 4XX: - application/json: {"message": "", "status_code": 414389} + application/json: {"message": "", "status_code": 503937} getTags: speakeasy-default-get-tags: parameters: @@ -490,9 +566,9 @@ examples: namespace_name: "" responses: 2XX: - application/json: {"items": []} + application/json: {"items": [{"id": "", "name": "", "namespace_name": "", "revision_digest": ""}]} 4XX: - application/json: {"message": "", "status_code": 50428} + application/json: {"message": "", "status_code": 293534} listRemoteSources: speakeasy-default-list-remote-sources: parameters: @@ -500,9 +576,9 @@ examples: namespace_name: "" responses: 2XX: - application/json: {"inputs": [{"registry_url": "https://well-lit-cap.net"}, {"registry_url": "https://vibrant-labourer.net"}], "output": {"registry_url": "https://unfit-minor.biz"}} + application/json: {"inputs": [], "output": {"registry_url": "https://happy-substitution.com"}} 4XX: - application/json: {"message": "", "status_code": 754391} + application/json: {"message": "", "status_code": 672449} postTags: speakeasy-default-post-tags: parameters: @@ -510,14 +586,22 @@ examples: namespace_name: "" responses: 4XX: - application/json: {"message": "", "status_code": 581484} + application/json: {"message": "", "status_code": 418537} preflight: speakeasy-default-preflight: responses: 2XX: application/json: {} 4XX: - application/json: {"message": "", "status_code": 820828} + application/json: {"message": "", "status_code": 626529} + archiveNamespace: + speakeasy-default-archive-namespace: + parameters: + path: + namespace_name: "" + responses: + 4XX: + application/json: {"message": "", "status_code": 726683} setVisibility: speakeasy-default-set-visibility: parameters: @@ -525,12 +609,12 @@ examples: namespace_name: "" responses: 4XX: - application/json: {"message": "", "status_code": 651364} + application/json: {"message": "", "status_code": 669253} getWorkspaceAccess: speakeasy-default-get-workspace-access: responses: 2XX: - application/json: {"generation_allowed": true, "message": ""} + application/json: {"generation_allowed": false, "message": ""} getAccessToken: speakeasy-default-get-access-token: parameters: @@ -538,59 +622,72 @@ examples: workspace_id: "" responses: 2XX: - application/json: {"access_token": ""} + application/json: {"access_token": "", "claims": {}, "user": {}} 4XX: - application/json: {"message": "", "status_code": 299050} + application/json: {"message": "", "status_code": 646748} getUser: speakeasy-default-get-user: responses: 2XX: - application/json: {"admin": false, "confirmed": true, "created_at": "2025-09-05T08:59:40.988Z", "display_name": "Tianna_Prohaska", "email": "Morton82@gmail.com", "email_verified": false, "id": "", "updated_at": "2023-08-28T03:26:52.335Z", "whitelisted": true} + application/json: {"admin": true, "confirmed": true, "created_at": "2025-07-25T03:12:15.738Z", "display_name": "Gunnar6", "email": "Ernesto40@gmail.com", "email_verified": false, "id": "", "updated_at": "2025-07-05T00:21:52.607Z", "whitelisted": false} 4XX: - application/json: {"message": "", "status_code": 237845} + application/json: {"message": "", "status_code": 527542} validateApiKey: speakeasy-default-validate-api-key: responses: 2XX: - application/json: {"account_type_v2": "enterprise", "enabled_features": ["", "", ""], "org_slug": "", "telemetry_disabled": true, "workspace_created_at": "2024-02-05T22:57:49.657Z", "workspace_id": "", "workspace_slug": ""} + application/json: {"account_type_v2": "scale-up", "billing_add_ons": [], "enabled_features": ["", "", ""], "org_slug": "", "telemetry_disabled": true, "workspace_created_at": "2023-12-15T07:11:54.529Z", "workspace_id": "", "workspace_slug": ""} 4XX: - application/json: {"message": "", "status_code": 150892} + application/json: {"message": "", "status_code": 532463} generateCodeSamplePreview: - speakeasy-default-generate-code-sample-preview: + default: requestBody: - multipart/form-data: {"languages": ["", ""], "schema_file": {"": "example.file"}} + multipart/form-data: {"language": "", "schema_file": "x-file: example.file"} responses: - 4XX: - application/json: {"message": "", "status_code": 140843} + 2XX: + application/json: {"snippets": [{"code": "import { Petstore } from \"petstore-sdk\";\n\nconst petstore = new Petstore({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await petstore.pet.getById({\n id: 137396,\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();", "language": "typescript", "method": "get", "operationId": "getPetById", "path": "/pet/{id}"}]} generateCodeSamplePreviewAsync: speakeasy-default-generate-code-sample-preview-async: requestBody: - multipart/form-data: {"languages": ["", ""], "schema_file": {"": "example.file"}} + multipart/form-data: {"language": "", "schema_file": "x-file: example.file"} responses: "202": application/json: {"job_id": "", "status": "pending"} 4XX: - application/json: {"message": "", "status_code": 282243} + application/json: {"message": "", "status_code": 431188} + 5XX: + application/json: {"message": "", "status_code": 431188} getCodeSamples: speakeasy-default-get-code-samples: parameters: query: - registry_url: "https://normal-making.name" + registry_url: "https://spec.speakeasy.com/my-org/my-workspace/my-source" + operation_ids: ["getPets"] + method_paths: [{"method": "get", "path": "/pets"}] + languages: ["python", "javascript"] responses: 2XX: - application/json: {"snippets": [{"code": "", "language": "", "operationId": ""}, {"code": "", "language": "", "operationId": ""}, {"code": "", "language": "", "operationId": ""}]} + application/json: {"snippets": []} 4XX: - application/json: {"message": "", "status_code": 458049} + application/json: {"message": "", "status_code": 887801} + default: + parameters: + query: + registry_url: "https://spec.speakeasy.com/my-org/my-workspace/my-source" + operation_ids: ["getPets"] + method_paths: [{"method": "get", "path": "/pets"}] + languages: ["python", "javascript"] + responses: + 2XX: + application/json: {"snippets": [{"code": "import { Petstore } from \"petstore-sdk\";\n\nconst petstore = new Petstore({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await petstore.pet.getById({\n id: 137396,\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();", "language": "typescript", "method": "get", "operationId": "getPetById", "path": "/pet/{id}"}]} getCodeSamplePreviewAsync: - speakeasy-default-get-code-sample-preview-async: + default: parameters: path: jobID: "" responses: - "202": - application/json: {"status": "pending"} - 4XX: - application/json: {"message": "", "status_code": 44984} + 2XX: + application/json: {"snippets": [{"code": "import { Petstore } from \"petstore-sdk\";\n\nconst petstore = new Petstore({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await petstore.pet.getById({\n id: 137396,\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();", "language": "typescript", "method": "get", "operationId": "getPetById", "path": "/pet/{id}"}]} checkGithubAccess: speakeasy-default-check-github-access: parameters: @@ -599,7 +696,7 @@ examples: repo: "" responses: 4XX: - application/json: {"message": "", "status_code": 74604} + application/json: {"message": "", "status_code": 292890} githubCheckPublishingPRs: speakeasy-default-github-check-publishing-P-rs: parameters: @@ -611,7 +708,7 @@ examples: 2XX: application/json: {} 4XX: - application/json: {"message": "", "status_code": 670562} + application/json: {"message": "", "status_code": 64289} githubCheckPublishingSecrets: speakeasy-default-github-check-publishing-secrets: parameters: @@ -621,30 +718,30 @@ examples: 2XX: application/json: {} 4XX: - application/json: {"message": "", "status_code": 749379} + application/json: {"message": "", "status_code": 929456} githubConfigureCodeSamples: speakeasy-default-github-configure-code-samples: requestBody: application/json: {"org": "", "repo": "", "targetName": ""} responses: 2XX: - application/json: {"codeSampleOverlayRegistryURL": "https://giving-handover.net", "source": {"location": ""}} + application/json: {"codeSampleOverlayRegistryURL": "https://flustered-mountain.net/", "source": {"location": ""}} 4XX: - application/json: {"message": "", "status_code": 628169} + application/json: {"message": "", "status_code": 382989} githubConfigureMintlifyRepo: speakeasy-default-github-configure-mintlify-repo: requestBody: - application/json: {"input": "", "org": "", "overlays": [""], "repo": ""} + application/json: {"input": "", "org": "", "overlays": [""], "repo": ""} responses: 4XX: - application/json: {"message": "", "status_code": 529873} + application/json: {"message": "", "status_code": 685904} githubConfigureTarget: speakeasy-default-github-configure-target: requestBody: application/json: {"org": "", "repo_name": ""} responses: 4XX: - application/json: {"message": "", "status_code": 210299} + application/json: {"message": "", "status_code": 285752} getGitHubAction: speakeasy-default-get-git-hub-action: parameters: @@ -655,7 +752,7 @@ examples: 2XX: application/json: {} 4XX: - application/json: {"message": "", "status_code": 252330} + application/json: {"message": "", "status_code": 413434} getGithubSetupState: speakeasy-default-get-github-setup-state: parameters: @@ -665,42 +762,59 @@ examples: generate_gen_lock_id: "" responses: 2XX: - application/json: {"actions": {"generation_action_configured": false, "publish_action_configured": false}, "app_installed": false, "secrets": {"api_key_configured": true, "publishing_secrets_configured": true}} + application/json: {"actions": {"generation_action_configured": true, "publish_action_configured": true}, "app_installed": true, "secrets": {"api_key_configured": true, "publishing_secrets_configured": false}} 4XX: - application/json: {"message": "", "status_code": 743106} + application/json: {"message": "", "status_code": 78009} linkGithubAccess: speakeasy-default-link-github-access: responses: 4XX: - application/json: {"message": "", "status_code": 774553} + application/json: {"message": "", "status_code": 829955} githubStorePublishingSecrets: speakeasy-default-github-store-publishing-secrets: requestBody: application/json: {"generate_gen_lock_id": ""} responses: 4XX: - application/json: {"message": "", "status_code": 444361} + application/json: {"message": "", "status_code": 258052} githubTriggerAction: speakeasy-default-github-trigger-action: requestBody: application/json: {"gen_lock_id": "", "org": "", "repo_name": ""} responses: 4XX: - application/json: {"message": "", "status_code": 689611} + application/json: {"message": "", "status_code": 124849} createOrganization: speakeasy-default-create-organization: requestBody: - application/json: {"account_type": "scale-up", "created_at": "2024-11-30T17:06:07.804Z", "id": "", "name": "", "slug": "", "sso_activated": true, "telemetry_disabled": true, "updated_at": "2023-03-17T15:39:20.911Z"} + application/json: {"account_type": "scale-up", "created_at": "2025-10-26T09:05:00.560Z", "id": "", "name": "", "slug": "", "sso_activated": false, "telemetry_disabled": false, "updated_at": "2023-12-23T08:00:51.380Z"} responses: 2XX: - application/json: {"account_type": "enterprise", "created_at": "2025-11-08T08:43:39.394Z", "id": "", "name": "", "slug": "", "sso_activated": true, "telemetry_disabled": true, "updated_at": "2023-04-09T14:25:29.356Z"} + application/json: {"account_type": "free", "created_at": "2025-06-13T19:16:50.186Z", "id": "", "name": "", "slug": "", "sso_activated": false, "telemetry_disabled": true, "updated_at": "2024-03-27T19:13:33.227Z"} 4XX: - application/json: {"message": "", "status_code": 792620} + application/json: {"message": "", "status_code": 634641} + createBillingAddOns: + speakeasy-default-create-billing-add-ons: + requestBody: + application/json: {"add_ons": ["custom_code_regions"]} + responses: + "200": + application/json: {"add_ons": []} + 5XX: + application/json: {"message": "", "status_code": 501320} createFreeTrial: speakeasy-default-create-free-trial: responses: 4XX: - application/json: {"message": "", "status_code": 728627} + application/json: {"message": "", "status_code": 822669} + deleteBillingAddOn: + speakeasy-default-delete-billing-add-on: + parameters: + path: + add_on: "sdk_testing" + responses: + 5XX: + application/json: {"message": "", "status_code": 844353} getOrganization: speakeasy-default-get-organization: parameters: @@ -708,23 +822,90 @@ examples: organizationID: "" responses: 2XX: - application/json: {"account_type": "business", "created_at": "2024-09-04T11:33:52.011Z", "id": "", "name": "", "slug": "", "sso_activated": false, "telemetry_disabled": false, "updated_at": "2025-11-29T01:50:48.954Z"} + application/json: {"account_type": "scale-up", "created_at": "2024-10-13T14:22:14.424Z", "id": "", "name": "", "slug": "", "sso_activated": false, "telemetry_disabled": true, "updated_at": "2024-05-28T14:00:19.557Z"} 4XX: - application/json: {"message": "", "status_code": 458049} + application/json: {"message": "", "status_code": 924479} getOrganizations: speakeasy-default-get-organizations: responses: 2XX: - application/json: [{"account_type": "free", "created_at": "2024-10-17T22:25:06.537Z", "id": "", "name": "", "slug": "", "sso_activated": false, "telemetry_disabled": true, "updated_at": "2024-05-22T13:01:16.115Z"}] + application/json: [{"account_type": "free", "created_at": "2025-01-26T18:20:48.179Z", "id": "", "name": "", "slug": "", "sso_activated": false, "telemetry_disabled": true, "updated_at": "2025-06-30T11:58:00.293Z"}] 4XX: - application/json: {"message": "", "status_code": 621425} + application/json: {"message": "", "status_code": 367315} + getBillingAddOns: + speakeasy-default-get-billing-add-ons: + responses: + "200": + application/json: {"add_ons": ["snippet_ai"]} + 5XX: + application/json: {"message": "", "status_code": 576599} getOrganizationUsage: speakeasy-default-get-organization-usage: responses: 2XX: - application/json: {"allowed_languages": [], "total_allowed_languages": 863126, "usage": [{"accessible": false, "accessible_features": [""], "gen_lock_ids": ["", "", ""], "language": "", "max_operations": 939867, "number_of_operations": 881790, "used_features": [""], "workspaces": ["", ""]}, {"accessible": true, "accessible_features": ["", "", ""], "gen_lock_ids": [""], "language": "", "max_operations": 593645, "number_of_operations": 369818, "used_features": [""], "workspaces": []}]} + application/json: {"allowed_languages": ["", ""], "total_allowed_languages": 68444, "usage": []} + 4XX: + application/json: {"message": "", "status_code": 577242} + createPublishingToken: + speakeasy-default-create-publishing-token: + responses: + "200": + application/json: {"created_at": "2023-03-05T16:00:09.135Z", "created_by": "", "id": "", "organization_id": "", "target_id": "", "target_resource": "document", "token": "", "token_name": "", "valid_until": "2023-04-09T03:55:02.077Z", "workspace_id": ""} + 4XX: + application/json: {"message": "", "status_code": 956440} + deletePublishingToken: + speakeasy-default-delete-publishing-token: + parameters: + path: + tokenID: "" + responses: + 4XX: + application/json: {"message": "", "status_code": 411698} + getPublishingTokenByID: + speakeasy-default-get-publishing-token-by-ID: + parameters: + path: + tokenID: "" + responses: + "200": + application/json: {"created_at": "2024-12-02T05:03:56.616Z", "created_by": "", "id": "", "organization_id": "", "target_id": "", "target_resource": "document", "token": "", "token_name": "", "valid_until": "2023-06-04T22:39:04.224Z", "workspace_id": ""} + 4XX: + application/json: {"message": "", "status_code": 560933} + getPublishingToken: + speakeasy-default-get-publishing-token: + responses: + "200": + application/json: [{"created_at": "2024-10-15T09:36:59.033Z", "created_by": "", "id": "", "organization_id": "", "target_id": "", "target_resource": "document", "token": "", "token_name": "", "valid_until": "2025-03-31T17:27:20.802Z", "workspace_id": ""}] 4XX: - application/json: {"message": "", "status_code": 804495} + application/json: {"message": "", "status_code": 464289} + getPublishingTokenPublicMetadata: + speakeasy-default-get-publishing-token-public-metadata: + parameters: + path: + tokenID: "" + responses: + "200": + application/json: {} + 4XX: + application/json: {"message": "", "status_code": 833471} + getPublishingTokenTargetByID: + speakeasy-default-get-publishing-token-target-by-ID: + parameters: + path: + tokenID: "" + responses: + "200": + text/plain: "" + 4XX: + application/json: {"message": "", "status_code": 690090} + updatePublishingTokenExpiration: + speakeasy-default-update-publishing-token-expiration: + parameters: + path: + tokenID: "" + responses: + 4XX: + application/json: {"message": "", "status_code": 324979} getChangesReportSignedUrl: speakeasy-default-get-changes-report-signed-url: parameters: @@ -732,7 +913,7 @@ examples: documentChecksum: "" responses: 2XX: - application/json: {"url": "https://rosy-masterpiece.biz/"} + application/json: {"url": "https://babyish-foodstuffs.info/"} getLintingReportSignedUrl: speakeasy-default-get-linting-report-signed-url: parameters: @@ -740,21 +921,37 @@ examples: documentChecksum: "" responses: 2XX: - application/json: {"url": "https://negligible-merit.info"} + application/json: {"url": "https://somber-lashes.org/"} uploadReport: speakeasy-default-upload-report: requestBody: - multipart/form-data: {"file": {"": "example.file"}} + multipart/form-data: {"data": {}, "file": "x-file: example.file"} + responses: + 2XX: + application/json: {"url": "https://aged-armoire.info"} + createSchemaStoreItem: + speakeasy-default-create-schema-store-item: + requestBody: + application/json: {"format": "yaml", "packageName": "", "sdkClassname": "", "spec": ""} responses: 2XX: - application/json: {"url": "https://cluttered-stall.info"} + application/json: {"created_at": "2023-06-13T18:33:55.488Z", "format": "json", "id": "", "packageName": "", "sdkClassname": "", "spec": ""} + 4XX: + application/json: {"message": "", "status_code": 865252} + getSchemaStoreItem: + speakeasy-default-get-schema-store-item: + responses: + 2XX: + application/json: {"created_at": "2024-08-18T15:04:44.601Z", "format": "yaml", "id": "", "packageName": "", "sdkClassname": "", "spec": ""} + 4XX: + application/json: {"message": "", "status_code": 59948} create: speakeasy-default-create: requestBody: - application/json: {"url": "https://probable-heating.com/"} + application/json: {"url": "https://exalted-heroine.org/"} responses: 2XX: - application/json: {"full_url": "https://standard-utilization.com/", "short_url": "https://brisk-seafood.net/"} + application/json: {"full_url": "https://merry-luck.info", "short_url": "https://stable-tomb.biz/"} activateSubscriptionNamespace: speakeasy-default-activate-subscription-namespace: parameters: @@ -763,7 +960,7 @@ examples: namespaceName: "" responses: 4XX: - application/json: {"message": "", "status_code": 566510} + application/json: {"message": "", "status_code": 496630} ignoreSubscriptionNamespace: speakeasy-default-ignore-subscription-namespace: parameters: @@ -772,28 +969,34 @@ examples: namespaceName: "" responses: 4XX: - application/json: {"message": "", "status_code": 844164} + application/json: {"message": "", "status_code": 60658} suggest: speakeasy-default-suggest: parameters: header: x-session-id: "" requestBody: - application/json: {"diagnostics": [{"message": "", "path": ["/opt/include", "/opt/share"], "type": ""}, {"message": "", "path": [], "type": ""}], "oas_summary": {"info": {"description": "amid traffic the unfortunately underneath what father lovely out", "summary": "", "title": "", "version": ""}, "operations": [{"description": "times dull than except", "method": "", "operation_id": "", "path": "/mnt", "tags": ["", ""]}]}, "suggestion_type": "diagnostics-only"} + application/json: {"diagnostics": [{"message": "", "path": ["/usr/src"], "type": ""}], "oas_summary": {"info": {"description": "prioritize bell vainly", "license": {}, "summary": "", "title": "", "version": ""}, "operations": [{"description": "though since instead accurate safe unnaturally charming", "method": "", "operation_id": "", "path": "/usr/local/bin", "tags": ["", ""]}]}, "suggestion_type": "method-names"} + responses: + 2XX: + application/json: "x-file: example.file" suggestItems: speakeasy-default-suggest-items: requestBody: - application/json: {"items": [], "prompt": ""} + application/json: {"items": [""], "prompt": ""} responses: 2XX: - application/json: ["", ""] + application/json: ["", ""] suggestOpenAPI: speakeasy-default-suggest-open-API: parameters: header: x-session-id: "" requestBody: - multipart/form-data: {"schema": {"": "example.file"}} + multipart/form-data: {"schema": "x-file: example.file"} + responses: + 2XX: + application/json: "x-file: example.file" suggestOpenAPIRegistry: speakeasy-default-suggest-open-API-registry: parameters: @@ -802,25 +1005,28 @@ examples: revision_reference: "" header: x-session-id: "" + responses: + 2XX: + application/json: "x-file: example.file" createWorkspace: speakeasy-default-create-workspace: requestBody: - application/json: {"created_at": "2024-06-17T07:14:55.338Z", "id": "", "name": "", "organization_id": "", "slug": "", "updated_at": "2024-11-30T17:06:07.804Z", "verified": true} + application/json: {"created_at": "2023-11-18T13:41:10.525Z", "id": "", "name": "", "organization_id": "", "slug": "", "updated_at": "2024-11-21T08:36:32.740Z", "verified": true} responses: 2XX: - application/json: {"created_at": "2023-05-28T06:20:22.766Z", "id": "", "name": "", "organization_id": "", "slug": "", "updated_at": "2023-03-17T15:39:20.911Z", "verified": false} + application/json: {"created_at": "2023-04-24T17:11:44.872Z", "id": "", "name": "", "organization_id": "", "slug": "", "updated_at": "2023-07-24T11:15:07.239Z", "verified": false} 4XX: - application/json: {"message": "", "status_code": 951062} + application/json: {"message": "", "status_code": 373179} createWorkspaceToken: speakeasy-default-create-workspace-token: parameters: path: workspace_id: "" requestBody: - application/json: {"alg": "", "created_at": "2023-08-16T02:33:00.784Z", "id": "", "key": "", "name": "", "workspace_id": ""} + application/json: {"alg": "", "created_at": "2024-10-04T10:23:04.522Z", "id": "", "key": "", "name": "", "workspace_id": ""} responses: 4XX: - application/json: {"message": "", "status_code": 966454} + application/json: {"message": "", "status_code": 869423} deleteWorkspaceToken: speakeasy-default-delete-workspace-token: parameters: @@ -829,21 +1035,21 @@ examples: tokenID: "" responses: 4XX: - application/json: {"message": "", "status_code": 120260} + application/json: {"message": "", "status_code": 478706} getWorkspaceByContext: speakeasy-default-get-workspace-by-context: responses: 2XX: - application/json: {"organization": {"account_type": "business", "created_at": "2024-09-04T11:33:52.011Z", "id": "", "name": "", "slug": "", "sso_activated": false, "telemetry_disabled": false, "updated_at": "2025-11-29T01:50:48.954Z"}, "workspace": {"created_at": "2024-05-17T00:32:02.244Z", "id": "", "name": "", "organization_id": "", "slug": "", "updated_at": "2024-05-09T02:28:23.533Z", "verified": true}} + application/json: {"organization": {"account_type": "free", "created_at": "2024-11-04T19:58:57.410Z", "id": "", "name": "", "slug": "", "sso_activated": true, "telemetry_disabled": true, "updated_at": "2023-03-22T01:46:46.818Z"}, "workspace": {"created_at": "2023-06-27T03:14:56.721Z", "id": "", "name": "", "organization_id": "", "slug": "", "updated_at": "2024-04-17T17:49:11.505Z", "verified": false}} 4XX: - application/json: {"message": "", "status_code": 213457} + application/json: {"message": "", "status_code": 305240} getWorkspaces: speakeasy-default-get-workspaces: responses: 2XX: - application/json: [{"created_at": "2023-03-06T21:36:22.528Z", "id": "", "name": "", "organization_id": "", "slug": "", "updated_at": "2024-10-17T22:25:06.537Z", "verified": false}] + application/json: [{"created_at": "2025-04-04T16:14:43.471Z", "id": "", "name": "", "organization_id": "", "slug": "", "updated_at": "2023-01-19T03:44:32.150Z", "verified": false}] 4XX: - application/json: {"message": "", "status_code": 16308} + application/json: {"message": "", "status_code": 660531} getWorkspace: speakeasy-default-get-workspace: parameters: @@ -851,9 +1057,9 @@ examples: workspace_id: "" responses: 2XX: - application/json: {"created_at": "2025-11-17T10:14:22.985Z", "id": "", "name": "", "organization_id": "", "slug": "", "updated_at": "2025-07-28T15:04:25.117Z", "verified": false} + application/json: {"created_at": "2024-12-18T07:48:58.821Z", "id": "", "name": "", "organization_id": "", "slug": "", "updated_at": "2025-06-24T23:43:05.468Z", "verified": true} 4XX: - application/json: {"message": "", "status_code": 868924} + application/json: {"message": "", "status_code": 239288} getWorkspaceFeatureFlags: speakeasy-default-get-workspace-feature-flags: parameters: @@ -863,7 +1069,7 @@ examples: "200": application/json: {} 5XX: - application/json: {"message": "", "status_code": 104495} + application/json: {"message": "", "status_code": 689983} getWorkspaceSettings: speakeasy-default-get-workspace-settings: parameters: @@ -871,9 +1077,9 @@ examples: workspace_id: "" responses: 2XX: - application/json: {"created_at": "2025-05-29T22:34:47.605Z", "updated_at": "2024-02-24T21:50:01.663Z", "webhook_url": "https://different-amendment.com/", "workspace_id": ""} + application/json: {"created_at": "2025-01-01T09:37:48.245Z", "updated_at": "2025-10-09T10:59:45.889Z", "webhook_url": "https://dirty-taxicab.name/", "workspace_id": ""} 4XX: - application/json: {"message": "", "status_code": 864485} + application/json: {"message": "", "status_code": 88356} getWorkspaceTeam: speakeasy-default-get-workspace-team: parameters: @@ -883,7 +1089,7 @@ examples: 2XX: application/json: {"users": []} 4XX: - application/json: {"message": "", "status_code": 194974} + application/json: {"message": "", "status_code": 227320} getWorkspaceTokens: speakeasy-default-get-workspace-tokens: parameters: @@ -891,20 +1097,20 @@ examples: workspace_id: "" responses: 2XX: - application/json: [{"alg": "", "created_at": "2024-06-30T03:05:24.969Z", "id": "", "key": "", "name": "", "workspace_id": ""}, {"alg": "", "created_at": "2024-11-09T11:33:52.654Z", "id": "", "key": "", "name": "", "workspace_id": ""}, {"alg": "", "created_at": "2024-11-05T09:03:46.133Z", "id": "", "key": "", "name": "", "workspace_id": ""}] + application/json: [{"alg": "", "created_at": "2024-09-13T14:17:43.018Z", "id": "", "key": "", "name": "", "workspace_id": ""}] 4XX: - application/json: {"message": "", "status_code": 858647} + application/json: {"message": "", "status_code": 306057} grantUserAccessToWorkspace: speakeasy-default-grant-user-access-to-workspace: parameters: path: workspace_id: "" - email: "Lucinda.Batz8@hotmail.com" + email: "Idella24@gmail.com" responses: "200": application/json: {"relationship": {"user_id": "", "workspace_id": ""}} 4XX: - application/json: {"message": "", "status_code": 621540} + application/json: {"message": "", "status_code": 146190} revokeUserAccessToWorkspace: speakeasy-default-revoke-user-access-to-workspace: parameters: @@ -913,76 +1119,83 @@ examples: userId: "" responses: 4XX: - application/json: {"message": "", "status_code": 243814} + application/json: {"message": "", "status_code": 910892} + setWorkspaceFeatureFlags: + speakeasy-default-set-workspace-feature-flags: + requestBody: + application/json: {"feature_flags": []} + responses: + "200": + application/json: {} + 5XX: + application/json: {"message": "", "status_code": 831800} updateWorkspaceDetails: speakeasy-default-update-workspace-details: parameters: path: workspace_id: "" requestBody: - application/json: {"created_at": "2025-07-28T19:04:48.565Z", "id": "", "name": "", "organization_id": "", "slug": "", "updated_at": "2024-10-16T10:52:42.015Z", "verified": true} + application/json: {"created_at": "2023-08-02T22:30:24.264Z", "id": "", "name": "", "organization_id": "", "slug": "", "updated_at": "2025-01-24T03:53:13.581Z", "verified": true} responses: 4XX: - application/json: {"message": "", "status_code": 991464} + application/json: {"message": "", "status_code": 708653} updateWorkspaceSettings: speakeasy-default-update-workspace-settings: parameters: path: workspace_id: "" requestBody: - application/json: {"created_at": "2023-07-05T11:43:28.305Z", "updated_at": "2024-05-14T05:39:21.874Z", "webhook_url": "https://grown-pharmacopoeia.net", "workspace_id": ""} + application/json: {"created_at": "2025-03-09T15:48:09.330Z", "updated_at": "2025-11-24T16:37:53.492Z", "webhook_url": "https://wobbly-lid.org", "workspace_id": ""} responses: 4XX: - application/json: {"message": "", "status_code": 54657} + application/json: {"message": "", "status_code": 911456} getWorkspaceEventsByTarget: speakeasy-default-get-workspace-events-by-target: parameters: path: workspace_id: "" target_id: "" - query: {} responses: "200": - application/json: [] + application/json: [{"created_at": "2023-04-02T15:35:18.939Z", "execution_id": "", "id": "", "interaction_type": "TARGET_GENERATE", "local_started_at": "2025-04-06T11:11:25.699Z", "speakeasy_api_key_name": "", "speakeasy_version": "", "success": false, "workspace_id": ""}] 5XX: - application/json: {"message": "", "status_code": 296981} + application/json: {"message": "", "status_code": 224805} getWorkspaceTargets: speakeasy-default-get-workspace-targets: responses: "200": - application/json: [{"generate_gen_lock_id": "", "generate_target": "", "id": "", "last_event_created_at": "2025-12-14T05:15:52.449Z", "last_event_id": "", "last_event_interaction_type": "TARGET_GENERATE"}, {"generate_gen_lock_id": "", "generate_target": "", "id": "", "last_event_created_at": "2023-05-31T08:33:28.499Z", "last_event_id": "", "last_event_interaction_type": "CLI_EXEC"}] + application/json: [{"generate_gen_lock_id": "", "generate_target": "", "id": "", "last_event_created_at": "2025-11-25T04:49:38.730Z", "last_event_id": "", "last_event_interaction_type": "AUTHENTICATE"}] 5XX: - application/json: {"message": "", "status_code": 801192} + application/json: {"message": "", "status_code": 869083} getWorkspaceTargetsDeprecated: speakeasy-default-get-workspace-targets-deprecated: parameters: path: workspace_id: "" - query: {} responses: "200": - application/json: [] + application/json: [{"generate_gen_lock_id": "", "generate_target": "", "id": "", "last_event_created_at": "2023-03-04T07:55:39.835Z", "last_event_id": "", "last_event_interaction_type": "QUICKSTART"}] 5XX: - application/json: {"message": "", "status_code": 255923} + application/json: {"message": "", "status_code": 397013} postWorkspaceEvents: speakeasy-default-post-workspace-events: parameters: path: workspace_id: "" requestBody: - application/json: [{"created_at": "2025-03-02T10:07:28.113Z", "execution_id": "", "id": "", "interaction_type": "AUTHENTICATE", "local_started_at": "2025-08-12T17:54:17.538Z", "speakeasy_api_key_name": "", "speakeasy_version": "", "success": true, "workspace_id": ""}] + application/json: [{"created_at": "2023-02-16T09:12:42.397Z", "execution_id": "", "id": "", "interaction_type": "QUICKSTART", "local_started_at": "2024-01-24T01:13:51.002Z", "speakeasy_api_key_name": "", "speakeasy_version": "", "success": true, "workspace_id": ""}] responses: 5XX: - application/json: {"message": "", "status_code": 630719} + application/json: {"message": "", "status_code": 104921} searchWorkspaceEvents: speakeasy-default-search-workspace-events: parameters: path: workspace_id: "" - query: {} responses: "200": - application/json: [{"created_at": "2024-01-24T23:49:11.608Z", "execution_id": "", "id": "", "interaction_type": "LINT", "local_started_at": "2023-03-09T07:00:10.489Z", "speakeasy_api_key_name": "", "speakeasy_version": "", "success": true, "workspace_id": ""}] + application/json: [{"created_at": "2024-08-19T16:09:42.068Z", "execution_id": "", "id": "", "interaction_type": "TEST", "local_started_at": "2024-07-02T15:46:28.663Z", "speakeasy_api_key_name": "", "speakeasy_version": "", "success": false, "workspace_id": ""}] 5XX: - application/json: {"message": "", "status_code": 238575} + application/json: {"message": "", "status_code": 436496} +examplesVersion: 1.0.2 generatedTests: {} diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index b2e5b8f6..d38861ce 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -3,23 +3,33 @@ generation: sdkClassName: speakeasy usageSnippets: optionalPropertyRendering: withExample + sdkInitStyle: constructor fixes: nameResolutionDec2023: true + nameResolutionFeb2025: false parameterOrderingFeb2024: true requestResponseComponentNamesFeb2024: true + securityFeb2025: false + sharedErrorComponentsApr2025: false auth: oAuth2ClientCredentialsEnabled: false oAuth2PasswordEnabled: false + tests: + generateTests: true + generateNewTests: false + skipResponseBodyAssertions: false python: - version: 7.0.0-rc.2 + version: 7.0.0-rc.3 additionalDependencies: dev: {} main: {} authors: - Speakeasy + baseErrorName: SpeakeasyError clientServerStatusCodesAsErrors: true defaultErrorName: SDKError description: Speakeasy API Client SDK for Python + enableCustomCodeRegions: false enumFormat: enum fixFlags: responseRequiredSep2024: false @@ -37,8 +47,11 @@ python: inputModelSuffix: input maxMethodParams: 0 methodArguments: require-security-and-request + moduleName: "" outputModelSuffix: output packageName: speakeasy-client-sdk-python projectUrls: {} + pytestFilterWarnings: [] + pytestTimeout: 0 responseFormat: envelope templateVersion: v2 diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 5e339eff..b4c0165a 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,21 +1,21 @@ -speakeasyVersion: 1.462.2 +speakeasyVersion: 1.595.0 sources: speakeasy-openapi: sourceNamespace: speakeasy-openapi - sourceRevisionDigest: sha256:79fa1cda10dbe045bf4d56fd367cebff8244f2cf789740c759e44ba91be16cef - sourceBlobDigest: sha256:3a6d2e7825969575182762eba53f1b78039986d5c80ff7644aa6faafd5ce4c69 + sourceRevisionDigest: sha256:4404daeabe0d49aa1afe4d5e89bab0ec19ac29a8ec572f9c558689758516105e + sourceBlobDigest: sha256:5fb3233bacf52f009b9d8c51a9694283c3b23e89c5253b42f67a697cb17298cc tags: - latest - - speakeasy-sdk-regen-1736136609 + - speakeasy-sdk-regen-1746491433 - 0.4.0 targets: speakeasy-client-sdk-python: source: speakeasy-openapi sourceNamespace: speakeasy-openapi - sourceRevisionDigest: sha256:79fa1cda10dbe045bf4d56fd367cebff8244f2cf789740c759e44ba91be16cef - sourceBlobDigest: sha256:3a6d2e7825969575182762eba53f1b78039986d5c80ff7644aa6faafd5ce4c69 + sourceRevisionDigest: sha256:4404daeabe0d49aa1afe4d5e89bab0ec19ac29a8ec572f9c558689758516105e + sourceBlobDigest: sha256:5fb3233bacf52f009b9d8c51a9694283c3b23e89c5253b42f67a697cb17298cc codeSamplesNamespace: code-samples-python-speakeasy-client-sdk-python - codeSamplesRevisionDigest: sha256:91eef570ebdc3cfb58537d237f79b7e36c765d7fdd43e0a385f0ea4ede4f8289 + codeSamplesRevisionDigest: sha256:10c01b2e3f0c2693d9e654b977afc9ddda0c07c1b6b00a4defbe055e6735ebc7 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index 66dc9051..54f540aa 100644 --- a/README.md +++ b/README.md @@ -1 +1,698 @@ -undefined \ No newline at end of file +undefined + +## Summary + +Speakeasy API: The Subscriptions API manages subscriptions for CLI and registry events + +For more information about the API: [The Speakeasy Platform Documentation](/docs) + + + +## Table of Contents + + * [SDK Installation](#sdk-installation) + * [IDE Support](#ide-support) + * [SDK Example Usage](#sdk-example-usage) + * [Authentication](#authentication) + * [Available Resources and Operations](#available-resources-and-operations) + * [Global Parameters](#global-parameters) + * [File uploads](#file-uploads) + * [Retries](#retries) + * [Error Handling](#error-handling) + * [Server Selection](#server-selection) + * [Custom HTTP Client](#custom-http-client) + * [Resource Management](#resource-management) + * [Debugging](#debugging) + + + + +## SDK Installation + +> [!NOTE] +> **Python version upgrade policy** +> +> Once a Python version reaches its [official end of life date](https://devguide.python.org/versions/), a 3-month grace period is provided for users to upgrade. Following this grace period, the minimum python version supported in the SDK will be updated. + +The SDK can be installed with either *pip* or *poetry* package managers. + +### PIP + +*PIP* is the default package installer for Python, enabling easy installation and management of packages from PyPI via the command line. + +```bash +pip install speakeasy-client-sdk-python +``` + +### Poetry + +*Poetry* is a modern tool that simplifies dependency management and package publishing by using a single `pyproject.toml` file to handle project metadata and dependencies. + +```bash +poetry add speakeasy-client-sdk-python +``` + +### Shell and script usage with `uv` + +You can use this SDK in a Python shell with [uv](https://docs.astral.sh/uv/) and the `uvx` command that comes with it like so: + +```shell +uvx --from speakeasy-client-sdk-python python +``` + +It's also possible to write a standalone Python script without needing to set up a whole project like so: + +```python +#!/usr/bin/env -S uv run --script +# /// script +# requires-python = ">=3.9" +# dependencies = [ +# "speakeasy-client-sdk-python", +# ] +# /// + +from speakeasy_client_sdk_python import Speakeasy + +sdk = Speakeasy( + # SDK arguments +) + +# Rest of script here... +``` + +Once that is saved to a file, you can run it with `uv run script.py` where +`script.py` can be replaced with the actual file name. + + + +## IDE Support + +### PyCharm + +Generally, the SDK will work well with most IDEs out of the box. However, when using PyCharm, you can enjoy much better integration with Pydantic by installing an additional plugin. + +- [PyCharm Pydantic Plugin](https://docs.pydantic.dev/latest/integrations/pycharm/) + + + +## SDK Example Usage + +### Example + +```python +# Synchronous Example +from speakeasy_client_sdk_python import Speakeasy +from speakeasy_client_sdk_python.models import shared + + +with Speakeasy( + security=shared.Security( + api_key="", + ), +) as speakeasy: + + res = speakeasy.artifacts.create_remote_source() + + assert res is not None + + # Handle response + print(res) +``` + +
+ +The same SDK client can also be used to make asychronous requests by importing asyncio. +```python +# Asynchronous Example +import asyncio +from speakeasy_client_sdk_python import Speakeasy +from speakeasy_client_sdk_python.models import shared + +async def main(): + + async with Speakeasy( + security=shared.Security( + api_key="", + ), + ) as speakeasy: + + res = await speakeasy.artifacts.create_remote_source_async() + + assert res is not None + + # Handle response + print(res) + +asyncio.run(main()) +``` + + + +## Authentication + +### Per-Client Security Schemes + +This SDK supports the following security schemes globally: + +| Name | Type | Scheme | +| ---------------------- | ------ | ----------- | +| `api_key` | apiKey | API key | +| `bearer` | http | HTTP Bearer | +| `workspace_identifier` | apiKey | API key | + +You can set the security parameters through the `security` optional parameter when initializing the SDK client instance. The selected scheme will be used by default to authenticate with the API for all operations that support it. For example: +```python +from speakeasy_client_sdk_python import Speakeasy +from speakeasy_client_sdk_python.models import shared + + +with Speakeasy( + security=shared.Security( + api_key="", + ), +) as speakeasy: + + res = speakeasy.artifacts.create_remote_source() + + assert res is not None + + # Handle response + print(res) + +``` + + + +## Available Resources and Operations + +
+Available methods + +### [artifacts](docs/sdks/artifacts/README.md) + +* [create_remote_source](docs/sdks/artifacts/README.md#create_remote_source) - Configure a new remote source +* [get_blob](docs/sdks/artifacts/README.md#get_blob) - Get blob for a particular digest +* [get_manifest](docs/sdks/artifacts/README.md#get_manifest) - Get manifest for a particular reference +* [get_namespaces](docs/sdks/artifacts/README.md#get_namespaces) - Each namespace contains many revisions. +* [get_revisions](docs/sdks/artifacts/README.md#get_revisions) +* [get_tags](docs/sdks/artifacts/README.md#get_tags) +* [list_remote_sources](docs/sdks/artifacts/README.md#list_remote_sources) - Get remote sources attached to a particular namespace +* [post_tags](docs/sdks/artifacts/README.md#post_tags) - Add tags to an existing revision +* [preflight](docs/sdks/artifacts/README.md#preflight) - Get access token for communicating with OCI distribution endpoints +* [set_archived](docs/sdks/artifacts/README.md#set_archived) - Set whether a namespace is archived +* [set_visibility](docs/sdks/artifacts/README.md#set_visibility) - Set visibility of a namespace with an existing metadata entry + +### [auth](docs/sdks/auth/README.md) + +* [get_access](docs/sdks/auth/README.md#get_access) - Get access allowances for a particular workspace +* [get_access_token](docs/sdks/auth/README.md#get_access_token) - Get or refresh an access token for the current workspace. +* [get_user](docs/sdks/auth/README.md#get_user) - Get information about the current user. +* [validate_api_key](docs/sdks/auth/README.md#validate_api_key) - Validate the current api key. + +### [code_samples](docs/sdks/codesamples/README.md) + +* [generate_code_sample_preview](docs/sdks/codesamples/README.md#generate_code_sample_preview) - Generate Code Sample previews from a file and configuration parameters. +* [generate_code_sample_preview_asynchronous](docs/sdks/codesamples/README.md#generate_code_sample_preview_asynchronous) - Initiate asynchronous Code Sample preview generation from a file and configuration parameters, receiving an async JobID response for polling. +* [get](docs/sdks/codesamples/README.md#get) - Retrieve usage snippets +* [get_code_sample_preview_async](docs/sdks/codesamples/README.md#get_code_sample_preview_async) - Poll for the result of an asynchronous Code Sample preview generation. + +### [events](docs/sdks/events/README.md) + +* [get_events_by_target](docs/sdks/events/README.md#get_events_by_target) - Load recent events for a particular workspace +* [get_targets](docs/sdks/events/README.md#get_targets) - Load targets for a particular workspace +* [get_targets_deprecated](docs/sdks/events/README.md#get_targets_deprecated) - Load targets for a particular workspace +* [post](docs/sdks/events/README.md#post) - Post events for a specific workspace +* [search](docs/sdks/events/README.md#search) - Search events for a particular workspace by any field + +### [github](docs/sdks/github/README.md) + +* [check_access](docs/sdks/github/README.md#check_access) +* [check_publishing_p_rs](docs/sdks/github/README.md#check_publishing_p_rs) +* [check_publishing_secrets](docs/sdks/github/README.md#check_publishing_secrets) +* [configure_code_samples](docs/sdks/github/README.md#configure_code_samples) +* [configure_mintlify_repo](docs/sdks/github/README.md#configure_mintlify_repo) +* [configure_target](docs/sdks/github/README.md#configure_target) +* [get_action](docs/sdks/github/README.md#get_action) +* [get_setup](docs/sdks/github/README.md#get_setup) +* [link_github](docs/sdks/github/README.md#link_github) +* [store_publishing_secrets](docs/sdks/github/README.md#store_publishing_secrets) +* [trigger_action](docs/sdks/github/README.md#trigger_action) + +### [organizations](docs/sdks/organizations/README.md) + +* [create](docs/sdks/organizations/README.md#create) - Create an organization +* [create_billing_add_ons](docs/sdks/organizations/README.md#create_billing_add_ons) - Create billing add ons +* [create_free_trial](docs/sdks/organizations/README.md#create_free_trial) - Create a free trial for an organization +* [delete_billing_add_on](docs/sdks/organizations/README.md#delete_billing_add_on) - Delete billing add ons +* [get](docs/sdks/organizations/README.md#get) - Get organization +* [get_all](docs/sdks/organizations/README.md#get_all) - Get organizations for a user +* [get_billing_add_ons](docs/sdks/organizations/README.md#get_billing_add_ons) - Get billing add ons +* [get_usage](docs/sdks/organizations/README.md#get_usage) - Get billing usage summary for a particular organization + +### [publishing_tokens](docs/sdks/publishingtokens/README.md) + +* [create](docs/sdks/publishingtokens/README.md#create) - Create a publishing token for a workspace +* [delete](docs/sdks/publishingtokens/README.md#delete) - Delete a specific publishing token +* [get](docs/sdks/publishingtokens/README.md#get) - Get a specific publishing token +* [list](docs/sdks/publishingtokens/README.md#list) - Get publishing tokens for a workspace +* [resolve_metadata](docs/sdks/publishingtokens/README.md#resolve_metadata) - Get metadata about the token +* [resolve_target](docs/sdks/publishingtokens/README.md#resolve_target) - Get a specific publishing token target +* [update](docs/sdks/publishingtokens/README.md#update) - Updates the validitity period of a publishing token + +### [reports](docs/sdks/reports/README.md) + +* [get_changes_report_signed_url](docs/sdks/reports/README.md#get_changes_report_signed_url) - Get the signed access url for the change reports for a particular document. +* [get_linting_report_signed_url](docs/sdks/reports/README.md#get_linting_report_signed_url) - Get the signed access url for the linting reports for a particular document. +* [upload_report](docs/sdks/reports/README.md#upload_report) - Upload a report. + +### [schema_store](docs/sdks/schemastore/README.md) + +* [create_schema_store_item](docs/sdks/schemastore/README.md#create_schema_store_item) - Create a schema in the schema store +* [get_schema_store_item](docs/sdks/schemastore/README.md#get_schema_store_item) - Get a OAS schema from the schema store + +### [short_ur_ls](docs/sdks/shorturls/README.md) + +* [create](docs/sdks/shorturls/README.md#create) - Shorten a URL. + + +### [subscriptions](docs/sdks/subscriptions/README.md) + +* [activate_subscription_namespace](docs/sdks/subscriptions/README.md#activate_subscription_namespace) - Activate an ignored namespace for a subscription +* [ignore_subscription_namespace](docs/sdks/subscriptions/README.md#ignore_subscription_namespace) - Ignored a namespace for a subscription + +### [suggest](docs/sdks/suggest/README.md) + +* [suggest](docs/sdks/suggest/README.md#suggest) - Generate suggestions for improving an OpenAPI document. +* [suggest_items](docs/sdks/suggest/README.md#suggest_items) - Generate generic suggestions for a list of items. +* [suggest_open_api](docs/sdks/suggest/README.md#suggest_open_api) - (DEPRECATED) Generate suggestions for improving an OpenAPI document. +* [suggest_open_api_registry](docs/sdks/suggest/README.md#suggest_open_api_registry) - Generate suggestions for improving an OpenAPI document stored in the registry. + +### [workspaces](docs/sdks/workspaces/README.md) + +* [create](docs/sdks/workspaces/README.md#create) - Create a workspace +* [create_token](docs/sdks/workspaces/README.md#create_token) - Create a token for a particular workspace +* [delete_token](docs/sdks/workspaces/README.md#delete_token) - Delete a token for a particular workspace +* [get](docs/sdks/workspaces/README.md#get) - Get workspace by context +* [get_all](docs/sdks/workspaces/README.md#get_all) - Get workspaces for a user +* [get_by_id](docs/sdks/workspaces/README.md#get_by_id) - Get workspace +* [get_feature_flags](docs/sdks/workspaces/README.md#get_feature_flags) - Get workspace feature flags +* [get_settings](docs/sdks/workspaces/README.md#get_settings) - Get workspace settings +* [get_team](docs/sdks/workspaces/README.md#get_team) - Get team members for a particular workspace +* [get_tokens](docs/sdks/workspaces/README.md#get_tokens) - Get tokens for a particular workspace +* [grant_access](docs/sdks/workspaces/README.md#grant_access) - Grant a user access to a particular workspace +* [revoke_access](docs/sdks/workspaces/README.md#revoke_access) - Revoke a user's access to a particular workspace +* [set_feature_flags](docs/sdks/workspaces/README.md#set_feature_flags) - Set workspace feature flags +* [update](docs/sdks/workspaces/README.md#update) - Update workspace details +* [update_settings](docs/sdks/workspaces/README.md#update_settings) - Update workspace settings + +
+ + + +## Global Parameters + +A parameter is configured globally. This parameter may be set on the SDK client instance itself during initialization. When configured as an option during SDK initialization, This global value will be used as the default on the operations that use it. When such operations are called, there is a place in each to override the global value, if needed. + +For example, you can set `workspace_id` to `""` at SDK initialization and then you do not have to pass the same value on calls to operations like `get_access_token`. But if you want to do so you may, which will locally override the global setting. See the example code below for a demonstration. + + +### Available Globals + +The following global parameter is available. + +| Name | Type | Description | +| ------------ | ---- | --------------------------- | +| workspace_id | str | The workspace_id parameter. | + +### Example + +```python +from speakeasy_client_sdk_python import Speakeasy + + +with Speakeasy( + workspace_id="", +) as speakeasy: + + res = speakeasy.auth.get_access_token(request={ + "workspace_id": "", + }) + + assert res.access_token is not None + + # Handle response + print(res.access_token) + +``` + + + +## File uploads + +Certain SDK methods accept file objects as part of a request body or multi-part request. It is possible and typically recommended to upload files as a stream rather than reading the entire contents into memory. This avoids excessive memory consumption and potentially crashing with out-of-memory errors when working with very large files. The following example demonstrates how to attach a file stream to a request. + +> [!TIP] +> +> For endpoints that handle file uploads bytes arrays can also be used. However, using streams is recommended for large files. +> + +```python +from speakeasy_client_sdk_python import Speakeasy +from speakeasy_client_sdk_python.models import shared + + +with Speakeasy( + security=shared.Security( + api_key="", + ), +) as speakeasy: + + res = speakeasy.code_samples.generate_code_sample_preview(request={ + "language": "", + "schema_file": { + "content": open("example.file", "rb"), + "file_name": "example.file", + }, + }) + + assert res.usage_snippets is not None + + # Handle response + print(res.usage_snippets) + +``` + + + +## Retries + +Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK. + +To change the default retry strategy for a single API call, simply provide a `RetryConfig` object to the call: +```python +from speakeasy_client_sdk_python import Speakeasy +from speakeasy_client_sdk_python.models import shared +from speakeasy_client_sdk_python.utils import BackoffStrategy, RetryConfig + + +with Speakeasy( + security=shared.Security( + api_key="", + ), +) as speakeasy: + + res = speakeasy.artifacts.create_remote_source(, + RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False)) + + assert res is not None + + # Handle response + print(res) + +``` + +If you'd like to override the default retry strategy for all operations that support retries, you can use the `retry_config` optional parameter when initializing the SDK: +```python +from speakeasy_client_sdk_python import Speakeasy +from speakeasy_client_sdk_python.models import shared +from speakeasy_client_sdk_python.utils import BackoffStrategy, RetryConfig + + +with Speakeasy( + retry_config=RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False), + security=shared.Security( + api_key="", + ), +) as speakeasy: + + res = speakeasy.artifacts.create_remote_source() + + assert res is not None + + # Handle response + print(res) + +``` + + + +## Error Handling + +[`SpeakeasyError`](./src/speakeasy_client_sdk_python/models/errors/speakeasyerror.py) is the base class for all HTTP error responses. It has the following properties: + +| Property | Type | Description | +| ------------------ | ---------------- | --------------------------------------------------------------------------------------- | +| `err.message` | `str` | Error message | +| `err.status_code` | `int` | HTTP response status code eg `404` | +| `err.headers` | `httpx.Headers` | HTTP response headers | +| `err.body` | `str` | HTTP body. Can be empty string if no body is returned. | +| `err.raw_response` | `httpx.Response` | Raw HTTP response | +| `err.data` | | Optional. Some errors may contain structured data. [See Error Classes](#error-classes). | + +### Example +```python +from speakeasy_client_sdk_python import Speakeasy +from speakeasy_client_sdk_python.models import errors, shared + + +with Speakeasy( + security=shared.Security( + api_key="", + ), +) as speakeasy: + res = None + try: + + res = speakeasy.artifacts.create_remote_source() + + assert res is not None + + # Handle response + print(res) + + + except errors.SpeakeasyError as e: + # The base class for HTTP error responses + print(e.message) + print(e.status_code) + print(e.body) + print(e.headers) + print(e.raw_response) + + # Depending on the method different errors may be thrown + if isinstance(e, errors.Error): + print(e.data.message) # str + print(e.data.status_code) # int +``` + +### Error Classes +**Primary errors:** +* [`SpeakeasyError`](./src/speakeasy_client_sdk_python/models/errors/speakeasyerror.py): The base class for HTTP error responses. + * [`Error`](./src/speakeasy_client_sdk_python/models/errors/error.py): The `Status` type defines a logical error model. * + +
Less common errors (5) + +
+ +**Network errors:** +* [`httpx.RequestError`](https://www.python-httpx.org/exceptions/#httpx.RequestError): Base class for request errors. + * [`httpx.ConnectError`](https://www.python-httpx.org/exceptions/#httpx.ConnectError): HTTP client was unable to make a request to a server. + * [`httpx.TimeoutException`](https://www.python-httpx.org/exceptions/#httpx.TimeoutException): HTTP request timed out. + + +**Inherit from [`SpeakeasyError`](./src/speakeasy_client_sdk_python/models/errors/speakeasyerror.py)**: +* [`ResponseValidationError`](./src/speakeasy_client_sdk_python/models/errors/responsevalidationerror.py): Type mismatch between the response data and the expected Pydantic model. Provides access to the Pydantic validation error via the `cause` attribute. + +
+ +\* Check [the method documentation](#available-resources-and-operations) to see if the error is applicable. + + + +## Server Selection + +### Select Server by Name + +You can override the default server globally by passing a server name to the `server: str` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the names associated with the available servers: + +| Name | Server | Description | +| ------ | -------------------------------- | ----------- | +| `prod` | `https://api.prod.speakeasy.com` | | + +#### Example + +```python +from speakeasy_client_sdk_python import Speakeasy +from speakeasy_client_sdk_python.models import shared + + +with Speakeasy( + server="prod", + security=shared.Security( + api_key="", + ), +) as speakeasy: + + res = speakeasy.artifacts.create_remote_source() + + assert res is not None + + # Handle response + print(res) + +``` + +### Override Server URL Per-Client + +The default server can also be overridden globally by passing a URL to the `server_url: str` optional parameter when initializing the SDK client instance. For example: +```python +from speakeasy_client_sdk_python import Speakeasy +from speakeasy_client_sdk_python.models import shared + + +with Speakeasy( + server_url="https://api.prod.speakeasy.com", + security=shared.Security( + api_key="", + ), +) as speakeasy: + + res = speakeasy.artifacts.create_remote_source() + + assert res is not None + + # Handle response + print(res) + +``` + + + +## Custom HTTP Client + +The Python SDK makes API calls using the [httpx](https://www.python-httpx.org/) HTTP library. In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with your own HTTP client instance. +Depending on whether you are using the sync or async version of the SDK, you can pass an instance of `HttpClient` or `AsyncHttpClient` respectively, which are Protocol's ensuring that the client has the necessary methods to make API calls. +This allows you to wrap the client with your own custom logic, such as adding custom headers, logging, or error handling, or you can just pass an instance of `httpx.Client` or `httpx.AsyncClient` directly. + +For example, you could specify a header for every request that this sdk makes as follows: +```python +from speakeasy_client_sdk_python import Speakeasy +import httpx + +http_client = httpx.Client(headers={"x-custom-header": "someValue"}) +s = Speakeasy(client=http_client) +``` + +or you could wrap the client with your own custom logic: +```python +from speakeasy_client_sdk_python import Speakeasy +from speakeasy_client_sdk_python.httpclient import AsyncHttpClient +import httpx + +class CustomClient(AsyncHttpClient): + client: AsyncHttpClient + + def __init__(self, client: AsyncHttpClient): + self.client = client + + async def send( + self, + request: httpx.Request, + *, + stream: bool = False, + auth: Union[ + httpx._types.AuthTypes, httpx._client.UseClientDefault, None + ] = httpx.USE_CLIENT_DEFAULT, + follow_redirects: Union[ + bool, httpx._client.UseClientDefault + ] = httpx.USE_CLIENT_DEFAULT, + ) -> httpx.Response: + request.headers["Client-Level-Header"] = "added by client" + + return await self.client.send( + request, stream=stream, auth=auth, follow_redirects=follow_redirects + ) + + def build_request( + self, + method: str, + url: httpx._types.URLTypes, + *, + content: Optional[httpx._types.RequestContent] = None, + data: Optional[httpx._types.RequestData] = None, + files: Optional[httpx._types.RequestFiles] = None, + json: Optional[Any] = None, + params: Optional[httpx._types.QueryParamTypes] = None, + headers: Optional[httpx._types.HeaderTypes] = None, + cookies: Optional[httpx._types.CookieTypes] = None, + timeout: Union[ + httpx._types.TimeoutTypes, httpx._client.UseClientDefault + ] = httpx.USE_CLIENT_DEFAULT, + extensions: Optional[httpx._types.RequestExtensions] = None, + ) -> httpx.Request: + return self.client.build_request( + method, + url, + content=content, + data=data, + files=files, + json=json, + params=params, + headers=headers, + cookies=cookies, + timeout=timeout, + extensions=extensions, + ) + +s = Speakeasy(async_client=CustomClient(httpx.AsyncClient())) +``` + + + +## Resource Management + +The `Speakeasy` class implements the context manager protocol and registers a finalizer function to close the underlying sync and async HTTPX clients it uses under the hood. This will close HTTP connections, release memory and free up other resources held by the SDK. In short-lived Python programs and notebooks that make a few SDK method calls, resource management may not be a concern. However, in longer-lived programs, it is beneficial to create a single SDK instance via a [context manager][context-manager] and reuse it across the application. + +[context-manager]: https://docs.python.org/3/reference/datamodel.html#context-managers + +```python +from speakeasy_client_sdk_python import Speakeasy +from speakeasy_client_sdk_python.models import shared +def main(): + + with Speakeasy( + security=shared.Security( + api_key="", + ), + ) as speakeasy: + # Rest of application here... + + +# Or when using async: +async def amain(): + + async with Speakeasy( + security=shared.Security( + api_key="", + ), + ) as speakeasy: + # Rest of application here... +``` + + + +## Debugging + +You can setup your SDK to emit debug logs for SDK requests and responses. + +You can pass your own logger class directly into your SDK. +```python +from speakeasy_client_sdk_python import Speakeasy +import logging + +logging.basicConfig(level=logging.DEBUG) +s = Speakeasy(debug_logger=logging.getLogger("speakeasy_client_sdk_python")) +``` + + + diff --git a/RELEASES.md b/RELEASES.md index 542f5dbb..f9b9d4bf 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1796,4 +1796,14 @@ Based on: ### Generated - [python v7.0.0-rc.2] . ### Releases -- [PyPI v7.0.0-rc.2] https://pypi.org/project/speakeasy-client-sdk-python/7.0.0-rc.2 - . \ No newline at end of file +- [PyPI v7.0.0-rc.2] https://pypi.org/project/speakeasy-client-sdk-python/7.0.0-rc.2 - . + +## 2025-08-01 00:38:40 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.595.0 (2.670.1) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v7.0.0-rc.3] . +### Releases +- [PyPI v7.0.0-rc.3] https://pypi.org/project/speakeasy-client-sdk-python/7.0.0-rc.3 - . \ No newline at end of file diff --git a/USAGE.md b/USAGE.md index 1bd0736f..6c09d317 100644 --- a/USAGE.md +++ b/USAGE.md @@ -4,6 +4,7 @@ from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -28,6 +29,7 @@ from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared async def main(): + async with Speakeasy( security=shared.Security( api_key="", diff --git a/codeSamples.yaml b/codeSamples.yaml index ef9e8a1a..af828b19 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -12,6 +12,7 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -24,6 +25,30 @@ actions: # Handle response print(res.get_namespaces_response) + - target: $["paths"]["/v1/artifacts/namespaces/{namespace_name}/archive"]["post"] + update: + x-codeSamples: + - lang: python + label: archiveNamespace + source: |- + from speakeasy_client_sdk_python import Speakeasy + from speakeasy_client_sdk_python.models import shared + + + with Speakeasy( + security=shared.Security( + api_key="", + ), + ) as speakeasy: + + res = speakeasy.artifacts.set_archived(request={ + "namespace_name": "", + }) + + assert res is not None + + # Handle response + print(res) - target: $["paths"]["/v1/artifacts/namespaces/{namespace_name}/revisions"]["get"] update: x-codeSamples: @@ -33,6 +58,7 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -56,6 +82,7 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -79,6 +106,7 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -102,6 +130,7 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -125,6 +154,7 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -146,6 +176,7 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -169,6 +200,7 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -189,6 +221,7 @@ actions: source: |- from speakeasy_client_sdk_python import Speakeasy + with Speakeasy() as speakeasy: res = speakeasy.auth.get_access_token(request={ @@ -208,6 +241,7 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -229,6 +263,7 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -236,7 +271,26 @@ actions: ) as speakeasy: res = speakeasy.code_samples.get(request={ - "registry_url": "https://normal-making.name", + "registry_url": "https://spec.speakeasy.com/my-org/my-workspace/my-source", + "operation_ids": [ + "g", + "e", + "t", + "P", + "e", + "t", + "s", + ], + "method_paths": [ + { + "method": shared.HTTPMethod.GET, + "path": "/pets", + }, + ], + "languages": [ + "python", + "javascript", + ], }) assert res.usage_snippets is not None @@ -252,6 +306,7 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -259,20 +314,17 @@ actions: ) as speakeasy: res = speakeasy.code_samples.generate_code_sample_preview(request={ - "languages": [ - "", - "", - ], + "language": "", "schema_file": { "file_name": "example.file", "content": open("example.file", "rb"), }, }) - assert res.two_hundred_application_x_yaml_response_stream is not None + assert res.usage_snippets is not None # Handle response - print(res.two_hundred_application_x_yaml_response_stream) + print(res.usage_snippets) - target: $["paths"]["/v1/code_sample/preview/async"]["post"] update: x-codeSamples: @@ -282,6 +334,7 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -289,10 +342,7 @@ actions: ) as speakeasy: res = speakeasy.code_samples.generate_code_sample_preview_asynchronous(request={ - "languages": [ - "", - "", - ], + "language": "", "schema_file": { "file_name": "example.file", "content": open("example.file", "rb"), @@ -312,6 +362,7 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -322,10 +373,10 @@ actions: "job_id": "", }) - assert res.two_hundred_application_x_yaml_response_stream is not None + assert res.object is not None # Handle response - print(res.two_hundred_application_x_yaml_response_stream) + print(res.object) - target: $["paths"]["/v1/github/action"]["get"] update: x-codeSamples: @@ -335,6 +386,7 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -359,6 +411,7 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -383,6 +436,7 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -408,6 +462,7 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -419,7 +474,7 @@ actions: "repo": "", "input": "", "overlays": [ - "", + "", ], }) @@ -436,6 +491,7 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -460,6 +516,7 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -481,6 +538,7 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -506,6 +564,7 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -529,6 +588,7 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -552,6 +612,7 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -577,6 +638,7 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -602,6 +664,7 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -628,6 +691,7 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -651,9 +715,10 @@ actions: - lang: python label: createOrganization source: |- - import dateutil.parser from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + from speakeasy_client_sdk_python.utils import parse_datetime + with Speakeasy( security=shared.Security( @@ -667,8 +732,8 @@ actions: "slug": "", "account_type": shared.AccountType.SCALE_UP, "telemetry_disabled": False, - "created_at": dateutil.parser.isoparse("2024-04-02T12:48:32.253Z"), - "updated_at": dateutil.parser.isoparse("2023-05-28T06:20:22.766Z"), + "created_at": parse_datetime("2025-12-17T21:02:28.497Z"), + "updated_at": parse_datetime("2025-07-22T00:26:10.078Z"), "sso_activated": True, }) @@ -676,6 +741,78 @@ actions: # Handle response print(res.organization) + - target: $["paths"]["/v1/organization/add_ons"]["get"] + update: + x-codeSamples: + - lang: python + label: getBillingAddOns + source: |- + from speakeasy_client_sdk_python import Speakeasy + from speakeasy_client_sdk_python.models import shared + + + with Speakeasy( + security=shared.Security( + api_key="", + ), + ) as speakeasy: + + res = speakeasy.organizations.get_billing_add_ons() + + assert res.organization_billing_add_on_response is not None + + # Handle response + print(res.organization_billing_add_on_response) + - target: $["paths"]["/v1/organization/add_ons"]["post"] + update: + x-codeSamples: + - lang: python + label: createBillingAddOns + source: |- + from speakeasy_client_sdk_python import Speakeasy + from speakeasy_client_sdk_python.models import shared + + + with Speakeasy( + security=shared.Security( + api_key="", + ), + ) as speakeasy: + + res = speakeasy.organizations.create_billing_add_ons(request={ + "add_ons": [ + shared.BillingAddOn.CUSTOM_CODE_REGIONS, + ], + }) + + assert res.organization_billing_add_on_response is not None + + # Handle response + print(res.organization_billing_add_on_response) + - target: $["paths"]["/v1/organization/add_ons/{add_on}"]["delete"] + update: + x-codeSamples: + - lang: python + label: deleteBillingAddOn + source: |- + from speakeasy_client_sdk_python import Speakeasy + from speakeasy_client_sdk_python.models import shared + + + with Speakeasy( + security=shared.Security( + api_key="", + ), + ) as speakeasy: + + res = speakeasy.organizations.delete_billing_add_on(request={ + "add_on": shared.BillingAddOn.SDK_TESTING, + }) + + assert res is not None + + # Handle response + print(res) - target: $["paths"]["/v1/organization/free_trial"]["post"] update: x-codeSamples: @@ -685,6 +822,7 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -706,6 +844,7 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -727,6 +866,7 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -750,6 +890,7 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -762,6 +903,170 @@ actions: # Handle response print(res.organizations) + - target: $["paths"]["/v1/publishing-tokens"]["get"] + update: + x-codeSamples: + - lang: python + label: getPublishingToken + source: |- + from speakeasy_client_sdk_python import Speakeasy + from speakeasy_client_sdk_python.models import shared + + + with Speakeasy( + security=shared.Security( + api_key="", + ), + ) as speakeasy: + + res = speakeasy.publishing_tokens.list() + + assert res.publishing_tokens is not None + + # Handle response + print(res.publishing_tokens) + - target: $["paths"]["/v1/publishing-tokens"]["post"] + update: + x-codeSamples: + - lang: python + label: createPublishingToken + source: |- + from speakeasy_client_sdk_python import Speakeasy + from speakeasy_client_sdk_python.models import shared + + + with Speakeasy( + security=shared.Security( + api_key="", + ), + ) as speakeasy: + + res = speakeasy.publishing_tokens.create() + + assert res.publishing_token is not None + + # Handle response + print(res.publishing_token) + - target: $["paths"]["/v1/publishing-tokens/{tokenID}"]["delete"] + update: + x-codeSamples: + - lang: python + label: deletePublishingToken + source: |- + from speakeasy_client_sdk_python import Speakeasy + from speakeasy_client_sdk_python.models import shared + + + with Speakeasy( + security=shared.Security( + api_key="", + ), + ) as speakeasy: + + res = speakeasy.publishing_tokens.delete(request={ + "token_id": "", + }) + + assert res is not None + + # Handle response + print(res) + - target: $["paths"]["/v1/publishing-tokens/{tokenID}"]["get"] + update: + x-codeSamples: + - lang: python + label: getPublishingTokenByID + source: |- + from speakeasy_client_sdk_python import Speakeasy + from speakeasy_client_sdk_python.models import shared + + + with Speakeasy( + security=shared.Security( + api_key="", + ), + ) as speakeasy: + + res = speakeasy.publishing_tokens.get(request={ + "token_id": "", + }) + + assert res.publishing_token is not None + + # Handle response + print(res.publishing_token) + - target: $["paths"]["/v1/publishing-tokens/{tokenID}"]["put"] + update: + x-codeSamples: + - lang: python + label: updatePublishingTokenExpiration + source: |- + from speakeasy_client_sdk_python import Speakeasy + from speakeasy_client_sdk_python.models import shared + + + with Speakeasy( + security=shared.Security( + api_key="", + ), + ) as speakeasy: + + res = speakeasy.publishing_tokens.update(request={ + "token_id": "", + }) + + assert res is not None + + # Handle response + print(res) + - target: $["paths"]["/v1/publishing-tokens/{tokenID}/metadata"]["get"] + update: + x-codeSamples: + - lang: python + label: getPublishingTokenPublicMetadata + source: |- + from speakeasy_client_sdk_python import Speakeasy + from speakeasy_client_sdk_python.models import shared + + + with Speakeasy( + security=shared.Security( + api_key="", + ), + ) as speakeasy: + + res = speakeasy.publishing_tokens.resolve_metadata(request={ + "token_id": "", + }) + + assert res.object is not None + + # Handle response + print(res.object) + - target: $["paths"]["/v1/publishing-tokens/{tokenID}/target"]["get"] + update: + x-codeSamples: + - lang: python + label: getPublishingTokenTargetByID + source: |- + from speakeasy_client_sdk_python import Speakeasy + from speakeasy_client_sdk_python.models import shared + + + with Speakeasy( + security=shared.Security( + api_key="", + ), + ) as speakeasy: + + res = speakeasy.publishing_tokens.resolve_target(request={ + "token_id": "", + }) + + assert res.res is not None + + # Handle response + print(res.res) - target: $["paths"]["/v1/reports"]["post"] update: x-codeSamples: @@ -771,6 +1076,7 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -798,6 +1104,7 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -821,6 +1128,7 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -835,6 +1143,55 @@ actions: # Handle response print(res.signed_access) + - target: $["paths"]["/v1/schema_store"]["get"] + update: + x-codeSamples: + - lang: python + label: getSchemaStoreItem + source: |- + from speakeasy_client_sdk_python import Speakeasy + from speakeasy_client_sdk_python.models import shared + + + with Speakeasy( + security=shared.Security( + api_key="", + ), + ) as speakeasy: + + res = speakeasy.schema_store.get_schema_store_item() + + assert res.schema_store_item is not None + + # Handle response + print(res.schema_store_item) + - target: $["paths"]["/v1/schema_store"]["post"] + update: + x-codeSamples: + - lang: python + label: createSchemaStoreItem + source: |- + from speakeasy_client_sdk_python import Speakeasy + from speakeasy_client_sdk_python.models import operations, shared + + + with Speakeasy( + security=shared.Security( + api_key="", + ), + ) as speakeasy: + + res = speakeasy.schema_store.create_schema_store_item(request={ + "spec": "", + "package_name": "", + "sdk_classname": "", + "format_": operations.Format.YAML, + }) + + assert res.schema_store_item is not None + + # Handle response + print(res.schema_store_item) - target: $["paths"]["/v1/short_urls"]["post"] update: x-codeSamples: @@ -844,6 +1201,7 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -851,7 +1209,7 @@ actions: ) as speakeasy: res = speakeasy.short_ur_ls.create(request={ - "url": "https://probable-heating.com/", + "url": "https://exalted-heroine.org/", }) assert res.short_url is not None @@ -867,6 +1225,7 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -891,6 +1250,7 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -915,6 +1275,7 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -924,7 +1285,7 @@ actions: res = speakeasy.suggest.suggest_items(request={ "prompt": "", "items": [ - "", + "", ], }) @@ -941,6 +1302,7 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -970,6 +1332,7 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -995,6 +1358,7 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -1008,32 +1372,14 @@ actions: "info": { "title": "", "summary": "", - "description": "ugh which garrote ashamed sarong fiddle really", + "description": "strictly shyly who and than majority unit boohoo", "version": "", "license": {}, }, - "operations": [ - { - "method": "", - "path": "/rescue", - "operation_id": "", - "description": "kielbasa psst stitcher cannon devoted blindly apropos low", - "tags": [ - "", - ], - }, - ], + "operations": [], }, - "suggestion_type": shared.SuggestRequestBodySuggestionType.DIAGNOSTICS_ONLY, - "diagnostics": [ - { - "message": "", - "path": [ - "/opt/share", - ], - "type": "", - }, - ], + "suggestion_type": shared.SuggestRequestBodySuggestionType.METHOD_NAMES, + "diagnostics": [], }, }) @@ -1050,6 +1396,7 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -1071,6 +1418,7 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -1089,9 +1437,10 @@ actions: - lang: python label: createWorkspace source: |- - import dateutil.parser from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + from speakeasy_client_sdk_python.utils import parse_datetime + with Speakeasy( security=shared.Security( @@ -1100,12 +1449,12 @@ actions: ) as speakeasy: res = speakeasy.workspaces.create(request={ - "created_at": dateutil.parser.isoparse("2024-06-17T07:14:55.338Z"), + "created_at": parse_datetime("2023-11-18T13:41:10.525Z"), "id": "", "name": "", "organization_id": "", "slug": "", - "updated_at": dateutil.parser.isoparse("2024-11-30T17:06:07.804Z"), + "updated_at": parse_datetime("2024-11-21T08:36:32.740Z"), "verified": True, }) @@ -1122,6 +1471,7 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -1143,6 +1493,7 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -1155,6 +1506,30 @@ actions: # Handle response print(res.target_sdk_list) + - target: $["paths"]["/v1/workspace/feature_flags"]["post"] + update: + x-codeSamples: + - lang: python + label: setWorkspaceFeatureFlags + source: |- + from speakeasy_client_sdk_python import Speakeasy + from speakeasy_client_sdk_python.models import shared + + + with Speakeasy( + security=shared.Security( + api_key="", + ), + ) as speakeasy: + + res = speakeasy.workspaces.set_feature_flags(request={ + "feature_flags": [], + }) + + assert res.workspace_feature_flag_response is not None + + # Handle response + print(res.workspace_feature_flag_response) - target: $["paths"]["/v1/workspace/{workspace_id}"]["get"] update: x-codeSamples: @@ -1164,15 +1539,15 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( + workspace_id="", security=shared.Security( api_key="", ), ) as speakeasy: - res = speakeasy.workspaces.get_by_id(request={ - "workspace_id": "", - }) + res = speakeasy.workspaces.get_by_id(request={}) assert res.workspace is not None @@ -1184,25 +1559,26 @@ actions: - lang: python label: updateWorkspaceDetails source: |- - import dateutil.parser from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + from speakeasy_client_sdk_python.utils import parse_datetime + with Speakeasy( + workspace_id="", security=shared.Security( api_key="", ), ) as speakeasy: res = speakeasy.workspaces.update(request={ - "workspace_id": "", "workspace": { - "created_at": dateutil.parser.isoparse("2025-07-28T19:04:48.565Z"), + "created_at": parse_datetime("2023-08-02T22:30:24.264Z"), "id": "", "name": "", "organization_id": "", "slug": "", - "updated_at": dateutil.parser.isoparse("2024-10-16T10:52:42.015Z"), + "updated_at": parse_datetime("2025-01-24T03:53:13.581Z"), "verified": True, }, }) @@ -1220,15 +1596,15 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( + workspace_id="", security=shared.Security( api_key="", ), ) as speakeasy: - res = speakeasy.events.search(request={ - "workspace_id": "", - }) + res = speakeasy.events.search(request={}) assert res.cli_event_batch is not None @@ -1240,27 +1616,28 @@ actions: - lang: python label: postWorkspaceEvents source: |- - import dateutil.parser from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + from speakeasy_client_sdk_python.utils import parse_datetime + with Speakeasy( + workspace_id="", security=shared.Security( api_key="", ), ) as speakeasy: res = speakeasy.events.post(request={ - "workspace_id": "", "request_body": [ { "id": "", "execution_id": "", "workspace_id": "", "speakeasy_api_key_name": "", - "interaction_type": shared.InteractionType.QUICKSTART, - "local_started_at": dateutil.parser.isoparse("2024-09-08T05:59:33.876Z"), - "created_at": dateutil.parser.isoparse("2025-08-12T17:54:17.538Z"), + "interaction_type": shared.InteractionType.CI_EXEC, + "local_started_at": parse_datetime("2024-12-22T21:01:06.740Z"), + "created_at": parse_datetime("2024-01-24T01:13:51.002Z"), "speakeasy_version": "", "success": True, }, @@ -1280,15 +1657,15 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( + workspace_id="", security=shared.Security( api_key="", ), ) as speakeasy: - res = speakeasy.events.get_targets_deprecated(request={ - "workspace_id": "", - }) + res = speakeasy.events.get_targets_deprecated(request={}) assert res.target_sdk_list is not None @@ -1303,14 +1680,15 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( + workspace_id="", security=shared.Security( api_key="", ), ) as speakeasy: res = speakeasy.events.get_events_by_target(request={ - "workspace_id": "", "target_id": "", }) @@ -1327,15 +1705,15 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( + workspace_id="", security=shared.Security( api_key="", ), ) as speakeasy: - res = speakeasy.workspaces.get_feature_flags(request={ - "workspace_id": "", - }) + res = speakeasy.workspaces.get_feature_flags(request={}) assert res.workspace_feature_flag_response is not None @@ -1350,15 +1728,15 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( + workspace_id="", security=shared.Security( api_key="", ), ) as speakeasy: - res = speakeasy.workspaces.get_settings(request={ - "workspace_id": "", - }) + res = speakeasy.workspaces.get_settings(request={}) assert res.workspace_settings is not None @@ -1370,23 +1748,24 @@ actions: - lang: python label: updateWorkspaceSettings source: |- - import dateutil.parser from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + from speakeasy_client_sdk_python.utils import parse_datetime + with Speakeasy( + workspace_id="", security=shared.Security( api_key="", ), ) as speakeasy: res = speakeasy.workspaces.update_settings(request={ - "workspace_id": "", "workspace_settings": { "workspace_id": "", - "webhook_url": "https://last-suspension.info/", - "created_at": dateutil.parser.isoparse("2024-12-28T06:46:35.807Z"), - "updated_at": dateutil.parser.isoparse("2025-02-03T10:37:56.725Z"), + "webhook_url": "https://wicked-reboot.org", + "created_at": parse_datetime("2024-07-27T10:14:11.397Z"), + "updated_at": parse_datetime("2025-12-12T17:54:28.990Z"), }, }) @@ -1403,15 +1782,15 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( + workspace_id="", security=shared.Security( api_key="", ), ) as speakeasy: - res = speakeasy.workspaces.get_team(request={ - "workspace_id": "", - }) + res = speakeasy.workspaces.get_team(request={}) assert res.workspace_team_response is not None @@ -1426,15 +1805,16 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( + workspace_id="", security=shared.Security( api_key="", ), ) as speakeasy: res = speakeasy.workspaces.grant_access(request={ - "workspace_id": "", - "email": "Lucinda.Batz8@hotmail.com", + "email": "Idella24@gmail.com", }) assert res.workspace_invite_response is not None @@ -1450,14 +1830,15 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( + workspace_id="", security=shared.Security( api_key="", ), ) as speakeasy: res = speakeasy.workspaces.revoke_access(request={ - "workspace_id": "", "user_id": "", }) @@ -1474,15 +1855,15 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( + workspace_id="", security=shared.Security( api_key="", ), ) as speakeasy: - res = speakeasy.workspaces.get_tokens(request={ - "workspace_id": "", - }) + res = speakeasy.workspaces.get_tokens(request={}) assert res.workspace_tokens is not None @@ -1494,25 +1875,26 @@ actions: - lang: python label: createWorkspaceToken source: |- - import dateutil.parser from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + from speakeasy_client_sdk_python.utils import parse_datetime + with Speakeasy( + workspace_id="", security=shared.Security( api_key="", ), ) as speakeasy: res = speakeasy.workspaces.create_token(request={ - "workspace_id": "", "workspace_token": { "id": "", "name": "", "workspace_id": "", "alg": "", "key": "", - "created_at": dateutil.parser.isoparse("2023-08-16T02:33:00.784Z"), + "created_at": parse_datetime("2024-10-04T10:23:04.522Z"), }, }) @@ -1529,14 +1911,15 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( + workspace_id="", security=shared.Security( api_key="", ), ) as speakeasy: res = speakeasy.workspaces.delete_token(request={ - "workspace_id": "", "token_id": "", }) @@ -1553,6 +1936,7 @@ actions: from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", diff --git a/docs/models/operations/archivenamespacerequest.md b/docs/models/operations/archivenamespacerequest.md new file mode 100644 index 00000000..84d9841f --- /dev/null +++ b/docs/models/operations/archivenamespacerequest.md @@ -0,0 +1,9 @@ +# ArchiveNamespaceRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `namespace_name` | *str* | :heavy_check_mark: | N/A | +| `request_body` | [Optional[operations.ArchiveNamespaceRequestBody]](../../models/operations/archivenamespacerequestbody.md) | :heavy_minus_sign: | Archived status | \ No newline at end of file diff --git a/docs/models/operations/archivenamespacerequestbody.md b/docs/models/operations/archivenamespacerequestbody.md new file mode 100644 index 00000000..27b9949d --- /dev/null +++ b/docs/models/operations/archivenamespacerequestbody.md @@ -0,0 +1,10 @@ +# ArchiveNamespaceRequestBody + +Archived status + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `archived` | *Optional[bool]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/archivenamespaceresponse.md b/docs/models/operations/archivenamespaceresponse.md new file mode 100644 index 00000000..2433d930 --- /dev/null +++ b/docs/models/operations/archivenamespaceresponse.md @@ -0,0 +1,10 @@ +# ArchiveNamespaceResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/createbillingaddonsresponse.md b/docs/models/operations/createbillingaddonsresponse.md new file mode 100644 index 00000000..936387cb --- /dev/null +++ b/docs/models/operations/createbillingaddonsresponse.md @@ -0,0 +1,11 @@ +# CreateBillingAddOnsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | +| `organization_billing_add_on_response` | [Optional[shared.OrganizationBillingAddOnResponse]](../../models/shared/organizationbillingaddonresponse.md) | :heavy_minus_sign: | Success | +| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/createorganizationresponse.md b/docs/models/operations/createorganizationresponse.md index e0312d8b..be305be0 100644 --- a/docs/models/operations/createorganizationresponse.md +++ b/docs/models/operations/createorganizationresponse.md @@ -6,6 +6,6 @@ | Field | Type | Required | Description | | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | | `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | +| `organization` | [Optional[shared.Organization]](../../models/shared/organization.md) | :heavy_minus_sign: | OK | | `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `organization` | [Optional[shared.Organization]](../../models/shared/organization.md) | :heavy_minus_sign: | OK | \ No newline at end of file +| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/createpublishingtokenrequestbody.md b/docs/models/operations/createpublishingtokenrequestbody.md new file mode 100644 index 00000000..ab90dc0b --- /dev/null +++ b/docs/models/operations/createpublishingtokenrequestbody.md @@ -0,0 +1,13 @@ +# CreatePublishingTokenRequestBody + +The publishing token to create + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `target_id` | *str* | :heavy_check_mark: | N/A | +| `target_resource` | *str* | :heavy_check_mark: | N/A | +| `token_name` | *str* | :heavy_check_mark: | N/A | +| `valid_until` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/createpublishingtokenresponse.md b/docs/models/operations/createpublishingtokenresponse.md new file mode 100644 index 00000000..8124393a --- /dev/null +++ b/docs/models/operations/createpublishingtokenresponse.md @@ -0,0 +1,11 @@ +# CreatePublishingTokenResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | +| `publishing_token` | [Optional[shared.PublishingToken]](../../models/shared/publishingtoken.md) | :heavy_minus_sign: | OK | +| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/createresponse.md b/docs/models/operations/createresponse.md index 7bef9855..dd37f871 100644 --- a/docs/models/operations/createresponse.md +++ b/docs/models/operations/createresponse.md @@ -6,6 +6,6 @@ | Field | Type | Required | Description | | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | | `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | +| `short_url` | [Optional[shared.ShortURL]](../../models/shared/shorturl.md) | :heavy_minus_sign: | OK | | `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `short_url` | [Optional[shared.ShortURL]](../../models/shared/shorturl.md) | :heavy_minus_sign: | OK | \ No newline at end of file +| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/createschemastoreitemrequestbody.md b/docs/models/operations/createschemastoreitemrequestbody.md new file mode 100644 index 00000000..78fe28e0 --- /dev/null +++ b/docs/models/operations/createschemastoreitemrequestbody.md @@ -0,0 +1,11 @@ +# CreateSchemaStoreItemRequestBody + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `format_` | [operations.Format](../../models/operations/format_.md) | :heavy_check_mark: | The format of the OpenAPI specification. | +| `package_name` | *str* | :heavy_check_mark: | The package name to use in code snippets / quickstart. | +| `sdk_classname` | *str* | :heavy_check_mark: | The classname of the SDK to use in code snippets / quickstart. | +| `spec` | *str* | :heavy_check_mark: | The OpenAPI specification to store. | \ No newline at end of file diff --git a/docs/models/operations/createschemastoreitemresponse.md b/docs/models/operations/createschemastoreitemresponse.md new file mode 100644 index 00000000..a01dd243 --- /dev/null +++ b/docs/models/operations/createschemastoreitemresponse.md @@ -0,0 +1,11 @@ +# CreateSchemaStoreItemResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | +| `schema_store_item` | [Optional[shared.SchemaStoreItem]](../../models/shared/schemastoreitem.md) | :heavy_minus_sign: | OK | +| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/createworkspacetokenrequest.md b/docs/models/operations/createworkspacetokenrequest.md index 6f26a5f3..287daab8 100644 --- a/docs/models/operations/createworkspacetokenrequest.md +++ b/docs/models/operations/createworkspacetokenrequest.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -| `workspace_token` | [shared.WorkspaceToken](../../models/shared/workspacetoken.md) | :heavy_check_mark: | N/A | -| `workspace_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier of the workspace. | \ No newline at end of file +| `workspace_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier of the workspace. | +| `workspace_token` | [shared.WorkspaceToken](../../models/shared/workspacetoken.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/deletebillingaddonrequest.md b/docs/models/operations/deletebillingaddonrequest.md new file mode 100644 index 00000000..fe308b7f --- /dev/null +++ b/docs/models/operations/deletebillingaddonrequest.md @@ -0,0 +1,8 @@ +# DeleteBillingAddOnRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `add_on` | [shared.BillingAddOn](../../models/shared/billingaddon.md) | :heavy_check_mark: | The specific add-on to delete. | \ No newline at end of file diff --git a/docs/models/operations/deletebillingaddonresponse.md b/docs/models/operations/deletebillingaddonresponse.md new file mode 100644 index 00000000..b772354e --- /dev/null +++ b/docs/models/operations/deletebillingaddonresponse.md @@ -0,0 +1,10 @@ +# DeleteBillingAddOnResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/deletepublishingtokenrequest.md b/docs/models/operations/deletepublishingtokenrequest.md new file mode 100644 index 00000000..faf06e11 --- /dev/null +++ b/docs/models/operations/deletepublishingtokenrequest.md @@ -0,0 +1,8 @@ +# DeletePublishingTokenRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| `token_id` | *str* | :heavy_check_mark: | Unique identifier of the publishing token. | \ No newline at end of file diff --git a/docs/models/operations/deletepublishingtokenresponse.md b/docs/models/operations/deletepublishingtokenresponse.md new file mode 100644 index 00000000..db83c8f7 --- /dev/null +++ b/docs/models/operations/deletepublishingtokenresponse.md @@ -0,0 +1,10 @@ +# DeletePublishingTokenResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/deleteworkspacetokenrequest.md b/docs/models/operations/deleteworkspacetokenrequest.md index d4fe25fa..c1c4b385 100644 --- a/docs/models/operations/deleteworkspacetokenrequest.md +++ b/docs/models/operations/deleteworkspacetokenrequest.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `token_id` | *str* | :heavy_check_mark: | Unique identifier of the token. | -| `workspace_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier of the workspace. | \ No newline at end of file +| `workspace_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier of the workspace. | +| `token_id` | *str* | :heavy_check_mark: | Unique identifier of the token. | \ No newline at end of file diff --git a/docs/models/operations/file.md b/docs/models/operations/file.md index 730c7d29..308e7de7 100644 --- a/docs/models/operations/file.md +++ b/docs/models/operations/file.md @@ -6,5 +6,5 @@ | Field | Type | Required | Description | | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | | `content` | *Union[bytes, IO[bytes], io.BufferedReader]* | :heavy_check_mark: | N/A | -| `file_name` | *str* | :heavy_check_mark: | N/A | -| `content_type` | *Optional[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file +| `content_type` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `file_name` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/format_.md b/docs/models/operations/format_.md new file mode 100644 index 00000000..573bab2b --- /dev/null +++ b/docs/models/operations/format_.md @@ -0,0 +1,11 @@ +# Format + +The format of the OpenAPI specification. + + +## Values + +| Name | Value | +| ------ | ------ | +| `JSON` | json | +| `YAML` | yaml | \ No newline at end of file diff --git a/docs/models/operations/generatecodesamplepreviewresponse.md b/docs/models/operations/generatecodesamplepreviewresponse.md index c379d9bb..32ee43b0 100644 --- a/docs/models/operations/generatecodesamplepreviewresponse.md +++ b/docs/models/operations/generatecodesamplepreviewresponse.md @@ -3,10 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `two_hundred_application_json_response_stream` | *Optional[httpx.Response]* | :heavy_minus_sign: | Successfully returned codeSample overlay file | -| `two_hundred_application_x_yaml_response_stream` | *Optional[httpx.Response]* | :heavy_minus_sign: | Successfully returned codeSample overlay file | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `usage_snippets` | [Optional[shared.UsageSnippets]](../../models/shared/usagesnippets.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getaccesstokenresponse.md b/docs/models/operations/getaccesstokenresponse.md index eb0d0a76..0888c472 100644 --- a/docs/models/operations/getaccesstokenresponse.md +++ b/docs/models/operations/getaccesstokenresponse.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `access_token` | [Optional[shared.AccessToken]](../../models/shared/accesstoken.md) | :heavy_minus_sign: | OK | | `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `access_token` | [Optional[shared.AccessToken]](../../models/shared/accesstoken.md) | :heavy_minus_sign: | OK | \ No newline at end of file +| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/getbillingaddonsresponse.md b/docs/models/operations/getbillingaddonsresponse.md new file mode 100644 index 00000000..0ea07a73 --- /dev/null +++ b/docs/models/operations/getbillingaddonsresponse.md @@ -0,0 +1,11 @@ +# GetBillingAddOnsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | +| `organization_billing_add_on_response` | [Optional[shared.OrganizationBillingAddOnResponse]](../../models/shared/organizationbillingaddonresponse.md) | :heavy_minus_sign: | Success | +| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/getblobresponse.md b/docs/models/operations/getblobresponse.md index a3cc0141..a16d0357 100644 --- a/docs/models/operations/getblobresponse.md +++ b/docs/models/operations/getblobresponse.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `blob` | *Optional[httpx.Response]* | :heavy_minus_sign: | OK | | `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `blob` | *Optional[httpx.Response]* | :heavy_minus_sign: | OK | \ No newline at end of file +| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/getcodesamplepreviewasyncresponse.md b/docs/models/operations/getcodesamplepreviewasyncresponse.md index ca5c213f..bfa688dd 100644 --- a/docs/models/operations/getcodesamplepreviewasyncresponse.md +++ b/docs/models/operations/getcodesamplepreviewasyncresponse.md @@ -8,6 +8,5 @@ | `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `two_hundred_application_json_response_stream` | *Optional[httpx.Response]* | :heavy_minus_sign: | Successfully returned codeSample overlay file | -| `two_hundred_application_x_yaml_response_stream` | *Optional[httpx.Response]* | :heavy_minus_sign: | Successfully returned codeSample overlay file | -| `two_hundred_and_two_application_json_object` | [Optional[operations.GetCodeSamplePreviewAsyncResponseBody]](../../models/operations/getcodesamplepreviewasyncresponsebody.md) | :heavy_minus_sign: | Job is still in progress | \ No newline at end of file +| `usage_snippets` | [Optional[shared.UsageSnippets]](../../models/shared/usagesnippets.md) | :heavy_minus_sign: | OK | +| `object` | [Optional[operations.GetCodeSamplePreviewAsyncResponseBody]](../../models/operations/getcodesamplepreviewasyncresponsebody.md) | :heavy_minus_sign: | Job is still in progress | \ No newline at end of file diff --git a/docs/models/operations/getcodesamplesrequest.md b/docs/models/operations/getcodesamplesrequest.md index 4a5da3d6..7080ffc7 100644 --- a/docs/models/operations/getcodesamplesrequest.md +++ b/docs/models/operations/getcodesamplesrequest.md @@ -3,8 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | -| `registry_url` | *str* | :heavy_check_mark: | The registry URL from which to retrieve the snippets. E.g. https://spec.speakeasy.com/org/ws/my-source | -| `operation_ids` | List[*str*] | :heavy_minus_sign: | N/A | -| `languages` | List[*str*] | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `registry_url` | *str* | :heavy_check_mark: | The registry URL from which to retrieve the snippets. | https://spec.speakeasy.com/my-org/my-workspace/my-source | +| `operation_ids` | List[*str*] | :heavy_minus_sign: | The operation IDs to retrieve snippets for. | getPets | +| `method_paths` | List[[operations.MethodPaths](../../models/operations/methodpaths.md)] | :heavy_minus_sign: | The method paths to retrieve snippets for. | [
{
"method": "get",
"path": "/pets"
}
] | +| `languages` | List[*str*] | :heavy_minus_sign: | The languages to retrieve snippets for. | [
"python",
"javascript"
] | \ No newline at end of file diff --git a/docs/models/operations/getgithubactionrequest.md b/docs/models/operations/getgithubactionrequest.md index 69f8216a..07031afe 100644 --- a/docs/models/operations/getgithubactionrequest.md +++ b/docs/models/operations/getgithubactionrequest.md @@ -5,6 +5,6 @@ | Field | Type | Required | Description | | -------------------------------------- | -------------------------------------- | -------------------------------------- | -------------------------------------- | +| `target_name` | *Optional[str]* | :heavy_minus_sign: | The targetName of the workflow target. | | `org` | *str* | :heavy_check_mark: | N/A | -| `repo` | *str* | :heavy_check_mark: | N/A | -| `target_name` | *Optional[str]* | :heavy_minus_sign: | The targetName of the workflow target. | \ No newline at end of file +| `repo` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getgithubactionresponse.md b/docs/models/operations/getgithubactionresponse.md index f0ecec90..7994e6e1 100644 --- a/docs/models/operations/getgithubactionresponse.md +++ b/docs/models/operations/getgithubactionresponse.md @@ -6,6 +6,6 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | | `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | +| `github_get_action_response` | [Optional[shared.GithubGetActionResponse]](../../models/shared/githubgetactionresponse.md) | :heavy_minus_sign: | OK | | `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `github_get_action_response` | [Optional[shared.GithubGetActionResponse]](../../models/shared/githubgetactionresponse.md) | :heavy_minus_sign: | OK | \ No newline at end of file +| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/getgithubsetupstateresponse.md b/docs/models/operations/getgithubsetupstateresponse.md index 27b81321..7df6635a 100644 --- a/docs/models/operations/getgithubsetupstateresponse.md +++ b/docs/models/operations/getgithubsetupstateresponse.md @@ -6,6 +6,6 @@ | Field | Type | Required | Description | | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | | `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | +| `github_setup_state_response` | [Optional[shared.GithubSetupStateResponse]](../../models/shared/githubsetupstateresponse.md) | :heavy_minus_sign: | github setup state response | | `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `github_setup_state_response` | [Optional[shared.GithubSetupStateResponse]](../../models/shared/githubsetupstateresponse.md) | :heavy_minus_sign: | github setup state response | \ No newline at end of file +| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/getmanifestresponse.md b/docs/models/operations/getmanifestresponse.md index 9750a7b5..6c33a03e 100644 --- a/docs/models/operations/getmanifestresponse.md +++ b/docs/models/operations/getmanifestresponse.md @@ -6,6 +6,6 @@ | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | +| `manifest` | [Optional[shared.Manifest]](../../models/shared/manifest.md) | :heavy_minus_sign: | OK | {
"config": {
"digest": "sha256:6d1ef012b5674ad8a127ecfa9b5e6f5178d171b90ee462846974177fd9bdd39f",
"mediaType": "application/vnd.docker.container.image.v1+json",
"size": 1512
},
"layers": [
{
"digest": "sha256:5d20c808ce198565ff70b3ed23a991dd49afac45dece63474b27ce6ed036adc6",
"mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
"size": 2107098
}
],
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"schemaVersion": 2
} | | `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `manifest` | [Optional[shared.Manifest]](../../models/shared/manifest.md) | :heavy_minus_sign: | OK | {
"config": {
"digest": "sha256:6d1ef012b5674ad8a127ecfa9b5e6f5178d171b90ee462846974177fd9bdd39f",
"mediaType": "application/vnd.docker.container.image.v1+json",
"size": 1512
},
"layers": [
{
"digest": "sha256:5d20c808ce198565ff70b3ed23a991dd49afac45dece63474b27ce6ed036adc6",
"mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
"size": 2107098
}
],
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"schemaVersion": 2
} | \ No newline at end of file +| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/docs/models/operations/getnamespacesresponse.md b/docs/models/operations/getnamespacesresponse.md index 2a13d1ce..5a557ef6 100644 --- a/docs/models/operations/getnamespacesresponse.md +++ b/docs/models/operations/getnamespacesresponse.md @@ -6,6 +6,6 @@ | Field | Type | Required | Description | | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | | `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | +| `get_namespaces_response` | [Optional[shared.GetNamespacesResponse]](../../models/shared/getnamespacesresponse.md) | :heavy_minus_sign: | OK | | `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `get_namespaces_response` | [Optional[shared.GetNamespacesResponse]](../../models/shared/getnamespacesresponse.md) | :heavy_minus_sign: | OK | \ No newline at end of file +| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/getorganizationresponse.md b/docs/models/operations/getorganizationresponse.md index 0738b6ac..62c58c6a 100644 --- a/docs/models/operations/getorganizationresponse.md +++ b/docs/models/operations/getorganizationresponse.md @@ -6,6 +6,6 @@ | Field | Type | Required | Description | | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | | `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | +| `organization` | [Optional[shared.Organization]](../../models/shared/organization.md) | :heavy_minus_sign: | OK | | `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `organization` | [Optional[shared.Organization]](../../models/shared/organization.md) | :heavy_minus_sign: | OK | \ No newline at end of file +| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/getorganizationsresponse.md b/docs/models/operations/getorganizationsresponse.md index f352822c..096e9201 100644 --- a/docs/models/operations/getorganizationsresponse.md +++ b/docs/models/operations/getorganizationsresponse.md @@ -6,6 +6,6 @@ | Field | Type | Required | Description | | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | | `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | +| `organizations` | List[[shared.Organization](../../models/shared/organization.md)] | :heavy_minus_sign: | OK | | `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `organizations` | List[[shared.Organization](../../models/shared/organization.md)] | :heavy_minus_sign: | OK | \ No newline at end of file +| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/getorganizationusageresponse.md b/docs/models/operations/getorganizationusageresponse.md index 8c415d06..6f78537f 100644 --- a/docs/models/operations/getorganizationusageresponse.md +++ b/docs/models/operations/getorganizationusageresponse.md @@ -6,6 +6,6 @@ | Field | Type | Required | Description | | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | | `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | +| `organization_usage_response` | [Optional[shared.OrganizationUsageResponse]](../../models/shared/organizationusageresponse.md) | :heavy_minus_sign: | OK | | `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `organization_usage_response` | [Optional[shared.OrganizationUsageResponse]](../../models/shared/organizationusageresponse.md) | :heavy_minus_sign: | OK | \ No newline at end of file +| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/getpublishingtokenbyidrequest.md b/docs/models/operations/getpublishingtokenbyidrequest.md new file mode 100644 index 00000000..338c17a6 --- /dev/null +++ b/docs/models/operations/getpublishingtokenbyidrequest.md @@ -0,0 +1,8 @@ +# GetPublishingTokenByIDRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| `token_id` | *str* | :heavy_check_mark: | Unique identifier of the publishing token. | \ No newline at end of file diff --git a/docs/models/operations/getpublishingtokenbyidresponse.md b/docs/models/operations/getpublishingtokenbyidresponse.md new file mode 100644 index 00000000..1d112c0d --- /dev/null +++ b/docs/models/operations/getpublishingtokenbyidresponse.md @@ -0,0 +1,11 @@ +# GetPublishingTokenByIDResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | +| `publishing_token` | [Optional[shared.PublishingToken]](../../models/shared/publishingtoken.md) | :heavy_minus_sign: | OK | +| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/getpublishingtokenpublicmetadatarequest.md b/docs/models/operations/getpublishingtokenpublicmetadatarequest.md new file mode 100644 index 00000000..90ffe576 --- /dev/null +++ b/docs/models/operations/getpublishingtokenpublicmetadatarequest.md @@ -0,0 +1,8 @@ +# GetPublishingTokenPublicMetadataRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| `token_id` | *str* | :heavy_check_mark: | Unique identifier of the publishing token. | \ No newline at end of file diff --git a/docs/models/operations/getpublishingtokenpublicmetadataresponse.md b/docs/models/operations/getpublishingtokenpublicmetadataresponse.md new file mode 100644 index 00000000..00722e18 --- /dev/null +++ b/docs/models/operations/getpublishingtokenpublicmetadataresponse.md @@ -0,0 +1,11 @@ +# GetPublishingTokenPublicMetadataResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [Optional[operations.GetPublishingTokenPublicMetadataResponseBody]](../../models/operations/getpublishingtokenpublicmetadataresponsebody.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getpublishingtokenpublicmetadataresponsebody.md b/docs/models/operations/getpublishingtokenpublicmetadataresponsebody.md new file mode 100644 index 00000000..faef89f2 --- /dev/null +++ b/docs/models/operations/getpublishingtokenpublicmetadataresponsebody.md @@ -0,0 +1,14 @@ +# GetPublishingTokenPublicMetadataResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `organization_id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `target_id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `target_resource` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `valid_until` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | +| `workspace_id` | *Optional[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getpublishingtokenresponse.md b/docs/models/operations/getpublishingtokenresponse.md new file mode 100644 index 00000000..e2835613 --- /dev/null +++ b/docs/models/operations/getpublishingtokenresponse.md @@ -0,0 +1,11 @@ +# GetPublishingTokenResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `classes` | List[[shared.PublishingToken](../../models/shared/publishingtoken.md)] | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getpublishingtokentargetbyidrequest.md b/docs/models/operations/getpublishingtokentargetbyidrequest.md new file mode 100644 index 00000000..871a070d --- /dev/null +++ b/docs/models/operations/getpublishingtokentargetbyidrequest.md @@ -0,0 +1,8 @@ +# GetPublishingTokenTargetByIDRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| `token_id` | *str* | :heavy_check_mark: | Unique identifier of the publishing token. | \ No newline at end of file diff --git a/docs/models/operations/getpublishingtokentargetbyidresponse.md b/docs/models/operations/getpublishingtokentargetbyidresponse.md new file mode 100644 index 00000000..00a47619 --- /dev/null +++ b/docs/models/operations/getpublishingtokentargetbyidresponse.md @@ -0,0 +1,11 @@ +# GetPublishingTokenTargetByIDResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `res` | *Optional[str]* | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/docs/models/operations/getrevisionsresponse.md b/docs/models/operations/getrevisionsresponse.md index fc597869..c4ee0a1b 100644 --- a/docs/models/operations/getrevisionsresponse.md +++ b/docs/models/operations/getrevisionsresponse.md @@ -6,6 +6,6 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | | `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | +| `get_revisions_response` | [Optional[shared.GetRevisionsResponse]](../../models/shared/getrevisionsresponse.md) | :heavy_minus_sign: | OK | | `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `get_revisions_response` | [Optional[shared.GetRevisionsResponse]](../../models/shared/getrevisionsresponse.md) | :heavy_minus_sign: | OK | \ No newline at end of file +| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/getschemastoreitemrequestbody.md b/docs/models/operations/getschemastoreitemrequestbody.md new file mode 100644 index 00000000..6765ac2d --- /dev/null +++ b/docs/models/operations/getschemastoreitemrequestbody.md @@ -0,0 +1,8 @@ +# GetSchemaStoreItemRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `id` | *Optional[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getschemastoreitemresponse.md b/docs/models/operations/getschemastoreitemresponse.md new file mode 100644 index 00000000..4d54e11f --- /dev/null +++ b/docs/models/operations/getschemastoreitemresponse.md @@ -0,0 +1,11 @@ +# GetSchemaStoreItemResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | +| `schema_store_item` | [Optional[shared.SchemaStoreItem]](../../models/shared/schemastoreitem.md) | :heavy_minus_sign: | OK | +| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/gettagsresponse.md b/docs/models/operations/gettagsresponse.md index 5bc5ce52..c9e3ddbe 100644 --- a/docs/models/operations/gettagsresponse.md +++ b/docs/models/operations/gettagsresponse.md @@ -6,6 +6,6 @@ | Field | Type | Required | Description | | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | | `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | +| `get_tags_response` | [Optional[shared.GetTagsResponse]](../../models/shared/gettagsresponse.md) | :heavy_minus_sign: | OK | | `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `get_tags_response` | [Optional[shared.GetTagsResponse]](../../models/shared/gettagsresponse.md) | :heavy_minus_sign: | OK | \ No newline at end of file +| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/getworkspaceaccessresponse.md b/docs/models/operations/getworkspaceaccessresponse.md index d52c1937..fbdb367b 100644 --- a/docs/models/operations/getworkspaceaccessresponse.md +++ b/docs/models/operations/getworkspaceaccessresponse.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `access_details` | [Optional[shared.AccessDetails]](../../models/shared/accessdetails.md) | :heavy_minus_sign: | OK | | `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `access_details` | [Optional[shared.AccessDetails]](../../models/shared/accessdetails.md) | :heavy_minus_sign: | OK | \ No newline at end of file +| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/getworkspaceeventsbytargetrequest.md b/docs/models/operations/getworkspaceeventsbytargetrequest.md index 181de993..35d6bd6f 100644 --- a/docs/models/operations/getworkspaceeventsbytargetrequest.md +++ b/docs/models/operations/getworkspaceeventsbytargetrequest.md @@ -5,6 +5,6 @@ | Field | Type | Required | Description | | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | -| `target_id` | *str* | :heavy_check_mark: | Filter to only return events corresponding to a particular gen_lock_id (gen_lock_id uniquely identifies a target) | | `workspace_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier of the workspace. | +| `target_id` | *str* | :heavy_check_mark: | Filter to only return events corresponding to a particular gen_lock_id (gen_lock_id uniquely identifies a target) | | `after_created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Filter to only return events created after this timestamp | \ No newline at end of file diff --git a/docs/models/operations/getworkspaceeventsbytargetresponse.md b/docs/models/operations/getworkspaceeventsbytargetresponse.md index 9160f44c..8f3f89f9 100644 --- a/docs/models/operations/getworkspaceeventsbytargetresponse.md +++ b/docs/models/operations/getworkspaceeventsbytargetresponse.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `cli_event_batch` | List[[shared.CliEvent](../../models/shared/clievent.md)] | :heavy_minus_sign: | Success | | `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `cli_event_batch` | List[[shared.CliEvent](../../models/shared/clievent.md)] | :heavy_minus_sign: | Success | \ No newline at end of file +| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/githubcheckpublishingprsresponse.md b/docs/models/operations/githubcheckpublishingprsresponse.md index cf41b492..aaaf3270 100644 --- a/docs/models/operations/githubcheckpublishingprsresponse.md +++ b/docs/models/operations/githubcheckpublishingprsresponse.md @@ -6,6 +6,6 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | | `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | +| `github_publishing_pr_response` | [Optional[shared.GithubPublishingPRResponse]](../../models/shared/githubpublishingprresponse.md) | :heavy_minus_sign: | OK | | `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `github_publishing_pr_response` | [Optional[shared.GithubPublishingPRResponse]](../../models/shared/githubpublishingprresponse.md) | :heavy_minus_sign: | OK | \ No newline at end of file +| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/githubcheckpublishingsecretsresponse.md b/docs/models/operations/githubcheckpublishingsecretsresponse.md index cd21da37..84817e43 100644 --- a/docs/models/operations/githubcheckpublishingsecretsresponse.md +++ b/docs/models/operations/githubcheckpublishingsecretsresponse.md @@ -6,6 +6,6 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | | `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | +| `github_missing_publishing_secrets_response` | [Optional[shared.GithubMissingPublishingSecretsResponse]](../../models/shared/githubmissingpublishingsecretsresponse.md) | :heavy_minus_sign: | OK | | `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `github_missing_publishing_secrets_response` | [Optional[shared.GithubMissingPublishingSecretsResponse]](../../models/shared/githubmissingpublishingsecretsresponse.md) | :heavy_minus_sign: | OK | \ No newline at end of file +| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/githubconfigurecodesamplesresponse.md b/docs/models/operations/githubconfigurecodesamplesresponse.md index 57471256..f3b26e00 100644 --- a/docs/models/operations/githubconfigurecodesamplesresponse.md +++ b/docs/models/operations/githubconfigurecodesamplesresponse.md @@ -6,6 +6,6 @@ | Field | Type | Required | Description | | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | | `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | +| `github_configure_code_samples_response` | [Optional[shared.GithubConfigureCodeSamplesResponse]](../../models/shared/githubconfigurecodesamplesresponse.md) | :heavy_minus_sign: | OK | | `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `github_configure_code_samples_response` | [Optional[shared.GithubConfigureCodeSamplesResponse]](../../models/shared/githubconfigurecodesamplesresponse.md) | :heavy_minus_sign: | OK | \ No newline at end of file +| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/grantuseraccesstoworkspacerequest.md b/docs/models/operations/grantuseraccesstoworkspacerequest.md index ab987d6d..6019a777 100644 --- a/docs/models/operations/grantuseraccesstoworkspacerequest.md +++ b/docs/models/operations/grantuseraccesstoworkspacerequest.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | | ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | -| `email` | *str* | :heavy_check_mark: | Email of the user to grant access to. | -| `workspace_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier of the workspace. | \ No newline at end of file +| `workspace_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier of the workspace. | +| `email` | *str* | :heavy_check_mark: | Email of the user to grant access to. | \ No newline at end of file diff --git a/docs/models/operations/listremotesourcesresponse.md b/docs/models/operations/listremotesourcesresponse.md index edb07164..5287e46e 100644 --- a/docs/models/operations/listremotesourcesresponse.md +++ b/docs/models/operations/listremotesourcesresponse.md @@ -6,6 +6,6 @@ | Field | Type | Required | Description | | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | | `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | +| `remote_source` | [Optional[shared.RemoteSource]](../../models/shared/remotesource.md) | :heavy_minus_sign: | OK | | `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `remote_source` | [Optional[shared.RemoteSource]](../../models/shared/remotesource.md) | :heavy_minus_sign: | OK | \ No newline at end of file +| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/methodpaths.md b/docs/models/operations/methodpaths.md new file mode 100644 index 00000000..afea22cf --- /dev/null +++ b/docs/models/operations/methodpaths.md @@ -0,0 +1,9 @@ +# MethodPaths + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `method` | [shared.HTTPMethod](../../models/shared/httpmethod.md) | :heavy_check_mark: | N/A | +| `path` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/postworkspaceeventsrequest.md b/docs/models/operations/postworkspaceeventsrequest.md index ef012d39..bf10dff2 100644 --- a/docs/models/operations/postworkspaceeventsrequest.md +++ b/docs/models/operations/postworkspaceeventsrequest.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -| `request_body` | List[[shared.CliEvent](../../models/shared/clievent.md)] | :heavy_check_mark: | N/A | -| `workspace_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier of the workspace. | \ No newline at end of file +| `workspace_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier of the workspace. | +| `request_body` | List[[shared.CliEvent](../../models/shared/clievent.md)] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/preflightresponse.md b/docs/models/operations/preflightresponse.md index 229fcee5..c183eb18 100644 --- a/docs/models/operations/preflightresponse.md +++ b/docs/models/operations/preflightresponse.md @@ -6,6 +6,6 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | | `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | +| `preflight_token` | [Optional[shared.PreflightToken]](../../models/shared/preflighttoken.md) | :heavy_minus_sign: | OK | | `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `preflight_token` | [Optional[shared.PreflightToken]](../../models/shared/preflighttoken.md) | :heavy_minus_sign: | OK | \ No newline at end of file +| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/revokeuseraccesstoworkspacerequest.md b/docs/models/operations/revokeuseraccesstoworkspacerequest.md index 16c3757a..4df7a307 100644 --- a/docs/models/operations/revokeuseraccesstoworkspacerequest.md +++ b/docs/models/operations/revokeuseraccesstoworkspacerequest.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `user_id` | *str* | :heavy_check_mark: | Unique identifier of the user. | -| `workspace_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier of the workspace. | \ No newline at end of file +| `workspace_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier of the workspace. | +| `user_id` | *str* | :heavy_check_mark: | Unique identifier of the user. | \ No newline at end of file diff --git a/docs/models/operations/schema.md b/docs/models/operations/schema.md index 6649ba92..9738da23 100644 --- a/docs/models/operations/schema.md +++ b/docs/models/operations/schema.md @@ -6,5 +6,5 @@ | Field | Type | Required | Description | | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | | `content` | *Union[bytes, IO[bytes], io.BufferedReader]* | :heavy_check_mark: | N/A | -| `file_name` | *str* | :heavy_check_mark: | N/A | -| `content_type` | *Optional[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file +| `content_type` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `file_name` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/searchworkspaceeventsresponse.md b/docs/models/operations/searchworkspaceeventsresponse.md index ada3fafe..2371235f 100644 --- a/docs/models/operations/searchworkspaceeventsresponse.md +++ b/docs/models/operations/searchworkspaceeventsresponse.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `cli_event_batch` | List[[shared.CliEvent](../../models/shared/clievent.md)] | :heavy_minus_sign: | Success | | `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `cli_event_batch` | List[[shared.CliEvent](../../models/shared/clievent.md)] | :heavy_minus_sign: | Success | \ No newline at end of file +| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/setworkspacefeatureflagsresponse.md b/docs/models/operations/setworkspacefeatureflagsresponse.md new file mode 100644 index 00000000..93b37e92 --- /dev/null +++ b/docs/models/operations/setworkspacefeatureflagsresponse.md @@ -0,0 +1,11 @@ +# SetWorkspaceFeatureFlagsResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `workspace_feature_flag_response` | [Optional[shared.WorkspaceFeatureFlagResponse]](../../models/shared/workspacefeatureflagresponse.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/docs/models/operations/suggestopenapiregistryresponse.md b/docs/models/operations/suggestopenapiregistryresponse.md index 1104f284..0d9ff2aa 100644 --- a/docs/models/operations/suggestopenapiregistryresponse.md +++ b/docs/models/operations/suggestopenapiregistryresponse.md @@ -6,6 +6,6 @@ | Field | Type | Required | Description | | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | | `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | +| `schema_` | *Optional[httpx.Response]* | :heavy_minus_sign: | An overlay containing the suggested spec modifications. | | `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `schema_` | *Optional[httpx.Response]* | :heavy_minus_sign: | An overlay containing the suggested spec modifications. | \ No newline at end of file +| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/suggestopenapirequestbody.md b/docs/models/operations/suggestopenapirequestbody.md index 17d3653e..fa547a5d 100644 --- a/docs/models/operations/suggestopenapirequestbody.md +++ b/docs/models/operations/suggestopenapirequestbody.md @@ -7,5 +7,5 @@ The schema file to upload provided as a multipart/form-data file segment. | Field | Type | Required | Description | | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | -| `schema_` | [operations.Schema](../../models/operations/schema.md) | :heavy_check_mark: | N/A | -| `opts` | [Optional[shared.SuggestOptsOld]](../../models/shared/suggestoptsold.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `opts` | [Optional[shared.SuggestOptsOld]](../../models/shared/suggestoptsold.md) | :heavy_minus_sign: | N/A | +| `schema_` | [operations.Schema](../../models/operations/schema.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/suggestopenapiresponse.md b/docs/models/operations/suggestopenapiresponse.md index 56bbf47e..f557d326 100644 --- a/docs/models/operations/suggestopenapiresponse.md +++ b/docs/models/operations/suggestopenapiresponse.md @@ -6,6 +6,6 @@ | Field | Type | Required | Description | | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | | `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | +| `schema_` | *Optional[httpx.Response]* | :heavy_minus_sign: | An overlay containing the suggested spec modifications. | | `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `schema_` | *Optional[httpx.Response]* | :heavy_minus_sign: | An overlay containing the suggested spec modifications. | \ No newline at end of file +| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/suggestresponse.md b/docs/models/operations/suggestresponse.md index 731be20c..647cb2b3 100644 --- a/docs/models/operations/suggestresponse.md +++ b/docs/models/operations/suggestresponse.md @@ -6,6 +6,6 @@ | Field | Type | Required | Description | | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | | `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | +| `schema_` | *Optional[httpx.Response]* | :heavy_minus_sign: | An overlay containing the suggested spec modifications. | | `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `schema_` | *Optional[httpx.Response]* | :heavy_minus_sign: | An overlay containing the suggested spec modifications. | \ No newline at end of file +| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/updatepublishingtokenexpirationrequest.md b/docs/models/operations/updatepublishingtokenexpirationrequest.md new file mode 100644 index 00000000..bad3285a --- /dev/null +++ b/docs/models/operations/updatepublishingtokenexpirationrequest.md @@ -0,0 +1,9 @@ +# UpdatePublishingTokenExpirationRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `token_id` | *str* | :heavy_check_mark: | Unique identifier of the publishing token. | +| `request_body` | [Optional[operations.UpdatePublishingTokenExpirationRequestBody]](../../models/operations/updatepublishingtokenexpirationrequestbody.md) | :heavy_minus_sign: | The publishing token to update | \ No newline at end of file diff --git a/docs/models/operations/updatepublishingtokenexpirationrequestbody.md b/docs/models/operations/updatepublishingtokenexpirationrequestbody.md new file mode 100644 index 00000000..be1609c1 --- /dev/null +++ b/docs/models/operations/updatepublishingtokenexpirationrequestbody.md @@ -0,0 +1,11 @@ +# UpdatePublishingTokenExpirationRequestBody + +The publishing token to update + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `token_name` | *Optional[str]* | :heavy_minus_sign: | The new name for the publishing token. | +| `valid_until` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | The new expiration date for the publishing token. | \ No newline at end of file diff --git a/docs/models/operations/updatepublishingtokenexpirationresponse.md b/docs/models/operations/updatepublishingtokenexpirationresponse.md new file mode 100644 index 00000000..d5391c4d --- /dev/null +++ b/docs/models/operations/updatepublishingtokenexpirationresponse.md @@ -0,0 +1,10 @@ +# UpdatePublishingTokenExpirationResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/updateworkspacedetailsrequest.md b/docs/models/operations/updateworkspacedetailsrequest.md index 318b9e04..43d3c56b 100644 --- a/docs/models/operations/updateworkspacedetailsrequest.md +++ b/docs/models/operations/updateworkspacedetailsrequest.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `workspace` | [shared.Workspace](../../models/shared/workspace.md) | :heavy_check_mark: | The workspace details to update. | -| `workspace_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier of the workspace. | \ No newline at end of file +| `workspace_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier of the workspace. | +| `workspace` | [shared.Workspace](../../models/shared/workspace.md) | :heavy_check_mark: | The workspace details to update. | \ No newline at end of file diff --git a/docs/models/operations/updateworkspacesettingsrequest.md b/docs/models/operations/updateworkspacesettingsrequest.md index a43138f4..cc6fd6ad 100644 --- a/docs/models/operations/updateworkspacesettingsrequest.md +++ b/docs/models/operations/updateworkspacesettingsrequest.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `workspace_settings` | [shared.WorkspaceSettings](../../models/shared/workspacesettings.md) | :heavy_check_mark: | The workspace settings to update. | -| `workspace_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier of the workspace. | \ No newline at end of file +| `workspace_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier of the workspace. | +| `workspace_settings` | [shared.WorkspaceSettings](../../models/shared/workspacesettings.md) | :heavy_check_mark: | The workspace settings to update. | \ No newline at end of file diff --git a/docs/models/operations/validateapikeyresponse.md b/docs/models/operations/validateapikeyresponse.md index c3406608..972a437f 100644 --- a/docs/models/operations/validateapikeyresponse.md +++ b/docs/models/operations/validateapikeyresponse.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `api_key_details` | [Optional[shared.APIKeyDetails]](../../models/shared/apikeydetails.md) | :heavy_minus_sign: | OK | | `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `api_key_details` | [Optional[shared.APIKeyDetails]](../../models/shared/apikeydetails.md) | :heavy_minus_sign: | OK | \ No newline at end of file +| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/shared/accessdetails.md b/docs/models/shared/accessdetails.md index 415d7c8c..ac56d95f 100644 --- a/docs/models/shared/accessdetails.md +++ b/docs/models/shared/accessdetails.md @@ -6,5 +6,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | | `generation_allowed` | *bool* | :heavy_check_mark: | N/A | -| `message` | *str* | :heavy_check_mark: | N/A | -| `level` | [Optional[shared.Level]](../../models/shared/level.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `level` | [Optional[shared.Level]](../../models/shared/level.md) | :heavy_minus_sign: | N/A | +| `message` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/accesstoken.md b/docs/models/shared/accesstoken.md index 21af6ae5..b3c174ae 100644 --- a/docs/models/shared/accesstoken.md +++ b/docs/models/shared/accesstoken.md @@ -9,6 +9,6 @@ An AccessToken is a token that can be used to authenticate with the Speakeasy AP | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | | `access_token` | *str* | :heavy_check_mark: | N/A | | `claims` | [shared.Claims](../../models/shared/claims.md) | :heavy_check_mark: | N/A | -| `user` | [shared.AccessTokenUser](../../models/shared/accesstokenuser.md) | :heavy_check_mark: | N/A | | `feature_flags` | List[[shared.FeatureFlag](../../models/shared/featureflag.md)] | :heavy_minus_sign: | N/A | +| `user` | [shared.AccessTokenUser](../../models/shared/accesstokenuser.md) | :heavy_check_mark: | N/A | | `workspaces` | List[[shared.Workspaces](../../models/shared/workspaces.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/apikeydetails.md b/docs/models/shared/apikeydetails.md index e3369ed1..e2998b72 100644 --- a/docs/models/shared/apikeydetails.md +++ b/docs/models/shared/apikeydetails.md @@ -6,11 +6,12 @@ | Field | Type | Required | Description | | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | | `account_type_v2` | [shared.AccountType](../../models/shared/accounttype.md) | :heavy_check_mark: | N/A | +| `billing_add_ons` | List[[shared.BillingAddOn](../../models/shared/billingaddon.md)] | :heavy_check_mark: | N/A | | `enabled_features` | List[*str*] | :heavy_check_mark: | N/A | +| ~~`feature_flags`~~ | List[*str*] | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | +| `generation_access_unlimited` | *Optional[bool]* | :heavy_minus_sign: | N/A | | `org_slug` | *str* | :heavy_check_mark: | N/A | | `telemetry_disabled` | *bool* | :heavy_check_mark: | N/A | | `workspace_created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | Workspace creation timestamp. | | `workspace_id` | *str* | :heavy_check_mark: | N/A | -| `workspace_slug` | *str* | :heavy_check_mark: | N/A | -| ~~`feature_flags`~~ | List[*str*] | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | -| `generation_access_unlimited` | *Optional[bool]* | :heavy_minus_sign: | N/A | \ No newline at end of file +| `workspace_slug` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/billingaddon.md b/docs/models/shared/billingaddon.md new file mode 100644 index 00000000..da31dcf4 --- /dev/null +++ b/docs/models/shared/billingaddon.md @@ -0,0 +1,11 @@ +# BillingAddOn + + +## Values + +| Name | Value | +| --------------------- | --------------------- | +| `WEBHOOKS` | webhooks | +| `SDK_TESTING` | sdk_testing | +| `CUSTOM_CODE_REGIONS` | custom_code_regions | +| `SNIPPET_AI` | snippet_ai | \ No newline at end of file diff --git a/docs/models/shared/clievent.md b/docs/models/shared/clievent.md index c75f9db3..53e6ed2c 100644 --- a/docs/models/shared/clievent.md +++ b/docs/models/shared/clievent.md @@ -5,19 +5,12 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | Timestamp when the event was created in the database. | -| `execution_id` | *str* | :heavy_check_mark: | Unique identifier for each execution of the CLI. | -| `id` | *str* | :heavy_check_mark: | Unique identifier for each event. | -| `interaction_type` | [shared.InteractionType](../../models/shared/interactiontype.md) | :heavy_check_mark: | Type of interaction. | -| `local_started_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | Timestamp when the event started, in local time. | -| `speakeasy_api_key_name` | *str* | :heavy_check_mark: | Identifier of the Speakeasy API key. | -| `speakeasy_version` | *str* | :heavy_check_mark: | Version of the Speakeasy CLI. | -| `success` | *bool* | :heavy_check_mark: | Indicates whether the event was successful. | -| `workspace_id` | *str* | :heavy_check_mark: | Identifier of the workspace. | | `commit_head` | *Optional[str]* | :heavy_minus_sign: | Remote commit ID. | | `continuous_integration_environment` | *Optional[str]* | :heavy_minus_sign: | Name of the CI environment. | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | Timestamp when the event was created in the database. | | `duration_ms` | *Optional[int]* | :heavy_minus_sign: | Duration of the event in milliseconds. | | `error` | *Optional[str]* | :heavy_minus_sign: | Error message if the event was not successful. | +| `execution_id` | *str* | :heavy_check_mark: | Unique identifier for each execution of the CLI. | | `generate_bump_type` | [Optional[shared.GenerateBumpType]](../../models/shared/generatebumptype.md) | :heavy_minus_sign: | Bump type of the lock file (calculated semver delta, custom change (manual release), or prerelease/graduate) | | `generate_config_post_checksum` | *Optional[str]* | :heavy_minus_sign: | Checksum of the configuration file (post generation) | | `generate_config_post_raw` | *Optional[str]* | :heavy_minus_sign: | Rendered configuration file (post generation) | @@ -58,12 +51,15 @@ | `git_user_email` | *Optional[str]* | :heavy_minus_sign: | User email from git configuration. | | `git_user_name` | *Optional[str]* | :heavy_minus_sign: | User's name from git configuration. (not GitHub username) | | `hostname` | *Optional[str]* | :heavy_minus_sign: | Remote hostname. | +| `id` | *str* | :heavy_check_mark: | Unique identifier for each event. | +| `interaction_type` | [shared.InteractionType](../../models/shared/interactiontype.md) | :heavy_check_mark: | Type of interaction. | | `last_step` | *Optional[str]* | :heavy_minus_sign: | The last step of the event. | | `lint_report_digest` | *Optional[str]* | :heavy_minus_sign: | The checksum of the lint report. | | `lint_report_error_count` | *Optional[int]* | :heavy_minus_sign: | The number of errors in the lint report. | | `lint_report_info_count` | *Optional[int]* | :heavy_minus_sign: | The number of info messages in the lint report. | | `lint_report_warning_count` | *Optional[int]* | :heavy_minus_sign: | The number of warnings in the lint report. | | `local_completed_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Timestamp when the event completed, in local time. | +| `local_started_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | Timestamp when the event started, in local time. | | `management_doc_checksum` | *Optional[str]* | :heavy_minus_sign: | Checksum of the currently Rendered OpenAPI document. | | `management_doc_version` | *Optional[str]* | :heavy_minus_sign: | Version taken from info.version field of the Rendered OpenAPI document. | | `mermaid_diagram` | *Optional[str]* | :heavy_minus_sign: | Mermaid diagram | @@ -82,7 +78,12 @@ | `source_blob_digest` | *Optional[str]* | :heavy_minus_sign: | The blob digest of the source. | | `source_namespace_name` | *Optional[str]* | :heavy_minus_sign: | The namespace name of the source. | | `source_revision_digest` | *Optional[str]* | :heavy_minus_sign: | The revision digest of the source. | +| `speakeasy_api_key_name` | *str* | :heavy_check_mark: | Identifier of the Speakeasy API key. | +| `speakeasy_version` | *str* | :heavy_check_mark: | Version of the Speakeasy CLI. | +| `success` | *bool* | :heavy_check_mark: | Indicates whether the event was successful. | +| `test_report_raw` | *Optional[str]* | :heavy_minus_sign: | The raw test report xml | | `workflow_lock_post_raw` | *Optional[str]* | :heavy_minus_sign: | Workflow lock file (post execution) | | `workflow_lock_pre_raw` | *Optional[str]* | :heavy_minus_sign: | Workflow lock file (prior to execution) | | `workflow_post_raw` | *Optional[str]* | :heavy_minus_sign: | Workflow file (post execution) | -| `workflow_pre_raw` | *Optional[str]* | :heavy_minus_sign: | Workflow file (prior to execution) | \ No newline at end of file +| `workflow_pre_raw` | *Optional[str]* | :heavy_minus_sign: | Workflow file (prior to execution) | +| `workspace_id` | *str* | :heavy_check_mark: | Identifier of the workspace. | \ No newline at end of file diff --git a/docs/models/shared/codesampleschemainput.md b/docs/models/shared/codesampleschemainput.md index b17569fb..81385a9b 100644 --- a/docs/models/shared/codesampleschemainput.md +++ b/docs/models/shared/codesampleschemainput.md @@ -5,7 +5,8 @@ | Field | Type | Required | Description | | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | -| `languages` | List[*str*] | :heavy_check_mark: | A list of languages to generate code samples for | -| `schema_file` | [shared.SchemaFile](../../models/shared/schemafile.md) | :heavy_check_mark: | The OpenAPI file to be uploaded | +| `language` | *str* | :heavy_check_mark: | The language to generate code samples for | +| `operation_ids` | List[*str*] | :heavy_minus_sign: | A list of operations IDs to generate code samples for | | `package_name` | *Optional[str]* | :heavy_minus_sign: | The name of the package | +| `schema_file` | [shared.SchemaFile](../../models/shared/schemafile.md) | :heavy_check_mark: | The OpenAPI file to be uploaded | | `sdk_class_name` | *Optional[str]* | :heavy_minus_sign: | The SDK class name | \ No newline at end of file diff --git a/docs/models/shared/diagnostic.md b/docs/models/shared/diagnostic.md index 68cc1191..b4c1f25c 100644 --- a/docs/models/shared/diagnostic.md +++ b/docs/models/shared/diagnostic.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | +| `help_message` | *Optional[str]* | :heavy_minus_sign: | Help message for how to fix the issue | | `message` | *str* | :heavy_check_mark: | Message describing the issue | | `path` | List[*str*] | :heavy_check_mark: | Schema path to the issue | -| `type` | *str* | :heavy_check_mark: | Issue type | -| `help_message` | *Optional[str]* | :heavy_minus_sign: | Help message for how to fix the issue | \ No newline at end of file +| `type` | *str* | :heavy_check_mark: | Issue type | \ No newline at end of file diff --git a/docs/models/shared/featureflag.md b/docs/models/shared/featureflag.md index 5dc0208f..632f8f2c 100644 --- a/docs/models/shared/featureflag.md +++ b/docs/models/shared/featureflag.md @@ -5,7 +5,7 @@ A feature flag is a key-value pair that can be used to enable or disable feature ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `feature_flag` | *str* | :heavy_check_mark: | N/A | -| `trial_ends_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `feature_flag` | [shared.WorkspaceFeatureFlag](../../models/shared/workspacefeatureflag.md) | :heavy_check_mark: | enum value workspace feature flag | +| `trial_ends_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/format_.md b/docs/models/shared/format_.md new file mode 100644 index 00000000..851cd0b3 --- /dev/null +++ b/docs/models/shared/format_.md @@ -0,0 +1,9 @@ +# Format + + +## Values + +| Name | Value | +| ------ | ------ | +| `JSON` | json | +| `YAML` | yaml | \ No newline at end of file diff --git a/docs/models/shared/githubconfigurecodesamplesresponse.md b/docs/models/shared/githubconfigurecodesamplesresponse.md index 9bd843c2..0277ef6c 100644 --- a/docs/models/shared/githubconfigurecodesamplesresponse.md +++ b/docs/models/shared/githubconfigurecodesamplesresponse.md @@ -8,5 +8,5 @@ A response to configure GitHub code samples | Field | Type | Required | Description | | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | | `code_sample_overlay_registry_url` | *str* | :heavy_check_mark: | The URL of the code sample overlay registry | -| `source` | [shared.WorkflowDocument](../../models/shared/workflowdocument.md) | :heavy_check_mark: | A document referenced by a workflow | -| `gh_action_id` | *Optional[str]* | :heavy_minus_sign: | The ID of the GitHub action that was dispatched | \ No newline at end of file +| `gh_action_id` | *Optional[str]* | :heavy_minus_sign: | The ID of the GitHub action that was dispatched | +| `source` | [shared.WorkflowDocument](../../models/shared/workflowdocument.md) | :heavy_check_mark: | A document referenced by a workflow | \ No newline at end of file diff --git a/docs/models/shared/githubpublishingprresponse.md b/docs/models/shared/githubpublishingprresponse.md index 436eefa9..022ac721 100644 --- a/docs/models/shared/githubpublishingprresponse.md +++ b/docs/models/shared/githubpublishingprresponse.md @@ -5,7 +5,8 @@ Open generation PRs pending publishing ## Fields -| Field | Type | Required | Description | -| ------------------------- | ------------------------- | ------------------------- | ------------------------- | -| `generation_pull_request` | *Optional[str]* | :heavy_minus_sign: | N/A | -| `pending_version` | *Optional[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `pending_version` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `pull_request` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `pull_request_metadata` | [Optional[shared.PullRequestMetadata]](../../models/shared/pullrequestmetadata.md) | :heavy_minus_sign: | This can only be populated when the github app is installed for a repo | \ No newline at end of file diff --git a/docs/models/shared/githubtriggeractionrequest.md b/docs/models/shared/githubtriggeractionrequest.md index 302b2864..d42ee022 100644 --- a/docs/models/shared/githubtriggeractionrequest.md +++ b/docs/models/shared/githubtriggeractionrequest.md @@ -7,9 +7,9 @@ A request to trigger an action on a GitHub target | Field | Type | Required | Description | | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `force` | *Optional[bool]* | :heavy_minus_sign: | Force an SDK generation | | `gen_lock_id` | *str* | :heavy_check_mark: | The generation lock ID | | `org` | *str* | :heavy_check_mark: | The GitHub organization name | | `repo_name` | *str* | :heavy_check_mark: | The GitHub repository name | -| `force` | *Optional[bool]* | :heavy_minus_sign: | Force an SDK generation | | `set_version` | *Optional[str]* | :heavy_minus_sign: | A version to override the SDK too in workflow dispatch | | `target_name` | *Optional[str]* | :heavy_minus_sign: | The target name for the action | \ No newline at end of file diff --git a/docs/models/shared/httpmethod.md b/docs/models/shared/httpmethod.md new file mode 100644 index 00000000..6106d000 --- /dev/null +++ b/docs/models/shared/httpmethod.md @@ -0,0 +1,15 @@ +# HTTPMethod + + +## Values + +| Name | Value | +| --------- | --------- | +| `GET` | get | +| `POST` | post | +| `PUT` | put | +| `PATCH` | patch | +| `DELETE` | delete | +| `HEAD` | head | +| `OPTIONS` | options | +| `TRACE` | trace | \ No newline at end of file diff --git a/docs/models/shared/interactiontype.md b/docs/models/shared/interactiontype.md index aad98c67..21b03202 100644 --- a/docs/models/shared/interactiontype.md +++ b/docs/models/shared/interactiontype.md @@ -17,4 +17,5 @@ Type of interaction. | `QUICKSTART` | QUICKSTART | | `RUN` | RUN | | `CONFIGURE` | CONFIGURE | -| `PUBLISH` | PUBLISH | \ No newline at end of file +| `PUBLISH` | PUBLISH | +| `TEST` | TEST | \ No newline at end of file diff --git a/docs/models/shared/namespace.md b/docs/models/shared/namespace.md index d3eced56..3709faad 100644 --- a/docs/models/shared/namespace.md +++ b/docs/models/shared/namespace.md @@ -5,11 +5,13 @@ A namespace contains many revisions. ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | -| `id` | *str* | :heavy_check_mark: | {organization_slug}/{workspace_slug}/{namespace_name} | -| `name` | *str* | :heavy_check_mark: | A human-readable name for the namespace. | -| `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | -| `composite_spec_metadata` | [Optional[shared.CompositeSpecMetadata]](../../models/shared/compositespecmetadata.md) | :heavy_minus_sign: | N/A | -| `public` | *Optional[bool]* | :heavy_minus_sign: | Indicates whether the namespace is publicly accessible | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `archived_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | +| `composite_spec_metadata` | [Optional[shared.CompositeSpecMetadata]](../../models/shared/compositespecmetadata.md) | :heavy_minus_sign: | N/A | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `id` | *str* | :heavy_check_mark: | {organization_slug}/{workspace_slug}/{namespace_name} | +| `latest_revision_metadata` | [Optional[shared.RevisionContentsMetadata]](../../models/shared/revisioncontentsmetadata.md) | :heavy_minus_sign: | N/A | +| `name` | *str* | :heavy_check_mark: | A human-readable name for the namespace. | +| `public` | *Optional[bool]* | :heavy_minus_sign: | Indicates whether the namespace is publicly accessible | +| `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/oasoperation.md b/docs/models/shared/oasoperation.md index a055118c..7813eddd 100644 --- a/docs/models/shared/oasoperation.md +++ b/docs/models/shared/oasoperation.md @@ -6,9 +6,9 @@ | Field | Type | Required | Description | | ---------------------- | ---------------------- | ---------------------- | ---------------------- | | `description` | *str* | :heavy_check_mark: | N/A | +| `group_override` | *Optional[str]* | :heavy_minus_sign: | N/A | | `method` | *str* | :heavy_check_mark: | N/A | +| `method_name_override` | *Optional[str]* | :heavy_minus_sign: | N/A | | `operation_id` | *str* | :heavy_check_mark: | N/A | | `path` | *str* | :heavy_check_mark: | N/A | -| `tags` | List[*str*] | :heavy_check_mark: | N/A | -| `group_override` | *Optional[str]* | :heavy_minus_sign: | N/A | -| `method_name_override` | *Optional[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file +| `tags` | List[*str*] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/organization.md b/docs/models/shared/organization.md index 230e390e..41266486 100644 --- a/docs/models/shared/organization.md +++ b/docs/models/shared/organization.md @@ -9,12 +9,12 @@ A speakeasy organization | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | | `account_type` | [shared.AccountType](../../models/shared/accounttype.md) | :heavy_check_mark: | N/A | | `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `free_trial_expiry` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | | `id` | *str* | :heavy_check_mark: | N/A | +| `internal` | *Optional[bool]* | :heavy_minus_sign: | N/A | | `name` | *str* | :heavy_check_mark: | N/A | | `slug` | *str* | :heavy_check_mark: | N/A | | `sso_activated` | *bool* | :heavy_check_mark: | N/A | +| `sso_connection_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `telemetry_disabled` | *bool* | :heavy_check_mark: | N/A | -| `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | -| `free_trial_expiry` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | -| `internal` | *Optional[bool]* | :heavy_minus_sign: | N/A | -| `sso_connection_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file +| `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/organizationbillingaddonrequest.md b/docs/models/shared/organizationbillingaddonrequest.md new file mode 100644 index 00000000..6a6d7395 --- /dev/null +++ b/docs/models/shared/organizationbillingaddonrequest.md @@ -0,0 +1,10 @@ +# OrganizationBillingAddOnRequest + +A request to add billing add ons + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `add_ons` | List[[shared.BillingAddOn](../../models/shared/billingaddon.md)] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/organizationbillingaddonresponse.md b/docs/models/shared/organizationbillingaddonresponse.md new file mode 100644 index 00000000..09d8e3ba --- /dev/null +++ b/docs/models/shared/organizationbillingaddonresponse.md @@ -0,0 +1,10 @@ +# OrganizationBillingAddOnResponse + +Billing add on response + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `add_ons` | List[[shared.BillingAddOn](../../models/shared/billingaddon.md)] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/organizationusageresponse.md b/docs/models/shared/organizationusageresponse.md index 76f2db97..0b6f041b 100644 --- a/docs/models/shared/organizationusageresponse.md +++ b/docs/models/shared/organizationusageresponse.md @@ -8,6 +8,6 @@ A billing summary of organization usage | Field | Type | Required | Description | | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | | `allowed_languages` | List[*str*] | :heavy_check_mark: | List of allowed languages | +| `free_trial_expiry` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Expiry date of the free trial, will be null if no trial | | `total_allowed_languages` | *int* | :heavy_check_mark: | Total number of allowed languages, -1 if unlimited | -| `usage` | List[[shared.OrganizationUsage](../../models/shared/organizationusage.md)] | :heavy_check_mark: | N/A | -| `free_trial_expiry` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Expiry date of the free trial, will be null if no trial | \ No newline at end of file +| `usage` | List[[shared.OrganizationUsage](../../models/shared/organizationusage.md)] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/publishingtoken.md b/docs/models/shared/publishingtoken.md new file mode 100644 index 00000000..e8e19e4e --- /dev/null +++ b/docs/models/shared/publishingtoken.md @@ -0,0 +1,21 @@ +# PublishingToken + +A token used to publish to a target + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `created_by` | *str* | :heavy_check_mark: | N/A | +| `id` | *str* | :heavy_check_mark: | N/A | +| `organization_id` | *str* | :heavy_check_mark: | N/A | +| `target_id` | *str* | :heavy_check_mark: | N/A | +| `target_resource` | [shared.TargetResource](../../models/shared/targetresource.md) | :heavy_check_mark: | N/A | +| `token` | *str* | :heavy_check_mark: | N/A | +| `token_name` | *str* | :heavy_check_mark: | N/A | +| `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | +| `updated_by` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `valid_until` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `workspace_id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/pullrequestmetadata.md b/docs/models/shared/pullrequestmetadata.md new file mode 100644 index 00000000..20ca5ff0 --- /dev/null +++ b/docs/models/shared/pullrequestmetadata.md @@ -0,0 +1,18 @@ +# PullRequestMetadata + +This can only be populated when the github app is installed for a repo + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `base_branch` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `can_merge` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | +| `description` | *Optional[str]* | :heavy_minus_sign: | truncated to first 1000 characters | +| `head_branch` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `labels` | List[*str*] | :heavy_minus_sign: | List of github labels | +| `requested_reviewers` | List[*str*] | :heavy_minus_sign: | List of github handles | +| `status` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `title` | *Optional[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/remotesourcesubscriptionsettings.md b/docs/models/shared/remotesourcesubscriptionsettings.md index 0ffb22ec..709852cf 100644 --- a/docs/models/shared/remotesourcesubscriptionsettings.md +++ b/docs/models/shared/remotesourcesubscriptionsettings.md @@ -6,6 +6,6 @@ | Field | Type | Required | Description | | ---------------------- | ---------------------- | ---------------------- | ---------------------- | | `base_spec_namespaces` | List[*str*] | :heavy_check_mark: | N/A | +| `ignored_namespaces` | List[*str*] | :heavy_minus_sign: | N/A | | `output_namespace` | *str* | :heavy_check_mark: | N/A | -| `overlay_namespaces` | List[*str*] | :heavy_check_mark: | N/A | -| `ignored_namespaces` | List[*str*] | :heavy_minus_sign: | N/A | \ No newline at end of file +| `overlay_namespaces` | List[*str*] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/revision.md b/docs/models/shared/revision.md index df667ccf..1005f1ab 100644 --- a/docs/models/shared/revision.md +++ b/docs/models/shared/revision.md @@ -3,11 +3,12 @@ ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | -| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | | -| `digest` | *str* | :heavy_check_mark: | N/A | sha256:6d1ef012b5674ad8a127ecfa9b5e6f5178d171b90ee462846974177fd9bdd39f | -| `id` | *str* | :heavy_check_mark: | Format {namespace_id}/{revision_digest} | | -| `namespace_name` | *str* | :heavy_check_mark: | N/A | | -| `tags` | List[*str*] | :heavy_check_mark: | N/A | | -| `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `contents_metadata` | [Optional[shared.RevisionContentsMetadata]](../../models/shared/revisioncontentsmetadata.md) | :heavy_minus_sign: | N/A | | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | | +| `digest` | *str* | :heavy_check_mark: | N/A | sha256:6d1ef012b5674ad8a127ecfa9b5e6f5178d171b90ee462846974177fd9bdd39f | +| `id` | *str* | :heavy_check_mark: | Format {namespace_id}/{revision_digest} | | +| `namespace_name` | *str* | :heavy_check_mark: | N/A | | +| `tags` | List[*str*] | :heavy_check_mark: | N/A | | +| `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/shared/revisioncontentsmetadata.md b/docs/models/shared/revisioncontentsmetadata.md new file mode 100644 index 00000000..605d6cf4 --- /dev/null +++ b/docs/models/shared/revisioncontentsmetadata.md @@ -0,0 +1,20 @@ +# RevisionContentsMetadata + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `contains_code_samples` | *bool* | :heavy_check_mark: | Whether the OAS contains code samples. | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `description` | *str* | :heavy_check_mark: | The OAS description | +| `hash` | *str* | :heavy_check_mark: | The hash of the contents | +| `namespace` | *str* | :heavy_check_mark: | The fully qualified namespace | +| `num_overlay_actions` | *int* | :heavy_check_mark: | The number of overlay actions in the OAS. Will be 0 if the OAS is not an overlay. | +| `operation_ids` | List[*str*] | :heavy_check_mark: | The operation IDs contained in the OAS. Will be empty if the OAS is an overlay. | +| `revision_digest` | *str* | :heavy_check_mark: | The digest of the parent bundle | +| `tags` | List[*str*] | :heavy_check_mark: | The tags contained in the OAS -- NOT the OCI tags. Will be empty if the OAS is an overlay. | +| `title` | *str* | :heavy_check_mark: | The OAS title | +| `type` | [shared.RevisionContentsMetadataType](../../models/shared/revisioncontentsmetadatatype.md) | :heavy_check_mark: | N/A | +| `version` | *str* | :heavy_check_mark: | The OAS version | +| `workspace_id` | *str* | :heavy_check_mark: | The workspace ID | \ No newline at end of file diff --git a/docs/models/shared/revisioncontentsmetadatatype.md b/docs/models/shared/revisioncontentsmetadatatype.md new file mode 100644 index 00000000..939b22fb --- /dev/null +++ b/docs/models/shared/revisioncontentsmetadatatype.md @@ -0,0 +1,9 @@ +# RevisionContentsMetadataType + + +## Values + +| Name | Value | +| ----------------- | ----------------- | +| `OPENAPI_BUNDLE` | OPENAPI_BUNDLE | +| `OPENAPI_OVERLAY` | OPENAPI_OVERLAY | \ No newline at end of file diff --git a/docs/models/shared/schemafile.md b/docs/models/shared/schemafile.md index 191f8610..84ddd4fc 100644 --- a/docs/models/shared/schemafile.md +++ b/docs/models/shared/schemafile.md @@ -6,5 +6,5 @@ | Field | Type | Required | Description | | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | | `content` | *Union[bytes, IO[bytes], io.BufferedReader]* | :heavy_check_mark: | N/A | -| `file_name` | *str* | :heavy_check_mark: | N/A | -| `content_type` | *Optional[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file +| `content_type` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `file_name` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/schemastoreitem.md b/docs/models/shared/schemastoreitem.md new file mode 100644 index 00000000..fff9b621 --- /dev/null +++ b/docs/models/shared/schemastoreitem.md @@ -0,0 +1,13 @@ +# SchemaStoreItem + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `format_` | [shared.Format](../../models/shared/format_.md) | :heavy_check_mark: | N/A | +| `id` | *str* | :heavy_check_mark: | N/A | +| `package_name` | *str* | :heavy_check_mark: | N/A | +| `sdk_classname` | *str* | :heavy_check_mark: | N/A | +| `spec` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/suggestoptsold.md b/docs/models/shared/suggestoptsold.md index d8bfb10a..5e277ebd 100644 --- a/docs/models/shared/suggestoptsold.md +++ b/docs/models/shared/suggestoptsold.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -| `suggestion_type` | [shared.SuggestionType](../../models/shared/suggestiontype.md) | :heavy_check_mark: | N/A | -| `diagnostics` | List[[shared.Diagnostic](../../models/shared/diagnostic.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file +| `diagnostics` | List[[shared.Diagnostic](../../models/shared/diagnostic.md)] | :heavy_minus_sign: | N/A | +| `suggestion_type` | [shared.SuggestionType](../../models/shared/suggestiontype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/targetresource.md b/docs/models/shared/targetresource.md new file mode 100644 index 00000000..141e2977 --- /dev/null +++ b/docs/models/shared/targetresource.md @@ -0,0 +1,8 @@ +# TargetResource + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `DOCUMENT` | document | \ No newline at end of file diff --git a/docs/models/shared/targetsdk.md b/docs/models/shared/targetsdk.md index 4cf23d17..5d98c0f2 100644 --- a/docs/models/shared/targetsdk.md +++ b/docs/models/shared/targetsdk.md @@ -5,23 +5,19 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `generate_gen_lock_id` | *str* | :heavy_check_mark: | gen.lock ID (expected to be a uuid). The same as `id`. A unique identifier for the target. | -| `generate_target` | *str* | :heavy_check_mark: | eg `typescript`, `terraform`, `python` | -| `id` | *str* | :heavy_check_mark: | Unique identifier of the target the same as `generate_gen_lock_id` | -| `last_event_created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | Timestamp when the event was created in the database. | -| `last_event_id` | *str* | :heavy_check_mark: | Unique identifier of the last event for the target | -| `last_event_interaction_type` | [shared.InteractionType](../../models/shared/interactiontype.md) | :heavy_check_mark: | Type of interaction. | | `commit_head` | *Optional[str]* | :heavy_minus_sign: | Remote commit ID. | | `continuous_integration_environment` | *Optional[str]* | :heavy_minus_sign: | Name of the CI environment. | | `error` | *Optional[str]* | :heavy_minus_sign: | Error message if the last event was not successful. | | `generate_config_post_version` | *Optional[str]* | :heavy_minus_sign: | Version of the generated target (post generation) | | `generate_eligible_features` | *Optional[str]* | :heavy_minus_sign: | Eligible feature set during generation | +| `generate_gen_lock_id` | *str* | :heavy_check_mark: | gen.lock ID (expected to be a uuid). The same as `id`. A unique identifier for the target. | | `generate_gen_lock_pre_features` | *Optional[str]* | :heavy_minus_sign: | Features prior to generation | | `generate_gen_lock_pre_version` | *Optional[str]* | :heavy_minus_sign: | Artifact version for the Previous Generation | | `generate_number_of_operations_ignored` | *Optional[int]* | :heavy_minus_sign: | The number of operations ignored in generation. | | `generate_number_of_operations_used` | *Optional[int]* | :heavy_minus_sign: | The number of operations used in generation. | | `generate_number_of_terraform_resources` | *Optional[int]* | :heavy_minus_sign: | The number of terraform resources used in generation. | | `generate_published` | *Optional[bool]* | :heavy_minus_sign: | Indicates whether the target was considered published. | +| `generate_target` | *str* | :heavy_check_mark: | eg `typescript`, `terraform`, `python` | | `generate_target_name` | *Optional[str]* | :heavy_minus_sign: | The workflow name of the target. | | `generate_target_version` | *Optional[str]* | :heavy_minus_sign: | The version of the Speakeasy generator for this target eg v2 of the typescript generator. | | `gh_action_organization` | *Optional[str]* | :heavy_minus_sign: | GitHub organization of the action. | @@ -35,6 +31,10 @@ | `git_user_email` | *Optional[str]* | :heavy_minus_sign: | User email from git configuration. | | `git_user_name` | *Optional[str]* | :heavy_minus_sign: | User's name from git configuration. (not GitHub username) | | `hostname` | *Optional[str]* | :heavy_minus_sign: | Remote hostname. | +| `id` | *str* | :heavy_check_mark: | Unique identifier of the target the same as `generate_gen_lock_id` | +| `last_event_created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | Timestamp when the event was created in the database. | +| `last_event_id` | *str* | :heavy_check_mark: | Unique identifier of the last event for the target | +| `last_event_interaction_type` | [shared.InteractionType](../../models/shared/interactiontype.md) | :heavy_check_mark: | Type of interaction. | | `last_publish_created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Timestamp when the last publishing event was created. | | `last_publish_gh_action_run_link` | *Optional[str]* | :heavy_minus_sign: | Link to the GitHub action run for the last publishing event. | | `publish_package_name` | *Optional[str]* | :heavy_minus_sign: | Name of the published package. | diff --git a/docs/models/shared/usagesnippet.md b/docs/models/shared/usagesnippet.md index 0a27546a..75050fa9 100644 --- a/docs/models/shared/usagesnippet.md +++ b/docs/models/shared/usagesnippet.md @@ -7,4 +7,6 @@ | -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | | `code` | *str* | :heavy_check_mark: | The code snippet | | `language` | *str* | :heavy_check_mark: | The language of the snippet | -| `operation_id` | *str* | :heavy_check_mark: | The operation ID for the snippet | \ No newline at end of file +| `method` | *Any* | :heavy_check_mark: | The HTTP method of the operation | +| `operation_id` | *str* | :heavy_check_mark: | The operation ID for the snippet | +| `path` | *str* | :heavy_check_mark: | The path of the operation | \ No newline at end of file diff --git a/docs/models/shared/user.md b/docs/models/shared/user.md index cabf4853..03ae5905 100644 --- a/docs/models/shared/user.md +++ b/docs/models/shared/user.md @@ -3,19 +3,21 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `admin` | *bool* | :heavy_check_mark: | Indicates whether the user is an admin. | -| `confirmed` | *bool* | :heavy_check_mark: | Indicates whether the user has been confirmed. | -| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | Timestamp of the user's creation. | -| `display_name` | *str* | :heavy_check_mark: | Display name of the user. | -| `email` | *str* | :heavy_check_mark: | Email address of the user. | -| `email_verified` | *bool* | :heavy_check_mark: | Indicates whether the email address has been verified. | -| `id` | *str* | :heavy_check_mark: | Unique identifier for the user. | -| `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | Timestamp of the user's last update. | -| `whitelisted` | *bool* | :heavy_check_mark: | Indicates whether the user has been whitelisted. | -| `default_workspace_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Identifier of the default workspace. | -| `github_handle` | *OptionalNullable[str]* | :heavy_minus_sign: | GitHub handle of the user. | -| `internal` | *Optional[bool]* | :heavy_minus_sign: | Indicates whether the user is internal. | -| `last_login_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Timestamp of the last login. | -| `photo_url` | *OptionalNullable[str]* | :heavy_minus_sign: | URL of the user's photo. | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `admin` | *bool* | :heavy_check_mark: | Indicates whether the user is an admin. | +| `confirmed` | *bool* | :heavy_check_mark: | Indicates whether the user has been confirmed. | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | Timestamp of the user's creation. | +| `default_workspace_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Identifier of the default workspace. | +| `display_name` | *str* | :heavy_check_mark: | Display name of the user. | +| `email` | *str* | :heavy_check_mark: | Email address of the user. | +| `email_verified` | *bool* | :heavy_check_mark: | Indicates whether the email address has been verified. | +| `github_handle` | *OptionalNullable[str]* | :heavy_minus_sign: | GitHub handle of the user. | +| `has_created_api_key` | *Optional[bool]* | :heavy_minus_sign: | Indicates whether the user has created an API key. Not always populated | +| `id` | *str* | :heavy_check_mark: | Unique identifier for the user. | +| `internal` | *Optional[bool]* | :heavy_minus_sign: | Indicates whether the user is internal. | +| `last_login_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Timestamp of the last login. | +| `photo_url` | *OptionalNullable[str]* | :heavy_minus_sign: | URL of the user's photo. | +| `pylon_identity_hash` | *Optional[str]* | :heavy_minus_sign: | Hash used for pylon identity verification returned on v1/user. | +| `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | Timestamp of the user's last update. | +| `whitelisted` | *bool* | :heavy_check_mark: | Indicates whether the user has been whitelisted. | \ No newline at end of file diff --git a/docs/models/shared/workflowdocument.md b/docs/models/shared/workflowdocument.md index 63821968..58058c56 100644 --- a/docs/models/shared/workflowdocument.md +++ b/docs/models/shared/workflowdocument.md @@ -7,5 +7,5 @@ A document referenced by a workflow | Field | Type | Required | Description | | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `location` | *str* | :heavy_check_mark: | N/A | -| `auth` | [Optional[shared.Auth]](../../models/shared/auth.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `auth` | [Optional[shared.Auth]](../../models/shared/auth.md) | :heavy_minus_sign: | N/A | +| `location` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/workspace.md b/docs/models/shared/workspace.md index e01ffd06..7b62b927 100644 --- a/docs/models/shared/workspace.md +++ b/docs/models/shared/workspace.md @@ -9,10 +9,10 @@ A speakeasy workspace | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | | `id` | *str* | :heavy_check_mark: | N/A | +| `inactive` | *Optional[bool]* | :heavy_minus_sign: | N/A | | `name` | *str* | :heavy_check_mark: | N/A | | `organization_id` | *str* | :heavy_check_mark: | N/A | | `slug` | *str* | :heavy_check_mark: | N/A | +| ~~`telemetry_disabled`~~ | *Optional[bool]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Deprecated. Use organization.telemetry_disabled instead. | | `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | -| `verified` | *bool* | :heavy_check_mark: | N/A | -| `inactive` | *Optional[bool]* | :heavy_minus_sign: | N/A | -| ~~`telemetry_disabled`~~ | *Optional[bool]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Deprecated. Use organization.telemetry_disabled instead. | \ No newline at end of file +| `verified` | *bool* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/workspacefeatureflag.md b/docs/models/shared/workspacefeatureflag.md new file mode 100644 index 00000000..07aa4139 --- /dev/null +++ b/docs/models/shared/workspacefeatureflag.md @@ -0,0 +1,13 @@ +# WorkspaceFeatureFlag + +enum value workspace feature flag + + +## Values + +| Name | Value | +| ---------------------- | ---------------------- | +| `SCHEMA_REGISTRY` | schema_registry | +| `CHANGES_REPORT` | changes_report | +| `SKIP_SCHEMA_REGISTRY` | skip_schema_registry | +| `WEBHOOKS` | webhooks | \ No newline at end of file diff --git a/docs/models/shared/workspacefeatureflagrequest.md b/docs/models/shared/workspacefeatureflagrequest.md new file mode 100644 index 00000000..0aaee5d1 --- /dev/null +++ b/docs/models/shared/workspacefeatureflagrequest.md @@ -0,0 +1,10 @@ +# WorkspaceFeatureFlagRequest + +A request to add workspace feature flags + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `feature_flags` | List[[shared.WorkspaceFeatureFlag](../../models/shared/workspacefeatureflag.md)] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/workspaceinviteresponse.md b/docs/models/shared/workspaceinviteresponse.md index d02b291d..596622e1 100644 --- a/docs/models/shared/workspaceinviteresponse.md +++ b/docs/models/shared/workspaceinviteresponse.md @@ -7,5 +7,5 @@ A response for workspace user invite | Field | Type | Required | Description | | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | -| `relationship` | [shared.Relationship](../../models/shared/relationship.md) | :heavy_check_mark: | N/A | -| `invite_link` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file +| `invite_link` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `relationship` | [shared.Relationship](../../models/shared/relationship.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/workspaceteamresponse.md b/docs/models/shared/workspaceteamresponse.md index 2cdab461..a6005c29 100644 --- a/docs/models/shared/workspaceteamresponse.md +++ b/docs/models/shared/workspaceteamresponse.md @@ -7,5 +7,5 @@ Workspace team response | Field | Type | Required | Description | | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `users` | List[[shared.User](../../models/shared/user.md)] | :heavy_check_mark: | N/A | -| `sso_metadata` | [Optional[shared.SSOMetadata]](../../models/shared/ssometadata.md) | :heavy_minus_sign: | SSO metadata for a workspace | \ No newline at end of file +| `sso_metadata` | [Optional[shared.SSOMetadata]](../../models/shared/ssometadata.md) | :heavy_minus_sign: | SSO metadata for a workspace | +| `users` | List[[shared.User](../../models/shared/user.md)] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/workspacetoken.md b/docs/models/shared/workspacetoken.md index 3bf1169a..0d3ca4cd 100644 --- a/docs/models/shared/workspacetoken.md +++ b/docs/models/shared/workspacetoken.md @@ -9,10 +9,12 @@ A workspace token | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | | `alg` | *str* | :heavy_check_mark: | N/A | | `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `created_by` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `created_by_name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `created_by_photo_url` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `email` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `id` | *str* | :heavy_check_mark: | N/A | | `key` | *str* | :heavy_check_mark: | N/A | +| `last_used` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | | `name` | *str* | :heavy_check_mark: | N/A | -| `workspace_id` | *str* | :heavy_check_mark: | N/A | -| `created_by` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `email` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `last_used` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `workspace_id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdks/artifacts/README.md b/docs/sdks/artifacts/README.md index b17d049a..200347a0 100644 --- a/docs/sdks/artifacts/README.md +++ b/docs/sdks/artifacts/README.md @@ -16,6 +16,7 @@ REST APIs for working with Registry artifacts * [list_remote_sources](#list_remote_sources) - Get remote sources attached to a particular namespace * [post_tags](#post_tags) - Add tags to an existing revision * [preflight](#preflight) - Get access token for communicating with OCI distribution endpoints +* [set_archived](#set_archived) - Set whether a namespace is archived * [set_visibility](#set_visibility) - Set visibility of a namespace with an existing metadata entry ## create_remote_source @@ -24,10 +25,12 @@ Configure a new remote source ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -67,10 +70,12 @@ Get blob for a particular digest ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -115,10 +120,12 @@ Get manifest for a particular reference ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -163,10 +170,12 @@ Each namespace contains many revisions. ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -203,10 +212,12 @@ with Speakeasy( ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -246,10 +257,12 @@ with Speakeasy( ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -291,10 +304,12 @@ Get remote sources attached to a particular namespace ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -336,10 +351,12 @@ Add tags to an existing revision ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -381,10 +398,12 @@ Get access token for communicating with OCI distribution endpoints ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -418,16 +437,65 @@ with Speakeasy( | errors.Error | 4XX | application/json | | errors.SDKError | 5XX | \*/\* | +## set_archived + +Set whether a namespace is archived + +### Example Usage + + +```python +from speakeasy_client_sdk_python import Speakeasy +from speakeasy_client_sdk_python.models import shared + + +with Speakeasy( + security=shared.Security( + api_key="", + ), +) as speakeasy: + + res = speakeasy.artifacts.set_archived(request={ + "namespace_name": "", + }) + + assert res is not None + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `request` | [operations.ArchiveNamespaceRequest](../../models/operations/archivenamespacerequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[operations.ArchiveNamespaceResponse](../../models/operations/archivenamespaceresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------- | ---------------- | ---------------- | +| errors.Error | 4XX | application/json | +| errors.SDKError | 5XX | \*/\* | + ## set_visibility Set visibility of a namespace with an existing metadata entry ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", diff --git a/docs/sdks/auth/README.md b/docs/sdks/auth/README.md index 412f0549..a89d5f36 100644 --- a/docs/sdks/auth/README.md +++ b/docs/sdks/auth/README.md @@ -18,10 +18,12 @@ Checks if generation is permitted for a particular run of the CLI ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -60,9 +62,11 @@ Get or refresh an access token for the current workspace. ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy + with Speakeasy() as speakeasy: res = speakeasy.auth.get_access_token(request={ @@ -100,10 +104,12 @@ Get information about the current user. ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -142,10 +148,12 @@ Validate the current api key. ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", diff --git a/docs/sdks/codesamples/README.md b/docs/sdks/codesamples/README.md index 66acddb0..41a8f369 100644 --- a/docs/sdks/codesamples/README.md +++ b/docs/sdks/codesamples/README.md @@ -9,7 +9,7 @@ REST APIs for retrieving Code Samples * [generate_code_sample_preview](#generate_code_sample_preview) - Generate Code Sample previews from a file and configuration parameters. * [generate_code_sample_preview_asynchronous](#generate_code_sample_preview_asynchronous) - Initiate asynchronous Code Sample preview generation from a file and configuration parameters, receiving an async JobID response for polling. -* [get](#get) - Retrieve usage snippets from document stored in the registry +* [get](#get) - Retrieve usage snippets * [get_code_sample_preview_async](#get_code_sample_preview_async) - Poll for the result of an asynchronous Code Sample preview generation. ## generate_code_sample_preview @@ -18,10 +18,12 @@ This endpoint generates Code Sample previews from a file and configuration param ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -29,20 +31,17 @@ with Speakeasy( ) as speakeasy: res = speakeasy.code_samples.generate_code_sample_preview(request={ - "languages": [ - "", - "", - ], + "language": "", "schema_file": { "content": open("example.file", "rb"), "file_name": "example.file", }, }) - assert res.two_hundred_application_json_response_stream is not None + assert res.usage_snippets is not None # Handle response - print(res.two_hundred_application_json_response_stream) + print(res.usage_snippets) ``` @@ -61,7 +60,8 @@ with Speakeasy( | Error Type | Status Code | Content Type | | ---------------- | ---------------- | ---------------- | -| errors.Error | 4XX, 5XX | application/json | +| errors.Error | 4XX | application/json | +| errors.Error | 5XX | application/json | ## generate_code_sample_preview_asynchronous @@ -69,10 +69,12 @@ This endpoint generates Code Sample previews from a file and configuration param ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -80,10 +82,7 @@ with Speakeasy( ) as speakeasy: res = speakeasy.code_samples.generate_code_sample_preview_asynchronous(request={ - "languages": [ - "", - "", - ], + "language": "", "schema_file": { "content": open("example.file", "rb"), "file_name": "example.file", @@ -112,18 +111,21 @@ with Speakeasy( | Error Type | Status Code | Content Type | | ---------------- | ---------------- | ---------------- | -| errors.Error | 4XX, 5XX | application/json | +| errors.Error | 4XX | application/json | +| errors.Error | 5XX | application/json | ## get -Retrieve usage snippets from document stored in the registry. Supports filtering by language and operation ID. +Retrieve usage snippets from an OpenAPI document stored in the registry. Supports filtering by language and operation ID. ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -131,7 +133,26 @@ with Speakeasy( ) as speakeasy: res = speakeasy.code_samples.get(request={ - "registry_url": "https://normal-making.name", + "registry_url": "https://spec.speakeasy.com/my-org/my-workspace/my-source", + "operation_ids": [ + "g", + "e", + "t", + "P", + "e", + "t", + "s", + ], + "method_paths": [ + { + "method": shared.HTTPMethod.GET, + "path": "/pets", + }, + ], + "languages": [ + "python", + "javascript", + ], }) assert res.usage_snippets is not None @@ -165,10 +186,12 @@ Poll for the result of an asynchronous Code Sample preview generation. ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -179,10 +202,10 @@ with Speakeasy( "job_id": "", }) - assert res.two_hundred_application_json_response_stream is not None + assert res.object is not None # Handle response - print(res.two_hundred_application_json_response_stream) + print(res.object) ``` @@ -201,4 +224,5 @@ with Speakeasy( | Error Type | Status Code | Content Type | | ---------------- | ---------------- | ---------------- | -| errors.Error | 4XX, 5XX | application/json | \ No newline at end of file +| errors.Error | 4XX | application/json | +| errors.Error | 5XX | application/json | \ No newline at end of file diff --git a/docs/sdks/events/README.md b/docs/sdks/events/README.md index 854feca6..11615ed6 100644 --- a/docs/sdks/events/README.md +++ b/docs/sdks/events/README.md @@ -19,11 +19,14 @@ Load recent events for a particular workspace ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( + workspace_id="", security=shared.Security( api_key="", ), @@ -31,7 +34,6 @@ with Speakeasy( res = speakeasy.events.get_events_by_target(request={ "target_id": "", - "workspace_id": "", }) assert res.cli_event_batch is not None @@ -65,10 +67,12 @@ Load targets for a particular workspace ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -108,19 +112,20 @@ Load targets for a particular workspace ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( + workspace_id="", security=shared.Security( api_key="", ), ) as speakeasy: - res = speakeasy.events.get_targets_deprecated(request={ - "workspace_id": "", - }) + res = speakeasy.events.get_targets_deprecated(request={}) assert res.target_sdk_list is not None @@ -153,12 +158,15 @@ Sends an array of events to be stored for a particular workspace. ### Example Usage + ```python -import dateutil.parser from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared +from speakeasy_client_sdk_python.utils import parse_datetime + with Speakeasy( + workspace_id="", security=shared.Security( api_key="", ), @@ -167,18 +175,17 @@ with Speakeasy( res = speakeasy.events.post(request={ "request_body": [ { - "created_at": dateutil.parser.isoparse("2025-03-02T10:07:28.113Z"), + "created_at": parse_datetime("2023-02-16T09:12:42.397Z"), "execution_id": "", "id": "", - "interaction_type": shared.InteractionType.AUTHENTICATE, - "local_started_at": dateutil.parser.isoparse("2025-08-12T17:54:17.538Z"), + "interaction_type": shared.InteractionType.QUICKSTART, + "local_started_at": parse_datetime("2024-01-24T01:13:51.002Z"), "speakeasy_api_key_name": "", "speakeasy_version": "", "success": True, "workspace_id": "", }, ], - "workspace_id": "", }) assert res is not None @@ -212,19 +219,20 @@ Search events for a particular workspace by any field ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( + workspace_id="", security=shared.Security( api_key="", ), ) as speakeasy: - res = speakeasy.events.search(request={ - "workspace_id": "", - }) + res = speakeasy.events.search(request={}) assert res.cli_event_batch is not None diff --git a/docs/sdks/github/README.md b/docs/sdks/github/README.md index 814b08d6..c836bc8d 100644 --- a/docs/sdks/github/README.md +++ b/docs/sdks/github/README.md @@ -23,10 +23,12 @@ REST APIs for managing the github integration ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -67,10 +69,12 @@ with Speakeasy( ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -112,10 +116,12 @@ with Speakeasy( ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -155,10 +161,12 @@ with Speakeasy( ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -200,10 +208,12 @@ with Speakeasy( ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -214,7 +224,7 @@ with Speakeasy( "input": "", "org": "", "overlays": [ - "", + "", ], "repo": "", }) @@ -248,10 +258,12 @@ with Speakeasy( ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -292,10 +304,12 @@ with Speakeasy( ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -336,10 +350,12 @@ with Speakeasy( ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -381,10 +397,12 @@ with Speakeasy( ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -422,10 +440,12 @@ with Speakeasy( ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -465,10 +485,12 @@ with Speakeasy( ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", diff --git a/docs/sdks/organizations/README.md b/docs/sdks/organizations/README.md index f32a8515..54560231 100644 --- a/docs/sdks/organizations/README.md +++ b/docs/sdks/organizations/README.md @@ -8,9 +8,12 @@ REST APIs for managing Organizations (speakeasy L1 Tenancy construct) ### Available Operations * [create](#create) - Create an organization +* [create_billing_add_ons](#create_billing_add_ons) - Create billing add ons * [create_free_trial](#create_free_trial) - Create a free trial for an organization +* [delete_billing_add_on](#delete_billing_add_on) - Delete billing add ons * [get](#get) - Get organization * [get_all](#get_all) - Get organizations for a user +* [get_billing_add_ons](#get_billing_add_ons) - Get billing add ons * [get_usage](#get_usage) - Get billing usage summary for a particular organization ## create @@ -19,10 +22,12 @@ Creates an organization ### Example Usage + ```python -import dateutil.parser from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared +from speakeasy_client_sdk_python.utils import parse_datetime + with Speakeasy( security=shared.Security( @@ -32,13 +37,13 @@ with Speakeasy( res = speakeasy.organizations.create(request={ "account_type": shared.AccountType.SCALE_UP, - "created_at": dateutil.parser.isoparse("2024-11-30T17:06:07.804Z"), + "created_at": parse_datetime("2025-10-26T09:05:00.560Z"), "id": "", "name": "", "slug": "", - "sso_activated": True, - "telemetry_disabled": True, - "updated_at": dateutil.parser.isoparse("2023-03-17T15:39:20.911Z"), + "sso_activated": False, + "telemetry_disabled": False, + "updated_at": parse_datetime("2023-12-23T08:00:51.380Z"), }) assert res.organization is not None @@ -66,16 +71,67 @@ with Speakeasy( | errors.Error | 4XX | application/json | | errors.SDKError | 5XX | \*/\* | +## create_billing_add_ons + +Create billing add ons + +### Example Usage + + +```python +from speakeasy_client_sdk_python import Speakeasy +from speakeasy_client_sdk_python.models import shared + + +with Speakeasy( + security=shared.Security( + api_key="", + ), +) as speakeasy: + + res = speakeasy.organizations.create_billing_add_ons(request={ + "add_ons": [ + shared.BillingAddOn.CUSTOM_CODE_REGIONS, + ], + }) + + assert res.organization_billing_add_on_response is not None + + # Handle response + print(res.organization_billing_add_on_response) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `request` | [shared.OrganizationBillingAddOnRequest](../../models/shared/organizationbillingaddonrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[operations.CreateBillingAddOnsResponse](../../models/operations/createbillingaddonsresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------- | ---------------- | ---------------- | +| errors.Error | 5XX | application/json | +| errors.SDKError | 4XX | \*/\* | + ## create_free_trial Creates a free trial for an organization ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -108,16 +164,65 @@ with Speakeasy( | errors.Error | 4XX | application/json | | errors.SDKError | 5XX | \*/\* | +## delete_billing_add_on + +Delete billing add ons + +### Example Usage + + +```python +from speakeasy_client_sdk_python import Speakeasy +from speakeasy_client_sdk_python.models import shared + + +with Speakeasy( + security=shared.Security( + api_key="", + ), +) as speakeasy: + + res = speakeasy.organizations.delete_billing_add_on(request={ + "add_on": shared.BillingAddOn.SDK_TESTING, + }) + + assert res is not None + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `request` | [operations.DeleteBillingAddOnRequest](../../models/operations/deletebillingaddonrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[operations.DeleteBillingAddOnResponse](../../models/operations/deletebillingaddonresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------- | ---------------- | ---------------- | +| errors.Error | 5XX | application/json | +| errors.SDKError | 4XX | \*/\* | + ## get Get information about a particular organization. ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -159,10 +264,12 @@ Returns a list of organizations a user has access too ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -195,16 +302,62 @@ with Speakeasy( | errors.Error | 4XX | application/json | | errors.SDKError | 5XX | \*/\* | +## get_billing_add_ons + +Get billing add ons + +### Example Usage + + +```python +from speakeasy_client_sdk_python import Speakeasy +from speakeasy_client_sdk_python.models import shared + + +with Speakeasy( + security=shared.Security( + api_key="", + ), +) as speakeasy: + + res = speakeasy.organizations.get_billing_add_ons() + + assert res.organization_billing_add_on_response is not None + + # Handle response + print(res.organization_billing_add_on_response) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[operations.GetBillingAddOnsResponse](../../models/operations/getbillingaddonsresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------- | ---------------- | ---------------- | +| errors.Error | 5XX | application/json | +| errors.SDKError | 4XX | \*/\* | + ## get_usage Returns a billing usage summary by target languages for a particular organization ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", diff --git a/docs/sdks/publishingtokens/README.md b/docs/sdks/publishingtokens/README.md new file mode 100644 index 00000000..863e48b6 --- /dev/null +++ b/docs/sdks/publishingtokens/README.md @@ -0,0 +1,338 @@ +# PublishingTokens +(*publishing_tokens*) + +## Overview + +### Available Operations + +* [create](#create) - Create a publishing token for a workspace +* [delete](#delete) - Delete a specific publishing token +* [get](#get) - Get a specific publishing token +* [list](#list) - Get publishing tokens for a workspace +* [resolve_metadata](#resolve_metadata) - Get metadata about the token +* [resolve_target](#resolve_target) - Get a specific publishing token target +* [update](#update) - Updates the validitity period of a publishing token + +## create + +Creates a publishing token for the current workspace + +### Example Usage + + +```python +from speakeasy_client_sdk_python import Speakeasy +from speakeasy_client_sdk_python.models import shared + + +with Speakeasy( + security=shared.Security( + api_key="", + ), +) as speakeasy: + + res = speakeasy.publishing_tokens.create() + + assert res.publishing_token is not None + + # Handle response + print(res.publishing_token) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `request` | [operations.CreatePublishingTokenRequestBody](../../models/operations/createpublishingtokenrequestbody.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[operations.CreatePublishingTokenResponse](../../models/operations/createpublishingtokenresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------- | ---------------- | ---------------- | +| errors.Error | 4XX | application/json | +| errors.SDKError | 5XX | \*/\* | + +## delete + +Delete a particular publishing token. + +### Example Usage + + +```python +from speakeasy_client_sdk_python import Speakeasy +from speakeasy_client_sdk_python.models import shared + + +with Speakeasy( + security=shared.Security( + api_key="", + ), +) as speakeasy: + + res = speakeasy.publishing_tokens.delete(request={ + "token_id": "", + }) + + assert res is not None + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `request` | [operations.DeletePublishingTokenRequest](../../models/operations/deletepublishingtokenrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[operations.DeletePublishingTokenResponse](../../models/operations/deletepublishingtokenresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------- | ---------------- | ---------------- | +| errors.Error | 4XX | application/json | +| errors.SDKError | 5XX | \*/\* | + +## get + +Get information about a particular publishing token. + +### Example Usage + + +```python +from speakeasy_client_sdk_python import Speakeasy +from speakeasy_client_sdk_python.models import shared + + +with Speakeasy( + security=shared.Security( + api_key="", + ), +) as speakeasy: + + res = speakeasy.publishing_tokens.get(request={ + "token_id": "", + }) + + assert res.publishing_token is not None + + # Handle response + print(res.publishing_token) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `request` | [operations.GetPublishingTokenByIDRequest](../../models/operations/getpublishingtokenbyidrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[operations.GetPublishingTokenByIDResponse](../../models/operations/getpublishingtokenbyidresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------- | ---------------- | ---------------- | +| errors.Error | 4XX | application/json | +| errors.SDKError | 5XX | \*/\* | + +## list + +Returns a publishing token for the current workspace + +### Example Usage + + +```python +from speakeasy_client_sdk_python import Speakeasy +from speakeasy_client_sdk_python.models import shared + + +with Speakeasy( + security=shared.Security( + api_key="", + ), +) as speakeasy: + + res = speakeasy.publishing_tokens.list() + + assert res.classes is not None + + # Handle response + print(res.classes) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[operations.GetPublishingTokenResponse](../../models/operations/getpublishingtokenresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------- | ---------------- | ---------------- | +| errors.Error | 4XX | application/json | +| errors.SDKError | 5XX | \*/\* | + +## resolve_metadata + +Get information about a particular publishing token. + +### Example Usage + + +```python +from speakeasy_client_sdk_python import Speakeasy +from speakeasy_client_sdk_python.models import shared + + +with Speakeasy( + security=shared.Security( + api_key="", + ), +) as speakeasy: + + res = speakeasy.publishing_tokens.resolve_metadata(request={ + "token_id": "", + }) + + assert res.object is not None + + # Handle response + print(res.object) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetPublishingTokenPublicMetadataRequest](../../models/operations/getpublishingtokenpublicmetadatarequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[operations.GetPublishingTokenPublicMetadataResponse](../../models/operations/getpublishingtokenpublicmetadataresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------- | ---------------- | ---------------- | +| errors.Error | 4XX | application/json | +| errors.SDKError | 5XX | \*/\* | + +## resolve_target + +Get information about a particular publishing token target. + +### Example Usage + + +```python +from speakeasy_client_sdk_python import Speakeasy +from speakeasy_client_sdk_python.models import shared + + +with Speakeasy( + security=shared.Security( + api_key="", + ), +) as speakeasy: + + res = speakeasy.publishing_tokens.resolve_target(request={ + "token_id": "", + }) + + assert res.res is not None + + # Handle response + print(res.res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `request` | [operations.GetPublishingTokenTargetByIDRequest](../../models/operations/getpublishingtokentargetbyidrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[operations.GetPublishingTokenTargetByIDResponse](../../models/operations/getpublishingtokentargetbyidresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------- | ---------------- | ---------------- | +| errors.Error | 4XX | application/json | +| errors.SDKError | 5XX | \*/\* | + +## update + +Updates the validity period of a particular publishing token. + +### Example Usage + + +```python +from speakeasy_client_sdk_python import Speakeasy +from speakeasy_client_sdk_python.models import shared + + +with Speakeasy( + security=shared.Security( + api_key="", + ), +) as speakeasy: + + res = speakeasy.publishing_tokens.update(request={ + "token_id": "", + }) + + assert res is not None + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| `request` | [operations.UpdatePublishingTokenExpirationRequest](../../models/operations/updatepublishingtokenexpirationrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[operations.UpdatePublishingTokenExpirationResponse](../../models/operations/updatepublishingtokenexpirationresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------- | ---------------- | ---------------- | +| errors.Error | 4XX | application/json | +| errors.SDKError | 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/reports/README.md b/docs/sdks/reports/README.md index 88413974..6cfc9bed 100644 --- a/docs/sdks/reports/README.md +++ b/docs/sdks/reports/README.md @@ -17,10 +17,12 @@ Get the signed access url for the change reports for a particular document. ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -61,10 +63,12 @@ Get the signed access url for the linting reports for a particular document. ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -105,10 +109,12 @@ Upload a report. ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", diff --git a/docs/sdks/schemastore/README.md b/docs/sdks/schemastore/README.md new file mode 100644 index 00000000..9f224136 --- /dev/null +++ b/docs/sdks/schemastore/README.md @@ -0,0 +1,104 @@ +# SchemaStore +(*schema_store*) + +## Overview + +### Available Operations + +* [create_schema_store_item](#create_schema_store_item) - Create a schema in the schema store +* [get_schema_store_item](#get_schema_store_item) - Get a OAS schema from the schema store + +## create_schema_store_item + +Create a schema in the schema store + +### Example Usage + + +```python +from speakeasy_client_sdk_python import Speakeasy +from speakeasy_client_sdk_python.models import operations, shared + + +with Speakeasy( + security=shared.Security( + api_key="", + ), +) as speakeasy: + + res = speakeasy.schema_store.create_schema_store_item(request={ + "format_": operations.Format.YAML, + "package_name": "", + "sdk_classname": "", + "spec": "", + }) + + assert res.schema_store_item is not None + + # Handle response + print(res.schema_store_item) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `request` | [operations.CreateSchemaStoreItemRequestBody](../../models/operations/createschemastoreitemrequestbody.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[operations.CreateSchemaStoreItemResponse](../../models/operations/createschemastoreitemresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------- | ---------------- | ---------------- | +| errors.Error | 4XX | application/json | +| errors.SDKError | 5XX | \*/\* | + +## get_schema_store_item + +Get a OAS schema from the schema store + +### Example Usage + + +```python +from speakeasy_client_sdk_python import Speakeasy +from speakeasy_client_sdk_python.models import shared + + +with Speakeasy( + security=shared.Security( + api_key="", + ), +) as speakeasy: + + res = speakeasy.schema_store.get_schema_store_item() + + assert res.schema_store_item is not None + + # Handle response + print(res.schema_store_item) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `request` | [operations.GetSchemaStoreItemRequestBody](../../models/operations/getschemastoreitemrequestbody.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[operations.GetSchemaStoreItemResponse](../../models/operations/getschemastoreitemresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------- | ---------------- | ---------------- | +| errors.Error | 4XX | application/json | +| errors.SDKError | 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/shorturls/README.md b/docs/sdks/shorturls/README.md index fca342c7..116a52be 100644 --- a/docs/sdks/shorturls/README.md +++ b/docs/sdks/shorturls/README.md @@ -15,10 +15,12 @@ Shorten a URL. ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -26,7 +28,7 @@ with Speakeasy( ) as speakeasy: res = speakeasy.short_ur_ls.create(request={ - "url": "https://probable-heating.com/", + "url": "https://exalted-heroine.org/", }) assert res.short_url is not None diff --git a/docs/sdks/subscriptions/README.md b/docs/sdks/subscriptions/README.md index 76f1ae08..822a20fa 100644 --- a/docs/sdks/subscriptions/README.md +++ b/docs/sdks/subscriptions/README.md @@ -16,10 +16,12 @@ Activate an ignored namespace for a subscription ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -62,10 +64,12 @@ Ignored a namespace for a subscription ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", diff --git a/docs/sdks/suggest/README.md b/docs/sdks/suggest/README.md index 16f1ec6c..203bf95c 100644 --- a/docs/sdks/suggest/README.md +++ b/docs/sdks/suggest/README.md @@ -18,10 +18,12 @@ Get suggestions from an LLM model for improving an OpenAPI document. ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -35,22 +37,14 @@ with Speakeasy( { "message": "", "path": [ - "/opt/include", - "/opt/share", - ], - "type": "", - }, - { - "message": "", - "path": [ - "/rescue", + "/usr/src", ], "type": "", }, ], "oas_summary": { "info": { - "description": "amid traffic the unfortunately underneath what father lovely out", + "description": "prioritize bell vainly", "license": {}, "summary": "", "title": "", @@ -58,18 +52,18 @@ with Speakeasy( }, "operations": [ { - "description": "times dull than except", + "description": "though since instead accurate safe unnaturally charming", "method": "", "operation_id": "", - "path": "/mnt", + "path": "/usr/local/bin", "tags": [ - "", - "", + "", + "", ], }, ], }, - "suggestion_type": shared.SuggestRequestBodySuggestionType.DIAGNOSTICS_ONLY, + "suggestion_type": shared.SuggestRequestBodySuggestionType.METHOD_NAMES, }, }) @@ -103,10 +97,12 @@ Generate generic suggestions for a list of items. ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -115,7 +111,7 @@ with Speakeasy( res = speakeasy.suggest.suggest_items(request={ "items": [ - "", + "", ], "prompt": "", }) @@ -150,10 +146,12 @@ Get suggestions from an LLM model for improving an OpenAPI document. ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -200,10 +198,12 @@ Get suggestions from an LLM model for improving an OpenAPI document stored in th ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", diff --git a/docs/sdks/workspaces/README.md b/docs/sdks/workspaces/README.md index cbe539b9..82256286 100644 --- a/docs/sdks/workspaces/README.md +++ b/docs/sdks/workspaces/README.md @@ -19,6 +19,7 @@ REST APIs for managing Workspaces (speakeasy tenancy) * [get_tokens](#get_tokens) - Get tokens for a particular workspace * [grant_access](#grant_access) - Grant a user access to a particular workspace * [revoke_access](#revoke_access) - Revoke a user's access to a particular workspace +* [set_feature_flags](#set_feature_flags) - Set workspace feature flags * [update](#update) - Update workspace details * [update_settings](#update_settings) - Update workspace settings @@ -28,10 +29,12 @@ Creates a workspace ### Example Usage + ```python -import dateutil.parser from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared +from speakeasy_client_sdk_python.utils import parse_datetime + with Speakeasy( security=shared.Security( @@ -40,12 +43,12 @@ with Speakeasy( ) as speakeasy: res = speakeasy.workspaces.create(request={ - "created_at": dateutil.parser.isoparse("2024-06-17T07:14:55.338Z"), + "created_at": parse_datetime("2023-11-18T13:41:10.525Z"), "id": "", "name": "", "organization_id": "", "slug": "", - "updated_at": dateutil.parser.isoparse("2024-11-30T17:06:07.804Z"), + "updated_at": parse_datetime("2024-11-21T08:36:32.740Z"), "verified": True, }) @@ -80,12 +83,15 @@ Create a token for a particular workspace ### Example Usage + ```python -import dateutil.parser from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared +from speakeasy_client_sdk_python.utils import parse_datetime + with Speakeasy( + workspace_id="", security=shared.Security( api_key="", ), @@ -94,13 +100,12 @@ with Speakeasy( res = speakeasy.workspaces.create_token(request={ "workspace_token": { "alg": "", - "created_at": dateutil.parser.isoparse("2023-08-16T02:33:00.784Z"), + "created_at": parse_datetime("2024-10-04T10:23:04.522Z"), "id": "", "key": "", "name": "", "workspace_id": "", }, - "workspace_id": "", }) assert res is not None @@ -134,11 +139,14 @@ Delete a token for a particular workspace ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( + workspace_id="", security=shared.Security( api_key="", ), @@ -146,7 +154,6 @@ with Speakeasy( res = speakeasy.workspaces.delete_token(request={ "token_id": "", - "workspace_id": "", }) assert res is not None @@ -180,10 +187,12 @@ Get information about a particular workspace by context. ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -222,10 +231,12 @@ Returns a list of workspaces a user has access too ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( security=shared.Security( api_key="", @@ -264,19 +275,20 @@ Get information about a particular workspace. ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( + workspace_id="", security=shared.Security( api_key="", ), ) as speakeasy: - res = speakeasy.workspaces.get_by_id(request={ - "workspace_id": "", - }) + res = speakeasy.workspaces.get_by_id(request={}) assert res.workspace is not None @@ -309,19 +321,20 @@ Get workspace feature flags ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( + workspace_id="", security=shared.Security( api_key="", ), ) as speakeasy: - res = speakeasy.workspaces.get_feature_flags(request={ - "workspace_id": "", - }) + res = speakeasy.workspaces.get_feature_flags(request={}) assert res.workspace_feature_flag_response is not None @@ -354,19 +367,20 @@ Get settings about a particular workspace. ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( + workspace_id="", security=shared.Security( api_key="", ), ) as speakeasy: - res = speakeasy.workspaces.get_settings(request={ - "workspace_id": "", - }) + res = speakeasy.workspaces.get_settings(request={}) assert res.workspace_settings is not None @@ -399,19 +413,20 @@ Get team members for a particular workspace ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( + workspace_id="", security=shared.Security( api_key="", ), ) as speakeasy: - res = speakeasy.workspaces.get_team(request={ - "workspace_id": "", - }) + res = speakeasy.workspaces.get_team(request={}) assert res.workspace_team_response is not None @@ -444,19 +459,20 @@ Get tokens for a particular workspace ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( + workspace_id="", security=shared.Security( api_key="", ), ) as speakeasy: - res = speakeasy.workspaces.get_tokens(request={ - "workspace_id": "", - }) + res = speakeasy.workspaces.get_tokens(request={}) assert res.classes is not None @@ -489,19 +505,21 @@ Grant a user access to a particular workspace ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( + workspace_id="", security=shared.Security( api_key="", ), ) as speakeasy: res = speakeasy.workspaces.grant_access(request={ - "email": "Lucinda.Batz8@hotmail.com", - "workspace_id": "", + "email": "Idella24@gmail.com", }) assert res.workspace_invite_response is not None @@ -535,11 +553,14 @@ Revoke a user's access to a particular workspace ### Example Usage + ```python from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared + with Speakeasy( + workspace_id="", security=shared.Security( api_key="", ), @@ -547,7 +568,6 @@ with Speakeasy( res = speakeasy.workspaces.revoke_access(request={ "user_id": "", - "workspace_id": "", }) assert res is not None @@ -575,18 +595,68 @@ with Speakeasy( | errors.Error | 4XX | application/json | | errors.SDKError | 5XX | \*/\* | +## set_feature_flags + +Set workspace feature flags + +### Example Usage + + +```python +from speakeasy_client_sdk_python import Speakeasy +from speakeasy_client_sdk_python.models import shared + + +with Speakeasy( + security=shared.Security( + api_key="", + ), +) as speakeasy: + + res = speakeasy.workspaces.set_feature_flags(request={ + "feature_flags": [], + }) + + assert res.workspace_feature_flag_response is not None + + # Handle response + print(res.workspace_feature_flag_response) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `request` | [shared.WorkspaceFeatureFlagRequest](../../models/shared/workspacefeatureflagrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[operations.SetWorkspaceFeatureFlagsResponse](../../models/operations/setworkspacefeatureflagsresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------- | ---------------- | ---------------- | +| errors.Error | 5XX | application/json | +| errors.SDKError | 4XX | \*/\* | + ## update Update information about a particular workspace. ### Example Usage + ```python -import dateutil.parser from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared +from speakeasy_client_sdk_python.utils import parse_datetime + with Speakeasy( + workspace_id="", security=shared.Security( api_key="", ), @@ -594,15 +664,14 @@ with Speakeasy( res = speakeasy.workspaces.update(request={ "workspace": { - "created_at": dateutil.parser.isoparse("2025-07-28T19:04:48.565Z"), + "created_at": parse_datetime("2023-08-02T22:30:24.264Z"), "id": "", "name": "", "organization_id": "", "slug": "", - "updated_at": dateutil.parser.isoparse("2024-10-16T10:52:42.015Z"), + "updated_at": parse_datetime("2025-01-24T03:53:13.581Z"), "verified": True, }, - "workspace_id": "", }) assert res is not None @@ -636,12 +705,15 @@ Update settings about a particular workspace. ### Example Usage + ```python -import dateutil.parser from speakeasy_client_sdk_python import Speakeasy from speakeasy_client_sdk_python.models import shared +from speakeasy_client_sdk_python.utils import parse_datetime + with Speakeasy( + workspace_id="", security=shared.Security( api_key="", ), @@ -649,12 +721,11 @@ with Speakeasy( res = speakeasy.workspaces.update_settings(request={ "workspace_settings": { - "created_at": dateutil.parser.isoparse("2023-07-05T11:43:28.305Z"), - "updated_at": dateutil.parser.isoparse("2024-05-14T05:39:21.874Z"), - "webhook_url": "https://grown-pharmacopoeia.net", + "created_at": parse_datetime("2025-03-09T15:48:09.330Z"), + "updated_at": parse_datetime("2025-11-24T16:37:53.492Z"), + "webhook_url": "https://wobbly-lid.org", "workspace_id": "", }, - "workspace_id": "", }) assert res is not None diff --git a/poetry.lock b/poetry.lock index c409f2e2..ba32f070 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.1.3 and should not be changed by hand. [[package]] name = "annotated-types" @@ -6,20 +6,19 @@ version = "0.7.0" description = "Reusable constraint types to use with typing.Annotated" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53"}, {file = "annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89"}, ] -[package.dependencies] -typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.9\""} - [[package]] name = "anyio" version = "4.4.0" description = "High level compatibility layer for multiple asynchronous event loop implementations" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "anyio-4.4.0-py3-none-any.whl", hash = "sha256:c1b2d8f46a8a812513012e1107cb0e68c17159a7a594208005a57dc776e1bdc7"}, {file = "anyio-4.4.0.tar.gz", hash = "sha256:5aadc6a1bbb7cdb0bede386cac5e2940f5e2ff3aa20277e991cf028e0585ce94"}, @@ -33,7 +32,7 @@ typing-extensions = {version = ">=4.1", markers = "python_version < \"3.11\""} [package.extras] doc = ["Sphinx (>=7)", "packaging", "sphinx-autodoc-typehints (>=1.2.0)", "sphinx-rtd-theme"] -test = ["anyio[trio]", "coverage[toml] (>=7)", "exceptiongroup (>=1.2.0)", "hypothesis (>=4.0)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "uvloop (>=0.17)"] +test = ["anyio[trio]", "coverage[toml] (>=7)", "exceptiongroup (>=1.2.0)", "hypothesis (>=4.0)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "uvloop (>=0.17) ; platform_python_implementation == \"CPython\" and platform_system != \"Windows\""] trio = ["trio (>=0.23)"] [[package]] @@ -42,6 +41,7 @@ version = "3.2.2" description = "An abstract syntax tree for Python with inference support." optional = false python-versions = ">=3.8.0" +groups = ["dev"] files = [ {file = "astroid-3.2.2-py3-none-any.whl", hash = "sha256:e8a0083b4bb28fcffb6207a3bfc9e5d0a68be951dd7e336d5dcf639c682388c0"}, {file = "astroid-3.2.2.tar.gz", hash = "sha256:8ead48e31b92b2e217b6c9733a21afafe479d52d6e164dd25fb1a770c7c3cf94"}, @@ -56,6 +56,7 @@ version = "2024.7.4" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.6" +groups = ["main"] files = [ {file = "certifi-2024.7.4-py3-none-any.whl", hash = "sha256:c198e21b1289c2ab85ee4e67bb4b4ef3ead0892059901a8d5b622f24a1101e90"}, {file = "certifi-2024.7.4.tar.gz", hash = "sha256:5a1e7645bc0ec61a09e26c36f6106dd4cf40c6db3a1fb6352b0244e7fb057c7b"}, @@ -67,6 +68,8 @@ version = "0.4.6" description = "Cross-platform colored terminal text." optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" +groups = ["dev"] +markers = "sys_platform == \"win32\"" files = [ {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, @@ -78,6 +81,7 @@ version = "0.3.8" description = "serialize all of Python" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "dill-0.3.8-py3-none-any.whl", hash = "sha256:c36ca9ffb54365bdd2f8eb3eff7d2a21237f8452b57ace88b1ac615b7e815bd7"}, {file = "dill-0.3.8.tar.gz", hash = "sha256:3ebe3c479ad625c4553aca177444d89b486b1d84982eeacded644afc0cf797ca"}, @@ -87,26 +91,14 @@ files = [ graph = ["objgraph (>=1.7.2)"] profile = ["gprof2dot (>=2022.7.29)"] -[[package]] -name = "eval-type-backport" -version = "0.2.0" -description = "Like `typing._eval_type`, but lets older Python versions use newer typing features." -optional = false -python-versions = ">=3.8" -files = [ - {file = "eval_type_backport-0.2.0-py3-none-any.whl", hash = "sha256:ac2f73d30d40c5a30a80b8739a789d6bb5e49fdffa66d7912667e2015d9c9933"}, - {file = "eval_type_backport-0.2.0.tar.gz", hash = "sha256:68796cfbc7371ebf923f03bdf7bef415f3ec098aeced24e054b253a0e78f7b37"}, -] - -[package.extras] -tests = ["pytest"] - [[package]] name = "exceptiongroup" version = "1.2.1" description = "Backport of PEP 654 (exception groups)" optional = false python-versions = ">=3.7" +groups = ["main"] +markers = "python_version < \"3.11\"" files = [ {file = "exceptiongroup-1.2.1-py3-none-any.whl", hash = "sha256:5258b9ed329c5bbdd31a309f53cbfb0b155341807f6ff7606a1e801a891b29ad"}, {file = "exceptiongroup-1.2.1.tar.gz", hash = "sha256:a4785e48b045528f5bfe627b6ad554ff32def154f42372786903b7abcfe1aa16"}, @@ -117,35 +109,37 @@ test = ["pytest (>=6)"] [[package]] name = "h11" -version = "0.14.0" +version = "0.16.0" description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" +groups = ["main"] files = [ - {file = "h11-0.14.0-py3-none-any.whl", hash = "sha256:e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761"}, - {file = "h11-0.14.0.tar.gz", hash = "sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d"}, + {file = "h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86"}, + {file = "h11-0.16.0.tar.gz", hash = "sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1"}, ] [[package]] name = "httpcore" -version = "1.0.5" +version = "1.0.9" description = "A minimal low-level HTTP client." optional = false python-versions = ">=3.8" +groups = ["main"] files = [ - {file = "httpcore-1.0.5-py3-none-any.whl", hash = "sha256:421f18bac248b25d310f3cacd198d55b8e6125c107797b609ff9b7a6ba7991b5"}, - {file = "httpcore-1.0.5.tar.gz", hash = "sha256:34a38e2f9291467ee3b44e89dd52615370e152954ba21721378a87b2960f7a61"}, + {file = "httpcore-1.0.9-py3-none-any.whl", hash = "sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55"}, + {file = "httpcore-1.0.9.tar.gz", hash = "sha256:6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8"}, ] [package.dependencies] certifi = "*" -h11 = ">=0.13,<0.15" +h11 = ">=0.16" [package.extras] asyncio = ["anyio (>=4.0,<5.0)"] http2 = ["h2 (>=3,<5)"] socks = ["socksio (==1.*)"] -trio = ["trio (>=0.22.0,<0.26.0)"] +trio = ["trio (>=0.22.0,<1.0)"] [[package]] name = "httpx" @@ -153,6 +147,7 @@ version = "0.28.1" description = "The next generation HTTP client." optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad"}, {file = "httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc"}, @@ -165,7 +160,7 @@ httpcore = "==1.*" idna = "*" [package.extras] -brotli = ["brotli", "brotlicffi"] +brotli = ["brotli ; platform_python_implementation == \"CPython\"", "brotlicffi ; platform_python_implementation != \"CPython\""] cli = ["click (==8.*)", "pygments (==2.*)", "rich (>=10,<14)"] http2 = ["h2 (>=3,<5)"] socks = ["socksio (==1.*)"] @@ -177,6 +172,7 @@ version = "3.7" description = "Internationalized Domain Names in Applications (IDNA)" optional = false python-versions = ">=3.5" +groups = ["main"] files = [ {file = "idna-3.7-py3-none-any.whl", hash = "sha256:82fee1fc78add43492d3a1898bfa6d8a904cc97d8427f683ed8e798d07761aa0"}, {file = "idna-3.7.tar.gz", hash = "sha256:028ff3aadf0609c1fd278d8ea3089299412a7a8b9bd005dd08b9f8285bcb5cfc"}, @@ -188,6 +184,7 @@ version = "5.13.2" description = "A Python utility / library to sort Python imports." optional = false python-versions = ">=3.8.0" +groups = ["dev"] files = [ {file = "isort-5.13.2-py3-none-any.whl", hash = "sha256:8ca5e72a8d85860d5a3fa69b8745237f2939afe12dbf656afbcb47fe72d947a6"}, {file = "isort-5.13.2.tar.gz", hash = "sha256:48fdfcb9face5d58a4f6dde2e72a1fb8dcaf8ab26f95ab49fab84c2ddefb0109"}, @@ -196,23 +193,13 @@ files = [ [package.extras] colors = ["colorama (>=0.4.6)"] -[[package]] -name = "jsonpath-python" -version = "1.0.6" -description = "A more powerful JSONPath implementation in modern python" -optional = false -python-versions = ">=3.6" -files = [ - {file = "jsonpath-python-1.0.6.tar.gz", hash = "sha256:dd5be4a72d8a2995c3f583cf82bf3cd1a9544cfdabf2d22595b67aff07349666"}, - {file = "jsonpath_python-1.0.6-py3-none-any.whl", hash = "sha256:1e3b78df579f5efc23565293612decee04214609208a2335884b3ee3f786b575"}, -] - [[package]] name = "mccabe" version = "0.7.0" description = "McCabe checker, plugin for flake8" optional = false python-versions = ">=3.6" +groups = ["dev"] files = [ {file = "mccabe-0.7.0-py2.py3-none-any.whl", hash = "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"}, {file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"}, @@ -220,49 +207,50 @@ files = [ [[package]] name = "mypy" -version = "1.13.0" +version = "1.15.0" description = "Optional static typing for Python" optional = false -python-versions = ">=3.8" +python-versions = ">=3.9" +groups = ["dev"] files = [ - {file = "mypy-1.13.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:6607e0f1dd1fb7f0aca14d936d13fd19eba5e17e1cd2a14f808fa5f8f6d8f60a"}, - {file = "mypy-1.13.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8a21be69bd26fa81b1f80a61ee7ab05b076c674d9b18fb56239d72e21d9f4c80"}, - {file = "mypy-1.13.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7b2353a44d2179846a096e25691d54d59904559f4232519d420d64da6828a3a7"}, - {file = "mypy-1.13.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:0730d1c6a2739d4511dc4253f8274cdd140c55c32dfb0a4cf8b7a43f40abfa6f"}, - {file = "mypy-1.13.0-cp310-cp310-win_amd64.whl", hash = "sha256:c5fc54dbb712ff5e5a0fca797e6e0aa25726c7e72c6a5850cfd2adbc1eb0a372"}, - {file = "mypy-1.13.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:581665e6f3a8a9078f28d5502f4c334c0c8d802ef55ea0e7276a6e409bc0d82d"}, - {file = "mypy-1.13.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:3ddb5b9bf82e05cc9a627e84707b528e5c7caaa1c55c69e175abb15a761cec2d"}, - {file = "mypy-1.13.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:20c7ee0bc0d5a9595c46f38beb04201f2620065a93755704e141fcac9f59db2b"}, - {file = "mypy-1.13.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:3790ded76f0b34bc9c8ba4def8f919dd6a46db0f5a6610fb994fe8efdd447f73"}, - {file = "mypy-1.13.0-cp311-cp311-win_amd64.whl", hash = "sha256:51f869f4b6b538229c1d1bcc1dd7d119817206e2bc54e8e374b3dfa202defcca"}, - {file = "mypy-1.13.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:5c7051a3461ae84dfb5dd15eff5094640c61c5f22257c8b766794e6dd85e72d5"}, - {file = "mypy-1.13.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:39bb21c69a5d6342f4ce526e4584bc5c197fd20a60d14a8624d8743fffb9472e"}, - {file = "mypy-1.13.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:164f28cb9d6367439031f4c81e84d3ccaa1e19232d9d05d37cb0bd880d3f93c2"}, - {file = "mypy-1.13.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:a4c1bfcdbce96ff5d96fc9b08e3831acb30dc44ab02671eca5953eadad07d6d0"}, - {file = "mypy-1.13.0-cp312-cp312-win_amd64.whl", hash = "sha256:a0affb3a79a256b4183ba09811e3577c5163ed06685e4d4b46429a271ba174d2"}, - {file = "mypy-1.13.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:a7b44178c9760ce1a43f544e595d35ed61ac2c3de306599fa59b38a6048e1aa7"}, - {file = "mypy-1.13.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:5d5092efb8516d08440e36626f0153b5006d4088c1d663d88bf79625af3d1d62"}, - {file = "mypy-1.13.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:de2904956dac40ced10931ac967ae63c5089bd498542194b436eb097a9f77bc8"}, - {file = "mypy-1.13.0-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:7bfd8836970d33c2105562650656b6846149374dc8ed77d98424b40b09340ba7"}, - {file = "mypy-1.13.0-cp313-cp313-win_amd64.whl", hash = "sha256:9f73dba9ec77acb86457a8fc04b5239822df0c14a082564737833d2963677dbc"}, - {file = "mypy-1.13.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:100fac22ce82925f676a734af0db922ecfea991e1d7ec0ceb1e115ebe501301a"}, - {file = "mypy-1.13.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:7bcb0bb7f42a978bb323a7c88f1081d1b5dee77ca86f4100735a6f541299d8fb"}, - {file = "mypy-1.13.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bde31fc887c213e223bbfc34328070996061b0833b0a4cfec53745ed61f3519b"}, - {file = "mypy-1.13.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:07de989f89786f62b937851295ed62e51774722e5444a27cecca993fc3f9cd74"}, - {file = "mypy-1.13.0-cp38-cp38-win_amd64.whl", hash = "sha256:4bde84334fbe19bad704b3f5b78c4abd35ff1026f8ba72b29de70dda0916beb6"}, - {file = "mypy-1.13.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:0246bcb1b5de7f08f2826451abd947bf656945209b140d16ed317f65a17dc7dc"}, - {file = "mypy-1.13.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:7f5b7deae912cf8b77e990b9280f170381fdfbddf61b4ef80927edd813163732"}, - {file = "mypy-1.13.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7029881ec6ffb8bc233a4fa364736789582c738217b133f1b55967115288a2bc"}, - {file = "mypy-1.13.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:3e38b980e5681f28f033f3be86b099a247b13c491f14bb8b1e1e134d23bb599d"}, - {file = "mypy-1.13.0-cp39-cp39-win_amd64.whl", hash = "sha256:a6789be98a2017c912ae6ccb77ea553bbaf13d27605d2ca20a76dfbced631b24"}, - {file = "mypy-1.13.0-py3-none-any.whl", hash = "sha256:9c250883f9fd81d212e0952c92dbfcc96fc237f4b7c92f56ac81fd48460b3e5a"}, - {file = "mypy-1.13.0.tar.gz", hash = "sha256:0291a61b6fbf3e6673e3405cfcc0e7650bebc7939659fdca2702958038bd835e"}, + {file = "mypy-1.15.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:979e4e1a006511dacf628e36fadfecbcc0160a8af6ca7dad2f5025529e082c13"}, + {file = "mypy-1.15.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c4bb0e1bd29f7d34efcccd71cf733580191e9a264a2202b0239da95984c5b559"}, + {file = "mypy-1.15.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:be68172e9fd9ad8fb876c6389f16d1c1b5f100ffa779f77b1fb2176fcc9ab95b"}, + {file = "mypy-1.15.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c7be1e46525adfa0d97681432ee9fcd61a3964c2446795714699a998d193f1a3"}, + {file = "mypy-1.15.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:2e2c2e6d3593f6451b18588848e66260ff62ccca522dd231cd4dd59b0160668b"}, + {file = "mypy-1.15.0-cp310-cp310-win_amd64.whl", hash = "sha256:6983aae8b2f653e098edb77f893f7b6aca69f6cffb19b2cc7443f23cce5f4828"}, + {file = "mypy-1.15.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:2922d42e16d6de288022e5ca321cd0618b238cfc5570e0263e5ba0a77dbef56f"}, + {file = "mypy-1.15.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:2ee2d57e01a7c35de00f4634ba1bbf015185b219e4dc5909e281016df43f5ee5"}, + {file = "mypy-1.15.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:973500e0774b85d9689715feeffcc980193086551110fd678ebe1f4342fb7c5e"}, + {file = "mypy-1.15.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5a95fb17c13e29d2d5195869262f8125dfdb5c134dc8d9a9d0aecf7525b10c2c"}, + {file = "mypy-1.15.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:1905f494bfd7d85a23a88c5d97840888a7bd516545fc5aaedff0267e0bb54e2f"}, + {file = "mypy-1.15.0-cp311-cp311-win_amd64.whl", hash = "sha256:c9817fa23833ff189db061e6d2eff49b2f3b6ed9856b4a0a73046e41932d744f"}, + {file = "mypy-1.15.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:aea39e0583d05124836ea645f412e88a5c7d0fd77a6d694b60d9b6b2d9f184fd"}, + {file = "mypy-1.15.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:2f2147ab812b75e5b5499b01ade1f4a81489a147c01585cda36019102538615f"}, + {file = "mypy-1.15.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ce436f4c6d218a070048ed6a44c0bbb10cd2cc5e272b29e7845f6a2f57ee4464"}, + {file = "mypy-1.15.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8023ff13985661b50a5928fc7a5ca15f3d1affb41e5f0a9952cb68ef090b31ee"}, + {file = "mypy-1.15.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:1124a18bc11a6a62887e3e137f37f53fbae476dc36c185d549d4f837a2a6a14e"}, + {file = "mypy-1.15.0-cp312-cp312-win_amd64.whl", hash = "sha256:171a9ca9a40cd1843abeca0e405bc1940cd9b305eaeea2dda769ba096932bb22"}, + {file = "mypy-1.15.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:93faf3fdb04768d44bf28693293f3904bbb555d076b781ad2530214ee53e3445"}, + {file = "mypy-1.15.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:811aeccadfb730024c5d3e326b2fbe9249bb7413553f15499a4050f7c30e801d"}, + {file = "mypy-1.15.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:98b7b9b9aedb65fe628c62a6dc57f6d5088ef2dfca37903a7d9ee374d03acca5"}, + {file = "mypy-1.15.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c43a7682e24b4f576d93072216bf56eeff70d9140241f9edec0c104d0c515036"}, + {file = "mypy-1.15.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:baefc32840a9f00babd83251560e0ae1573e2f9d1b067719479bfb0e987c6357"}, + {file = "mypy-1.15.0-cp313-cp313-win_amd64.whl", hash = "sha256:b9378e2c00146c44793c98b8d5a61039a048e31f429fb0eb546d93f4b000bedf"}, + {file = "mypy-1.15.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:e601a7fa172c2131bff456bb3ee08a88360760d0d2f8cbd7a75a65497e2df078"}, + {file = "mypy-1.15.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:712e962a6357634fef20412699a3655c610110e01cdaa6180acec7fc9f8513ba"}, + {file = "mypy-1.15.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f95579473af29ab73a10bada2f9722856792a36ec5af5399b653aa28360290a5"}, + {file = "mypy-1.15.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8f8722560a14cde92fdb1e31597760dc35f9f5524cce17836c0d22841830fd5b"}, + {file = "mypy-1.15.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:1fbb8da62dc352133d7d7ca90ed2fb0e9d42bb1a32724c287d3c76c58cbaa9c2"}, + {file = "mypy-1.15.0-cp39-cp39-win_amd64.whl", hash = "sha256:d10d994b41fb3497719bbf866f227b3489048ea4bbbb5015357db306249f7980"}, + {file = "mypy-1.15.0-py3-none-any.whl", hash = "sha256:5469affef548bd1895d86d3bf10ce2b44e33d86923c29e4d675b3e323437ea3e"}, + {file = "mypy-1.15.0.tar.gz", hash = "sha256:404534629d51d3efea5c800ee7c42b72a6554d6c400e6a79eafe15d11341fd43"}, ] [package.dependencies] -mypy-extensions = ">=1.0.0" +mypy_extensions = ">=1.0.0" tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} -typing-extensions = ">=4.6.0" +typing_extensions = ">=4.6.0" [package.extras] dmypy = ["psutil (>=4.0)"] @@ -277,6 +265,7 @@ version = "1.0.0" description = "Type system extensions for programs checked with the mypy type checker." optional = false python-versions = ">=3.5" +groups = ["dev"] files = [ {file = "mypy_extensions-1.0.0-py3-none-any.whl", hash = "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d"}, {file = "mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782"}, @@ -288,6 +277,7 @@ version = "4.2.2" description = "A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`." optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "platformdirs-4.2.2-py3-none-any.whl", hash = "sha256:2d7a1657e36a80ea911db832a8a6ece5ee53d8de21edd5cc5879af6530b1bfee"}, {file = "platformdirs-4.2.2.tar.gz", hash = "sha256:38b7b51f512eed9e84a22788b4bce1de17c0adb134d6becb09836e37d8654cd3"}, @@ -300,131 +290,133 @@ type = ["mypy (>=1.8)"] [[package]] name = "pydantic" -version = "2.10.4" +version = "2.11.7" description = "Data validation using Python type hints" optional = false -python-versions = ">=3.8" +python-versions = ">=3.9" +groups = ["main"] files = [ - {file = "pydantic-2.10.4-py3-none-any.whl", hash = "sha256:597e135ea68be3a37552fb524bc7d0d66dcf93d395acd93a00682f1efcb8ee3d"}, - {file = "pydantic-2.10.4.tar.gz", hash = "sha256:82f12e9723da6de4fe2ba888b5971157b3be7ad914267dea8f05f82b28254f06"}, + {file = "pydantic-2.11.7-py3-none-any.whl", hash = "sha256:dde5df002701f6de26248661f6835bbe296a47bf73990135c7d07ce741b9623b"}, + {file = "pydantic-2.11.7.tar.gz", hash = "sha256:d989c3c6cb79469287b1569f7447a17848c998458d49ebe294e975b9baf0f0db"}, ] [package.dependencies] annotated-types = ">=0.6.0" -pydantic-core = "2.27.2" +pydantic-core = "2.33.2" typing-extensions = ">=4.12.2" +typing-inspection = ">=0.4.0" [package.extras] email = ["email-validator (>=2.0.0)"] -timezone = ["tzdata"] +timezone = ["tzdata ; python_version >= \"3.9\" and platform_system == \"Windows\""] [[package]] name = "pydantic-core" -version = "2.27.2" +version = "2.33.2" description = "Core functionality for Pydantic validation and serialization" optional = false -python-versions = ">=3.8" +python-versions = ">=3.9" +groups = ["main"] files = [ - {file = "pydantic_core-2.27.2-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:2d367ca20b2f14095a8f4fa1210f5a7b78b8a20009ecced6b12818f455b1e9fa"}, - {file = "pydantic_core-2.27.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:491a2b73db93fab69731eaee494f320faa4e093dbed776be1a829c2eb222c34c"}, - {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7969e133a6f183be60e9f6f56bfae753585680f3b7307a8e555a948d443cc05a"}, - {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:3de9961f2a346257caf0aa508a4da705467f53778e9ef6fe744c038119737ef5"}, - {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e2bb4d3e5873c37bb3dd58714d4cd0b0e6238cebc4177ac8fe878f8b3aa8e74c"}, - {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:280d219beebb0752699480fe8f1dc61ab6615c2046d76b7ab7ee38858de0a4e7"}, - {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:47956ae78b6422cbd46f772f1746799cbb862de838fd8d1fbd34a82e05b0983a"}, - {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:14d4a5c49d2f009d62a2a7140d3064f686d17a5d1a268bc641954ba181880236"}, - {file = "pydantic_core-2.27.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:337b443af21d488716f8d0b6164de833e788aa6bd7e3a39c005febc1284f4962"}, - {file = "pydantic_core-2.27.2-cp310-cp310-musllinux_1_1_armv7l.whl", hash = "sha256:03d0f86ea3184a12f41a2d23f7ccb79cdb5a18e06993f8a45baa8dfec746f0e9"}, - {file = "pydantic_core-2.27.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:7041c36f5680c6e0f08d922aed302e98b3745d97fe1589db0a3eebf6624523af"}, - {file = "pydantic_core-2.27.2-cp310-cp310-win32.whl", hash = "sha256:50a68f3e3819077be2c98110c1f9dcb3817e93f267ba80a2c05bb4f8799e2ff4"}, - {file = "pydantic_core-2.27.2-cp310-cp310-win_amd64.whl", hash = "sha256:e0fd26b16394ead34a424eecf8a31a1f5137094cabe84a1bcb10fa6ba39d3d31"}, - {file = "pydantic_core-2.27.2-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:8e10c99ef58cfdf2a66fc15d66b16c4a04f62bca39db589ae8cba08bc55331bc"}, - {file = "pydantic_core-2.27.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:26f32e0adf166a84d0cb63be85c562ca8a6fa8de28e5f0d92250c6b7e9e2aff7"}, - {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8c19d1ea0673cd13cc2f872f6c9ab42acc4e4f492a7ca9d3795ce2b112dd7e15"}, - {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5e68c4446fe0810e959cdff46ab0a41ce2f2c86d227d96dc3847af0ba7def306"}, - {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d9640b0059ff4f14d1f37321b94061c6db164fbe49b334b31643e0528d100d99"}, - {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:40d02e7d45c9f8af700f3452f329ead92da4c5f4317ca9b896de7ce7199ea459"}, - {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1c1fd185014191700554795c99b347d64f2bb637966c4cfc16998a0ca700d048"}, - {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d81d2068e1c1228a565af076598f9e7451712700b673de8f502f0334f281387d"}, - {file = "pydantic_core-2.27.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:1a4207639fb02ec2dbb76227d7c751a20b1a6b4bc52850568e52260cae64ca3b"}, - {file = "pydantic_core-2.27.2-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:3de3ce3c9ddc8bbd88f6e0e304dea0e66d843ec9de1b0042b0911c1663ffd474"}, - {file = "pydantic_core-2.27.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:30c5f68ded0c36466acede341551106821043e9afaad516adfb6e8fa80a4e6a6"}, - {file = "pydantic_core-2.27.2-cp311-cp311-win32.whl", hash = "sha256:c70c26d2c99f78b125a3459f8afe1aed4d9687c24fd677c6a4436bc042e50d6c"}, - {file = "pydantic_core-2.27.2-cp311-cp311-win_amd64.whl", hash = "sha256:08e125dbdc505fa69ca7d9c499639ab6407cfa909214d500897d02afb816e7cc"}, - {file = "pydantic_core-2.27.2-cp311-cp311-win_arm64.whl", hash = "sha256:26f0d68d4b235a2bae0c3fc585c585b4ecc51382db0e3ba402a22cbc440915e4"}, - {file = "pydantic_core-2.27.2-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:9e0c8cfefa0ef83b4da9588448b6d8d2a2bf1a53c3f1ae5fca39eb3061e2f0b0"}, - {file = "pydantic_core-2.27.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:83097677b8e3bd7eaa6775720ec8e0405f1575015a463285a92bfdfe254529ef"}, - {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:172fce187655fece0c90d90a678424b013f8fbb0ca8b036ac266749c09438cb7"}, - {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:519f29f5213271eeeeb3093f662ba2fd512b91c5f188f3bb7b27bc5973816934"}, - {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:05e3a55d124407fffba0dd6b0c0cd056d10e983ceb4e5dbd10dda135c31071d6"}, - {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9c3ed807c7b91de05e63930188f19e921d1fe90de6b4f5cd43ee7fcc3525cb8c"}, - {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6fb4aadc0b9a0c063206846d603b92030eb6f03069151a625667f982887153e2"}, - {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:28ccb213807e037460326424ceb8b5245acb88f32f3d2777427476e1b32c48c4"}, - {file = "pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:de3cd1899e2c279b140adde9357c4495ed9d47131b4a4eaff9052f23398076b3"}, - {file = "pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:220f892729375e2d736b97d0e51466252ad84c51857d4d15f5e9692f9ef12be4"}, - {file = "pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:a0fcd29cd6b4e74fe8ddd2c90330fd8edf2e30cb52acda47f06dd615ae72da57"}, - {file = "pydantic_core-2.27.2-cp312-cp312-win32.whl", hash = "sha256:1e2cb691ed9834cd6a8be61228471d0a503731abfb42f82458ff27be7b2186fc"}, - {file = "pydantic_core-2.27.2-cp312-cp312-win_amd64.whl", hash = "sha256:cc3f1a99a4f4f9dd1de4fe0312c114e740b5ddead65bb4102884b384c15d8bc9"}, - {file = "pydantic_core-2.27.2-cp312-cp312-win_arm64.whl", hash = "sha256:3911ac9284cd8a1792d3cb26a2da18f3ca26c6908cc434a18f730dc0db7bfa3b"}, - {file = "pydantic_core-2.27.2-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:7d14bd329640e63852364c306f4d23eb744e0f8193148d4044dd3dacdaacbd8b"}, - {file = "pydantic_core-2.27.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:82f91663004eb8ed30ff478d77c4d1179b3563df6cdb15c0817cd1cdaf34d154"}, - {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:71b24c7d61131bb83df10cc7e687433609963a944ccf45190cfc21e0887b08c9"}, - {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:fa8e459d4954f608fa26116118bb67f56b93b209c39b008277ace29937453dc9"}, - {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ce8918cbebc8da707ba805b7fd0b382816858728ae7fe19a942080c24e5b7cd1"}, - {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:eda3f5c2a021bbc5d976107bb302e0131351c2ba54343f8a496dc8783d3d3a6a"}, - {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bd8086fa684c4775c27f03f062cbb9eaa6e17f064307e86b21b9e0abc9c0f02e"}, - {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:8d9b3388db186ba0c099a6d20f0604a44eabdeef1777ddd94786cdae158729e4"}, - {file = "pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:7a66efda2387de898c8f38c0cf7f14fca0b51a8ef0b24bfea5849f1b3c95af27"}, - {file = "pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:18a101c168e4e092ab40dbc2503bdc0f62010e95d292b27827871dc85450d7ee"}, - {file = "pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:ba5dd002f88b78a4215ed2f8ddbdf85e8513382820ba15ad5ad8955ce0ca19a1"}, - {file = "pydantic_core-2.27.2-cp313-cp313-win32.whl", hash = "sha256:1ebaf1d0481914d004a573394f4be3a7616334be70261007e47c2a6fe7e50130"}, - {file = "pydantic_core-2.27.2-cp313-cp313-win_amd64.whl", hash = "sha256:953101387ecf2f5652883208769a79e48db18c6df442568a0b5ccd8c2723abee"}, - {file = "pydantic_core-2.27.2-cp313-cp313-win_arm64.whl", hash = "sha256:ac4dbfd1691affb8f48c2c13241a2e3b60ff23247cbcf981759c768b6633cf8b"}, - {file = "pydantic_core-2.27.2-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:d3e8d504bdd3f10835468f29008d72fc8359d95c9c415ce6e767203db6127506"}, - {file = "pydantic_core-2.27.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:521eb9b7f036c9b6187f0b47318ab0d7ca14bd87f776240b90b21c1f4f149320"}, - {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:85210c4d99a0114f5a9481b44560d7d1e35e32cc5634c656bc48e590b669b145"}, - {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d716e2e30c6f140d7560ef1538953a5cd1a87264c737643d481f2779fc247fe1"}, - {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f66d89ba397d92f840f8654756196d93804278457b5fbede59598a1f9f90b228"}, - {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:669e193c1c576a58f132e3158f9dfa9662969edb1a250c54d8fa52590045f046"}, - {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9fdbe7629b996647b99c01b37f11170a57ae675375b14b8c13b8518b8320ced5"}, - {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d262606bf386a5ba0b0af3b97f37c83d7011439e3dc1a9298f21efb292e42f1a"}, - {file = "pydantic_core-2.27.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:cabb9bcb7e0d97f74df8646f34fc76fbf793b7f6dc2438517d7a9e50eee4f14d"}, - {file = "pydantic_core-2.27.2-cp38-cp38-musllinux_1_1_armv7l.whl", hash = "sha256:d2d63f1215638d28221f664596b1ccb3944f6e25dd18cd3b86b0a4c408d5ebb9"}, - {file = "pydantic_core-2.27.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:bca101c00bff0adb45a833f8451b9105d9df18accb8743b08107d7ada14bd7da"}, - {file = "pydantic_core-2.27.2-cp38-cp38-win32.whl", hash = "sha256:f6f8e111843bbb0dee4cb6594cdc73e79b3329b526037ec242a3e49012495b3b"}, - {file = "pydantic_core-2.27.2-cp38-cp38-win_amd64.whl", hash = "sha256:fd1aea04935a508f62e0d0ef1f5ae968774a32afc306fb8545e06f5ff5cdf3ad"}, - {file = "pydantic_core-2.27.2-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:c10eb4f1659290b523af58fa7cffb452a61ad6ae5613404519aee4bfbf1df993"}, - {file = "pydantic_core-2.27.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ef592d4bad47296fb11f96cd7dc898b92e795032b4894dfb4076cfccd43a9308"}, - {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c61709a844acc6bf0b7dce7daae75195a10aac96a596ea1b776996414791ede4"}, - {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:42c5f762659e47fdb7b16956c71598292f60a03aa92f8b6351504359dbdba6cf"}, - {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4c9775e339e42e79ec99c441d9730fccf07414af63eac2f0e48e08fd38a64d76"}, - {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:57762139821c31847cfb2df63c12f725788bd9f04bc2fb392790959b8f70f118"}, - {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0d1e85068e818c73e048fe28cfc769040bb1f475524f4745a5dc621f75ac7630"}, - {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:097830ed52fd9e427942ff3b9bc17fab52913b2f50f2880dc4a5611446606a54"}, - {file = "pydantic_core-2.27.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:044a50963a614ecfae59bb1eaf7ea7efc4bc62f49ed594e18fa1e5d953c40e9f"}, - {file = "pydantic_core-2.27.2-cp39-cp39-musllinux_1_1_armv7l.whl", hash = "sha256:4e0b4220ba5b40d727c7f879eac379b822eee5d8fff418e9d3381ee45b3b0362"}, - {file = "pydantic_core-2.27.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5e4f4bb20d75e9325cc9696c6802657b58bc1dbbe3022f32cc2b2b632c3fbb96"}, - {file = "pydantic_core-2.27.2-cp39-cp39-win32.whl", hash = "sha256:cca63613e90d001b9f2f9a9ceb276c308bfa2a43fafb75c8031c4f66039e8c6e"}, - {file = "pydantic_core-2.27.2-cp39-cp39-win_amd64.whl", hash = "sha256:77d1bca19b0f7021b3a982e6f903dcd5b2b06076def36a652e3907f596e29f67"}, - {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:2bf14caea37e91198329b828eae1618c068dfb8ef17bb33287a7ad4b61ac314e"}, - {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:b0cb791f5b45307caae8810c2023a184c74605ec3bcbb67d13846c28ff731ff8"}, - {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:688d3fd9fcb71f41c4c015c023d12a79d1c4c0732ec9eb35d96e3388a120dcf3"}, - {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3d591580c34f4d731592f0e9fe40f9cc1b430d297eecc70b962e93c5c668f15f"}, - {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:82f986faf4e644ffc189a7f1aafc86e46ef70372bb153e7001e8afccc6e54133"}, - {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:bec317a27290e2537f922639cafd54990551725fc844249e64c523301d0822fc"}, - {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:0296abcb83a797db256b773f45773da397da75a08f5fcaef41f2044adec05f50"}, - {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:0d75070718e369e452075a6017fbf187f788e17ed67a3abd47fa934d001863d9"}, - {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:7e17b560be3c98a8e3aa66ce828bdebb9e9ac6ad5466fba92eb74c4c95cb1151"}, - {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:c33939a82924da9ed65dab5a65d427205a73181d8098e79b6b426bdf8ad4e656"}, - {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:00bad2484fa6bda1e216e7345a798bd37c68fb2d97558edd584942aa41b7d278"}, - {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c817e2b40aba42bac6f457498dacabc568c3b7a986fc9ba7c8d9d260b71485fb"}, - {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:251136cdad0cb722e93732cb45ca5299fb56e1344a833640bf93b2803f8d1bfd"}, - {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d2088237af596f0a524d3afc39ab3b036e8adb054ee57cbb1dcf8e09da5b29cc"}, - {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:d4041c0b966a84b4ae7a09832eb691a35aec90910cd2dbe7a208de59be77965b"}, - {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:8083d4e875ebe0b864ffef72a4304827015cff328a1be6e22cc850753bfb122b"}, - {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:f141ee28a0ad2123b6611b6ceff018039df17f32ada8b534e6aa039545a3efb2"}, - {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:7d0c8399fcc1848491f00e0314bd59fb34a9c008761bcb422a057670c3f65e35"}, - {file = "pydantic_core-2.27.2.tar.gz", hash = "sha256:eb026e5a4c1fee05726072337ff51d1efb6f59090b7da90d30ea58625b1ffb39"}, + {file = "pydantic_core-2.33.2-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:2b3d326aaef0c0399d9afffeb6367d5e26ddc24d351dbc9c636840ac355dc5d8"}, + {file = "pydantic_core-2.33.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:0e5b2671f05ba48b94cb90ce55d8bdcaaedb8ba00cc5359f6810fc918713983d"}, + {file = "pydantic_core-2.33.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0069c9acc3f3981b9ff4cdfaf088e98d83440a4c7ea1bc07460af3d4dc22e72d"}, + {file = "pydantic_core-2.33.2-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d53b22f2032c42eaaf025f7c40c2e3b94568ae077a606f006d206a463bc69572"}, + {file = "pydantic_core-2.33.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0405262705a123b7ce9f0b92f123334d67b70fd1f20a9372b907ce1080c7ba02"}, + {file = "pydantic_core-2.33.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4b25d91e288e2c4e0662b8038a28c6a07eaac3e196cfc4ff69de4ea3db992a1b"}, + {file = "pydantic_core-2.33.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6bdfe4b3789761f3bcb4b1ddf33355a71079858958e3a552f16d5af19768fef2"}, + {file = "pydantic_core-2.33.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:efec8db3266b76ef9607c2c4c419bdb06bf335ae433b80816089ea7585816f6a"}, + {file = "pydantic_core-2.33.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:031c57d67ca86902726e0fae2214ce6770bbe2f710dc33063187a68744a5ecac"}, + {file = "pydantic_core-2.33.2-cp310-cp310-musllinux_1_1_armv7l.whl", hash = "sha256:f8de619080e944347f5f20de29a975c2d815d9ddd8be9b9b7268e2e3ef68605a"}, + {file = "pydantic_core-2.33.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:73662edf539e72a9440129f231ed3757faab89630d291b784ca99237fb94db2b"}, + {file = "pydantic_core-2.33.2-cp310-cp310-win32.whl", hash = "sha256:0a39979dcbb70998b0e505fb1556a1d550a0781463ce84ebf915ba293ccb7e22"}, + {file = "pydantic_core-2.33.2-cp310-cp310-win_amd64.whl", hash = "sha256:b0379a2b24882fef529ec3b4987cb5d003b9cda32256024e6fe1586ac45fc640"}, + {file = "pydantic_core-2.33.2-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:4c5b0a576fb381edd6d27f0a85915c6daf2f8138dc5c267a57c08a62900758c7"}, + {file = "pydantic_core-2.33.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:e799c050df38a639db758c617ec771fd8fb7a5f8eaaa4b27b101f266b216a246"}, + {file = "pydantic_core-2.33.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dc46a01bf8d62f227d5ecee74178ffc448ff4e5197c756331f71efcc66dc980f"}, + {file = "pydantic_core-2.33.2-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:a144d4f717285c6d9234a66778059f33a89096dfb9b39117663fd8413d582dcc"}, + {file = "pydantic_core-2.33.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:73cf6373c21bc80b2e0dc88444f41ae60b2f070ed02095754eb5a01df12256de"}, + {file = "pydantic_core-2.33.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3dc625f4aa79713512d1976fe9f0bc99f706a9dee21dfd1810b4bbbf228d0e8a"}, + {file = "pydantic_core-2.33.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:881b21b5549499972441da4758d662aeea93f1923f953e9cbaff14b8b9565aef"}, + {file = "pydantic_core-2.33.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:bdc25f3681f7b78572699569514036afe3c243bc3059d3942624e936ec93450e"}, + {file = "pydantic_core-2.33.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:fe5b32187cbc0c862ee201ad66c30cf218e5ed468ec8dc1cf49dec66e160cc4d"}, + {file = "pydantic_core-2.33.2-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:bc7aee6f634a6f4a95676fcb5d6559a2c2a390330098dba5e5a5f28a2e4ada30"}, + {file = "pydantic_core-2.33.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:235f45e5dbcccf6bd99f9f472858849f73d11120d76ea8707115415f8e5ebebf"}, + {file = "pydantic_core-2.33.2-cp311-cp311-win32.whl", hash = "sha256:6368900c2d3ef09b69cb0b913f9f8263b03786e5b2a387706c5afb66800efd51"}, + {file = "pydantic_core-2.33.2-cp311-cp311-win_amd64.whl", hash = "sha256:1e063337ef9e9820c77acc768546325ebe04ee38b08703244c1309cccc4f1bab"}, + {file = "pydantic_core-2.33.2-cp311-cp311-win_arm64.whl", hash = "sha256:6b99022f1d19bc32a4c2a0d544fc9a76e3be90f0b3f4af413f87d38749300e65"}, + {file = "pydantic_core-2.33.2-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:a7ec89dc587667f22b6a0b6579c249fca9026ce7c333fc142ba42411fa243cdc"}, + {file = "pydantic_core-2.33.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:3c6db6e52c6d70aa0d00d45cdb9b40f0433b96380071ea80b09277dba021ddf7"}, + {file = "pydantic_core-2.33.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4e61206137cbc65e6d5256e1166f88331d3b6238e082d9f74613b9b765fb9025"}, + {file = "pydantic_core-2.33.2-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:eb8c529b2819c37140eb51b914153063d27ed88e3bdc31b71198a198e921e011"}, + {file = "pydantic_core-2.33.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c52b02ad8b4e2cf14ca7b3d918f3eb0ee91e63b3167c32591e57c4317e134f8f"}, + {file = "pydantic_core-2.33.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:96081f1605125ba0855dfda83f6f3df5ec90c61195421ba72223de35ccfb2f88"}, + {file = "pydantic_core-2.33.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8f57a69461af2a5fa6e6bbd7a5f60d3b7e6cebb687f55106933188e79ad155c1"}, + {file = "pydantic_core-2.33.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:572c7e6c8bb4774d2ac88929e3d1f12bc45714ae5ee6d9a788a9fb35e60bb04b"}, + {file = "pydantic_core-2.33.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:db4b41f9bd95fbe5acd76d89920336ba96f03e149097365afe1cb092fceb89a1"}, + {file = "pydantic_core-2.33.2-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:fa854f5cf7e33842a892e5c73f45327760bc7bc516339fda888c75ae60edaeb6"}, + {file = "pydantic_core-2.33.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:5f483cfb75ff703095c59e365360cb73e00185e01aaea067cd19acffd2ab20ea"}, + {file = "pydantic_core-2.33.2-cp312-cp312-win32.whl", hash = "sha256:9cb1da0f5a471435a7bc7e439b8a728e8b61e59784b2af70d7c169f8dd8ae290"}, + {file = "pydantic_core-2.33.2-cp312-cp312-win_amd64.whl", hash = "sha256:f941635f2a3d96b2973e867144fde513665c87f13fe0e193c158ac51bfaaa7b2"}, + {file = "pydantic_core-2.33.2-cp312-cp312-win_arm64.whl", hash = "sha256:cca3868ddfaccfbc4bfb1d608e2ccaaebe0ae628e1416aeb9c4d88c001bb45ab"}, + {file = "pydantic_core-2.33.2-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:1082dd3e2d7109ad8b7da48e1d4710c8d06c253cbc4a27c1cff4fbcaa97a9e3f"}, + {file = "pydantic_core-2.33.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:f517ca031dfc037a9c07e748cefd8d96235088b83b4f4ba8939105d20fa1dcd6"}, + {file = "pydantic_core-2.33.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0a9f2c9dd19656823cb8250b0724ee9c60a82f3cdf68a080979d13092a3b0fef"}, + {file = "pydantic_core-2.33.2-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:2b0a451c263b01acebe51895bfb0e1cc842a5c666efe06cdf13846c7418caa9a"}, + {file = "pydantic_core-2.33.2-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1ea40a64d23faa25e62a70ad163571c0b342b8bf66d5fa612ac0dec4f069d916"}, + {file = "pydantic_core-2.33.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0fb2d542b4d66f9470e8065c5469ec676978d625a8b7a363f07d9a501a9cb36a"}, + {file = "pydantic_core-2.33.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9fdac5d6ffa1b5a83bca06ffe7583f5576555e6c8b3a91fbd25ea7780f825f7d"}, + {file = "pydantic_core-2.33.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:04a1a413977ab517154eebb2d326da71638271477d6ad87a769102f7c2488c56"}, + {file = "pydantic_core-2.33.2-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:c8e7af2f4e0194c22b5b37205bfb293d166a7344a5b0d0eaccebc376546d77d5"}, + {file = "pydantic_core-2.33.2-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:5c92edd15cd58b3c2d34873597a1e20f13094f59cf88068adb18947df5455b4e"}, + {file = "pydantic_core-2.33.2-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:65132b7b4a1c0beded5e057324b7e16e10910c106d43675d9bd87d4f38dde162"}, + {file = "pydantic_core-2.33.2-cp313-cp313-win32.whl", hash = "sha256:52fb90784e0a242bb96ec53f42196a17278855b0f31ac7c3cc6f5c1ec4811849"}, + {file = "pydantic_core-2.33.2-cp313-cp313-win_amd64.whl", hash = "sha256:c083a3bdd5a93dfe480f1125926afcdbf2917ae714bdb80b36d34318b2bec5d9"}, + {file = "pydantic_core-2.33.2-cp313-cp313-win_arm64.whl", hash = "sha256:e80b087132752f6b3d714f041ccf74403799d3b23a72722ea2e6ba2e892555b9"}, + {file = "pydantic_core-2.33.2-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:61c18fba8e5e9db3ab908620af374db0ac1baa69f0f32df4f61ae23f15e586ac"}, + {file = "pydantic_core-2.33.2-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:95237e53bb015f67b63c91af7518a62a8660376a6a0db19b89acc77a4d6199f5"}, + {file = "pydantic_core-2.33.2-cp313-cp313t-win_amd64.whl", hash = "sha256:c2fc0a768ef76c15ab9238afa6da7f69895bb5d1ee83aeea2e3509af4472d0b9"}, + {file = "pydantic_core-2.33.2-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:a2b911a5b90e0374d03813674bf0a5fbbb7741570dcd4b4e85a2e48d17def29d"}, + {file = "pydantic_core-2.33.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:6fa6dfc3e4d1f734a34710f391ae822e0a8eb8559a85c6979e14e65ee6ba2954"}, + {file = "pydantic_core-2.33.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c54c939ee22dc8e2d545da79fc5381f1c020d6d3141d3bd747eab59164dc89fb"}, + {file = "pydantic_core-2.33.2-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:53a57d2ed685940a504248187d5685e49eb5eef0f696853647bf37c418c538f7"}, + {file = "pydantic_core-2.33.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:09fb9dd6571aacd023fe6aaca316bd01cf60ab27240d7eb39ebd66a3a15293b4"}, + {file = "pydantic_core-2.33.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0e6116757f7959a712db11f3e9c0a99ade00a5bbedae83cb801985aa154f071b"}, + {file = "pydantic_core-2.33.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8d55ab81c57b8ff8548c3e4947f119551253f4e3787a7bbc0b6b3ca47498a9d3"}, + {file = "pydantic_core-2.33.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:c20c462aa4434b33a2661701b861604913f912254e441ab8d78d30485736115a"}, + {file = "pydantic_core-2.33.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:44857c3227d3fb5e753d5fe4a3420d6376fa594b07b621e220cd93703fe21782"}, + {file = "pydantic_core-2.33.2-cp39-cp39-musllinux_1_1_armv7l.whl", hash = "sha256:eb9b459ca4df0e5c87deb59d37377461a538852765293f9e6ee834f0435a93b9"}, + {file = "pydantic_core-2.33.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:9fcd347d2cc5c23b06de6d3b7b8275be558a0c90549495c699e379a80bf8379e"}, + {file = "pydantic_core-2.33.2-cp39-cp39-win32.whl", hash = "sha256:83aa99b1285bc8f038941ddf598501a86f1536789740991d7d8756e34f1e74d9"}, + {file = "pydantic_core-2.33.2-cp39-cp39-win_amd64.whl", hash = "sha256:f481959862f57f29601ccced557cc2e817bce7533ab8e01a797a48b49c9692b3"}, + {file = "pydantic_core-2.33.2-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:5c4aa4e82353f65e548c476b37e64189783aa5384903bfea4f41580f255fddfa"}, + {file = "pydantic_core-2.33.2-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:d946c8bf0d5c24bf4fe333af284c59a19358aa3ec18cb3dc4370080da1e8ad29"}, + {file = "pydantic_core-2.33.2-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:87b31b6846e361ef83fedb187bb5b4372d0da3f7e28d85415efa92d6125d6e6d"}, + {file = "pydantic_core-2.33.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aa9d91b338f2df0508606f7009fde642391425189bba6d8c653afd80fd6bb64e"}, + {file = "pydantic_core-2.33.2-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2058a32994f1fde4ca0480ab9d1e75a0e8c87c22b53a3ae66554f9af78f2fe8c"}, + {file = "pydantic_core-2.33.2-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:0e03262ab796d986f978f79c943fc5f620381be7287148b8010b4097f79a39ec"}, + {file = "pydantic_core-2.33.2-pp310-pypy310_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:1a8695a8d00c73e50bff9dfda4d540b7dee29ff9b8053e38380426a85ef10052"}, + {file = "pydantic_core-2.33.2-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:fa754d1850735a0b0e03bcffd9d4b4343eb417e47196e4485d9cca326073a42c"}, + {file = "pydantic_core-2.33.2-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:a11c8d26a50bfab49002947d3d237abe4d9e4b5bdc8846a63537b6488e197808"}, + {file = "pydantic_core-2.33.2-pp311-pypy311_pp73-macosx_10_12_x86_64.whl", hash = "sha256:dd14041875d09cc0f9308e37a6f8b65f5585cf2598a53aa0123df8b129d481f8"}, + {file = "pydantic_core-2.33.2-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:d87c561733f66531dced0da6e864f44ebf89a8fba55f31407b00c2f7f9449593"}, + {file = "pydantic_core-2.33.2-pp311-pypy311_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2f82865531efd18d6e07a04a17331af02cb7a651583c418df8266f17a63c6612"}, + {file = "pydantic_core-2.33.2-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2bfb5112df54209d820d7bf9317c7a6c9025ea52e49f46b6a2060104bba37de7"}, + {file = "pydantic_core-2.33.2-pp311-pypy311_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:64632ff9d614e5eecfb495796ad51b0ed98c453e447a76bcbeeb69615079fc7e"}, + {file = "pydantic_core-2.33.2-pp311-pypy311_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:f889f7a40498cc077332c7ab6b4608d296d852182211787d4f3ee377aaae66e8"}, + {file = "pydantic_core-2.33.2-pp311-pypy311_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:de4b83bb311557e439b9e186f733f6c645b9417c84e2eb8203f3f820a4b988bf"}, + {file = "pydantic_core-2.33.2-pp311-pypy311_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:82f68293f055f51b51ea42fafc74b6aad03e70e191799430b90c13d643059ebb"}, + {file = "pydantic_core-2.33.2-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:329467cecfb529c925cf2bbd4d60d2c509bc2fb52a20c1045bf09bb70971a9c1"}, + {file = "pydantic_core-2.33.2-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:87acbfcf8e90ca885206e98359d7dca4bcbb35abdc0ff66672a293e1d7a19101"}, + {file = "pydantic_core-2.33.2-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:7f92c15cd1e97d4b12acd1cc9004fa092578acfa57b67ad5e43a197175d01a64"}, + {file = "pydantic_core-2.33.2-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d3f26877a748dc4251cfcfda9dfb5f13fcb034f5308388066bcfe9031b63ae7d"}, + {file = "pydantic_core-2.33.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dac89aea9af8cd672fa7b510e7b8c33b0bba9a43186680550ccf23020f32d535"}, + {file = "pydantic_core-2.33.2-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:970919794d126ba8645f3837ab6046fb4e72bbc057b3709144066204c19a455d"}, + {file = "pydantic_core-2.33.2-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:3eb3fe62804e8f859c49ed20a8451342de53ed764150cb14ca71357c765dc2a6"}, + {file = "pydantic_core-2.33.2-pp39-pypy39_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:3abcd9392a36025e3bd55f9bd38d908bd17962cc49bc6da8e7e96285336e2bca"}, + {file = "pydantic_core-2.33.2-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:3a1c81334778f9e3af2f8aeb7a960736e5cab1dfebfb26aabca09afd2906c039"}, + {file = "pydantic_core-2.33.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:2807668ba86cb38c6817ad9bc66215ab8584d1d304030ce4f0887336f28a5e27"}, + {file = "pydantic_core-2.33.2.tar.gz", hash = "sha256:7cb8bc3605c29176e1b105350d2e6474142d7c1bd1d9327c4a9bdb46bf827acc"}, ] [package.dependencies] @@ -436,6 +428,7 @@ version = "3.2.3" description = "python code static checker" optional = false python-versions = ">=3.8.0" +groups = ["dev"] files = [ {file = "pylint-3.2.3-py3-none-any.whl", hash = "sha256:b3d7d2708a3e04b4679e02d99e72329a8b7ee8afb8d04110682278781f889fa8"}, {file = "pylint-3.2.3.tar.gz", hash = "sha256:02f6c562b215582386068d52a30f520d84fdbcf2a95fc7e855b816060d048b60"}, @@ -447,7 +440,7 @@ colorama = {version = ">=0.4.5", markers = "sys_platform == \"win32\""} dill = [ {version = ">=0.2", markers = "python_version < \"3.11\""}, {version = ">=0.3.7", markers = "python_version >= \"3.12\""}, - {version = ">=0.3.6", markers = "python_version >= \"3.11\" and python_version < \"3.12\""}, + {version = ">=0.3.6", markers = "python_version == \"3.11\""}, ] isort = ">=4.2.5,<5.13.0 || >5.13.0,<6" mccabe = ">=0.6,<0.8" @@ -460,37 +453,13 @@ typing-extensions = {version = ">=3.10.0", markers = "python_version < \"3.10\"" spelling = ["pyenchant (>=3.2,<4.0)"] testutils = ["gitpython (>3)"] -[[package]] -name = "python-dateutil" -version = "2.9.0.post0" -description = "Extensions to the standard Python datetime module" -optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" -files = [ - {file = "python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3"}, - {file = "python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427"}, -] - -[package.dependencies] -six = ">=1.5" - -[[package]] -name = "six" -version = "1.16.0" -description = "Python 2 and 3 compatibility utilities" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" -files = [ - {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, - {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, -] - [[package]] name = "sniffio" version = "1.3.1" description = "Sniff out which async library your code is running under" optional = false python-versions = ">=3.7" +groups = ["main"] files = [ {file = "sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2"}, {file = "sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc"}, @@ -502,6 +471,8 @@ version = "2.0.1" description = "A lil' TOML parser" optional = false python-versions = ">=3.7" +groups = ["dev"] +markers = "python_version < \"3.11\"" files = [ {file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"}, {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, @@ -513,49 +484,40 @@ version = "0.12.5" description = "Style preserving TOML library" optional = false python-versions = ">=3.7" +groups = ["dev"] files = [ {file = "tomlkit-0.12.5-py3-none-any.whl", hash = "sha256:af914f5a9c59ed9d0762c7b64d3b5d5df007448eb9cd2edc8a46b1eafead172f"}, {file = "tomlkit-0.12.5.tar.gz", hash = "sha256:eef34fba39834d4d6b73c9ba7f3e4d1c417a4e56f89a7e96e090dd0d24b8fb3c"}, ] -[[package]] -name = "types-python-dateutil" -version = "2.9.0.20240316" -description = "Typing stubs for python-dateutil" -optional = false -python-versions = ">=3.8" -files = [ - {file = "types-python-dateutil-2.9.0.20240316.tar.gz", hash = "sha256:5d2f2e240b86905e40944dd787db6da9263f0deabef1076ddaed797351ec0202"}, - {file = "types_python_dateutil-2.9.0.20240316-py3-none-any.whl", hash = "sha256:6b8cb66d960771ce5ff974e9dd45e38facb81718cc1e208b10b1baccbfdbee3b"}, -] - [[package]] name = "typing-extensions" version = "4.12.2" description = "Backported and Experimental Type Hints for Python 3.8+" optional = false python-versions = ">=3.8" +groups = ["main", "dev"] files = [ {file = "typing_extensions-4.12.2-py3-none-any.whl", hash = "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d"}, {file = "typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"}, ] [[package]] -name = "typing-inspect" -version = "0.9.0" -description = "Runtime inspection utilities for typing module." +name = "typing-inspection" +version = "0.4.1" +description = "Runtime typing introspection tools" optional = false -python-versions = "*" +python-versions = ">=3.9" +groups = ["main"] files = [ - {file = "typing_inspect-0.9.0-py3-none-any.whl", hash = "sha256:9ee6fc59062311ef8547596ab6b955e1b8aa46242d854bfc78f4f6b0eff35f9f"}, - {file = "typing_inspect-0.9.0.tar.gz", hash = "sha256:b23fc42ff6f6ef6954e4852c1fb512cdd18dbea03134f91f856a95ccc9461f78"}, + {file = "typing_inspection-0.4.1-py3-none-any.whl", hash = "sha256:389055682238f53b04f7badcb49b989835495a96700ced5dab2d8feae4b26f51"}, + {file = "typing_inspection-0.4.1.tar.gz", hash = "sha256:6ae134cc0203c33377d43188d4064e9b357dba58cff3185f22924610e70a9d28"}, ] [package.dependencies] -mypy-extensions = ">=0.3.0" -typing-extensions = ">=3.7.4" +typing-extensions = ">=4.12.0" [metadata] -lock-version = "2.0" -python-versions = "^3.8" -content-hash = "231d09484040ca8e2e4ea801ceedb0b672113dd483caa7cb13d217c3e92d7655" +lock-version = "2.1" +python-versions = ">=3.9.2" +content-hash = "fd5d2a9148a00cbc5258586b48c24f763e191bdc12367f4e92abdbfc15e30679" diff --git a/pylintrc b/pylintrc index 50800386..e8cd3e85 100644 --- a/pylintrc +++ b/pylintrc @@ -89,7 +89,7 @@ persistent=yes # Minimum Python version to use for version dependent checks. Will default to # the version used to run pylint. -py-version=3.8 +py-version=3.9 # Discover python modules and packages in the file system subtree. recursive=no @@ -454,7 +454,11 @@ disable=raw-checker-failed, bare-except, broad-exception-caught, fixme, - relative-beyond-top-level + relative-beyond-top-level, + consider-using-with, + wildcard-import, + unused-wildcard-import, + too-many-return-statements # Enable the message, report, category or checker with the given id(s). You can # either give multiple identifier separated by comma (,) or put this option @@ -655,4 +659,4 @@ init-import=no # List of qualified module names which can have objects that can redefine # builtins. -redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io +redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index a4a8a51e..cfd0e9df 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,9 +1,17 @@ -[tool.poetry] +[project] name = "speakeasy-client-sdk-python" -version = "7.0.0-rc.2" +version = "7.0.0-rc.3" description = "Speakeasy API Client SDK for Python" -authors = ["Speakeasy",] +authors = [{ name = "Speakeasy" },] readme = "README-PYPI.md" +requires-python = ">=3.9.2" +dependencies = [ + "httpcore >=1.0.9", + "httpx >=0.28.1", + "pydantic >=2.11.2", +] + +[tool.poetry] repository = "https://github.com/speakeasy-api/speakeasy-client-sdk-python.git" packages = [ { include = "speakeasy_client_sdk_python", from = "src" } @@ -16,29 +24,22 @@ include = ["py.typed", "src/speakeasy_client_sdk_python/py.typed"] [virtualenvs] in-project = true -[tool.poetry.dependencies] -python = "^3.8" -eval-type-backport = "^0.2.0" -httpx = "^0.28.1" -jsonpath-python = "^1.0.6" -pydantic = "~2.10.3" -python-dateutil = "^2.8.2" -typing-inspect = "^0.9.0" - [tool.poetry.group.dev.dependencies] -mypy = "==1.13.0" +mypy = "==1.15.0" pylint = "==3.2.3" -types-python-dateutil = "^2.9.0.20240316" [build-system] requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" [tool.pytest.ini_options] +asyncio_default_fixture_loop_scope = "function" pythonpath = ["src"] [tool.mypy] disable_error_code = "misc" +explicit_package_bases = true +mypy_path = "src" [[tool.mypy.overrides]] module = "typing_inspect" diff --git a/scripts/prepare-readme.py b/scripts/prepare_readme.py similarity index 84% rename from scripts/prepare-readme.py rename to scripts/prepare_readme.py index f173d652..aaddb915 100644 --- a/scripts/prepare-readme.py +++ b/scripts/prepare_readme.py @@ -4,7 +4,7 @@ import shutil try: - with open("README.md", "r") as rh: + with open("README.md", "r", encoding="utf-8") as rh: readme_contents = rh.read() GITHUB_URL = "https://github.com/speakeasy-api/speakeasy-client-sdk-python.git" GITHUB_URL = ( @@ -21,13 +21,13 @@ readme_contents, ) - with open("README-PYPI.md", "w") as wh: + with open("README-PYPI.md", "w", encoding="utf-8") as wh: wh.write(readme_contents) except Exception as e: try: print("Failed to rewrite README.md to README-PYPI.md, copying original instead") print(e) shutil.copyfile("README.md", "README-PYPI.md") - except Exception as e: + except Exception as ie: print("Failed to copy README.md to README-PYPI.md") - print(e) + print(ie) diff --git a/scripts/publish.sh b/scripts/publish.sh index ab45b1f9..f2f2cf2c 100755 --- a/scripts/publish.sh +++ b/scripts/publish.sh @@ -2,6 +2,6 @@ export POETRY_PYPI_TOKEN_PYPI=${PYPI_TOKEN} -poetry run python scripts/prepare-readme.py +poetry run python scripts/prepare_readme.py poetry publish --build --skip-existing diff --git a/src/speakeasy_client_sdk_python/__init__.py b/src/speakeasy_client_sdk_python/__init__.py index 5c349179..833c68cd 100644 --- a/src/speakeasy_client_sdk_python/__init__.py +++ b/src/speakeasy_client_sdk_python/__init__.py @@ -1,8 +1,17 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" -from ._version import __title__, __version__ +from ._version import ( + __title__, + __version__, + __openapi_doc_version__, + __gen_version__, + __user_agent__, +) from .sdk import * from .sdkconfiguration import * VERSION: str = __version__ +OPENAPI_DOC_VERSION = __openapi_doc_version__ +SPEAKEASY_GENERATOR_VERSION = __gen_version__ +USER_AGENT = __user_agent__ diff --git a/src/speakeasy_client_sdk_python/_hooks/types.py b/src/speakeasy_client_sdk_python/_hooks/types.py index 700082a3..c1645281 100644 --- a/src/speakeasy_client_sdk_python/_hooks/types.py +++ b/src/speakeasy_client_sdk_python/_hooks/types.py @@ -3,20 +3,27 @@ from abc import ABC, abstractmethod import httpx from speakeasy_client_sdk_python.httpclient import HttpClient +from speakeasy_client_sdk_python.sdkconfiguration import SDKConfiguration from typing import Any, Callable, List, Optional, Tuple, Union class HookContext: + config: SDKConfiguration + base_url: str operation_id: str oauth2_scopes: Optional[List[str]] = None security_source: Optional[Union[Any, Callable[[], Any]]] = None def __init__( self, + config: SDKConfiguration, + base_url: str, operation_id: str, oauth2_scopes: Optional[List[str]], security_source: Optional[Union[Any, Callable[[], Any]]], ): + self.config = config + self.base_url = base_url self.operation_id = operation_id self.oauth2_scopes = oauth2_scopes self.security_source = security_source @@ -25,21 +32,33 @@ def __init__( class BeforeRequestContext(HookContext): def __init__(self, hook_ctx: HookContext): super().__init__( - hook_ctx.operation_id, hook_ctx.oauth2_scopes, hook_ctx.security_source + hook_ctx.config, + hook_ctx.base_url, + hook_ctx.operation_id, + hook_ctx.oauth2_scopes, + hook_ctx.security_source, ) class AfterSuccessContext(HookContext): def __init__(self, hook_ctx: HookContext): super().__init__( - hook_ctx.operation_id, hook_ctx.oauth2_scopes, hook_ctx.security_source + hook_ctx.config, + hook_ctx.base_url, + hook_ctx.operation_id, + hook_ctx.oauth2_scopes, + hook_ctx.security_source, ) class AfterErrorContext(HookContext): def __init__(self, hook_ctx: HookContext): super().__init__( - hook_ctx.operation_id, hook_ctx.oauth2_scopes, hook_ctx.security_source + hook_ctx.config, + hook_ctx.base_url, + hook_ctx.operation_id, + hook_ctx.oauth2_scopes, + hook_ctx.security_source, ) diff --git a/src/speakeasy_client_sdk_python/_version.py b/src/speakeasy_client_sdk_python/_version.py index a34ba7c8..c756a80c 100644 --- a/src/speakeasy_client_sdk_python/_version.py +++ b/src/speakeasy_client_sdk_python/_version.py @@ -3,7 +3,12 @@ import importlib.metadata __title__: str = "speakeasy-client-sdk-python" -__version__: str = "7.0.0-rc.2" +__version__: str = "7.0.0-rc.3" +__openapi_doc_version__: str = "0.4.0" +__gen_version__: str = "2.670.1" +__user_agent__: str = ( + "speakeasy-sdk/python 7.0.0-rc.3 2.670.1 0.4.0 speakeasy-client-sdk-python" +) try: if __package__ is not None: diff --git a/src/speakeasy_client_sdk_python/artifacts.py b/src/speakeasy_client_sdk_python/artifacts.py index bbef8073..a809cf0c 100644 --- a/src/speakeasy_client_sdk_python/artifacts.py +++ b/src/speakeasy_client_sdk_python/artifacts.py @@ -5,6 +5,9 @@ from speakeasy_client_sdk_python._hooks import HookContext from speakeasy_client_sdk_python.models import errors, operations, shared from speakeasy_client_sdk_python.types import BaseModel, OptionalNullable, UNSET +from speakeasy_client_sdk_python.utils.unmarshal_json_response import ( + unmarshal_json_response, +) from typing import Any, Mapping, Optional, Union, cast @@ -37,6 +40,8 @@ def create_remote_source( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, Optional[shared.RemoteSource]) @@ -71,6 +76,8 @@ def create_remote_source( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="createRemoteSource", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -80,7 +87,7 @@ def create_remote_source( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "*"): return operations.CreateRemoteSourceResponse( status_code=http_res.status_code, @@ -88,22 +95,13 @@ def create_remote_source( raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def create_remote_source_async( self, @@ -131,6 +129,8 @@ async def create_remote_source_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, Optional[shared.RemoteSource]) @@ -165,6 +165,8 @@ async def create_remote_source_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="createRemoteSource", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -174,7 +176,7 @@ async def create_remote_source_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "*"): return operations.CreateRemoteSourceResponse( status_code=http_res.status_code, @@ -182,22 +184,13 @@ async def create_remote_source_async( raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) def get_blob( self, @@ -223,6 +216,8 @@ def get_blob( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetBlobRequest) @@ -254,6 +249,8 @@ def get_blob( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="getBlob", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -264,7 +261,7 @@ def get_blob( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "application/octet-stream"): return operations.GetBlobResponse( blob=http_res, @@ -274,22 +271,16 @@ def get_blob( ) if utils.match_response(http_res, "4XX", "application/json"): http_res_text = utils.stream_to_text(http_res) - data = utils.unmarshal_json(http_res_text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response( + errors.ErrorData, http_res, http_res_text + ) + raise errors.Error(response_data, http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res, http_res_text) async def get_blob_async( self, @@ -315,6 +306,8 @@ async def get_blob_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetBlobRequest) @@ -346,6 +339,8 @@ async def get_blob_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="getBlob", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -356,7 +351,7 @@ async def get_blob_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "application/octet-stream"): return operations.GetBlobResponse( blob=http_res, @@ -366,22 +361,16 @@ async def get_blob_async( ) if utils.match_response(http_res, "4XX", "application/json"): http_res_text = await utils.stream_to_text_async(http_res) - data = utils.unmarshal_json(http_res_text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response( + errors.ErrorData, http_res, http_res_text + ) + raise errors.Error(response_data, http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res, http_res_text) def get_manifest( self, @@ -409,6 +398,8 @@ def get_manifest( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetManifestRequest) @@ -440,6 +431,8 @@ def get_manifest( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="getManifest", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -449,33 +442,24 @@ def get_manifest( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response( http_res, "2XX", "application/vnd.oci.image.manifest.v1+json" ): return operations.GetManifestResponse( - manifest=utils.unmarshal_json(http_res.text, Optional[shared.Manifest]), + manifest=unmarshal_json_response(Optional[shared.Manifest], http_res), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def get_manifest_async( self, @@ -503,6 +487,8 @@ async def get_manifest_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetManifestRequest) @@ -534,6 +520,8 @@ async def get_manifest_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="getManifest", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -543,33 +531,24 @@ async def get_manifest_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response( http_res, "2XX", "application/vnd.oci.image.manifest.v1+json" ): return operations.GetManifestResponse( - manifest=utils.unmarshal_json(http_res.text, Optional[shared.Manifest]), + manifest=unmarshal_json_response(Optional[shared.Manifest], http_res), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) def get_namespaces( self, @@ -593,6 +572,8 @@ def get_namespaces( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) req = self._build_request( method="GET", path="/v1/artifacts/namespaces", @@ -619,6 +600,8 @@ def get_namespaces( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="getNamespaces", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -628,33 +611,24 @@ def get_namespaces( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "application/json"): return operations.GetNamespacesResponse( - get_namespaces_response=utils.unmarshal_json( - http_res.text, Optional[shared.GetNamespacesResponse] + get_namespaces_response=unmarshal_json_response( + Optional[shared.GetNamespacesResponse], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def get_namespaces_async( self, @@ -678,6 +652,8 @@ async def get_namespaces_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) req = self._build_request_async( method="GET", path="/v1/artifacts/namespaces", @@ -704,6 +680,8 @@ async def get_namespaces_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="getNamespaces", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -713,33 +691,24 @@ async def get_namespaces_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "application/json"): return operations.GetNamespacesResponse( - get_namespaces_response=utils.unmarshal_json( - http_res.text, Optional[shared.GetNamespacesResponse] + get_namespaces_response=unmarshal_json_response( + Optional[shared.GetNamespacesResponse], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) def get_revisions( self, @@ -766,6 +735,8 @@ def get_revisions( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetRevisionsRequest) @@ -797,6 +768,8 @@ def get_revisions( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="getRevisions", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -806,33 +779,24 @@ def get_revisions( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "application/json"): return operations.GetRevisionsResponse( - get_revisions_response=utils.unmarshal_json( - http_res.text, Optional[shared.GetRevisionsResponse] + get_revisions_response=unmarshal_json_response( + Optional[shared.GetRevisionsResponse], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def get_revisions_async( self, @@ -859,6 +823,8 @@ async def get_revisions_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetRevisionsRequest) @@ -890,6 +856,8 @@ async def get_revisions_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="getRevisions", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -899,33 +867,24 @@ async def get_revisions_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "application/json"): return operations.GetRevisionsResponse( - get_revisions_response=utils.unmarshal_json( - http_res.text, Optional[shared.GetRevisionsResponse] + get_revisions_response=unmarshal_json_response( + Optional[shared.GetRevisionsResponse], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) def get_tags( self, @@ -950,6 +909,8 @@ def get_tags( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetTagsRequest) @@ -981,6 +942,8 @@ def get_tags( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="getTags", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -990,33 +953,24 @@ def get_tags( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "application/json"): return operations.GetTagsResponse( - get_tags_response=utils.unmarshal_json( - http_res.text, Optional[shared.GetTagsResponse] + get_tags_response=unmarshal_json_response( + Optional[shared.GetTagsResponse], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def get_tags_async( self, @@ -1041,6 +995,8 @@ async def get_tags_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetTagsRequest) @@ -1072,6 +1028,8 @@ async def get_tags_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="getTags", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1081,33 +1039,24 @@ async def get_tags_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "application/json"): return operations.GetTagsResponse( - get_tags_response=utils.unmarshal_json( - http_res.text, Optional[shared.GetTagsResponse] + get_tags_response=unmarshal_json_response( + Optional[shared.GetTagsResponse], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) def list_remote_sources( self, @@ -1136,6 +1085,8 @@ def list_remote_sources( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.ListRemoteSourcesRequest) @@ -1167,6 +1118,8 @@ def list_remote_sources( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="listRemoteSources", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1176,33 +1129,24 @@ def list_remote_sources( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "application/json"): return operations.ListRemoteSourcesResponse( - remote_source=utils.unmarshal_json( - http_res.text, Optional[shared.RemoteSource] + remote_source=unmarshal_json_response( + Optional[shared.RemoteSource], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def list_remote_sources_async( self, @@ -1231,6 +1175,8 @@ async def list_remote_sources_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.ListRemoteSourcesRequest) @@ -1262,6 +1208,8 @@ async def list_remote_sources_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="listRemoteSources", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1271,33 +1219,24 @@ async def list_remote_sources_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "application/json"): return operations.ListRemoteSourcesResponse( - remote_source=utils.unmarshal_json( - http_res.text, Optional[shared.RemoteSource] + remote_source=unmarshal_json_response( + Optional[shared.RemoteSource], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) def post_tags( self, @@ -1323,6 +1262,8 @@ def post_tags( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.PostTagsRequest) @@ -1357,6 +1298,8 @@ def post_tags( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="postTags", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1366,7 +1309,7 @@ def post_tags( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "*"): return operations.PostTagsResponse( status_code=http_res.status_code, @@ -1374,22 +1317,13 @@ def post_tags( raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def post_tags_async( self, @@ -1415,6 +1349,8 @@ async def post_tags_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.PostTagsRequest) @@ -1449,6 +1385,8 @@ async def post_tags_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="postTags", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1458,7 +1396,7 @@ async def post_tags_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "*"): return operations.PostTagsResponse( status_code=http_res.status_code, @@ -1466,22 +1404,13 @@ async def post_tags_async( raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) def preflight( self, @@ -1509,6 +1438,8 @@ def preflight( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, Optional[shared.PreflightRequest]) @@ -1543,6 +1474,8 @@ def preflight( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="preflight", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1552,33 +1485,24 @@ def preflight( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "application/json"): return operations.PreflightResponse( - preflight_token=utils.unmarshal_json( - http_res.text, Optional[shared.PreflightToken] + preflight_token=unmarshal_json_response( + Optional[shared.PreflightToken], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def preflight_async( self, @@ -1606,6 +1530,8 @@ async def preflight_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, Optional[shared.PreflightRequest]) @@ -1640,6 +1566,8 @@ async def preflight_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="preflight", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1649,34 +1577,213 @@ async def preflight_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "application/json"): return operations.PreflightResponse( - preflight_token=utils.unmarshal_json( - http_res.text, Optional[shared.PreflightToken] + preflight_token=unmarshal_json_response( + Optional[shared.PreflightToken], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def set_archived( + self, + *, + request: Union[ + operations.ArchiveNamespaceRequest, + operations.ArchiveNamespaceRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.ArchiveNamespaceResponse: + r"""Set whether a namespace is archived + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.ArchiveNamespaceRequest) + request = cast(operations.ArchiveNamespaceRequest, request) + + req = self._build_request( + method="POST", + path="/v1/artifacts/namespaces/{namespace_name}/archive", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.request_body, + False, + True, + "json", + Optional[operations.ArchiveNamespaceRequestBody], + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="archiveNamespace", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "2XX", "*"): + return operations.ArchiveNamespaceResponse( + status_code=http_res.status_code, + content_type=http_res.headers.get("Content-Type") or "", + raw_response=http_res, ) + if utils.match_response(http_res, "4XX", "application/json"): + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, + raise errors.SDKError("Unexpected response received", http_res) + + async def set_archived_async( + self, + *, + request: Union[ + operations.ArchiveNamespaceRequest, + operations.ArchiveNamespaceRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.ArchiveNamespaceResponse: + r"""Set whether a namespace is archived + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.ArchiveNamespaceRequest) + request = cast(operations.ArchiveNamespaceRequest, request) + + req = self._build_request_async( + method="POST", + path="/v1/artifacts/namespaces/{namespace_name}/archive", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.request_body, + False, + True, + "json", + Optional[operations.ArchiveNamespaceRequestBody], + ), + timeout_ms=timeout_ms, ) + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="archiveNamespace", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "2XX", "*"): + return operations.ArchiveNamespaceResponse( + status_code=http_res.status_code, + content_type=http_res.headers.get("Content-Type") or "", + raw_response=http_res, + ) + if utils.match_response(http_res, "4XX", "application/json"): + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + def set_visibility( self, *, @@ -1703,6 +1810,8 @@ def set_visibility( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.SetVisibilityRequest) @@ -1741,6 +1850,8 @@ def set_visibility( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="setVisibility", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1750,7 +1861,7 @@ def set_visibility( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "*"): return operations.SetVisibilityResponse( status_code=http_res.status_code, @@ -1758,22 +1869,13 @@ def set_visibility( raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def set_visibility_async( self, @@ -1801,6 +1903,8 @@ async def set_visibility_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.SetVisibilityRequest) @@ -1839,6 +1943,8 @@ async def set_visibility_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="setVisibility", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1848,7 +1954,7 @@ async def set_visibility_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "*"): return operations.SetVisibilityResponse( status_code=http_res.status_code, @@ -1856,19 +1962,10 @@ async def set_visibility_async( raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) diff --git a/src/speakeasy_client_sdk_python/auth.py b/src/speakeasy_client_sdk_python/auth.py index ab019e6f..61b282cd 100644 --- a/src/speakeasy_client_sdk_python/auth.py +++ b/src/speakeasy_client_sdk_python/auth.py @@ -5,6 +5,9 @@ from speakeasy_client_sdk_python._hooks import HookContext from speakeasy_client_sdk_python.models import errors, operations, shared from speakeasy_client_sdk_python.types import BaseModel, OptionalNullable, UNSET +from speakeasy_client_sdk_python.utils.unmarshal_json_response import ( + unmarshal_json_response, +) from typing import Any, Mapping, Optional, Union, cast @@ -40,6 +43,8 @@ def get_access( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetWorkspaceAccessRequest) @@ -75,6 +80,8 @@ def get_access( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="getWorkspaceAccess", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -86,27 +93,21 @@ def get_access( if utils.match_response(http_res, "2XX", "application/json"): return operations.GetWorkspaceAccessResponse( - access_details=utils.unmarshal_json( - http_res.text, Optional[shared.AccessDetails] + access_details=unmarshal_json_response( + Optional[shared.AccessDetails], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def get_access_async( self, @@ -137,6 +138,8 @@ async def get_access_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetWorkspaceAccessRequest) @@ -172,6 +175,8 @@ async def get_access_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="getWorkspaceAccess", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -183,27 +188,21 @@ async def get_access_async( if utils.match_response(http_res, "2XX", "application/json"): return operations.GetWorkspaceAccessResponse( - access_details=utils.unmarshal_json( - http_res.text, Optional[shared.AccessDetails] + access_details=unmarshal_json_response( + Optional[shared.AccessDetails], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) def get_access_token( self, @@ -231,6 +230,8 @@ def get_access_token( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetAccessTokenRequest) @@ -261,40 +262,35 @@ def get_access_token( http_res = self.do_request( hook_ctx=HookContext( - operation_id="getAccessToken", oauth2_scopes=[], security_source=None + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="getAccessToken", + oauth2_scopes=[], + security_source=None, ), request=req, error_status_codes=["4XX", "5XX"], retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "application/json"): return operations.GetAccessTokenResponse( - access_token=utils.unmarshal_json( - http_res.text, Optional[shared.AccessToken] + access_token=unmarshal_json_response( + Optional[shared.AccessToken], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def get_access_token_async( self, @@ -322,6 +318,8 @@ async def get_access_token_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetAccessTokenRequest) @@ -352,40 +350,35 @@ async def get_access_token_async( http_res = await self.do_request_async( hook_ctx=HookContext( - operation_id="getAccessToken", oauth2_scopes=[], security_source=None + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="getAccessToken", + oauth2_scopes=[], + security_source=None, ), request=req, error_status_codes=["4XX", "5XX"], retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "application/json"): return operations.GetAccessTokenResponse( - access_token=utils.unmarshal_json( - http_res.text, Optional[shared.AccessToken] + access_token=unmarshal_json_response( + Optional[shared.AccessToken], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) def get_user( self, @@ -409,6 +402,8 @@ def get_user( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) req = self._build_request( method="GET", path="/v1/user", @@ -435,6 +430,8 @@ def get_user( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="getUser", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -444,31 +441,22 @@ def get_user( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "application/json"): return operations.GetUserResponse( - user=utils.unmarshal_json(http_res.text, Optional[shared.User]), + user=unmarshal_json_response(Optional[shared.User], http_res), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def get_user_async( self, @@ -492,6 +480,8 @@ async def get_user_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) req = self._build_request_async( method="GET", path="/v1/user", @@ -518,6 +508,8 @@ async def get_user_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="getUser", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -527,31 +519,22 @@ async def get_user_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "application/json"): return operations.GetUserResponse( - user=utils.unmarshal_json(http_res.text, Optional[shared.User]), + user=unmarshal_json_response(Optional[shared.User], http_res), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) def validate_api_key( self, @@ -575,6 +558,8 @@ def validate_api_key( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) req = self._build_request( method="GET", path="/v1/auth/validate", @@ -601,6 +586,8 @@ def validate_api_key( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="validateApiKey", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -610,33 +597,24 @@ def validate_api_key( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "application/json"): return operations.ValidateAPIKeyResponse( - api_key_details=utils.unmarshal_json( - http_res.text, Optional[shared.APIKeyDetails] + api_key_details=unmarshal_json_response( + Optional[shared.APIKeyDetails], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def validate_api_key_async( self, @@ -660,6 +638,8 @@ async def validate_api_key_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) req = self._build_request_async( method="GET", path="/v1/auth/validate", @@ -686,6 +666,8 @@ async def validate_api_key_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="validateApiKey", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -695,30 +677,21 @@ async def validate_api_key_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "application/json"): return operations.ValidateAPIKeyResponse( - api_key_details=utils.unmarshal_json( - http_res.text, Optional[shared.APIKeyDetails] + api_key_details=unmarshal_json_response( + Optional[shared.APIKeyDetails], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) diff --git a/src/speakeasy_client_sdk_python/basesdk.py b/src/speakeasy_client_sdk_python/basesdk.py index 9c5f7d0a..6e9b0e23 100644 --- a/src/speakeasy_client_sdk_python/basesdk.py +++ b/src/speakeasy_client_sdk_python/basesdk.py @@ -223,12 +223,12 @@ def do_request( client = self.sdk_configuration.client logger = self.sdk_configuration.debug_logger + hooks = self.sdk_configuration.__dict__["_hooks"] + def do(): http_res = None try: - req = self.sdk_configuration.get_hooks().before_request( - BeforeRequestContext(hook_ctx), request - ) + req = hooks.before_request(BeforeRequestContext(hook_ctx), request) logger.debug( "Request:\nMethod: %s\nURL: %s\nHeaders: %s\nBody: %s", req.method, @@ -236,18 +236,20 @@ def do(): req.headers, get_body_content(req), ) + + if client is None: + raise ValueError("client is required") + http_res = client.send(req, stream=stream) except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error( - AfterErrorContext(hook_ctx), None, e - ) + _, e = hooks.after_error(AfterErrorContext(hook_ctx), None, e) if e is not None: logger.debug("Request Exception", exc_info=True) raise e if http_res is None: logger.debug("Raising no response SDK error") - raise errors.SDKError("No response received") + raise errors.NoResponseError("No response received") logger.debug( "Response:\nStatus Code: %s\nURL: %s\nHeaders: %s\nBody: %s", @@ -258,7 +260,7 @@ def do(): ) if utils.match_status_codes(error_status_codes, http_res.status_code): - result, err = self.sdk_configuration.get_hooks().after_error( + result, err = hooks.after_error( AfterErrorContext(hook_ctx), http_res, None ) if err is not None: @@ -268,7 +270,7 @@ def do(): http_res = result else: logger.debug("Raising unexpected SDK error") - raise errors.SDKError("Unexpected error occurred") + raise errors.SDKError("Unexpected error occurred", http_res) return http_res @@ -278,9 +280,7 @@ def do(): http_res = do() if not utils.match_status_codes(error_status_codes, http_res.status_code): - http_res = self.sdk_configuration.get_hooks().after_success( - AfterSuccessContext(hook_ctx), http_res - ) + http_res = hooks.after_success(AfterSuccessContext(hook_ctx), http_res) return http_res @@ -295,12 +295,12 @@ async def do_request_async( client = self.sdk_configuration.async_client logger = self.sdk_configuration.debug_logger + hooks = self.sdk_configuration.__dict__["_hooks"] + async def do(): http_res = None try: - req = self.sdk_configuration.get_hooks().before_request( - BeforeRequestContext(hook_ctx), request - ) + req = hooks.before_request(BeforeRequestContext(hook_ctx), request) logger.debug( "Request:\nMethod: %s\nURL: %s\nHeaders: %s\nBody: %s", req.method, @@ -308,18 +308,20 @@ async def do(): req.headers, get_body_content(req), ) + + if client is None: + raise ValueError("client is required") + http_res = await client.send(req, stream=stream) except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error( - AfterErrorContext(hook_ctx), None, e - ) + _, e = hooks.after_error(AfterErrorContext(hook_ctx), None, e) if e is not None: logger.debug("Request Exception", exc_info=True) raise e if http_res is None: logger.debug("Raising no response SDK error") - raise errors.SDKError("No response received") + raise errors.NoResponseError("No response received") logger.debug( "Response:\nStatus Code: %s\nURL: %s\nHeaders: %s\nBody: %s", @@ -330,7 +332,7 @@ async def do(): ) if utils.match_status_codes(error_status_codes, http_res.status_code): - result, err = self.sdk_configuration.get_hooks().after_error( + result, err = hooks.after_error( AfterErrorContext(hook_ctx), http_res, None ) if err is not None: @@ -340,7 +342,7 @@ async def do(): http_res = result else: logger.debug("Raising unexpected SDK error") - raise errors.SDKError("Unexpected error occurred") + raise errors.SDKError("Unexpected error occurred", http_res) return http_res @@ -352,8 +354,6 @@ async def do(): http_res = await do() if not utils.match_status_codes(error_status_codes, http_res.status_code): - http_res = self.sdk_configuration.get_hooks().after_success( - AfterSuccessContext(hook_ctx), http_res - ) + http_res = hooks.after_success(AfterSuccessContext(hook_ctx), http_res) return http_res diff --git a/src/speakeasy_client_sdk_python/codesamples.py b/src/speakeasy_client_sdk_python/codesamples.py index da258743..21474cda 100644 --- a/src/speakeasy_client_sdk_python/codesamples.py +++ b/src/speakeasy_client_sdk_python/codesamples.py @@ -1,24 +1,16 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from .basesdk import BaseSDK -from enum import Enum from speakeasy_client_sdk_python import utils from speakeasy_client_sdk_python._hooks import HookContext from speakeasy_client_sdk_python.models import errors, operations, shared from speakeasy_client_sdk_python.types import BaseModel, OptionalNullable, UNSET +from speakeasy_client_sdk_python.utils.unmarshal_json_response import ( + unmarshal_json_response, +) from typing import Any, Mapping, Optional, Union, cast -class GenerateCodeSamplePreviewAcceptEnum(str, Enum): - APPLICATION_JSON = "application/json" - APPLICATION_X_YAML = "application/x-yaml" - - -class GetCodeSamplePreviewAsyncAcceptEnum(str, Enum): - APPLICATION_JSON = "application/json" - APPLICATION_X_YAML = "application/x-yaml" - - class CodeSamples(BaseSDK): r"""REST APIs for retrieving Code Samples""" @@ -31,7 +23,6 @@ def generate_code_sample_preview( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - accept_header_override: Optional[GenerateCodeSamplePreviewAcceptEnum] = None, http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GenerateCodeSamplePreviewResponse: r"""Generate Code Sample previews from a file and configuration parameters. @@ -42,7 +33,6 @@ def generate_code_sample_preview( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param accept_header_override: Override the default accept header for this method :param http_headers: Additional headers to set or replace on requests. """ base_url = None @@ -52,6 +42,8 @@ def generate_code_sample_preview( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, shared.CodeSampleSchemaInput) @@ -67,9 +59,7 @@ def generate_code_sample_preview( request_has_path_params=False, request_has_query_params=True, user_agent_header="user-agent", - accept_header_value=accept_header_override.value - if accept_header_override is not None - else "application/json;q=1, application/x-yaml;q=0", + accept_header_value="application/json", http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( @@ -88,44 +78,35 @@ def generate_code_sample_preview( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="generateCodeSamplePreview", oauth2_scopes=[], security_source=self.sdk_configuration.security, ), request=req, error_status_codes=["4XX", "5XX"], - stream=True, retry_config=retry_config, ) - data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return operations.GenerateCodeSamplePreviewResponse( - two_hundred_application_json_response_stream=http_res, - status_code=http_res.status_code, - content_type=http_res.headers.get("Content-Type") or "", - raw_response=http_res, - ) - if utils.match_response(http_res, "200", "application/x-yaml"): + response_data: Any = None + if utils.match_response(http_res, "2XX", "application/json"): return operations.GenerateCodeSamplePreviewResponse( - two_hundred_application_x_yaml_response_stream=http_res, + usage_snippets=unmarshal_json_response( + Optional[shared.UsageSnippets], http_res + ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) - if utils.match_response(http_res, ["4XX", "5XX"], "application/json"): - http_res_text = utils.stream_to_text(http_res) - data = utils.unmarshal_json(http_res_text, errors.ErrorData) - raise errors.Error(data=data) - - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + if utils.match_response(http_res, "4XX", "application/json"): + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) + if utils.match_response(http_res, "5XX", "application/json"): + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) + + raise errors.SDKError("Unexpected response received", http_res) async def generate_code_sample_preview_async( self, @@ -136,7 +117,6 @@ async def generate_code_sample_preview_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - accept_header_override: Optional[GenerateCodeSamplePreviewAcceptEnum] = None, http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GenerateCodeSamplePreviewResponse: r"""Generate Code Sample previews from a file and configuration parameters. @@ -147,7 +127,6 @@ async def generate_code_sample_preview_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param accept_header_override: Override the default accept header for this method :param http_headers: Additional headers to set or replace on requests. """ base_url = None @@ -157,6 +136,8 @@ async def generate_code_sample_preview_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, shared.CodeSampleSchemaInput) @@ -172,9 +153,7 @@ async def generate_code_sample_preview_async( request_has_path_params=False, request_has_query_params=True, user_agent_header="user-agent", - accept_header_value=accept_header_override.value - if accept_header_override is not None - else "application/json;q=1, application/x-yaml;q=0", + accept_header_value="application/json", http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( @@ -193,46 +172,37 @@ async def generate_code_sample_preview_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="generateCodeSamplePreview", oauth2_scopes=[], security_source=self.sdk_configuration.security, ), request=req, error_status_codes=["4XX", "5XX"], - stream=True, retry_config=retry_config, ) - data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return operations.GenerateCodeSamplePreviewResponse( - two_hundred_application_json_response_stream=http_res, - status_code=http_res.status_code, - content_type=http_res.headers.get("Content-Type") or "", - raw_response=http_res, - ) - if utils.match_response(http_res, "200", "application/x-yaml"): + response_data: Any = None + if utils.match_response(http_res, "2XX", "application/json"): return operations.GenerateCodeSamplePreviewResponse( - two_hundred_application_x_yaml_response_stream=http_res, + usage_snippets=unmarshal_json_response( + Optional[shared.UsageSnippets], http_res + ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) - if utils.match_response(http_res, ["4XX", "5XX"], "application/json"): - http_res_text = await utils.stream_to_text_async(http_res) - data = utils.unmarshal_json(http_res_text, errors.ErrorData) - raise errors.Error(data=data) - - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + if utils.match_response(http_res, "4XX", "application/json"): + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) + if utils.match_response(http_res, "5XX", "application/json"): + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) + + raise errors.SDKError("Unexpected response received", http_res) - def generate_code_sample_previewhronous( + def generate_code_sample_preview_asynchronous( self, *, request: Union[ @@ -243,9 +213,9 @@ def generate_code_sample_previewhronous( timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GenerateCodeSamplePreviewAsyncResponse: - r"""Initiate asynchronous Code Sample preview generation from a file and configuration parameters, receiving an JobID response for polling. + r"""Initiate asynchronous Code Sample preview generation from a file and configuration parameters, receiving an async JobID response for polling. - This endpoint generates Code Sample previews from a file and configuration parameters, receiving an JobID response for polling. + This endpoint generates Code Sample previews from a file and configuration parameters, receiving an async JobID response for polling. :param request: The request object to send. :param retries: Override the default retry configuration for this method @@ -260,6 +230,8 @@ def generate_code_sample_previewhronous( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, shared.CodeSampleSchemaInput) @@ -294,6 +266,8 @@ def generate_code_sample_previewhronous( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="generateCodeSamplePreviewAsync", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -303,29 +277,25 @@ def generate_code_sample_previewhronous( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "202", "application/json"): return operations.GenerateCodeSamplePreviewAsyncResponse( - object=utils.unmarshal_json( - http_res.text, + object=unmarshal_json_response( Optional[operations.GenerateCodeSamplePreviewAsyncResponseBody], + http_res, ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) - if utils.match_response(http_res, ["4XX", "5XX"], "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) - - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + if utils.match_response(http_res, "4XX", "application/json"): + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) + if utils.match_response(http_res, "5XX", "application/json"): + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) + + raise errors.SDKError("Unexpected response received", http_res) async def generate_code_sample_preview_asynchronous_async( self, @@ -355,6 +325,8 @@ async def generate_code_sample_preview_asynchronous_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, shared.CodeSampleSchemaInput) @@ -389,6 +361,8 @@ async def generate_code_sample_preview_asynchronous_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="generateCodeSamplePreviewAsync", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -398,29 +372,25 @@ async def generate_code_sample_preview_asynchronous_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "202", "application/json"): return operations.GenerateCodeSamplePreviewAsyncResponse( - object=utils.unmarshal_json( - http_res.text, + object=unmarshal_json_response( Optional[operations.GenerateCodeSamplePreviewAsyncResponseBody], + http_res, ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) - if utils.match_response(http_res, ["4XX", "5XX"], "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) - - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + if utils.match_response(http_res, "4XX", "application/json"): + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) + if utils.match_response(http_res, "5XX", "application/json"): + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) + + raise errors.SDKError("Unexpected response received", http_res) def get( self, @@ -433,9 +403,9 @@ def get( timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetCodeSamplesResponse: - r"""Retrieve usage snippets from document stored in the registry + r"""Retrieve usage snippets - Retrieve usage snippets from document stored in the registry. Supports filtering by language and operation ID. + Retrieve usage snippets from an OpenAPI document stored in the registry. Supports filtering by language and operation ID. :param request: The request object to send. :param retries: Override the default retry configuration for this method @@ -450,6 +420,8 @@ def get( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetCodeSamplesRequest) @@ -481,6 +453,8 @@ def get( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="getCodeSamples", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -490,33 +464,24 @@ def get( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "application/json"): return operations.GetCodeSamplesResponse( - usage_snippets=utils.unmarshal_json( - http_res.text, Optional[shared.UsageSnippets] + usage_snippets=unmarshal_json_response( + Optional[shared.UsageSnippets], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def get_async( self, @@ -529,9 +494,9 @@ async def get_async( timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetCodeSamplesResponse: - r"""Retrieve usage snippets from document stored in the registry + r"""Retrieve usage snippets - Retrieve usage snippets from document stored in the registry. Supports filtering by language and operation ID. + Retrieve usage snippets from an OpenAPI document stored in the registry. Supports filtering by language and operation ID. :param request: The request object to send. :param retries: Override the default retry configuration for this method @@ -546,6 +511,8 @@ async def get_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetCodeSamplesRequest) @@ -577,6 +544,8 @@ async def get_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="getCodeSamples", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -586,35 +555,26 @@ async def get_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "application/json"): return operations.GetCodeSamplesResponse( - usage_snippets=utils.unmarshal_json( - http_res.text, Optional[shared.UsageSnippets] + usage_snippets=unmarshal_json_response( + Optional[shared.UsageSnippets], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) - def get_code_sample_preview( + def get_code_sample_preview_async( self, *, request: Union[ @@ -624,7 +584,6 @@ def get_code_sample_preview( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - accept_header_override: Optional[GetCodeSamplePreviewAsyncAcceptEnum] = None, http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetCodeSamplePreviewAsyncResponse: r"""Poll for the result of an asynchronous Code Sample preview generation. @@ -635,7 +594,6 @@ def get_code_sample_preview( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param accept_header_override: Override the default accept header for this method :param http_headers: Additional headers to set or replace on requests. """ base_url = None @@ -645,6 +603,8 @@ def get_code_sample_preview( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal( @@ -662,9 +622,7 @@ def get_code_sample_preview( request_has_path_params=True, request_has_query_params=True, user_agent_header="user-agent", - accept_header_value=accept_header_override.value - if accept_header_override is not None - else "application/json;q=1, application/x-yaml;q=0", + accept_header_value="application/json", http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, @@ -680,55 +638,44 @@ def get_code_sample_preview( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="getCodeSamplePreviewAsync", oauth2_scopes=[], security_source=self.sdk_configuration.security, ), request=req, error_status_codes=["4XX", "5XX"], - stream=True, retry_config=retry_config, ) - data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return operations.GetCodeSamplePreviewAsyncResponse( - two_hundred_application_json_response_stream=http_res, - status_code=http_res.status_code, - content_type=http_res.headers.get("Content-Type") or "", - raw_response=http_res, - ) - if utils.match_response(http_res, "200", "application/x-yaml"): + response_data: Any = None + if utils.match_response(http_res, "202", "application/json"): return operations.GetCodeSamplePreviewAsyncResponse( - two_hundred_application_x_yaml_response_stream=http_res, + object=unmarshal_json_response( + Optional[operations.GetCodeSamplePreviewAsyncResponseBody], http_res + ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) - if utils.match_response(http_res, "202", "application/json"): - http_response_text = utils.stream_to_text(http_res) + if utils.match_response(http_res, "2XX", "application/json"): return operations.GetCodeSamplePreviewAsyncResponse( - two_hundred_and_two_application_json_object=utils.unmarshal_json( - http_response_text, - Optional[operations.GetCodeSamplePreviewAsyncResponseBody], + usage_snippets=unmarshal_json_response( + Optional[shared.UsageSnippets], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) - if utils.match_response(http_res, ["4XX", "5XX"], "application/json"): - http_res_text = utils.stream_to_text(http_res) - data = utils.unmarshal_json(http_res_text, errors.ErrorData) - raise errors.Error(data=data) - - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + if utils.match_response(http_res, "4XX", "application/json"): + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) + if utils.match_response(http_res, "5XX", "application/json"): + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) + + raise errors.SDKError("Unexpected response received", http_res) async def get_code_sample_preview_async_async( self, @@ -740,7 +687,6 @@ async def get_code_sample_preview_async_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - accept_header_override: Optional[GetCodeSamplePreviewAsyncAcceptEnum] = None, http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetCodeSamplePreviewAsyncResponse: r"""Poll for the result of an asynchronous Code Sample preview generation. @@ -751,7 +697,6 @@ async def get_code_sample_preview_async_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param accept_header_override: Override the default accept header for this method :param http_headers: Additional headers to set or replace on requests. """ base_url = None @@ -761,6 +706,8 @@ async def get_code_sample_preview_async_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal( @@ -778,9 +725,7 @@ async def get_code_sample_preview_async_async( request_has_path_params=True, request_has_query_params=True, user_agent_header="user-agent", - accept_header_value=accept_header_override.value - if accept_header_override is not None - else "application/json;q=1, application/x-yaml;q=0", + accept_header_value="application/json", http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, @@ -796,52 +741,41 @@ async def get_code_sample_preview_async_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="getCodeSamplePreviewAsync", oauth2_scopes=[], security_source=self.sdk_configuration.security, ), request=req, error_status_codes=["4XX", "5XX"], - stream=True, retry_config=retry_config, ) - data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return operations.GetCodeSamplePreviewAsyncResponse( - two_hundred_application_json_response_stream=http_res, - status_code=http_res.status_code, - content_type=http_res.headers.get("Content-Type") or "", - raw_response=http_res, - ) - if utils.match_response(http_res, "200", "application/x-yaml"): + response_data: Any = None + if utils.match_response(http_res, "202", "application/json"): return operations.GetCodeSamplePreviewAsyncResponse( - two_hundred_application_x_yaml_response_stream=http_res, + object=unmarshal_json_response( + Optional[operations.GetCodeSamplePreviewAsyncResponseBody], http_res + ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) - if utils.match_response(http_res, "202", "application/json"): - http_response_text = await utils.stream_to_text_async(http_res) + if utils.match_response(http_res, "2XX", "application/json"): return operations.GetCodeSamplePreviewAsyncResponse( - two_hundred_and_two_application_json_object=utils.unmarshal_json( - http_response_text, - Optional[operations.GetCodeSamplePreviewAsyncResponseBody], + usage_snippets=unmarshal_json_response( + Optional[shared.UsageSnippets], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) - if utils.match_response(http_res, ["4XX", "5XX"], "application/json"): - http_res_text = await utils.stream_to_text_async(http_res) - data = utils.unmarshal_json(http_res_text, errors.ErrorData) - raise errors.Error(data=data) - - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + if utils.match_response(http_res, "4XX", "application/json"): + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) + if utils.match_response(http_res, "5XX", "application/json"): + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) + + raise errors.SDKError("Unexpected response received", http_res) diff --git a/src/speakeasy_client_sdk_python/events.py b/src/speakeasy_client_sdk_python/events.py index 91a30eaa..653abd93 100644 --- a/src/speakeasy_client_sdk_python/events.py +++ b/src/speakeasy_client_sdk_python/events.py @@ -5,6 +5,9 @@ from speakeasy_client_sdk_python._hooks import HookContext from speakeasy_client_sdk_python.models import errors, operations, shared from speakeasy_client_sdk_python.types import BaseModel, OptionalNullable, UNSET +from speakeasy_client_sdk_python.utils.unmarshal_json_response import ( + unmarshal_json_response, +) from typing import Any, List, Mapping, Optional, Union, cast @@ -38,6 +41,8 @@ def get_events_by_target( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal( @@ -74,6 +79,8 @@ def get_events_by_target( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="getWorkspaceEventsByTarget", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -83,11 +90,11 @@ def get_events_by_target( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetWorkspaceEventsByTargetResponse( - cli_event_batch=utils.unmarshal_json( - http_res.text, Optional[List[shared.CliEvent]] + cli_event_batch=unmarshal_json_response( + Optional[List[shared.CliEvent]], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", @@ -95,21 +102,12 @@ def get_events_by_target( ) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) - - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) + + raise errors.SDKError("Unexpected response received", http_res) async def get_events_by_target_async( self, @@ -138,6 +136,8 @@ async def get_events_by_target_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal( @@ -174,6 +174,8 @@ async def get_events_by_target_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="getWorkspaceEventsByTarget", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -183,11 +185,11 @@ async def get_events_by_target_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetWorkspaceEventsByTargetResponse( - cli_event_batch=utils.unmarshal_json( - http_res.text, Optional[List[shared.CliEvent]] + cli_event_batch=unmarshal_json_response( + Optional[List[shared.CliEvent]], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", @@ -195,21 +197,12 @@ async def get_events_by_target_async( ) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) - - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) + + raise errors.SDKError("Unexpected response received", http_res) def get_targets( self, @@ -238,6 +231,8 @@ def get_targets( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetWorkspaceTargetsRequest) @@ -269,6 +264,8 @@ def get_targets( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="getWorkspaceTargets", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -278,11 +275,11 @@ def get_targets( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetWorkspaceTargetsResponse( - target_sdk_list=utils.unmarshal_json( - http_res.text, Optional[List[shared.TargetSDK]] + target_sdk_list=unmarshal_json_response( + Optional[List[shared.TargetSDK]], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", @@ -290,21 +287,12 @@ def get_targets( ) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) - - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) + + raise errors.SDKError("Unexpected response received", http_res) async def get_targets_async( self, @@ -333,6 +321,8 @@ async def get_targets_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetWorkspaceTargetsRequest) @@ -364,6 +354,8 @@ async def get_targets_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="getWorkspaceTargets", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -373,11 +365,11 @@ async def get_targets_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetWorkspaceTargetsResponse( - target_sdk_list=utils.unmarshal_json( - http_res.text, Optional[List[shared.TargetSDK]] + target_sdk_list=unmarshal_json_response( + Optional[List[shared.TargetSDK]], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", @@ -385,21 +377,12 @@ async def get_targets_async( ) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) - - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) + + raise errors.SDKError("Unexpected response received", http_res) def get_targets_deprecated( self, @@ -428,6 +411,8 @@ def get_targets_deprecated( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal( @@ -464,6 +449,8 @@ def get_targets_deprecated( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="getWorkspaceTargetsDeprecated", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -473,11 +460,11 @@ def get_targets_deprecated( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetWorkspaceTargetsDeprecatedResponse( - target_sdk_list=utils.unmarshal_json( - http_res.text, Optional[List[shared.TargetSDK]] + target_sdk_list=unmarshal_json_response( + Optional[List[shared.TargetSDK]], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", @@ -485,21 +472,12 @@ def get_targets_deprecated( ) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) - - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) + + raise errors.SDKError("Unexpected response received", http_res) async def get_targets_deprecated_async( self, @@ -528,6 +506,8 @@ async def get_targets_deprecated_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal( @@ -564,6 +544,8 @@ async def get_targets_deprecated_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="getWorkspaceTargetsDeprecated", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -573,11 +555,11 @@ async def get_targets_deprecated_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetWorkspaceTargetsDeprecatedResponse( - target_sdk_list=utils.unmarshal_json( - http_res.text, Optional[List[shared.TargetSDK]] + target_sdk_list=unmarshal_json_response( + Optional[List[shared.TargetSDK]], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", @@ -585,21 +567,12 @@ async def get_targets_deprecated_async( ) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) - - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) + + raise errors.SDKError("Unexpected response received", http_res) def post( self, @@ -630,6 +603,8 @@ def post( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.PostWorkspaceEventsRequest) @@ -671,6 +646,8 @@ def post( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="postWorkspaceEvents", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -680,7 +657,7 @@ def post( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "*"): return operations.PostWorkspaceEventsResponse( status_code=http_res.status_code, @@ -689,21 +666,12 @@ def post( ) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) - - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) + + raise errors.SDKError("Unexpected response received", http_res) async def post_async( self, @@ -734,6 +702,8 @@ async def post_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.PostWorkspaceEventsRequest) @@ -775,6 +745,8 @@ async def post_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="postWorkspaceEvents", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -784,7 +756,7 @@ async def post_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "*"): return operations.PostWorkspaceEventsResponse( status_code=http_res.status_code, @@ -793,21 +765,12 @@ async def post_async( ) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) - - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) + + raise errors.SDKError("Unexpected response received", http_res) def search( self, @@ -836,6 +799,8 @@ def search( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.SearchWorkspaceEventsRequest) @@ -870,6 +835,8 @@ def search( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="searchWorkspaceEvents", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -879,11 +846,11 @@ def search( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.SearchWorkspaceEventsResponse( - cli_event_batch=utils.unmarshal_json( - http_res.text, Optional[List[shared.CliEvent]] + cli_event_batch=unmarshal_json_response( + Optional[List[shared.CliEvent]], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", @@ -891,21 +858,12 @@ def search( ) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) - - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) + + raise errors.SDKError("Unexpected response received", http_res) async def search_async( self, @@ -934,6 +892,8 @@ async def search_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.SearchWorkspaceEventsRequest) @@ -968,6 +928,8 @@ async def search_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="searchWorkspaceEvents", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -977,11 +939,11 @@ async def search_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.SearchWorkspaceEventsResponse( - cli_event_batch=utils.unmarshal_json( - http_res.text, Optional[List[shared.CliEvent]] + cli_event_batch=unmarshal_json_response( + Optional[List[shared.CliEvent]], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", @@ -989,18 +951,9 @@ async def search_async( ) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) - - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) + + raise errors.SDKError("Unexpected response received", http_res) diff --git a/src/speakeasy_client_sdk_python/github.py b/src/speakeasy_client_sdk_python/github.py index 28f91113..8eff06a6 100644 --- a/src/speakeasy_client_sdk_python/github.py +++ b/src/speakeasy_client_sdk_python/github.py @@ -5,6 +5,9 @@ from speakeasy_client_sdk_python._hooks import HookContext from speakeasy_client_sdk_python.models import errors, operations, shared from speakeasy_client_sdk_python.types import BaseModel, OptionalNullable, UNSET +from speakeasy_client_sdk_python.utils.unmarshal_json_response import ( + unmarshal_json_response, +) from typing import Any, Mapping, Optional, Union, cast @@ -37,6 +40,8 @@ def check_access( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.CheckGithubAccessRequest) @@ -68,6 +73,8 @@ def check_access( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="checkGithubAccess", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -77,7 +84,7 @@ def check_access( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "*"): return operations.CheckGithubAccessResponse( status_code=http_res.status_code, @@ -85,22 +92,13 @@ def check_access( raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def check_access_async( self, @@ -128,6 +126,8 @@ async def check_access_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.CheckGithubAccessRequest) @@ -159,6 +159,8 @@ async def check_access_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="checkGithubAccess", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -168,7 +170,7 @@ async def check_access_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "*"): return operations.CheckGithubAccessResponse( status_code=http_res.status_code, @@ -176,22 +178,13 @@ async def check_access_async( raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) def check_publishing_p_rs( self, @@ -219,6 +212,8 @@ def check_publishing_p_rs( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal( @@ -252,6 +247,8 @@ def check_publishing_p_rs( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="githubCheckPublishingPRs", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -261,33 +258,24 @@ def check_publishing_p_rs( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "application/json"): return operations.GithubCheckPublishingPRsResponse( - github_publishing_pr_response=utils.unmarshal_json( - http_res.text, Optional[shared.GithubPublishingPRResponse] + github_publishing_pr_response=unmarshal_json_response( + Optional[shared.GithubPublishingPRResponse], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def check_publishing_p_rs_async( self, @@ -315,6 +303,8 @@ async def check_publishing_p_rs_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal( @@ -348,6 +338,8 @@ async def check_publishing_p_rs_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="githubCheckPublishingPRs", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -357,33 +349,24 @@ async def check_publishing_p_rs_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "application/json"): return operations.GithubCheckPublishingPRsResponse( - github_publishing_pr_response=utils.unmarshal_json( - http_res.text, Optional[shared.GithubPublishingPRResponse] + github_publishing_pr_response=unmarshal_json_response( + Optional[shared.GithubPublishingPRResponse], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) def check_publishing_secrets( self, @@ -411,6 +394,8 @@ def check_publishing_secrets( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal( @@ -444,6 +429,8 @@ def check_publishing_secrets( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="githubCheckPublishingSecrets", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -453,34 +440,24 @@ def check_publishing_secrets( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "application/json"): return operations.GithubCheckPublishingSecretsResponse( - github_missing_publishing_secrets_response=utils.unmarshal_json( - http_res.text, - Optional[shared.GithubMissingPublishingSecretsResponse], + github_missing_publishing_secrets_response=unmarshal_json_response( + Optional[shared.GithubMissingPublishingSecretsResponse], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def check_publishing_secrets_async( self, @@ -508,6 +485,8 @@ async def check_publishing_secrets_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal( @@ -541,6 +520,8 @@ async def check_publishing_secrets_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="githubCheckPublishingSecrets", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -550,34 +531,24 @@ async def check_publishing_secrets_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "application/json"): return operations.GithubCheckPublishingSecretsResponse( - github_missing_publishing_secrets_response=utils.unmarshal_json( - http_res.text, - Optional[shared.GithubMissingPublishingSecretsResponse], + github_missing_publishing_secrets_response=unmarshal_json_response( + Optional[shared.GithubMissingPublishingSecretsResponse], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) def configure_code_samples( self, @@ -605,6 +576,8 @@ def configure_code_samples( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, shared.GithubConfigureCodeSamplesRequest) @@ -639,6 +612,8 @@ def configure_code_samples( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="githubConfigureCodeSamples", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -648,33 +623,24 @@ def configure_code_samples( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "application/json"): return operations.GithubConfigureCodeSamplesResponse( - github_configure_code_samples_response=utils.unmarshal_json( - http_res.text, Optional[shared.GithubConfigureCodeSamplesResponse] + github_configure_code_samples_response=unmarshal_json_response( + Optional[shared.GithubConfigureCodeSamplesResponse], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def configure_code_samples_async( self, @@ -702,6 +668,8 @@ async def configure_code_samples_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, shared.GithubConfigureCodeSamplesRequest) @@ -736,6 +704,8 @@ async def configure_code_samples_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="githubConfigureCodeSamples", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -745,33 +715,24 @@ async def configure_code_samples_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "application/json"): return operations.GithubConfigureCodeSamplesResponse( - github_configure_code_samples_response=utils.unmarshal_json( - http_res.text, Optional[shared.GithubConfigureCodeSamplesResponse] + github_configure_code_samples_response=unmarshal_json_response( + Optional[shared.GithubConfigureCodeSamplesResponse], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) def configure_mintlify_repo( self, @@ -799,6 +760,8 @@ def configure_mintlify_repo( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal( @@ -835,6 +798,8 @@ def configure_mintlify_repo( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="githubConfigureMintlifyRepo", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -844,7 +809,7 @@ def configure_mintlify_repo( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "*"): return operations.GithubConfigureMintlifyRepoResponse( status_code=http_res.status_code, @@ -852,22 +817,13 @@ def configure_mintlify_repo( raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def configure_mintlify_repo_async( self, @@ -895,6 +851,8 @@ async def configure_mintlify_repo_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal( @@ -931,6 +889,8 @@ async def configure_mintlify_repo_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="githubConfigureMintlifyRepo", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -940,7 +900,7 @@ async def configure_mintlify_repo_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "*"): return operations.GithubConfigureMintlifyRepoResponse( status_code=http_res.status_code, @@ -948,22 +908,13 @@ async def configure_mintlify_repo_async( raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) def configure_target( self, @@ -991,6 +942,8 @@ def configure_target( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, shared.GithubConfigureTargetRequest) @@ -1025,6 +978,8 @@ def configure_target( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="githubConfigureTarget", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1034,7 +989,7 @@ def configure_target( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "*"): return operations.GithubConfigureTargetResponse( status_code=http_res.status_code, @@ -1042,22 +997,13 @@ def configure_target( raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def configure_target_async( self, @@ -1085,6 +1031,8 @@ async def configure_target_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, shared.GithubConfigureTargetRequest) @@ -1119,6 +1067,8 @@ async def configure_target_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="githubConfigureTarget", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1128,7 +1078,7 @@ async def configure_target_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "*"): return operations.GithubConfigureTargetResponse( status_code=http_res.status_code, @@ -1136,22 +1086,13 @@ async def configure_target_async( raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) def get_action( self, @@ -1179,6 +1120,8 @@ def get_action( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetGitHubActionRequest) @@ -1210,6 +1153,8 @@ def get_action( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="getGitHubAction", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1219,33 +1164,24 @@ def get_action( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "application/json"): return operations.GetGitHubActionResponse( - github_get_action_response=utils.unmarshal_json( - http_res.text, Optional[shared.GithubGetActionResponse] + github_get_action_response=unmarshal_json_response( + Optional[shared.GithubGetActionResponse], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def get_action_async( self, @@ -1273,6 +1209,8 @@ async def get_action_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetGitHubActionRequest) @@ -1304,6 +1242,8 @@ async def get_action_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="getGitHubAction", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1313,33 +1253,24 @@ async def get_action_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "application/json"): return operations.GetGitHubActionResponse( - github_get_action_response=utils.unmarshal_json( - http_res.text, Optional[shared.GithubGetActionResponse] + github_get_action_response=unmarshal_json_response( + Optional[shared.GithubGetActionResponse], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) def get_setup( self, @@ -1367,6 +1298,8 @@ def get_setup( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetGithubSetupStateRequest) @@ -1398,6 +1331,8 @@ def get_setup( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="getGithubSetupState", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1407,33 +1342,24 @@ def get_setup( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "application/json"): return operations.GetGithubSetupStateResponse( - github_setup_state_response=utils.unmarshal_json( - http_res.text, Optional[shared.GithubSetupStateResponse] + github_setup_state_response=unmarshal_json_response( + Optional[shared.GithubSetupStateResponse], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def get_setup_async( self, @@ -1461,6 +1387,8 @@ async def get_setup_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetGithubSetupStateRequest) @@ -1492,6 +1420,8 @@ async def get_setup_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="getGithubSetupState", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1501,33 +1431,24 @@ async def get_setup_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "application/json"): return operations.GetGithubSetupStateResponse( - github_setup_state_response=utils.unmarshal_json( - http_res.text, Optional[shared.GithubSetupStateResponse] + github_setup_state_response=unmarshal_json_response( + Optional[shared.GithubSetupStateResponse], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) def link_github( self, @@ -1555,6 +1476,8 @@ def link_github( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.LinkGithubAccessRequest) @@ -1586,6 +1509,8 @@ def link_github( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="linkGithubAccess", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1595,7 +1520,7 @@ def link_github( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "*"): return operations.LinkGithubAccessResponse( status_code=http_res.status_code, @@ -1603,22 +1528,13 @@ def link_github( raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def link_github_async( self, @@ -1646,6 +1562,8 @@ async def link_github_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.LinkGithubAccessRequest) @@ -1677,6 +1595,8 @@ async def link_github_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="linkGithubAccess", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1686,7 +1606,7 @@ async def link_github_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "*"): return operations.LinkGithubAccessResponse( status_code=http_res.status_code, @@ -1694,22 +1614,13 @@ async def link_github_async( raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) def store_publishing_secrets( self, @@ -1737,6 +1648,8 @@ def store_publishing_secrets( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal( @@ -1777,6 +1690,8 @@ def store_publishing_secrets( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="githubStorePublishingSecrets", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1786,7 +1701,7 @@ def store_publishing_secrets( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "*"): return operations.GithubStorePublishingSecretsResponse( status_code=http_res.status_code, @@ -1794,22 +1709,13 @@ def store_publishing_secrets( raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def store_publishing_secrets_async( self, @@ -1837,6 +1743,8 @@ async def store_publishing_secrets_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal( @@ -1877,6 +1785,8 @@ async def store_publishing_secrets_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="githubStorePublishingSecrets", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1886,7 +1796,7 @@ async def store_publishing_secrets_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "*"): return operations.GithubStorePublishingSecretsResponse( status_code=http_res.status_code, @@ -1894,22 +1804,13 @@ async def store_publishing_secrets_async( raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) def trigger_action( self, @@ -1937,6 +1838,8 @@ def trigger_action( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, shared.GithubTriggerActionRequest) @@ -1971,6 +1874,8 @@ def trigger_action( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="githubTriggerAction", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1980,7 +1885,7 @@ def trigger_action( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "*"): return operations.GithubTriggerActionResponse( status_code=http_res.status_code, @@ -1988,22 +1893,13 @@ def trigger_action( raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def trigger_action_async( self, @@ -2031,6 +1927,8 @@ async def trigger_action_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, shared.GithubTriggerActionRequest) @@ -2065,6 +1963,8 @@ async def trigger_action_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="githubTriggerAction", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -2074,7 +1974,7 @@ async def trigger_action_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "*"): return operations.GithubTriggerActionResponse( status_code=http_res.status_code, @@ -2082,19 +1982,10 @@ async def trigger_action_async( raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) diff --git a/src/speakeasy_client_sdk_python/httpclient.py b/src/speakeasy_client_sdk_python/httpclient.py index 167cea4e..47b052cb 100644 --- a/src/speakeasy_client_sdk_python/httpclient.py +++ b/src/speakeasy_client_sdk_python/httpclient.py @@ -1,6 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" # pyright: reportReturnType = false +import asyncio from typing_extensions import Protocol, runtime_checkable import httpx from typing import Any, Optional, Union @@ -82,3 +83,44 @@ def build_request( async def aclose(self) -> None: pass + + +class ClientOwner(Protocol): + client: Union[HttpClient, None] + async_client: Union[AsyncHttpClient, None] + + +def close_clients( + owner: ClientOwner, + sync_client: Union[HttpClient, None], + sync_client_supplied: bool, + async_client: Union[AsyncHttpClient, None], + async_client_supplied: bool, +) -> None: + """ + A finalizer function that is meant to be used with weakref.finalize to close + httpx clients used by an SDK so that underlying resources can be garbage + collected. + """ + + # Unset the client/async_client properties so there are no more references + # to them from the owning SDK instance and they can be reaped. + owner.client = None + owner.async_client = None + + if sync_client is not None and not sync_client_supplied: + try: + sync_client.close() + except Exception: + pass + + if async_client is not None and not async_client_supplied: + try: + loop = asyncio.get_running_loop() + asyncio.run_coroutine_threadsafe(async_client.aclose(), loop) + except RuntimeError: + try: + asyncio.run(async_client.aclose()) + except RuntimeError: + # best effort + pass diff --git a/src/speakeasy_client_sdk_python/models/__init__.py b/src/speakeasy_client_sdk_python/models/__init__.py new file mode 100644 index 00000000..726fc5eb --- /dev/null +++ b/src/speakeasy_client_sdk_python/models/__init__.py @@ -0,0 +1,3 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +# package diff --git a/src/speakeasy_client_sdk_python/models/errors/__init__.py b/src/speakeasy_client_sdk_python/models/errors/__init__.py index ebdc9b39..70367144 100644 --- a/src/speakeasy_client_sdk_python/models/errors/__init__.py +++ b/src/speakeasy_client_sdk_python/models/errors/__init__.py @@ -1,6 +1,55 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" -from .error import Error, ErrorData -from .sdkerror import SDKError +from typing import TYPE_CHECKING +from importlib import import_module -__all__ = ["Error", "ErrorData", "SDKError"] +if TYPE_CHECKING: + from .error import Error, ErrorData + from .no_response_error import NoResponseError + from .responsevalidationerror import ResponseValidationError + from .sdkerror import SDKError + from .speakeasyerror import SpeakeasyError + +__all__ = [ + "Error", + "ErrorData", + "NoResponseError", + "ResponseValidationError", + "SDKError", + "SpeakeasyError", +] + +_dynamic_imports: dict[str, str] = { + "Error": ".error", + "ErrorData": ".error", + "NoResponseError": ".no_response_error", + "ResponseValidationError": ".responsevalidationerror", + "SDKError": ".sdkerror", + "SpeakeasyError": ".speakeasyerror", +} + + +def __getattr__(attr_name: str) -> object: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError( + f"No {attr_name} found in _dynamic_imports for module name -> {__name__} " + ) + + try: + module = import_module(module_name, __package__) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError( + f"Failed to import {attr_name} from {module_name}: {e}" + ) from e + except AttributeError as e: + raise AttributeError( + f"Failed to get {attr_name} from {module_name}: {e}" + ) from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) diff --git a/src/speakeasy_client_sdk_python/models/errors/error.py b/src/speakeasy_client_sdk_python/models/errors/error.py index 41051ecb..a771f6eb 100644 --- a/src/speakeasy_client_sdk_python/models/errors/error.py +++ b/src/speakeasy_client_sdk_python/models/errors/error.py @@ -1,8 +1,10 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from speakeasy_client_sdk_python import utils +import httpx +from speakeasy_client_sdk_python.models.errors import SpeakeasyError from speakeasy_client_sdk_python.types import BaseModel +from typing import Optional class ErrorData(BaseModel): @@ -13,13 +15,15 @@ class ErrorData(BaseModel): r"""The HTTP status code""" -class Error(Exception): +class Error(SpeakeasyError): r"""The `Status` type defines a logical error model""" data: ErrorData - def __init__(self, data: ErrorData): + def __init__( + self, data: ErrorData, raw_response: httpx.Response, body: Optional[str] = None + ): + fallback = body or raw_response.text + message = str(data.message) or fallback + super().__init__(message, raw_response, body) self.data = data - - def __str__(self) -> str: - return utils.marshal_json(self.data, ErrorData) diff --git a/src/speakeasy_client_sdk_python/models/errors/no_response_error.py b/src/speakeasy_client_sdk_python/models/errors/no_response_error.py new file mode 100644 index 00000000..f98beea2 --- /dev/null +++ b/src/speakeasy_client_sdk_python/models/errors/no_response_error.py @@ -0,0 +1,13 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +class NoResponseError(Exception): + """Error raised when no HTTP response is received from the server.""" + + message: str + + def __init__(self, message: str = "No response received"): + self.message = message + super().__init__(message) + + def __str__(self): + return self.message diff --git a/src/speakeasy_client_sdk_python/models/errors/responsevalidationerror.py b/src/speakeasy_client_sdk_python/models/errors/responsevalidationerror.py new file mode 100644 index 00000000..d92136e8 --- /dev/null +++ b/src/speakeasy_client_sdk_python/models/errors/responsevalidationerror.py @@ -0,0 +1,25 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import httpx +from typing import Optional + +from speakeasy_client_sdk_python.models.errors import SpeakeasyError + + +class ResponseValidationError(SpeakeasyError): + """Error raised when there is a type mismatch between the response data and the expected Pydantic model.""" + + def __init__( + self, + message: str, + raw_response: httpx.Response, + cause: Exception, + body: Optional[str] = None, + ): + message = f"{message}: {cause}" + super().__init__(message, raw_response, body) + + @property + def cause(self): + """Normally the Pydantic ValidationError""" + return self.__cause__ diff --git a/src/speakeasy_client_sdk_python/models/errors/sdkerror.py b/src/speakeasy_client_sdk_python/models/errors/sdkerror.py index 03216cbf..b611f8b6 100644 --- a/src/speakeasy_client_sdk_python/models/errors/sdkerror.py +++ b/src/speakeasy_client_sdk_python/models/errors/sdkerror.py @@ -1,22 +1,38 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" -from dataclasses import dataclass -from typing import Optional import httpx +from typing import Optional + +from speakeasy_client_sdk_python.models.errors import SpeakeasyError + +MAX_MESSAGE_LEN = 10_000 + + +class SDKError(SpeakeasyError): + """The fallback error class if no more specific error class is matched.""" + + def __init__( + self, message: str, raw_response: httpx.Response, body: Optional[str] = None + ): + body_display = body or raw_response.text or '""' + if message: + message += ": " + message += f"Status {raw_response.status_code}" -@dataclass -class SDKError(Exception): - """Represents an error returned by the API.""" + headers = raw_response.headers + content_type = headers.get("content-type", '""') + if content_type != "application/json": + if " " in content_type: + content_type = f'"{content_type}"' + message += f" Content-Type {content_type}" - message: str - status_code: int = -1 - body: str = "" - raw_response: Optional[httpx.Response] = None + if len(body_display) > MAX_MESSAGE_LEN: + truncated = body_display[:MAX_MESSAGE_LEN] + remaining = len(body_display) - MAX_MESSAGE_LEN + body_display = f"{truncated}...and {remaining} more chars" - def __str__(self): - body = "" - if len(self.body) > 0: - body = f"\n{self.body}" + message += f". Body: {body_display}" + message = message.strip() - return f"{self.message}: Status {self.status_code}{body}" + super().__init__(message, raw_response, body) diff --git a/src/speakeasy_client_sdk_python/models/errors/speakeasyerror.py b/src/speakeasy_client_sdk_python/models/errors/speakeasyerror.py new file mode 100644 index 00000000..5d724160 --- /dev/null +++ b/src/speakeasy_client_sdk_python/models/errors/speakeasyerror.py @@ -0,0 +1,26 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import httpx +from typing import Optional + + +class SpeakeasyError(Exception): + """The base class for all HTTP error responses.""" + + message: str + status_code: int + body: str + headers: httpx.Headers + raw_response: httpx.Response + + def __init__( + self, message: str, raw_response: httpx.Response, body: Optional[str] = None + ): + self.message = message + self.status_code = raw_response.status_code + self.body = body if body is not None else raw_response.text + self.headers = raw_response.headers + self.raw_response = raw_response + + def __str__(self): + return self.message diff --git a/src/speakeasy_client_sdk_python/models/internal/__init__.py b/src/speakeasy_client_sdk_python/models/internal/__init__.py index 9e3dfb7a..ff432150 100644 --- a/src/speakeasy_client_sdk_python/models/internal/__init__.py +++ b/src/speakeasy_client_sdk_python/models/internal/__init__.py @@ -1,5 +1,40 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" -from .globals import Globals, GlobalsTypedDict +from typing import TYPE_CHECKING +from importlib import import_module + +if TYPE_CHECKING: + from .globals import Globals, GlobalsTypedDict __all__ = ["Globals", "GlobalsTypedDict"] + +_dynamic_imports: dict[str, str] = { + "Globals": ".globals", + "GlobalsTypedDict": ".globals", +} + + +def __getattr__(attr_name: str) -> object: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError( + f"No {attr_name} found in _dynamic_imports for module name -> {__name__} " + ) + + try: + module = import_module(module_name, __package__) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError( + f"Failed to import {attr_name} from {module_name}: {e}" + ) from e + except AttributeError as e: + raise AttributeError( + f"Failed to get {attr_name} from {module_name}: {e}" + ) from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) diff --git a/src/speakeasy_client_sdk_python/models/operations/__init__.py b/src/speakeasy_client_sdk_python/models/operations/__init__.py index 80581f33..3d3fe022 100644 --- a/src/speakeasy_client_sdk_python/models/operations/__init__.py +++ b/src/speakeasy_client_sdk_python/models/operations/__init__.py @@ -1,387 +1,498 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" -from .activatesubscriptionnamespace import ( - ActivateSubscriptionNamespaceRequest, - ActivateSubscriptionNamespaceRequestTypedDict, - ActivateSubscriptionNamespaceResponse, - ActivateSubscriptionNamespaceResponseTypedDict, -) -from .checkgithubaccess import ( - CheckGithubAccessRequest, - CheckGithubAccessRequestTypedDict, - CheckGithubAccessResponse, - CheckGithubAccessResponseTypedDict, -) -from .create import ( - CreateRequestBody, - CreateRequestBodyTypedDict, - CreateResponse, - CreateResponseTypedDict, -) -from .createfreetrial import CreateFreeTrialResponse, CreateFreeTrialResponseTypedDict -from .createorganization import ( - CreateOrganizationResponse, - CreateOrganizationResponseTypedDict, -) -from .createremotesource import ( - CreateRemoteSourceResponse, - CreateRemoteSourceResponseTypedDict, -) -from .createworkspace import CreateWorkspaceResponse, CreateWorkspaceResponseTypedDict -from .createworkspacetoken import ( - CreateWorkspaceTokenGlobals, - CreateWorkspaceTokenGlobalsTypedDict, - CreateWorkspaceTokenRequest, - CreateWorkspaceTokenRequestTypedDict, - CreateWorkspaceTokenResponse, - CreateWorkspaceTokenResponseTypedDict, -) -from .deleteworkspacetoken import ( - DeleteWorkspaceTokenGlobals, - DeleteWorkspaceTokenGlobalsTypedDict, - DeleteWorkspaceTokenRequest, - DeleteWorkspaceTokenRequestTypedDict, - DeleteWorkspaceTokenResponse, - DeleteWorkspaceTokenResponseTypedDict, -) -from .generatecodesamplepreview import ( - GenerateCodeSamplePreviewResponse, - GenerateCodeSamplePreviewResponseTypedDict, -) -from .generatecodesamplepreviewasync import ( - GenerateCodeSamplePreviewAsyncResponse, - GenerateCodeSamplePreviewAsyncResponseBody, - GenerateCodeSamplePreviewAsyncResponseBodyTypedDict, - GenerateCodeSamplePreviewAsyncResponseTypedDict, -) -from .getaccesstoken import ( - GetAccessTokenRequest, - GetAccessTokenRequestTypedDict, - GetAccessTokenResponse, - GetAccessTokenResponseTypedDict, -) -from .getblob import ( - GetBlobRequest, - GetBlobRequestTypedDict, - GetBlobResponse, - GetBlobResponseTypedDict, -) -from .getchangesreportsignedurl import ( - GetChangesReportSignedURLRequest, - GetChangesReportSignedURLRequestTypedDict, - GetChangesReportSignedURLResponse, - GetChangesReportSignedURLResponseTypedDict, - GetChangesReportSignedURLSignedAccess, - GetChangesReportSignedURLSignedAccessTypedDict, -) -from .getcodesamplepreviewasync import ( - GetCodeSamplePreviewAsyncRequest, - GetCodeSamplePreviewAsyncRequestTypedDict, - GetCodeSamplePreviewAsyncResponse, - GetCodeSamplePreviewAsyncResponseBody, - GetCodeSamplePreviewAsyncResponseBodyTypedDict, - GetCodeSamplePreviewAsyncResponseTypedDict, -) -from .getcodesamples import ( - GetCodeSamplesRequest, - GetCodeSamplesRequestTypedDict, - GetCodeSamplesResponse, - GetCodeSamplesResponseTypedDict, -) -from .getgithubaction import ( - GetGitHubActionRequest, - GetGitHubActionRequestTypedDict, - GetGitHubActionResponse, - GetGitHubActionResponseTypedDict, -) -from .getgithubsetupstate import ( - GetGithubSetupStateRequest, - GetGithubSetupStateRequestTypedDict, - GetGithubSetupStateResponse, - GetGithubSetupStateResponseTypedDict, -) -from .getlintingreportsignedurl import ( - GetLintingReportSignedURLRequest, - GetLintingReportSignedURLRequestTypedDict, - GetLintingReportSignedURLResponse, - GetLintingReportSignedURLResponseTypedDict, - GetLintingReportSignedURLSignedAccess, - GetLintingReportSignedURLSignedAccessTypedDict, -) -from .getmanifest import ( - GetManifestRequest, - GetManifestRequestTypedDict, - GetManifestResponse, - GetManifestResponseTypedDict, -) -from .getnamespaces import GetNamespacesResponse, GetNamespacesResponseTypedDict -from .getorganization import ( - GetOrganizationRequest, - GetOrganizationRequestTypedDict, - GetOrganizationResponse, - GetOrganizationResponseTypedDict, -) -from .getorganizations import ( - GetOrganizationsResponse, - GetOrganizationsResponseTypedDict, -) -from .getorganizationusage import ( - GetOrganizationUsageResponse, - GetOrganizationUsageResponseTypedDict, -) -from .getrevisions import ( - GetRevisionsRequest, - GetRevisionsRequestTypedDict, - GetRevisionsResponse, - GetRevisionsResponseTypedDict, -) -from .gettags import ( - GetTagsRequest, - GetTagsRequestTypedDict, - GetTagsResponse, - GetTagsResponseTypedDict, -) -from .getuser import GetUserResponse, GetUserResponseTypedDict -from .getworkspace import ( - GetWorkspaceGlobals, - GetWorkspaceGlobalsTypedDict, - GetWorkspaceRequest, - GetWorkspaceRequestTypedDict, - GetWorkspaceResponse, - GetWorkspaceResponseTypedDict, -) -from .getworkspaceaccess import ( - GetWorkspaceAccessRequest, - GetWorkspaceAccessRequestTypedDict, - GetWorkspaceAccessResponse, - GetWorkspaceAccessResponseTypedDict, -) -from .getworkspacebycontext import ( - GetWorkspaceByContextResponse, - GetWorkspaceByContextResponseTypedDict, -) -from .getworkspaceeventsbytarget import ( - GetWorkspaceEventsByTargetGlobals, - GetWorkspaceEventsByTargetGlobalsTypedDict, - GetWorkspaceEventsByTargetRequest, - GetWorkspaceEventsByTargetRequestTypedDict, - GetWorkspaceEventsByTargetResponse, - GetWorkspaceEventsByTargetResponseTypedDict, -) -from .getworkspacefeatureflags import ( - GetWorkspaceFeatureFlagsGlobals, - GetWorkspaceFeatureFlagsGlobalsTypedDict, - GetWorkspaceFeatureFlagsRequest, - GetWorkspaceFeatureFlagsRequestTypedDict, - GetWorkspaceFeatureFlagsResponse, - GetWorkspaceFeatureFlagsResponseTypedDict, -) -from .getworkspaces import GetWorkspacesResponse, GetWorkspacesResponseTypedDict -from .getworkspacesettings import ( - GetWorkspaceSettingsGlobals, - GetWorkspaceSettingsGlobalsTypedDict, - GetWorkspaceSettingsRequest, - GetWorkspaceSettingsRequestTypedDict, - GetWorkspaceSettingsResponse, - GetWorkspaceSettingsResponseTypedDict, -) -from .getworkspacetargets import ( - GetWorkspaceTargetsRequest, - GetWorkspaceTargetsRequestTypedDict, - GetWorkspaceTargetsResponse, - GetWorkspaceTargetsResponseTypedDict, -) -from .getworkspacetargetsdeprecated import ( - GetWorkspaceTargetsDeprecatedGlobals, - GetWorkspaceTargetsDeprecatedGlobalsTypedDict, - GetWorkspaceTargetsDeprecatedRequest, - GetWorkspaceTargetsDeprecatedRequestTypedDict, - GetWorkspaceTargetsDeprecatedResponse, - GetWorkspaceTargetsDeprecatedResponseTypedDict, -) -from .getworkspaceteam import ( - GetWorkspaceTeamGlobals, - GetWorkspaceTeamGlobalsTypedDict, - GetWorkspaceTeamRequest, - GetWorkspaceTeamRequestTypedDict, - GetWorkspaceTeamResponse, - GetWorkspaceTeamResponseTypedDict, -) -from .getworkspacetokens import ( - GetWorkspaceTokensGlobals, - GetWorkspaceTokensGlobalsTypedDict, - GetWorkspaceTokensRequest, - GetWorkspaceTokensRequestTypedDict, - GetWorkspaceTokensResponse, - GetWorkspaceTokensResponseTypedDict, -) -from .githubcheckpublishingprs import ( - GithubCheckPublishingPRsRequest, - GithubCheckPublishingPRsRequestTypedDict, - GithubCheckPublishingPRsResponse, - GithubCheckPublishingPRsResponseTypedDict, -) -from .githubcheckpublishingsecrets import ( - GithubCheckPublishingSecretsRequest, - GithubCheckPublishingSecretsRequestTypedDict, - GithubCheckPublishingSecretsResponse, - GithubCheckPublishingSecretsResponseTypedDict, -) -from .githubconfigurecodesamples import ( - GithubConfigureCodeSamplesResponse, - GithubConfigureCodeSamplesResponseTypedDict, -) -from .githubconfiguremintlifyrepo import ( - GithubConfigureMintlifyRepoResponse, - GithubConfigureMintlifyRepoResponseTypedDict, -) -from .githubconfiguretarget import ( - GithubConfigureTargetResponse, - GithubConfigureTargetResponseTypedDict, -) -from .githubstorepublishingsecrets import ( - GithubStorePublishingSecretsResponse, - GithubStorePublishingSecretsResponseTypedDict, -) -from .githubtriggeraction import ( - GithubTriggerActionResponse, - GithubTriggerActionResponseTypedDict, -) -from .grantuseraccesstoworkspace import ( - GrantUserAccessToWorkspaceGlobals, - GrantUserAccessToWorkspaceGlobalsTypedDict, - GrantUserAccessToWorkspaceRequest, - GrantUserAccessToWorkspaceRequestTypedDict, - GrantUserAccessToWorkspaceResponse, - GrantUserAccessToWorkspaceResponseTypedDict, -) -from .ignoresubscriptionnamespace import ( - IgnoreSubscriptionNamespaceRequest, - IgnoreSubscriptionNamespaceRequestTypedDict, - IgnoreSubscriptionNamespaceResponse, - IgnoreSubscriptionNamespaceResponseTypedDict, -) -from .linkgithubaccess import ( - LinkGithubAccessRequest, - LinkGithubAccessRequestTypedDict, - LinkGithubAccessResponse, - LinkGithubAccessResponseTypedDict, -) -from .listremotesources import ( - ListRemoteSourcesRequest, - ListRemoteSourcesRequestTypedDict, - ListRemoteSourcesResponse, - ListRemoteSourcesResponseTypedDict, -) -from .posttags import ( - PostTagsRequest, - PostTagsRequestTypedDict, - PostTagsResponse, - PostTagsResponseTypedDict, -) -from .postworkspaceevents import ( - PostWorkspaceEventsGlobals, - PostWorkspaceEventsGlobalsTypedDict, - PostWorkspaceEventsRequest, - PostWorkspaceEventsRequestTypedDict, - PostWorkspaceEventsResponse, - PostWorkspaceEventsResponseTypedDict, -) -from .preflight import PreflightResponse, PreflightResponseTypedDict -from .revokeuseraccesstoworkspace import ( - RevokeUserAccessToWorkspaceGlobals, - RevokeUserAccessToWorkspaceGlobalsTypedDict, - RevokeUserAccessToWorkspaceRequest, - RevokeUserAccessToWorkspaceRequestTypedDict, - RevokeUserAccessToWorkspaceResponse, - RevokeUserAccessToWorkspaceResponseTypedDict, -) -from .searchworkspaceevents import ( - SearchWorkspaceEventsGlobals, - SearchWorkspaceEventsGlobalsTypedDict, - SearchWorkspaceEventsRequest, - SearchWorkspaceEventsRequestTypedDict, - SearchWorkspaceEventsResponse, - SearchWorkspaceEventsResponseTypedDict, -) -from .setvisibility import ( - SetVisibilityRequest, - SetVisibilityRequestBody, - SetVisibilityRequestBodyTypedDict, - SetVisibilityRequestTypedDict, - SetVisibilityResponse, - SetVisibilityResponseTypedDict, -) -from .suggest import ( - SuggestRequest, - SuggestRequestTypedDict, - SuggestResponse, - SuggestResponseTypedDict, -) -from .suggestitems import SuggestItemsResponse, SuggestItemsResponseTypedDict -from .suggestopenapi import ( - Schema, - SchemaTypedDict, - SuggestOpenAPIRequest, - SuggestOpenAPIRequestBody, - SuggestOpenAPIRequestBodyTypedDict, - SuggestOpenAPIRequestTypedDict, - SuggestOpenAPIResponse, - SuggestOpenAPIResponseTypedDict, -) -from .suggestopenapiregistry import ( - SuggestOpenAPIRegistryRequest, - SuggestOpenAPIRegistryRequestTypedDict, - SuggestOpenAPIRegistryResponse, - SuggestOpenAPIRegistryResponseTypedDict, -) -from .updateworkspacedetails import ( - UpdateWorkspaceDetailsGlobals, - UpdateWorkspaceDetailsGlobalsTypedDict, - UpdateWorkspaceDetailsRequest, - UpdateWorkspaceDetailsRequestTypedDict, - UpdateWorkspaceDetailsResponse, - UpdateWorkspaceDetailsResponseTypedDict, -) -from .updateworkspacesettings import ( - UpdateWorkspaceSettingsGlobals, - UpdateWorkspaceSettingsGlobalsTypedDict, - UpdateWorkspaceSettingsRequest, - UpdateWorkspaceSettingsRequestTypedDict, - UpdateWorkspaceSettingsResponse, - UpdateWorkspaceSettingsResponseTypedDict, -) -from .uploadreport import ( - File, - FileTypedDict, - UploadReportRequestBody, - UploadReportRequestBodyTypedDict, - UploadReportResponse, - UploadReportResponseTypedDict, - UploadReportUploadedReport, - UploadReportUploadedReportTypedDict, -) -from .validateapikey import ValidateAPIKeyResponse, ValidateAPIKeyResponseTypedDict +from typing import TYPE_CHECKING +from importlib import import_module + +if TYPE_CHECKING: + from .activatesubscriptionnamespace import ( + ActivateSubscriptionNamespaceRequest, + ActivateSubscriptionNamespaceRequestTypedDict, + ActivateSubscriptionNamespaceResponse, + ActivateSubscriptionNamespaceResponseTypedDict, + ) + from .archivenamespace import ( + ArchiveNamespaceRequest, + ArchiveNamespaceRequestBody, + ArchiveNamespaceRequestBodyTypedDict, + ArchiveNamespaceRequestTypedDict, + ArchiveNamespaceResponse, + ArchiveNamespaceResponseTypedDict, + ) + from .checkgithubaccess import ( + CheckGithubAccessRequest, + CheckGithubAccessRequestTypedDict, + CheckGithubAccessResponse, + CheckGithubAccessResponseTypedDict, + ) + from .create import ( + CreateRequestBody, + CreateRequestBodyTypedDict, + CreateResponse, + CreateResponseTypedDict, + ) + from .createbillingaddons import ( + CreateBillingAddOnsResponse, + CreateBillingAddOnsResponseTypedDict, + ) + from .createfreetrial import ( + CreateFreeTrialResponse, + CreateFreeTrialResponseTypedDict, + ) + from .createorganization import ( + CreateOrganizationResponse, + CreateOrganizationResponseTypedDict, + ) + from .createpublishingtoken import ( + CreatePublishingTokenRequestBody, + CreatePublishingTokenRequestBodyTypedDict, + CreatePublishingTokenResponse, + CreatePublishingTokenResponseTypedDict, + ) + from .createremotesource import ( + CreateRemoteSourceResponse, + CreateRemoteSourceResponseTypedDict, + ) + from .createschemastoreitem import ( + CreateSchemaStoreItemRequestBody, + CreateSchemaStoreItemRequestBodyTypedDict, + CreateSchemaStoreItemResponse, + CreateSchemaStoreItemResponseTypedDict, + Format, + ) + from .createworkspace import ( + CreateWorkspaceResponse, + CreateWorkspaceResponseTypedDict, + ) + from .createworkspacetoken import ( + CreateWorkspaceTokenGlobals, + CreateWorkspaceTokenGlobalsTypedDict, + CreateWorkspaceTokenRequest, + CreateWorkspaceTokenRequestTypedDict, + CreateWorkspaceTokenResponse, + CreateWorkspaceTokenResponseTypedDict, + ) + from .deletebillingaddon import ( + DeleteBillingAddOnRequest, + DeleteBillingAddOnRequestTypedDict, + DeleteBillingAddOnResponse, + DeleteBillingAddOnResponseTypedDict, + ) + from .deletepublishingtoken import ( + DeletePublishingTokenRequest, + DeletePublishingTokenRequestTypedDict, + DeletePublishingTokenResponse, + DeletePublishingTokenResponseTypedDict, + ) + from .deleteworkspacetoken import ( + DeleteWorkspaceTokenGlobals, + DeleteWorkspaceTokenGlobalsTypedDict, + DeleteWorkspaceTokenRequest, + DeleteWorkspaceTokenRequestTypedDict, + DeleteWorkspaceTokenResponse, + DeleteWorkspaceTokenResponseTypedDict, + ) + from .generatecodesamplepreview import ( + GenerateCodeSamplePreviewResponse, + GenerateCodeSamplePreviewResponseTypedDict, + ) + from .generatecodesamplepreviewasync import ( + GenerateCodeSamplePreviewAsyncResponse, + GenerateCodeSamplePreviewAsyncResponseBody, + GenerateCodeSamplePreviewAsyncResponseBodyTypedDict, + GenerateCodeSamplePreviewAsyncResponseTypedDict, + ) + from .getaccesstoken import ( + GetAccessTokenRequest, + GetAccessTokenRequestTypedDict, + GetAccessTokenResponse, + GetAccessTokenResponseTypedDict, + ) + from .getbillingaddons import ( + GetBillingAddOnsResponse, + GetBillingAddOnsResponseTypedDict, + ) + from .getblob import ( + GetBlobRequest, + GetBlobRequestTypedDict, + GetBlobResponse, + GetBlobResponseTypedDict, + ) + from .getchangesreportsignedurl import ( + GetChangesReportSignedURLRequest, + GetChangesReportSignedURLRequestTypedDict, + GetChangesReportSignedURLResponse, + GetChangesReportSignedURLResponseTypedDict, + GetChangesReportSignedURLSignedAccess, + GetChangesReportSignedURLSignedAccessTypedDict, + ) + from .getcodesamplepreviewasync import ( + GetCodeSamplePreviewAsyncRequest, + GetCodeSamplePreviewAsyncRequestTypedDict, + GetCodeSamplePreviewAsyncResponse, + GetCodeSamplePreviewAsyncResponseBody, + GetCodeSamplePreviewAsyncResponseBodyTypedDict, + GetCodeSamplePreviewAsyncResponseTypedDict, + ) + from .getcodesamples import ( + GetCodeSamplesRequest, + GetCodeSamplesRequestTypedDict, + GetCodeSamplesResponse, + GetCodeSamplesResponseTypedDict, + MethodPaths, + MethodPathsTypedDict, + ) + from .getgithubaction import ( + GetGitHubActionRequest, + GetGitHubActionRequestTypedDict, + GetGitHubActionResponse, + GetGitHubActionResponseTypedDict, + ) + from .getgithubsetupstate import ( + GetGithubSetupStateRequest, + GetGithubSetupStateRequestTypedDict, + GetGithubSetupStateResponse, + GetGithubSetupStateResponseTypedDict, + ) + from .getlintingreportsignedurl import ( + GetLintingReportSignedURLRequest, + GetLintingReportSignedURLRequestTypedDict, + GetLintingReportSignedURLResponse, + GetLintingReportSignedURLResponseTypedDict, + GetLintingReportSignedURLSignedAccess, + GetLintingReportSignedURLSignedAccessTypedDict, + ) + from .getmanifest import ( + GetManifestRequest, + GetManifestRequestTypedDict, + GetManifestResponse, + GetManifestResponseTypedDict, + ) + from .getnamespaces import GetNamespacesResponse, GetNamespacesResponseTypedDict + from .getorganization import ( + GetOrganizationRequest, + GetOrganizationRequestTypedDict, + GetOrganizationResponse, + GetOrganizationResponseTypedDict, + ) + from .getorganizations import ( + GetOrganizationsResponse, + GetOrganizationsResponseTypedDict, + ) + from .getorganizationusage import ( + GetOrganizationUsageResponse, + GetOrganizationUsageResponseTypedDict, + ) + from .getpublishingtoken import ( + GetPublishingTokenResponse, + GetPublishingTokenResponseTypedDict, + ) + from .getpublishingtokenbyid import ( + GetPublishingTokenByIDRequest, + GetPublishingTokenByIDRequestTypedDict, + GetPublishingTokenByIDResponse, + GetPublishingTokenByIDResponseTypedDict, + ) + from .getpublishingtokenpublicmetadata import ( + GetPublishingTokenPublicMetadataRequest, + GetPublishingTokenPublicMetadataRequestTypedDict, + GetPublishingTokenPublicMetadataResponse, + GetPublishingTokenPublicMetadataResponseBody, + GetPublishingTokenPublicMetadataResponseBodyTypedDict, + GetPublishingTokenPublicMetadataResponseTypedDict, + ) + from .getpublishingtokentargetbyid import ( + GetPublishingTokenTargetByIDRequest, + GetPublishingTokenTargetByIDRequestTypedDict, + GetPublishingTokenTargetByIDResponse, + GetPublishingTokenTargetByIDResponseTypedDict, + ) + from .getrevisions import ( + GetRevisionsRequest, + GetRevisionsRequestTypedDict, + GetRevisionsResponse, + GetRevisionsResponseTypedDict, + ) + from .getschemastoreitem import ( + GetSchemaStoreItemRequestBody, + GetSchemaStoreItemRequestBodyTypedDict, + GetSchemaStoreItemResponse, + GetSchemaStoreItemResponseTypedDict, + ) + from .gettags import ( + GetTagsRequest, + GetTagsRequestTypedDict, + GetTagsResponse, + GetTagsResponseTypedDict, + ) + from .getuser import GetUserResponse, GetUserResponseTypedDict + from .getworkspace import ( + GetWorkspaceGlobals, + GetWorkspaceGlobalsTypedDict, + GetWorkspaceRequest, + GetWorkspaceRequestTypedDict, + GetWorkspaceResponse, + GetWorkspaceResponseTypedDict, + ) + from .getworkspaceaccess import ( + GetWorkspaceAccessRequest, + GetWorkspaceAccessRequestTypedDict, + GetWorkspaceAccessResponse, + GetWorkspaceAccessResponseTypedDict, + ) + from .getworkspacebycontext import ( + GetWorkspaceByContextResponse, + GetWorkspaceByContextResponseTypedDict, + ) + from .getworkspaceeventsbytarget import ( + GetWorkspaceEventsByTargetGlobals, + GetWorkspaceEventsByTargetGlobalsTypedDict, + GetWorkspaceEventsByTargetRequest, + GetWorkspaceEventsByTargetRequestTypedDict, + GetWorkspaceEventsByTargetResponse, + GetWorkspaceEventsByTargetResponseTypedDict, + ) + from .getworkspacefeatureflags import ( + GetWorkspaceFeatureFlagsGlobals, + GetWorkspaceFeatureFlagsGlobalsTypedDict, + GetWorkspaceFeatureFlagsRequest, + GetWorkspaceFeatureFlagsRequestTypedDict, + GetWorkspaceFeatureFlagsResponse, + GetWorkspaceFeatureFlagsResponseTypedDict, + ) + from .getworkspaces import GetWorkspacesResponse, GetWorkspacesResponseTypedDict + from .getworkspacesettings import ( + GetWorkspaceSettingsGlobals, + GetWorkspaceSettingsGlobalsTypedDict, + GetWorkspaceSettingsRequest, + GetWorkspaceSettingsRequestTypedDict, + GetWorkspaceSettingsResponse, + GetWorkspaceSettingsResponseTypedDict, + ) + from .getworkspacetargets import ( + GetWorkspaceTargetsRequest, + GetWorkspaceTargetsRequestTypedDict, + GetWorkspaceTargetsResponse, + GetWorkspaceTargetsResponseTypedDict, + ) + from .getworkspacetargetsdeprecated import ( + GetWorkspaceTargetsDeprecatedGlobals, + GetWorkspaceTargetsDeprecatedGlobalsTypedDict, + GetWorkspaceTargetsDeprecatedRequest, + GetWorkspaceTargetsDeprecatedRequestTypedDict, + GetWorkspaceTargetsDeprecatedResponse, + GetWorkspaceTargetsDeprecatedResponseTypedDict, + ) + from .getworkspaceteam import ( + GetWorkspaceTeamGlobals, + GetWorkspaceTeamGlobalsTypedDict, + GetWorkspaceTeamRequest, + GetWorkspaceTeamRequestTypedDict, + GetWorkspaceTeamResponse, + GetWorkspaceTeamResponseTypedDict, + ) + from .getworkspacetokens import ( + GetWorkspaceTokensGlobals, + GetWorkspaceTokensGlobalsTypedDict, + GetWorkspaceTokensRequest, + GetWorkspaceTokensRequestTypedDict, + GetWorkspaceTokensResponse, + GetWorkspaceTokensResponseTypedDict, + ) + from .githubcheckpublishingprs import ( + GithubCheckPublishingPRsRequest, + GithubCheckPublishingPRsRequestTypedDict, + GithubCheckPublishingPRsResponse, + GithubCheckPublishingPRsResponseTypedDict, + ) + from .githubcheckpublishingsecrets import ( + GithubCheckPublishingSecretsRequest, + GithubCheckPublishingSecretsRequestTypedDict, + GithubCheckPublishingSecretsResponse, + GithubCheckPublishingSecretsResponseTypedDict, + ) + from .githubconfigurecodesamples import ( + GithubConfigureCodeSamplesResponse, + GithubConfigureCodeSamplesResponseTypedDict, + ) + from .githubconfiguremintlifyrepo import ( + GithubConfigureMintlifyRepoResponse, + GithubConfigureMintlifyRepoResponseTypedDict, + ) + from .githubconfiguretarget import ( + GithubConfigureTargetResponse, + GithubConfigureTargetResponseTypedDict, + ) + from .githubstorepublishingsecrets import ( + GithubStorePublishingSecretsResponse, + GithubStorePublishingSecretsResponseTypedDict, + ) + from .githubtriggeraction import ( + GithubTriggerActionResponse, + GithubTriggerActionResponseTypedDict, + ) + from .grantuseraccesstoworkspace import ( + GrantUserAccessToWorkspaceGlobals, + GrantUserAccessToWorkspaceGlobalsTypedDict, + GrantUserAccessToWorkspaceRequest, + GrantUserAccessToWorkspaceRequestTypedDict, + GrantUserAccessToWorkspaceResponse, + GrantUserAccessToWorkspaceResponseTypedDict, + ) + from .ignoresubscriptionnamespace import ( + IgnoreSubscriptionNamespaceRequest, + IgnoreSubscriptionNamespaceRequestTypedDict, + IgnoreSubscriptionNamespaceResponse, + IgnoreSubscriptionNamespaceResponseTypedDict, + ) + from .linkgithubaccess import ( + LinkGithubAccessRequest, + LinkGithubAccessRequestTypedDict, + LinkGithubAccessResponse, + LinkGithubAccessResponseTypedDict, + ) + from .listremotesources import ( + ListRemoteSourcesRequest, + ListRemoteSourcesRequestTypedDict, + ListRemoteSourcesResponse, + ListRemoteSourcesResponseTypedDict, + ) + from .posttags import ( + PostTagsRequest, + PostTagsRequestTypedDict, + PostTagsResponse, + PostTagsResponseTypedDict, + ) + from .postworkspaceevents import ( + PostWorkspaceEventsGlobals, + PostWorkspaceEventsGlobalsTypedDict, + PostWorkspaceEventsRequest, + PostWorkspaceEventsRequestTypedDict, + PostWorkspaceEventsResponse, + PostWorkspaceEventsResponseTypedDict, + ) + from .preflight import PreflightResponse, PreflightResponseTypedDict + from .revokeuseraccesstoworkspace import ( + RevokeUserAccessToWorkspaceGlobals, + RevokeUserAccessToWorkspaceGlobalsTypedDict, + RevokeUserAccessToWorkspaceRequest, + RevokeUserAccessToWorkspaceRequestTypedDict, + RevokeUserAccessToWorkspaceResponse, + RevokeUserAccessToWorkspaceResponseTypedDict, + ) + from .searchworkspaceevents import ( + SearchWorkspaceEventsGlobals, + SearchWorkspaceEventsGlobalsTypedDict, + SearchWorkspaceEventsRequest, + SearchWorkspaceEventsRequestTypedDict, + SearchWorkspaceEventsResponse, + SearchWorkspaceEventsResponseTypedDict, + ) + from .setvisibility import ( + SetVisibilityRequest, + SetVisibilityRequestBody, + SetVisibilityRequestBodyTypedDict, + SetVisibilityRequestTypedDict, + SetVisibilityResponse, + SetVisibilityResponseTypedDict, + ) + from .setworkspacefeatureflags import ( + SetWorkspaceFeatureFlagsResponse, + SetWorkspaceFeatureFlagsResponseTypedDict, + ) + from .suggest import ( + SuggestRequest, + SuggestRequestTypedDict, + SuggestResponse, + SuggestResponseTypedDict, + ) + from .suggestitems import SuggestItemsResponse, SuggestItemsResponseTypedDict + from .suggestopenapi import ( + Schema, + SchemaTypedDict, + SuggestOpenAPIRequest, + SuggestOpenAPIRequestBody, + SuggestOpenAPIRequestBodyTypedDict, + SuggestOpenAPIRequestTypedDict, + SuggestOpenAPIResponse, + SuggestOpenAPIResponseTypedDict, + ) + from .suggestopenapiregistry import ( + SuggestOpenAPIRegistryRequest, + SuggestOpenAPIRegistryRequestTypedDict, + SuggestOpenAPIRegistryResponse, + SuggestOpenAPIRegistryResponseTypedDict, + ) + from .updatepublishingtokenexpiration import ( + UpdatePublishingTokenExpirationRequest, + UpdatePublishingTokenExpirationRequestBody, + UpdatePublishingTokenExpirationRequestBodyTypedDict, + UpdatePublishingTokenExpirationRequestTypedDict, + UpdatePublishingTokenExpirationResponse, + UpdatePublishingTokenExpirationResponseTypedDict, + ) + from .updateworkspacedetails import ( + UpdateWorkspaceDetailsGlobals, + UpdateWorkspaceDetailsGlobalsTypedDict, + UpdateWorkspaceDetailsRequest, + UpdateWorkspaceDetailsRequestTypedDict, + UpdateWorkspaceDetailsResponse, + UpdateWorkspaceDetailsResponseTypedDict, + ) + from .updateworkspacesettings import ( + UpdateWorkspaceSettingsGlobals, + UpdateWorkspaceSettingsGlobalsTypedDict, + UpdateWorkspaceSettingsRequest, + UpdateWorkspaceSettingsRequestTypedDict, + UpdateWorkspaceSettingsResponse, + UpdateWorkspaceSettingsResponseTypedDict, + ) + from .uploadreport import ( + File, + FileTypedDict, + UploadReportRequestBody, + UploadReportRequestBodyTypedDict, + UploadReportResponse, + UploadReportResponseTypedDict, + UploadReportUploadedReport, + UploadReportUploadedReportTypedDict, + ) + from .validateapikey import ValidateAPIKeyResponse, ValidateAPIKeyResponseTypedDict __all__ = [ "ActivateSubscriptionNamespaceRequest", "ActivateSubscriptionNamespaceRequestTypedDict", "ActivateSubscriptionNamespaceResponse", "ActivateSubscriptionNamespaceResponseTypedDict", + "ArchiveNamespaceRequest", + "ArchiveNamespaceRequestBody", + "ArchiveNamespaceRequestBodyTypedDict", + "ArchiveNamespaceRequestTypedDict", + "ArchiveNamespaceResponse", + "ArchiveNamespaceResponseTypedDict", "CheckGithubAccessRequest", "CheckGithubAccessRequestTypedDict", "CheckGithubAccessResponse", "CheckGithubAccessResponseTypedDict", + "CreateBillingAddOnsResponse", + "CreateBillingAddOnsResponseTypedDict", "CreateFreeTrialResponse", "CreateFreeTrialResponseTypedDict", "CreateOrganizationResponse", "CreateOrganizationResponseTypedDict", + "CreatePublishingTokenRequestBody", + "CreatePublishingTokenRequestBodyTypedDict", + "CreatePublishingTokenResponse", + "CreatePublishingTokenResponseTypedDict", "CreateRemoteSourceResponse", "CreateRemoteSourceResponseTypedDict", "CreateRequestBody", "CreateRequestBodyTypedDict", "CreateResponse", "CreateResponseTypedDict", + "CreateSchemaStoreItemRequestBody", + "CreateSchemaStoreItemRequestBodyTypedDict", + "CreateSchemaStoreItemResponse", + "CreateSchemaStoreItemResponseTypedDict", "CreateWorkspaceResponse", "CreateWorkspaceResponseTypedDict", "CreateWorkspaceTokenGlobals", @@ -390,6 +501,14 @@ "CreateWorkspaceTokenRequestTypedDict", "CreateWorkspaceTokenResponse", "CreateWorkspaceTokenResponseTypedDict", + "DeleteBillingAddOnRequest", + "DeleteBillingAddOnRequestTypedDict", + "DeleteBillingAddOnResponse", + "DeleteBillingAddOnResponseTypedDict", + "DeletePublishingTokenRequest", + "DeletePublishingTokenRequestTypedDict", + "DeletePublishingTokenResponse", + "DeletePublishingTokenResponseTypedDict", "DeleteWorkspaceTokenGlobals", "DeleteWorkspaceTokenGlobalsTypedDict", "DeleteWorkspaceTokenRequest", @@ -398,6 +517,7 @@ "DeleteWorkspaceTokenResponseTypedDict", "File", "FileTypedDict", + "Format", "GenerateCodeSamplePreviewAsyncResponse", "GenerateCodeSamplePreviewAsyncResponseBody", "GenerateCodeSamplePreviewAsyncResponseBodyTypedDict", @@ -408,6 +528,8 @@ "GetAccessTokenRequestTypedDict", "GetAccessTokenResponse", "GetAccessTokenResponseTypedDict", + "GetBillingAddOnsResponse", + "GetBillingAddOnsResponseTypedDict", "GetBlobRequest", "GetBlobRequestTypedDict", "GetBlobResponse", @@ -456,10 +578,30 @@ "GetOrganizationUsageResponseTypedDict", "GetOrganizationsResponse", "GetOrganizationsResponseTypedDict", + "GetPublishingTokenByIDRequest", + "GetPublishingTokenByIDRequestTypedDict", + "GetPublishingTokenByIDResponse", + "GetPublishingTokenByIDResponseTypedDict", + "GetPublishingTokenPublicMetadataRequest", + "GetPublishingTokenPublicMetadataRequestTypedDict", + "GetPublishingTokenPublicMetadataResponse", + "GetPublishingTokenPublicMetadataResponseBody", + "GetPublishingTokenPublicMetadataResponseBodyTypedDict", + "GetPublishingTokenPublicMetadataResponseTypedDict", + "GetPublishingTokenResponse", + "GetPublishingTokenResponseTypedDict", + "GetPublishingTokenTargetByIDRequest", + "GetPublishingTokenTargetByIDRequestTypedDict", + "GetPublishingTokenTargetByIDResponse", + "GetPublishingTokenTargetByIDResponseTypedDict", "GetRevisionsRequest", "GetRevisionsRequestTypedDict", "GetRevisionsResponse", "GetRevisionsResponseTypedDict", + "GetSchemaStoreItemRequestBody", + "GetSchemaStoreItemRequestBodyTypedDict", + "GetSchemaStoreItemResponse", + "GetSchemaStoreItemResponseTypedDict", "GetTagsRequest", "GetTagsRequestTypedDict", "GetTagsResponse", @@ -556,6 +698,8 @@ "ListRemoteSourcesRequestTypedDict", "ListRemoteSourcesResponse", "ListRemoteSourcesResponseTypedDict", + "MethodPaths", + "MethodPathsTypedDict", "PostTagsRequest", "PostTagsRequestTypedDict", "PostTagsResponse", @@ -588,6 +732,8 @@ "SetVisibilityRequestTypedDict", "SetVisibilityResponse", "SetVisibilityResponseTypedDict", + "SetWorkspaceFeatureFlagsResponse", + "SetWorkspaceFeatureFlagsResponseTypedDict", "SuggestItemsResponse", "SuggestItemsResponseTypedDict", "SuggestOpenAPIRegistryRequest", @@ -604,6 +750,12 @@ "SuggestRequestTypedDict", "SuggestResponse", "SuggestResponseTypedDict", + "UpdatePublishingTokenExpirationRequest", + "UpdatePublishingTokenExpirationRequestBody", + "UpdatePublishingTokenExpirationRequestBodyTypedDict", + "UpdatePublishingTokenExpirationRequestTypedDict", + "UpdatePublishingTokenExpirationResponse", + "UpdatePublishingTokenExpirationResponseTypedDict", "UpdateWorkspaceDetailsGlobals", "UpdateWorkspaceDetailsGlobalsTypedDict", "UpdateWorkspaceDetailsRequest", @@ -625,3 +777,349 @@ "ValidateAPIKeyResponse", "ValidateAPIKeyResponseTypedDict", ] + +_dynamic_imports: dict[str, str] = { + "ActivateSubscriptionNamespaceRequest": ".activatesubscriptionnamespace", + "ActivateSubscriptionNamespaceRequestTypedDict": ".activatesubscriptionnamespace", + "ActivateSubscriptionNamespaceResponse": ".activatesubscriptionnamespace", + "ActivateSubscriptionNamespaceResponseTypedDict": ".activatesubscriptionnamespace", + "ArchiveNamespaceRequest": ".archivenamespace", + "ArchiveNamespaceRequestBody": ".archivenamespace", + "ArchiveNamespaceRequestBodyTypedDict": ".archivenamespace", + "ArchiveNamespaceRequestTypedDict": ".archivenamespace", + "ArchiveNamespaceResponse": ".archivenamespace", + "ArchiveNamespaceResponseTypedDict": ".archivenamespace", + "CheckGithubAccessRequest": ".checkgithubaccess", + "CheckGithubAccessRequestTypedDict": ".checkgithubaccess", + "CheckGithubAccessResponse": ".checkgithubaccess", + "CheckGithubAccessResponseTypedDict": ".checkgithubaccess", + "CreateRequestBody": ".create", + "CreateRequestBodyTypedDict": ".create", + "CreateResponse": ".create", + "CreateResponseTypedDict": ".create", + "CreateBillingAddOnsResponse": ".createbillingaddons", + "CreateBillingAddOnsResponseTypedDict": ".createbillingaddons", + "CreateFreeTrialResponse": ".createfreetrial", + "CreateFreeTrialResponseTypedDict": ".createfreetrial", + "CreateOrganizationResponse": ".createorganization", + "CreateOrganizationResponseTypedDict": ".createorganization", + "CreatePublishingTokenRequestBody": ".createpublishingtoken", + "CreatePublishingTokenRequestBodyTypedDict": ".createpublishingtoken", + "CreatePublishingTokenResponse": ".createpublishingtoken", + "CreatePublishingTokenResponseTypedDict": ".createpublishingtoken", + "CreateRemoteSourceResponse": ".createremotesource", + "CreateRemoteSourceResponseTypedDict": ".createremotesource", + "CreateSchemaStoreItemRequestBody": ".createschemastoreitem", + "CreateSchemaStoreItemRequestBodyTypedDict": ".createschemastoreitem", + "CreateSchemaStoreItemResponse": ".createschemastoreitem", + "CreateSchemaStoreItemResponseTypedDict": ".createschemastoreitem", + "Format": ".createschemastoreitem", + "CreateWorkspaceResponse": ".createworkspace", + "CreateWorkspaceResponseTypedDict": ".createworkspace", + "CreateWorkspaceTokenGlobals": ".createworkspacetoken", + "CreateWorkspaceTokenGlobalsTypedDict": ".createworkspacetoken", + "CreateWorkspaceTokenRequest": ".createworkspacetoken", + "CreateWorkspaceTokenRequestTypedDict": ".createworkspacetoken", + "CreateWorkspaceTokenResponse": ".createworkspacetoken", + "CreateWorkspaceTokenResponseTypedDict": ".createworkspacetoken", + "DeleteBillingAddOnRequest": ".deletebillingaddon", + "DeleteBillingAddOnRequestTypedDict": ".deletebillingaddon", + "DeleteBillingAddOnResponse": ".deletebillingaddon", + "DeleteBillingAddOnResponseTypedDict": ".deletebillingaddon", + "DeletePublishingTokenRequest": ".deletepublishingtoken", + "DeletePublishingTokenRequestTypedDict": ".deletepublishingtoken", + "DeletePublishingTokenResponse": ".deletepublishingtoken", + "DeletePublishingTokenResponseTypedDict": ".deletepublishingtoken", + "DeleteWorkspaceTokenGlobals": ".deleteworkspacetoken", + "DeleteWorkspaceTokenGlobalsTypedDict": ".deleteworkspacetoken", + "DeleteWorkspaceTokenRequest": ".deleteworkspacetoken", + "DeleteWorkspaceTokenRequestTypedDict": ".deleteworkspacetoken", + "DeleteWorkspaceTokenResponse": ".deleteworkspacetoken", + "DeleteWorkspaceTokenResponseTypedDict": ".deleteworkspacetoken", + "GenerateCodeSamplePreviewResponse": ".generatecodesamplepreview", + "GenerateCodeSamplePreviewResponseTypedDict": ".generatecodesamplepreview", + "GenerateCodeSamplePreviewAsyncResponse": ".generatecodesamplepreviewasync", + "GenerateCodeSamplePreviewAsyncResponseBody": ".generatecodesamplepreviewasync", + "GenerateCodeSamplePreviewAsyncResponseBodyTypedDict": ".generatecodesamplepreviewasync", + "GenerateCodeSamplePreviewAsyncResponseTypedDict": ".generatecodesamplepreviewasync", + "GetAccessTokenRequest": ".getaccesstoken", + "GetAccessTokenRequestTypedDict": ".getaccesstoken", + "GetAccessTokenResponse": ".getaccesstoken", + "GetAccessTokenResponseTypedDict": ".getaccesstoken", + "GetBillingAddOnsResponse": ".getbillingaddons", + "GetBillingAddOnsResponseTypedDict": ".getbillingaddons", + "GetBlobRequest": ".getblob", + "GetBlobRequestTypedDict": ".getblob", + "GetBlobResponse": ".getblob", + "GetBlobResponseTypedDict": ".getblob", + "GetChangesReportSignedURLRequest": ".getchangesreportsignedurl", + "GetChangesReportSignedURLRequestTypedDict": ".getchangesreportsignedurl", + "GetChangesReportSignedURLResponse": ".getchangesreportsignedurl", + "GetChangesReportSignedURLResponseTypedDict": ".getchangesreportsignedurl", + "GetChangesReportSignedURLSignedAccess": ".getchangesreportsignedurl", + "GetChangesReportSignedURLSignedAccessTypedDict": ".getchangesreportsignedurl", + "GetCodeSamplePreviewAsyncRequest": ".getcodesamplepreviewasync", + "GetCodeSamplePreviewAsyncRequestTypedDict": ".getcodesamplepreviewasync", + "GetCodeSamplePreviewAsyncResponse": ".getcodesamplepreviewasync", + "GetCodeSamplePreviewAsyncResponseBody": ".getcodesamplepreviewasync", + "GetCodeSamplePreviewAsyncResponseBodyTypedDict": ".getcodesamplepreviewasync", + "GetCodeSamplePreviewAsyncResponseTypedDict": ".getcodesamplepreviewasync", + "GetCodeSamplesRequest": ".getcodesamples", + "GetCodeSamplesRequestTypedDict": ".getcodesamples", + "GetCodeSamplesResponse": ".getcodesamples", + "GetCodeSamplesResponseTypedDict": ".getcodesamples", + "MethodPaths": ".getcodesamples", + "MethodPathsTypedDict": ".getcodesamples", + "GetGitHubActionRequest": ".getgithubaction", + "GetGitHubActionRequestTypedDict": ".getgithubaction", + "GetGitHubActionResponse": ".getgithubaction", + "GetGitHubActionResponseTypedDict": ".getgithubaction", + "GetGithubSetupStateRequest": ".getgithubsetupstate", + "GetGithubSetupStateRequestTypedDict": ".getgithubsetupstate", + "GetGithubSetupStateResponse": ".getgithubsetupstate", + "GetGithubSetupStateResponseTypedDict": ".getgithubsetupstate", + "GetLintingReportSignedURLRequest": ".getlintingreportsignedurl", + "GetLintingReportSignedURLRequestTypedDict": ".getlintingreportsignedurl", + "GetLintingReportSignedURLResponse": ".getlintingreportsignedurl", + "GetLintingReportSignedURLResponseTypedDict": ".getlintingreportsignedurl", + "GetLintingReportSignedURLSignedAccess": ".getlintingreportsignedurl", + "GetLintingReportSignedURLSignedAccessTypedDict": ".getlintingreportsignedurl", + "GetManifestRequest": ".getmanifest", + "GetManifestRequestTypedDict": ".getmanifest", + "GetManifestResponse": ".getmanifest", + "GetManifestResponseTypedDict": ".getmanifest", + "GetNamespacesResponse": ".getnamespaces", + "GetNamespacesResponseTypedDict": ".getnamespaces", + "GetOrganizationRequest": ".getorganization", + "GetOrganizationRequestTypedDict": ".getorganization", + "GetOrganizationResponse": ".getorganization", + "GetOrganizationResponseTypedDict": ".getorganization", + "GetOrganizationsResponse": ".getorganizations", + "GetOrganizationsResponseTypedDict": ".getorganizations", + "GetOrganizationUsageResponse": ".getorganizationusage", + "GetOrganizationUsageResponseTypedDict": ".getorganizationusage", + "GetPublishingTokenResponse": ".getpublishingtoken", + "GetPublishingTokenResponseTypedDict": ".getpublishingtoken", + "GetPublishingTokenByIDRequest": ".getpublishingtokenbyid", + "GetPublishingTokenByIDRequestTypedDict": ".getpublishingtokenbyid", + "GetPublishingTokenByIDResponse": ".getpublishingtokenbyid", + "GetPublishingTokenByIDResponseTypedDict": ".getpublishingtokenbyid", + "GetPublishingTokenPublicMetadataRequest": ".getpublishingtokenpublicmetadata", + "GetPublishingTokenPublicMetadataRequestTypedDict": ".getpublishingtokenpublicmetadata", + "GetPublishingTokenPublicMetadataResponse": ".getpublishingtokenpublicmetadata", + "GetPublishingTokenPublicMetadataResponseBody": ".getpublishingtokenpublicmetadata", + "GetPublishingTokenPublicMetadataResponseBodyTypedDict": ".getpublishingtokenpublicmetadata", + "GetPublishingTokenPublicMetadataResponseTypedDict": ".getpublishingtokenpublicmetadata", + "GetPublishingTokenTargetByIDRequest": ".getpublishingtokentargetbyid", + "GetPublishingTokenTargetByIDRequestTypedDict": ".getpublishingtokentargetbyid", + "GetPublishingTokenTargetByIDResponse": ".getpublishingtokentargetbyid", + "GetPublishingTokenTargetByIDResponseTypedDict": ".getpublishingtokentargetbyid", + "GetRevisionsRequest": ".getrevisions", + "GetRevisionsRequestTypedDict": ".getrevisions", + "GetRevisionsResponse": ".getrevisions", + "GetRevisionsResponseTypedDict": ".getrevisions", + "GetSchemaStoreItemRequestBody": ".getschemastoreitem", + "GetSchemaStoreItemRequestBodyTypedDict": ".getschemastoreitem", + "GetSchemaStoreItemResponse": ".getschemastoreitem", + "GetSchemaStoreItemResponseTypedDict": ".getschemastoreitem", + "GetTagsRequest": ".gettags", + "GetTagsRequestTypedDict": ".gettags", + "GetTagsResponse": ".gettags", + "GetTagsResponseTypedDict": ".gettags", + "GetUserResponse": ".getuser", + "GetUserResponseTypedDict": ".getuser", + "GetWorkspaceGlobals": ".getworkspace", + "GetWorkspaceGlobalsTypedDict": ".getworkspace", + "GetWorkspaceRequest": ".getworkspace", + "GetWorkspaceRequestTypedDict": ".getworkspace", + "GetWorkspaceResponse": ".getworkspace", + "GetWorkspaceResponseTypedDict": ".getworkspace", + "GetWorkspaceAccessRequest": ".getworkspaceaccess", + "GetWorkspaceAccessRequestTypedDict": ".getworkspaceaccess", + "GetWorkspaceAccessResponse": ".getworkspaceaccess", + "GetWorkspaceAccessResponseTypedDict": ".getworkspaceaccess", + "GetWorkspaceByContextResponse": ".getworkspacebycontext", + "GetWorkspaceByContextResponseTypedDict": ".getworkspacebycontext", + "GetWorkspaceEventsByTargetGlobals": ".getworkspaceeventsbytarget", + "GetWorkspaceEventsByTargetGlobalsTypedDict": ".getworkspaceeventsbytarget", + "GetWorkspaceEventsByTargetRequest": ".getworkspaceeventsbytarget", + "GetWorkspaceEventsByTargetRequestTypedDict": ".getworkspaceeventsbytarget", + "GetWorkspaceEventsByTargetResponse": ".getworkspaceeventsbytarget", + "GetWorkspaceEventsByTargetResponseTypedDict": ".getworkspaceeventsbytarget", + "GetWorkspaceFeatureFlagsGlobals": ".getworkspacefeatureflags", + "GetWorkspaceFeatureFlagsGlobalsTypedDict": ".getworkspacefeatureflags", + "GetWorkspaceFeatureFlagsRequest": ".getworkspacefeatureflags", + "GetWorkspaceFeatureFlagsRequestTypedDict": ".getworkspacefeatureflags", + "GetWorkspaceFeatureFlagsResponse": ".getworkspacefeatureflags", + "GetWorkspaceFeatureFlagsResponseTypedDict": ".getworkspacefeatureflags", + "GetWorkspacesResponse": ".getworkspaces", + "GetWorkspacesResponseTypedDict": ".getworkspaces", + "GetWorkspaceSettingsGlobals": ".getworkspacesettings", + "GetWorkspaceSettingsGlobalsTypedDict": ".getworkspacesettings", + "GetWorkspaceSettingsRequest": ".getworkspacesettings", + "GetWorkspaceSettingsRequestTypedDict": ".getworkspacesettings", + "GetWorkspaceSettingsResponse": ".getworkspacesettings", + "GetWorkspaceSettingsResponseTypedDict": ".getworkspacesettings", + "GetWorkspaceTargetsRequest": ".getworkspacetargets", + "GetWorkspaceTargetsRequestTypedDict": ".getworkspacetargets", + "GetWorkspaceTargetsResponse": ".getworkspacetargets", + "GetWorkspaceTargetsResponseTypedDict": ".getworkspacetargets", + "GetWorkspaceTargetsDeprecatedGlobals": ".getworkspacetargetsdeprecated", + "GetWorkspaceTargetsDeprecatedGlobalsTypedDict": ".getworkspacetargetsdeprecated", + "GetWorkspaceTargetsDeprecatedRequest": ".getworkspacetargetsdeprecated", + "GetWorkspaceTargetsDeprecatedRequestTypedDict": ".getworkspacetargetsdeprecated", + "GetWorkspaceTargetsDeprecatedResponse": ".getworkspacetargetsdeprecated", + "GetWorkspaceTargetsDeprecatedResponseTypedDict": ".getworkspacetargetsdeprecated", + "GetWorkspaceTeamGlobals": ".getworkspaceteam", + "GetWorkspaceTeamGlobalsTypedDict": ".getworkspaceteam", + "GetWorkspaceTeamRequest": ".getworkspaceteam", + "GetWorkspaceTeamRequestTypedDict": ".getworkspaceteam", + "GetWorkspaceTeamResponse": ".getworkspaceteam", + "GetWorkspaceTeamResponseTypedDict": ".getworkspaceteam", + "GetWorkspaceTokensGlobals": ".getworkspacetokens", + "GetWorkspaceTokensGlobalsTypedDict": ".getworkspacetokens", + "GetWorkspaceTokensRequest": ".getworkspacetokens", + "GetWorkspaceTokensRequestTypedDict": ".getworkspacetokens", + "GetWorkspaceTokensResponse": ".getworkspacetokens", + "GetWorkspaceTokensResponseTypedDict": ".getworkspacetokens", + "GithubCheckPublishingPRsRequest": ".githubcheckpublishingprs", + "GithubCheckPublishingPRsRequestTypedDict": ".githubcheckpublishingprs", + "GithubCheckPublishingPRsResponse": ".githubcheckpublishingprs", + "GithubCheckPublishingPRsResponseTypedDict": ".githubcheckpublishingprs", + "GithubCheckPublishingSecretsRequest": ".githubcheckpublishingsecrets", + "GithubCheckPublishingSecretsRequestTypedDict": ".githubcheckpublishingsecrets", + "GithubCheckPublishingSecretsResponse": ".githubcheckpublishingsecrets", + "GithubCheckPublishingSecretsResponseTypedDict": ".githubcheckpublishingsecrets", + "GithubConfigureCodeSamplesResponse": ".githubconfigurecodesamples", + "GithubConfigureCodeSamplesResponseTypedDict": ".githubconfigurecodesamples", + "GithubConfigureMintlifyRepoResponse": ".githubconfiguremintlifyrepo", + "GithubConfigureMintlifyRepoResponseTypedDict": ".githubconfiguremintlifyrepo", + "GithubConfigureTargetResponse": ".githubconfiguretarget", + "GithubConfigureTargetResponseTypedDict": ".githubconfiguretarget", + "GithubStorePublishingSecretsResponse": ".githubstorepublishingsecrets", + "GithubStorePublishingSecretsResponseTypedDict": ".githubstorepublishingsecrets", + "GithubTriggerActionResponse": ".githubtriggeraction", + "GithubTriggerActionResponseTypedDict": ".githubtriggeraction", + "GrantUserAccessToWorkspaceGlobals": ".grantuseraccesstoworkspace", + "GrantUserAccessToWorkspaceGlobalsTypedDict": ".grantuseraccesstoworkspace", + "GrantUserAccessToWorkspaceRequest": ".grantuseraccesstoworkspace", + "GrantUserAccessToWorkspaceRequestTypedDict": ".grantuseraccesstoworkspace", + "GrantUserAccessToWorkspaceResponse": ".grantuseraccesstoworkspace", + "GrantUserAccessToWorkspaceResponseTypedDict": ".grantuseraccesstoworkspace", + "IgnoreSubscriptionNamespaceRequest": ".ignoresubscriptionnamespace", + "IgnoreSubscriptionNamespaceRequestTypedDict": ".ignoresubscriptionnamespace", + "IgnoreSubscriptionNamespaceResponse": ".ignoresubscriptionnamespace", + "IgnoreSubscriptionNamespaceResponseTypedDict": ".ignoresubscriptionnamespace", + "LinkGithubAccessRequest": ".linkgithubaccess", + "LinkGithubAccessRequestTypedDict": ".linkgithubaccess", + "LinkGithubAccessResponse": ".linkgithubaccess", + "LinkGithubAccessResponseTypedDict": ".linkgithubaccess", + "ListRemoteSourcesRequest": ".listremotesources", + "ListRemoteSourcesRequestTypedDict": ".listremotesources", + "ListRemoteSourcesResponse": ".listremotesources", + "ListRemoteSourcesResponseTypedDict": ".listremotesources", + "PostTagsRequest": ".posttags", + "PostTagsRequestTypedDict": ".posttags", + "PostTagsResponse": ".posttags", + "PostTagsResponseTypedDict": ".posttags", + "PostWorkspaceEventsGlobals": ".postworkspaceevents", + "PostWorkspaceEventsGlobalsTypedDict": ".postworkspaceevents", + "PostWorkspaceEventsRequest": ".postworkspaceevents", + "PostWorkspaceEventsRequestTypedDict": ".postworkspaceevents", + "PostWorkspaceEventsResponse": ".postworkspaceevents", + "PostWorkspaceEventsResponseTypedDict": ".postworkspaceevents", + "PreflightResponse": ".preflight", + "PreflightResponseTypedDict": ".preflight", + "RevokeUserAccessToWorkspaceGlobals": ".revokeuseraccesstoworkspace", + "RevokeUserAccessToWorkspaceGlobalsTypedDict": ".revokeuseraccesstoworkspace", + "RevokeUserAccessToWorkspaceRequest": ".revokeuseraccesstoworkspace", + "RevokeUserAccessToWorkspaceRequestTypedDict": ".revokeuseraccesstoworkspace", + "RevokeUserAccessToWorkspaceResponse": ".revokeuseraccesstoworkspace", + "RevokeUserAccessToWorkspaceResponseTypedDict": ".revokeuseraccesstoworkspace", + "SearchWorkspaceEventsGlobals": ".searchworkspaceevents", + "SearchWorkspaceEventsGlobalsTypedDict": ".searchworkspaceevents", + "SearchWorkspaceEventsRequest": ".searchworkspaceevents", + "SearchWorkspaceEventsRequestTypedDict": ".searchworkspaceevents", + "SearchWorkspaceEventsResponse": ".searchworkspaceevents", + "SearchWorkspaceEventsResponseTypedDict": ".searchworkspaceevents", + "SetVisibilityRequest": ".setvisibility", + "SetVisibilityRequestBody": ".setvisibility", + "SetVisibilityRequestBodyTypedDict": ".setvisibility", + "SetVisibilityRequestTypedDict": ".setvisibility", + "SetVisibilityResponse": ".setvisibility", + "SetVisibilityResponseTypedDict": ".setvisibility", + "SetWorkspaceFeatureFlagsResponse": ".setworkspacefeatureflags", + "SetWorkspaceFeatureFlagsResponseTypedDict": ".setworkspacefeatureflags", + "SuggestRequest": ".suggest", + "SuggestRequestTypedDict": ".suggest", + "SuggestResponse": ".suggest", + "SuggestResponseTypedDict": ".suggest", + "SuggestItemsResponse": ".suggestitems", + "SuggestItemsResponseTypedDict": ".suggestitems", + "Schema": ".suggestopenapi", + "SchemaTypedDict": ".suggestopenapi", + "SuggestOpenAPIRequest": ".suggestopenapi", + "SuggestOpenAPIRequestBody": ".suggestopenapi", + "SuggestOpenAPIRequestBodyTypedDict": ".suggestopenapi", + "SuggestOpenAPIRequestTypedDict": ".suggestopenapi", + "SuggestOpenAPIResponse": ".suggestopenapi", + "SuggestOpenAPIResponseTypedDict": ".suggestopenapi", + "SuggestOpenAPIRegistryRequest": ".suggestopenapiregistry", + "SuggestOpenAPIRegistryRequestTypedDict": ".suggestopenapiregistry", + "SuggestOpenAPIRegistryResponse": ".suggestopenapiregistry", + "SuggestOpenAPIRegistryResponseTypedDict": ".suggestopenapiregistry", + "UpdatePublishingTokenExpirationRequest": ".updatepublishingtokenexpiration", + "UpdatePublishingTokenExpirationRequestBody": ".updatepublishingtokenexpiration", + "UpdatePublishingTokenExpirationRequestBodyTypedDict": ".updatepublishingtokenexpiration", + "UpdatePublishingTokenExpirationRequestTypedDict": ".updatepublishingtokenexpiration", + "UpdatePublishingTokenExpirationResponse": ".updatepublishingtokenexpiration", + "UpdatePublishingTokenExpirationResponseTypedDict": ".updatepublishingtokenexpiration", + "UpdateWorkspaceDetailsGlobals": ".updateworkspacedetails", + "UpdateWorkspaceDetailsGlobalsTypedDict": ".updateworkspacedetails", + "UpdateWorkspaceDetailsRequest": ".updateworkspacedetails", + "UpdateWorkspaceDetailsRequestTypedDict": ".updateworkspacedetails", + "UpdateWorkspaceDetailsResponse": ".updateworkspacedetails", + "UpdateWorkspaceDetailsResponseTypedDict": ".updateworkspacedetails", + "UpdateWorkspaceSettingsGlobals": ".updateworkspacesettings", + "UpdateWorkspaceSettingsGlobalsTypedDict": ".updateworkspacesettings", + "UpdateWorkspaceSettingsRequest": ".updateworkspacesettings", + "UpdateWorkspaceSettingsRequestTypedDict": ".updateworkspacesettings", + "UpdateWorkspaceSettingsResponse": ".updateworkspacesettings", + "UpdateWorkspaceSettingsResponseTypedDict": ".updateworkspacesettings", + "File": ".uploadreport", + "FileTypedDict": ".uploadreport", + "UploadReportRequestBody": ".uploadreport", + "UploadReportRequestBodyTypedDict": ".uploadreport", + "UploadReportResponse": ".uploadreport", + "UploadReportResponseTypedDict": ".uploadreport", + "UploadReportUploadedReport": ".uploadreport", + "UploadReportUploadedReportTypedDict": ".uploadreport", + "ValidateAPIKeyResponse": ".validateapikey", + "ValidateAPIKeyResponseTypedDict": ".validateapikey", +} + + +def __getattr__(attr_name: str) -> object: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError( + f"No {attr_name} found in _dynamic_imports for module name -> {__name__} " + ) + + try: + module = import_module(module_name, __package__) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError( + f"Failed to import {attr_name} from {module_name}: {e}" + ) from e + except AttributeError as e: + raise AttributeError( + f"Failed to get {attr_name} from {module_name}: {e}" + ) from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) diff --git a/src/speakeasy_client_sdk_python/models/operations/archivenamespace.py b/src/speakeasy_client_sdk_python/models/operations/archivenamespace.py new file mode 100644 index 00000000..6e72af8b --- /dev/null +++ b/src/speakeasy_client_sdk_python/models/operations/archivenamespace.py @@ -0,0 +1,62 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +import httpx +from speakeasy_client_sdk_python.types import BaseModel +from speakeasy_client_sdk_python.utils import ( + FieldMetadata, + PathParamMetadata, + RequestMetadata, +) +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ArchiveNamespaceRequestBodyTypedDict(TypedDict): + r"""Archived status""" + + archived: NotRequired[bool] + + +class ArchiveNamespaceRequestBody(BaseModel): + r"""Archived status""" + + archived: Optional[bool] = True + + +class ArchiveNamespaceRequestTypedDict(TypedDict): + namespace_name: str + request_body: NotRequired[ArchiveNamespaceRequestBodyTypedDict] + r"""Archived status""" + + +class ArchiveNamespaceRequest(BaseModel): + namespace_name: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + request_body: Annotated[ + Optional[ArchiveNamespaceRequestBody], + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] = None + r"""Archived status""" + + +class ArchiveNamespaceResponseTypedDict(TypedDict): + content_type: str + r"""HTTP response content type for this operation""" + status_code: int + r"""HTTP response status code for this operation""" + raw_response: httpx.Response + r"""Raw HTTP response; suitable for custom response parsing""" + + +class ArchiveNamespaceResponse(BaseModel): + content_type: str + r"""HTTP response content type for this operation""" + + status_code: int + r"""HTTP response status code for this operation""" + + raw_response: httpx.Response + r"""Raw HTTP response; suitable for custom response parsing""" diff --git a/src/speakeasy_client_sdk_python/models/operations/createbillingaddons.py b/src/speakeasy_client_sdk_python/models/operations/createbillingaddons.py new file mode 100644 index 00000000..f6cfd43a --- /dev/null +++ b/src/speakeasy_client_sdk_python/models/operations/createbillingaddons.py @@ -0,0 +1,39 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +import httpx +from speakeasy_client_sdk_python.models.shared import ( + organizationbillingaddonresponse as shared_organizationbillingaddonresponse, +) +from speakeasy_client_sdk_python.types import BaseModel +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class CreateBillingAddOnsResponseTypedDict(TypedDict): + content_type: str + r"""HTTP response content type for this operation""" + status_code: int + r"""HTTP response status code for this operation""" + raw_response: httpx.Response + r"""Raw HTTP response; suitable for custom response parsing""" + organization_billing_add_on_response: NotRequired[ + shared_organizationbillingaddonresponse.OrganizationBillingAddOnResponseTypedDict + ] + r"""Success""" + + +class CreateBillingAddOnsResponse(BaseModel): + content_type: str + r"""HTTP response content type for this operation""" + + status_code: int + r"""HTTP response status code for this operation""" + + raw_response: httpx.Response + r"""Raw HTTP response; suitable for custom response parsing""" + + organization_billing_add_on_response: Optional[ + shared_organizationbillingaddonresponse.OrganizationBillingAddOnResponse + ] = None + r"""Success""" diff --git a/src/speakeasy_client_sdk_python/models/operations/createpublishingtoken.py b/src/speakeasy_client_sdk_python/models/operations/createpublishingtoken.py new file mode 100644 index 00000000..2882b9c9 --- /dev/null +++ b/src/speakeasy_client_sdk_python/models/operations/createpublishingtoken.py @@ -0,0 +1,57 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from datetime import datetime +import httpx +from speakeasy_client_sdk_python.models.shared import ( + publishingtoken as shared_publishingtoken, +) +from speakeasy_client_sdk_python.types import BaseModel +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class CreatePublishingTokenRequestBodyTypedDict(TypedDict): + r"""The publishing token to create""" + + target_id: str + target_resource: str + token_name: str + valid_until: datetime + + +class CreatePublishingTokenRequestBody(BaseModel): + r"""The publishing token to create""" + + target_id: str + + target_resource: str + + token_name: str + + valid_until: datetime + + +class CreatePublishingTokenResponseTypedDict(TypedDict): + content_type: str + r"""HTTP response content type for this operation""" + status_code: int + r"""HTTP response status code for this operation""" + raw_response: httpx.Response + r"""Raw HTTP response; suitable for custom response parsing""" + publishing_token: NotRequired[shared_publishingtoken.PublishingTokenTypedDict] + r"""OK""" + + +class CreatePublishingTokenResponse(BaseModel): + content_type: str + r"""HTTP response content type for this operation""" + + status_code: int + r"""HTTP response status code for this operation""" + + raw_response: httpx.Response + r"""Raw HTTP response; suitable for custom response parsing""" + + publishing_token: Optional[shared_publishingtoken.PublishingToken] = None + r"""OK""" diff --git a/src/speakeasy_client_sdk_python/models/operations/createschemastoreitem.py b/src/speakeasy_client_sdk_python/models/operations/createschemastoreitem.py new file mode 100644 index 00000000..2308dfb5 --- /dev/null +++ b/src/speakeasy_client_sdk_python/models/operations/createschemastoreitem.py @@ -0,0 +1,69 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum +import httpx +import pydantic +from speakeasy_client_sdk_python.models.shared import ( + schemastoreitem as shared_schemastoreitem, +) +from speakeasy_client_sdk_python.types import BaseModel +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class Format(str, Enum): + r"""The format of the OpenAPI specification.""" + + JSON = "json" + YAML = "yaml" + + +class CreateSchemaStoreItemRequestBodyTypedDict(TypedDict): + format_: Format + r"""The format of the OpenAPI specification.""" + package_name: str + r"""The package name to use in code snippets / quickstart.""" + sdk_classname: str + r"""The classname of the SDK to use in code snippets / quickstart.""" + spec: str + r"""The OpenAPI specification to store.""" + + +class CreateSchemaStoreItemRequestBody(BaseModel): + format_: Annotated[Format, pydantic.Field(alias="format")] + r"""The format of the OpenAPI specification.""" + + package_name: Annotated[str, pydantic.Field(alias="packageName")] + r"""The package name to use in code snippets / quickstart.""" + + sdk_classname: Annotated[str, pydantic.Field(alias="sdkClassname")] + r"""The classname of the SDK to use in code snippets / quickstart.""" + + spec: str + r"""The OpenAPI specification to store.""" + + +class CreateSchemaStoreItemResponseTypedDict(TypedDict): + content_type: str + r"""HTTP response content type for this operation""" + status_code: int + r"""HTTP response status code for this operation""" + raw_response: httpx.Response + r"""Raw HTTP response; suitable for custom response parsing""" + schema_store_item: NotRequired[shared_schemastoreitem.SchemaStoreItemTypedDict] + r"""OK""" + + +class CreateSchemaStoreItemResponse(BaseModel): + content_type: str + r"""HTTP response content type for this operation""" + + status_code: int + r"""HTTP response status code for this operation""" + + raw_response: httpx.Response + r"""Raw HTTP response; suitable for custom response parsing""" + + schema_store_item: Optional[shared_schemastoreitem.SchemaStoreItem] = None + r"""OK""" diff --git a/src/speakeasy_client_sdk_python/models/operations/deletebillingaddon.py b/src/speakeasy_client_sdk_python/models/operations/deletebillingaddon.py new file mode 100644 index 00000000..284fea55 --- /dev/null +++ b/src/speakeasy_client_sdk_python/models/operations/deletebillingaddon.py @@ -0,0 +1,50 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +import httpx +from pydantic.functional_validators import PlainValidator +from speakeasy_client_sdk_python.models.shared import ( + billingaddon as shared_billingaddon, +) +from speakeasy_client_sdk_python.types import BaseModel +from speakeasy_client_sdk_python.utils import ( + FieldMetadata, + PathParamMetadata, + validate_open_enum, +) +from typing_extensions import Annotated, TypedDict + + +class DeleteBillingAddOnRequestTypedDict(TypedDict): + add_on: shared_billingaddon.BillingAddOn + r"""The specific add-on to delete.""" + + +class DeleteBillingAddOnRequest(BaseModel): + add_on: Annotated[ + Annotated[ + shared_billingaddon.BillingAddOn, PlainValidator(validate_open_enum(False)) + ], + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""The specific add-on to delete.""" + + +class DeleteBillingAddOnResponseTypedDict(TypedDict): + content_type: str + r"""HTTP response content type for this operation""" + status_code: int + r"""HTTP response status code for this operation""" + raw_response: httpx.Response + r"""Raw HTTP response; suitable for custom response parsing""" + + +class DeleteBillingAddOnResponse(BaseModel): + content_type: str + r"""HTTP response content type for this operation""" + + status_code: int + r"""HTTP response status code for this operation""" + + raw_response: httpx.Response + r"""Raw HTTP response; suitable for custom response parsing""" diff --git a/src/speakeasy_client_sdk_python/models/operations/deletepublishingtoken.py b/src/speakeasy_client_sdk_python/models/operations/deletepublishingtoken.py new file mode 100644 index 00000000..13c739f4 --- /dev/null +++ b/src/speakeasy_client_sdk_python/models/operations/deletepublishingtoken.py @@ -0,0 +1,42 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +import httpx +import pydantic +from speakeasy_client_sdk_python.types import BaseModel +from speakeasy_client_sdk_python.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class DeletePublishingTokenRequestTypedDict(TypedDict): + token_id: str + r"""Unique identifier of the publishing token.""" + + +class DeletePublishingTokenRequest(BaseModel): + token_id: Annotated[ + str, + pydantic.Field(alias="tokenID"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier of the publishing token.""" + + +class DeletePublishingTokenResponseTypedDict(TypedDict): + content_type: str + r"""HTTP response content type for this operation""" + status_code: int + r"""HTTP response status code for this operation""" + raw_response: httpx.Response + r"""Raw HTTP response; suitable for custom response parsing""" + + +class DeletePublishingTokenResponse(BaseModel): + content_type: str + r"""HTTP response content type for this operation""" + + status_code: int + r"""HTTP response status code for this operation""" + + raw_response: httpx.Response + r"""Raw HTTP response; suitable for custom response parsing""" diff --git a/src/speakeasy_client_sdk_python/models/operations/generatecodesamplepreview.py b/src/speakeasy_client_sdk_python/models/operations/generatecodesamplepreview.py index 9e2079ca..a03c9b89 100644 --- a/src/speakeasy_client_sdk_python/models/operations/generatecodesamplepreview.py +++ b/src/speakeasy_client_sdk_python/models/operations/generatecodesamplepreview.py @@ -2,6 +2,9 @@ from __future__ import annotations import httpx +from speakeasy_client_sdk_python.models.shared import ( + usagesnippets as shared_usagesnippets, +) from speakeasy_client_sdk_python.types import BaseModel from typing import Optional from typing_extensions import NotRequired, TypedDict @@ -14,10 +17,8 @@ class GenerateCodeSamplePreviewResponseTypedDict(TypedDict): r"""HTTP response status code for this operation""" raw_response: httpx.Response r"""Raw HTTP response; suitable for custom response parsing""" - two_hundred_application_json_response_stream: NotRequired[httpx.Response] - r"""Successfully returned codeSample overlay file""" - two_hundred_application_x_yaml_response_stream: NotRequired[httpx.Response] - r"""Successfully returned codeSample overlay file""" + usage_snippets: NotRequired[shared_usagesnippets.UsageSnippetsTypedDict] + r"""OK""" class GenerateCodeSamplePreviewResponse(BaseModel): @@ -30,8 +31,5 @@ class GenerateCodeSamplePreviewResponse(BaseModel): raw_response: httpx.Response r"""Raw HTTP response; suitable for custom response parsing""" - two_hundred_application_json_response_stream: Optional[httpx.Response] = None - r"""Successfully returned codeSample overlay file""" - - two_hundred_application_x_yaml_response_stream: Optional[httpx.Response] = None - r"""Successfully returned codeSample overlay file""" + usage_snippets: Optional[shared_usagesnippets.UsageSnippets] = None + r"""OK""" diff --git a/src/speakeasy_client_sdk_python/models/operations/getbillingaddons.py b/src/speakeasy_client_sdk_python/models/operations/getbillingaddons.py new file mode 100644 index 00000000..7e2a4f5f --- /dev/null +++ b/src/speakeasy_client_sdk_python/models/operations/getbillingaddons.py @@ -0,0 +1,39 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +import httpx +from speakeasy_client_sdk_python.models.shared import ( + organizationbillingaddonresponse as shared_organizationbillingaddonresponse, +) +from speakeasy_client_sdk_python.types import BaseModel +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class GetBillingAddOnsResponseTypedDict(TypedDict): + content_type: str + r"""HTTP response content type for this operation""" + status_code: int + r"""HTTP response status code for this operation""" + raw_response: httpx.Response + r"""Raw HTTP response; suitable for custom response parsing""" + organization_billing_add_on_response: NotRequired[ + shared_organizationbillingaddonresponse.OrganizationBillingAddOnResponseTypedDict + ] + r"""Success""" + + +class GetBillingAddOnsResponse(BaseModel): + content_type: str + r"""HTTP response content type for this operation""" + + status_code: int + r"""HTTP response status code for this operation""" + + raw_response: httpx.Response + r"""Raw HTTP response; suitable for custom response parsing""" + + organization_billing_add_on_response: Optional[ + shared_organizationbillingaddonresponse.OrganizationBillingAddOnResponse + ] = None + r"""Success""" diff --git a/src/speakeasy_client_sdk_python/models/operations/getcodesamplepreviewasync.py b/src/speakeasy_client_sdk_python/models/operations/getcodesamplepreviewasync.py index 95844f7e..cfd9bb7e 100644 --- a/src/speakeasy_client_sdk_python/models/operations/getcodesamplepreviewasync.py +++ b/src/speakeasy_client_sdk_python/models/operations/getcodesamplepreviewasync.py @@ -5,6 +5,7 @@ import pydantic from speakeasy_client_sdk_python.models.shared import ( codesamplesjobstatus as shared_codesamplesjobstatus, + usagesnippets as shared_usagesnippets, ) from speakeasy_client_sdk_python.types import BaseModel from speakeasy_client_sdk_python.utils import FieldMetadata, PathParamMetadata @@ -47,13 +48,9 @@ class GetCodeSamplePreviewAsyncResponseTypedDict(TypedDict): r"""HTTP response status code for this operation""" raw_response: httpx.Response r"""Raw HTTP response; suitable for custom response parsing""" - two_hundred_application_json_response_stream: NotRequired[httpx.Response] - r"""Successfully returned codeSample overlay file""" - two_hundred_application_x_yaml_response_stream: NotRequired[httpx.Response] - r"""Successfully returned codeSample overlay file""" - two_hundred_and_two_application_json_object: NotRequired[ - GetCodeSamplePreviewAsyncResponseBodyTypedDict - ] + usage_snippets: NotRequired[shared_usagesnippets.UsageSnippetsTypedDict] + r"""OK""" + object: NotRequired[GetCodeSamplePreviewAsyncResponseBodyTypedDict] r"""Job is still in progress""" @@ -67,13 +64,8 @@ class GetCodeSamplePreviewAsyncResponse(BaseModel): raw_response: httpx.Response r"""Raw HTTP response; suitable for custom response parsing""" - two_hundred_application_json_response_stream: Optional[httpx.Response] = None - r"""Successfully returned codeSample overlay file""" - - two_hundred_application_x_yaml_response_stream: Optional[httpx.Response] = None - r"""Successfully returned codeSample overlay file""" + usage_snippets: Optional[shared_usagesnippets.UsageSnippets] = None + r"""OK""" - two_hundred_and_two_application_json_object: Optional[ - GetCodeSamplePreviewAsyncResponseBody - ] = None + object: Optional[GetCodeSamplePreviewAsyncResponseBody] = None r"""Job is still in progress""" diff --git a/src/speakeasy_client_sdk_python/models/operations/getcodesamples.py b/src/speakeasy_client_sdk_python/models/operations/getcodesamples.py index 34e5af95..efa954e5 100644 --- a/src/speakeasy_client_sdk_python/models/operations/getcodesamples.py +++ b/src/speakeasy_client_sdk_python/models/operations/getcodesamples.py @@ -3,6 +3,7 @@ from __future__ import annotations import httpx from speakeasy_client_sdk_python.models.shared import ( + httpmethod as shared_httpmethod, usagesnippets as shared_usagesnippets, ) from speakeasy_client_sdk_python.types import BaseModel @@ -11,28 +12,51 @@ from typing_extensions import Annotated, NotRequired, TypedDict +class MethodPathsTypedDict(TypedDict): + method: shared_httpmethod.HTTPMethod + path: str + + +class MethodPaths(BaseModel): + method: Annotated[shared_httpmethod.HTTPMethod, FieldMetadata(query=True)] + + path: Annotated[str, FieldMetadata(query=True)] + + class GetCodeSamplesRequestTypedDict(TypedDict): registry_url: str - r"""The registry URL from which to retrieve the snippets. E.g. https://spec.speakeasy.com/org/ws/my-source""" + r"""The registry URL from which to retrieve the snippets.""" operation_ids: NotRequired[List[str]] + r"""The operation IDs to retrieve snippets for.""" + method_paths: NotRequired[List[MethodPathsTypedDict]] + r"""The method paths to retrieve snippets for.""" languages: NotRequired[List[str]] + r"""The languages to retrieve snippets for.""" class GetCodeSamplesRequest(BaseModel): registry_url: Annotated[ str, FieldMetadata(query=QueryParamMetadata(style="form", explode=True)) ] - r"""The registry URL from which to retrieve the snippets. E.g. https://spec.speakeasy.com/org/ws/my-source""" + r"""The registry URL from which to retrieve the snippets.""" operation_ids: Annotated[ Optional[List[str]], FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), ] = None + r"""The operation IDs to retrieve snippets for.""" + + method_paths: Annotated[ + Optional[List[MethodPaths]], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""The method paths to retrieve snippets for.""" languages: Annotated[ Optional[List[str]], FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), ] = None + r"""The languages to retrieve snippets for.""" class GetCodeSamplesResponseTypedDict(TypedDict): diff --git a/src/speakeasy_client_sdk_python/models/operations/getpublishingtoken.py b/src/speakeasy_client_sdk_python/models/operations/getpublishingtoken.py new file mode 100644 index 00000000..d9786a95 --- /dev/null +++ b/src/speakeasy_client_sdk_python/models/operations/getpublishingtoken.py @@ -0,0 +1,35 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +import httpx +from speakeasy_client_sdk_python.models.shared import ( + publishingtoken as shared_publishingtoken, +) +from speakeasy_client_sdk_python.types import BaseModel +from typing import List, Optional +from typing_extensions import NotRequired, TypedDict + + +class GetPublishingTokenResponseTypedDict(TypedDict): + content_type: str + r"""HTTP response content type for this operation""" + status_code: int + r"""HTTP response status code for this operation""" + raw_response: httpx.Response + r"""Raw HTTP response; suitable for custom response parsing""" + classes: NotRequired[List[shared_publishingtoken.PublishingTokenTypedDict]] + r"""OK""" + + +class GetPublishingTokenResponse(BaseModel): + content_type: str + r"""HTTP response content type for this operation""" + + status_code: int + r"""HTTP response status code for this operation""" + + raw_response: httpx.Response + r"""Raw HTTP response; suitable for custom response parsing""" + + classes: Optional[List[shared_publishingtoken.PublishingToken]] = None + r"""OK""" diff --git a/src/speakeasy_client_sdk_python/models/operations/getpublishingtokenbyid.py b/src/speakeasy_client_sdk_python/models/operations/getpublishingtokenbyid.py new file mode 100644 index 00000000..213191eb --- /dev/null +++ b/src/speakeasy_client_sdk_python/models/operations/getpublishingtokenbyid.py @@ -0,0 +1,51 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +import httpx +import pydantic +from speakeasy_client_sdk_python.models.shared import ( + publishingtoken as shared_publishingtoken, +) +from speakeasy_client_sdk_python.types import BaseModel +from speakeasy_client_sdk_python.utils import FieldMetadata, PathParamMetadata +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class GetPublishingTokenByIDRequestTypedDict(TypedDict): + token_id: str + r"""Unique identifier of the publishing token.""" + + +class GetPublishingTokenByIDRequest(BaseModel): + token_id: Annotated[ + str, + pydantic.Field(alias="tokenID"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier of the publishing token.""" + + +class GetPublishingTokenByIDResponseTypedDict(TypedDict): + content_type: str + r"""HTTP response content type for this operation""" + status_code: int + r"""HTTP response status code for this operation""" + raw_response: httpx.Response + r"""Raw HTTP response; suitable for custom response parsing""" + publishing_token: NotRequired[shared_publishingtoken.PublishingTokenTypedDict] + r"""OK""" + + +class GetPublishingTokenByIDResponse(BaseModel): + content_type: str + r"""HTTP response content type for this operation""" + + status_code: int + r"""HTTP response status code for this operation""" + + raw_response: httpx.Response + r"""Raw HTTP response; suitable for custom response parsing""" + + publishing_token: Optional[shared_publishingtoken.PublishingToken] = None + r"""OK""" diff --git a/src/speakeasy_client_sdk_python/models/operations/getpublishingtokenpublicmetadata.py b/src/speakeasy_client_sdk_python/models/operations/getpublishingtokenpublicmetadata.py new file mode 100644 index 00000000..059ec595 --- /dev/null +++ b/src/speakeasy_client_sdk_python/models/operations/getpublishingtokenpublicmetadata.py @@ -0,0 +1,73 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from datetime import datetime +import httpx +import pydantic +from speakeasy_client_sdk_python.types import BaseModel +from speakeasy_client_sdk_python.utils import FieldMetadata, PathParamMetadata +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class GetPublishingTokenPublicMetadataRequestTypedDict(TypedDict): + token_id: str + r"""Unique identifier of the publishing token.""" + + +class GetPublishingTokenPublicMetadataRequest(BaseModel): + token_id: Annotated[ + str, + pydantic.Field(alias="tokenID"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier of the publishing token.""" + + +class GetPublishingTokenPublicMetadataResponseBodyTypedDict(TypedDict): + r"""OK""" + + organization_id: NotRequired[str] + target_id: NotRequired[str] + target_resource: NotRequired[str] + valid_until: NotRequired[datetime] + workspace_id: NotRequired[str] + + +class GetPublishingTokenPublicMetadataResponseBody(BaseModel): + r"""OK""" + + organization_id: Optional[str] = None + + target_id: Optional[str] = None + + target_resource: Optional[str] = None + + valid_until: Optional[datetime] = None + + workspace_id: Optional[str] = None + + +class GetPublishingTokenPublicMetadataResponseTypedDict(TypedDict): + content_type: str + r"""HTTP response content type for this operation""" + status_code: int + r"""HTTP response status code for this operation""" + raw_response: httpx.Response + r"""Raw HTTP response; suitable for custom response parsing""" + object: NotRequired[GetPublishingTokenPublicMetadataResponseBodyTypedDict] + r"""OK""" + + +class GetPublishingTokenPublicMetadataResponse(BaseModel): + content_type: str + r"""HTTP response content type for this operation""" + + status_code: int + r"""HTTP response status code for this operation""" + + raw_response: httpx.Response + r"""Raw HTTP response; suitable for custom response parsing""" + + object: Optional[GetPublishingTokenPublicMetadataResponseBody] = None + r"""OK""" diff --git a/src/speakeasy_client_sdk_python/models/operations/getpublishingtokentargetbyid.py b/src/speakeasy_client_sdk_python/models/operations/getpublishingtokentargetbyid.py new file mode 100644 index 00000000..23929e8b --- /dev/null +++ b/src/speakeasy_client_sdk_python/models/operations/getpublishingtokentargetbyid.py @@ -0,0 +1,48 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +import httpx +import pydantic +from speakeasy_client_sdk_python.types import BaseModel +from speakeasy_client_sdk_python.utils import FieldMetadata, PathParamMetadata +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class GetPublishingTokenTargetByIDRequestTypedDict(TypedDict): + token_id: str + r"""Unique identifier of the publishing token.""" + + +class GetPublishingTokenTargetByIDRequest(BaseModel): + token_id: Annotated[ + str, + pydantic.Field(alias="tokenID"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier of the publishing token.""" + + +class GetPublishingTokenTargetByIDResponseTypedDict(TypedDict): + content_type: str + r"""HTTP response content type for this operation""" + status_code: int + r"""HTTP response status code for this operation""" + raw_response: httpx.Response + r"""Raw HTTP response; suitable for custom response parsing""" + res: NotRequired[str] + r"""OK""" + + +class GetPublishingTokenTargetByIDResponse(BaseModel): + content_type: str + r"""HTTP response content type for this operation""" + + status_code: int + r"""HTTP response status code for this operation""" + + raw_response: httpx.Response + r"""Raw HTTP response; suitable for custom response parsing""" + + res: Optional[str] = None + r"""OK""" diff --git a/src/speakeasy_client_sdk_python/models/operations/getschemastoreitem.py b/src/speakeasy_client_sdk_python/models/operations/getschemastoreitem.py new file mode 100644 index 00000000..4d9d37d0 --- /dev/null +++ b/src/speakeasy_client_sdk_python/models/operations/getschemastoreitem.py @@ -0,0 +1,43 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +import httpx +from speakeasy_client_sdk_python.models.shared import ( + schemastoreitem as shared_schemastoreitem, +) +from speakeasy_client_sdk_python.types import BaseModel +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class GetSchemaStoreItemRequestBodyTypedDict(TypedDict): + id: NotRequired[str] + + +class GetSchemaStoreItemRequestBody(BaseModel): + id: Optional[str] = None + + +class GetSchemaStoreItemResponseTypedDict(TypedDict): + content_type: str + r"""HTTP response content type for this operation""" + status_code: int + r"""HTTP response status code for this operation""" + raw_response: httpx.Response + r"""Raw HTTP response; suitable for custom response parsing""" + schema_store_item: NotRequired[shared_schemastoreitem.SchemaStoreItemTypedDict] + r"""OK""" + + +class GetSchemaStoreItemResponse(BaseModel): + content_type: str + r"""HTTP response content type for this operation""" + + status_code: int + r"""HTTP response status code for this operation""" + + raw_response: httpx.Response + r"""Raw HTTP response; suitable for custom response parsing""" + + schema_store_item: Optional[shared_schemastoreitem.SchemaStoreItem] = None + r"""OK""" diff --git a/src/speakeasy_client_sdk_python/models/operations/setworkspacefeatureflags.py b/src/speakeasy_client_sdk_python/models/operations/setworkspacefeatureflags.py new file mode 100644 index 00000000..d6076121 --- /dev/null +++ b/src/speakeasy_client_sdk_python/models/operations/setworkspacefeatureflags.py @@ -0,0 +1,39 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +import httpx +from speakeasy_client_sdk_python.models.shared import ( + workspacefeatureflagresponse as shared_workspacefeatureflagresponse, +) +from speakeasy_client_sdk_python.types import BaseModel +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class SetWorkspaceFeatureFlagsResponseTypedDict(TypedDict): + content_type: str + r"""HTTP response content type for this operation""" + status_code: int + r"""HTTP response status code for this operation""" + raw_response: httpx.Response + r"""Raw HTTP response; suitable for custom response parsing""" + workspace_feature_flag_response: NotRequired[ + shared_workspacefeatureflagresponse.WorkspaceFeatureFlagResponseTypedDict + ] + r"""Success""" + + +class SetWorkspaceFeatureFlagsResponse(BaseModel): + content_type: str + r"""HTTP response content type for this operation""" + + status_code: int + r"""HTTP response status code for this operation""" + + raw_response: httpx.Response + r"""Raw HTTP response; suitable for custom response parsing""" + + workspace_feature_flag_response: Optional[ + shared_workspacefeatureflagresponse.WorkspaceFeatureFlagResponse + ] = None + r"""Success""" diff --git a/src/speakeasy_client_sdk_python/models/operations/updatepublishingtokenexpiration.py b/src/speakeasy_client_sdk_python/models/operations/updatepublishingtokenexpiration.py new file mode 100644 index 00000000..420422f6 --- /dev/null +++ b/src/speakeasy_client_sdk_python/models/operations/updatepublishingtokenexpiration.py @@ -0,0 +1,75 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from datetime import datetime +import httpx +import pydantic +from speakeasy_client_sdk_python.types import BaseModel +from speakeasy_client_sdk_python.utils import ( + FieldMetadata, + PathParamMetadata, + RequestMetadata, +) +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class UpdatePublishingTokenExpirationRequestBodyTypedDict(TypedDict): + r"""The publishing token to update""" + + valid_until: datetime + r"""The new expiration date for the publishing token.""" + token_name: NotRequired[str] + r"""The new name for the publishing token.""" + + +class UpdatePublishingTokenExpirationRequestBody(BaseModel): + r"""The publishing token to update""" + + valid_until: datetime + r"""The new expiration date for the publishing token.""" + + token_name: Optional[str] = None + r"""The new name for the publishing token.""" + + +class UpdatePublishingTokenExpirationRequestTypedDict(TypedDict): + token_id: str + r"""Unique identifier of the publishing token.""" + request_body: NotRequired[UpdatePublishingTokenExpirationRequestBodyTypedDict] + r"""The publishing token to update""" + + +class UpdatePublishingTokenExpirationRequest(BaseModel): + token_id: Annotated[ + str, + pydantic.Field(alias="tokenID"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier of the publishing token.""" + + request_body: Annotated[ + Optional[UpdatePublishingTokenExpirationRequestBody], + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] = None + r"""The publishing token to update""" + + +class UpdatePublishingTokenExpirationResponseTypedDict(TypedDict): + content_type: str + r"""HTTP response content type for this operation""" + status_code: int + r"""HTTP response status code for this operation""" + raw_response: httpx.Response + r"""Raw HTTP response; suitable for custom response parsing""" + + +class UpdatePublishingTokenExpirationResponse(BaseModel): + content_type: str + r"""HTTP response content type for this operation""" + + status_code: int + r"""HTTP response status code for this operation""" + + raw_response: httpx.Response + r"""Raw HTTP response; suitable for custom response parsing""" diff --git a/src/speakeasy_client_sdk_python/models/shared/__init__.py b/src/speakeasy_client_sdk_python/models/shared/__init__.py index 1c839643..9843e8b0 100644 --- a/src/speakeasy_client_sdk_python/models/shared/__init__.py +++ b/src/speakeasy_client_sdk_python/models/shared/__init__.py @@ -1,147 +1,193 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" -from .accessdetails import AccessDetails, AccessDetailsTypedDict, Level -from .accesstoken import ( - AccessToken, - AccessTokenTypedDict, - AccessTokenUser, - AccessTokenUserTypedDict, - Claims, - ClaimsTypedDict, - Workspaces, - WorkspacesTypedDict, -) -from .accounttype import AccountType -from .addtags import AddTags, AddTagsTypedDict -from .annotations import Annotations, AnnotationsTypedDict -from .apikeydetails import APIKeyDetails, APIKeyDetailsTypedDict -from .clievent import CliEvent, CliEventTypedDict, GenerateBumpType, OpenapiDiffBumpType -from .codesampleschemainput import ( - CodeSampleSchemaInput, - CodeSampleSchemaInputTypedDict, - SchemaFile, - SchemaFileTypedDict, -) -from .codesamplesjobstatus import CodeSamplesJobStatus -from .diagnostic import Diagnostic, DiagnosticTypedDict -from .featureflag import FeatureFlag, FeatureFlagTypedDict -from .getnamespacesresponse import GetNamespacesResponse, GetNamespacesResponseTypedDict -from .getrevisionsresponse import GetRevisionsResponse, GetRevisionsResponseTypedDict -from .gettagsresponse import GetTagsResponse, GetTagsResponseTypedDict -from .githubconfigurecodesamplesrequest import ( - GithubConfigureCodeSamplesRequest, - GithubConfigureCodeSamplesRequestTypedDict, -) -from .githubconfigurecodesamplesresponse import ( - GithubConfigureCodeSamplesResponse, - GithubConfigureCodeSamplesResponseTypedDict, -) -from .githubconfiguremintlifyreporequest import ( - GithubConfigureMintlifyRepoRequest, - GithubConfigureMintlifyRepoRequestTypedDict, -) -from .githubconfiguretargetrequest import ( - GithubConfigureTargetRequest, - GithubConfigureTargetRequestTypedDict, -) -from .githubgetactionresponse import ( - GithubGetActionResponse, - GithubGetActionResponseTypedDict, -) -from .githubmissingpublishingsecretsresponse import ( - GithubMissingPublishingSecretsResponse, - GithubMissingPublishingSecretsResponseTypedDict, -) -from .githubpublishingprresponse import ( - GithubPublishingPRResponse, - GithubPublishingPRResponseTypedDict, -) -from .githubsetupstateresponse import ( - Actions, - ActionsTypedDict, - GithubSetupStateResponse, - GithubSetupStateResponseTypedDict, - Secrets, - SecretsTypedDict, -) -from .githubstorepublishingsecretsrequest import ( - GithubStorePublishingSecretsRequest, - GithubStorePublishingSecretsRequestTypedDict, -) -from .githubtriggeractionrequest import ( - GithubTriggerActionRequest, - GithubTriggerActionRequestTypedDict, -) -from .interactiontype import InteractionType -from .manifest import Manifest, ManifestTypedDict -from .namespace import ( - CompositeSpecMetadata, - CompositeSpecMetadataTypedDict, - Namespace, - NamespaceTypedDict, -) -from .oasinfo import License, LicenseTypedDict, OASInfo, OASInfoTypedDict -from .oasoperation import OASOperation, OASOperationTypedDict -from .oassummary import OASSummary, OASSummaryTypedDict -from .organization import Organization, OrganizationTypedDict -from .organizationusage import OrganizationUsage, OrganizationUsageTypedDict -from .organizationusageresponse import ( - OrganizationUsageResponse, - OrganizationUsageResponseTypedDict, -) -from .preflightrequest import PreflightRequest, PreflightRequestTypedDict -from .preflighttoken import PreflightToken, PreflightTokenTypedDict -from .remotedocument import RemoteDocument, RemoteDocumentTypedDict -from .remotesource import RemoteSource, RemoteSourceTypedDict -from .remotesourcesubscriptionsettings import ( - RemoteSourceSubscriptionSettings, - RemoteSourceSubscriptionSettingsTypedDict, -) -from .report import Report, ReportTypedDict, Type -from .revision import Revision, RevisionTypedDict -from .security import Security, SecurityTypedDict -from .shorturl import ShortURL, ShortURLTypedDict -from .ssometadata import SSOMetadata, SSOMetadataTypedDict -from .suggestitemsrequestbody import ( - SuggestItemsRequestBody, - SuggestItemsRequestBodyTypedDict, -) -from .suggestoptsold import SuggestOptsOld, SuggestOptsOldTypedDict, SuggestionType -from .suggestrequestbody import ( - SuggestRequestBody, - SuggestRequestBodySuggestionType, - SuggestRequestBodyTypedDict, -) -from .tag import Tag, TagTypedDict -from .targetsdk import TargetSDK, TargetSDKTypedDict -from .usagesnippet import UsageSnippet, UsageSnippetTypedDict -from .usagesnippets import UsageSnippets, UsageSnippetsTypedDict -from .user import User, UserTypedDict -from .v2descriptor import V2Descriptor, V2DescriptorTypedDict -from .workflowdocument import ( - Auth, - AuthTypedDict, - WorkflowDocument, - WorkflowDocumentTypedDict, -) -from .workspace import Workspace, WorkspaceTypedDict -from .workspaceandorganization import ( - WorkspaceAndOrganization, - WorkspaceAndOrganizationTypedDict, -) -from .workspacefeatureflagresponse import ( - WorkspaceFeatureFlagResponse, - WorkspaceFeatureFlagResponseTypedDict, -) -from .workspaceinviteresponse import ( - Relationship, - RelationshipTypedDict, - WorkspaceInviteResponse, - WorkspaceInviteResponseTypedDict, -) -from .workspacesettings import WorkspaceSettings, WorkspaceSettingsTypedDict -from .workspaceteamresponse import WorkspaceTeamResponse, WorkspaceTeamResponseTypedDict -from .workspacetoken import WorkspaceToken, WorkspaceTokenTypedDict +from typing import TYPE_CHECKING +from importlib import import_module + +if TYPE_CHECKING: + from .accessdetails import AccessDetails, AccessDetailsTypedDict, Level + from .accesstoken import ( + AccessToken, + AccessTokenTypedDict, + AccessTokenUser, + AccessTokenUserTypedDict, + Claims, + ClaimsTypedDict, + Workspaces, + WorkspacesTypedDict, + ) + from .accounttype import AccountType + from .addtags import AddTags, AddTagsTypedDict + from .annotations import Annotations, AnnotationsTypedDict + from .apikeydetails import APIKeyDetails, APIKeyDetailsTypedDict + from .billingaddon import BillingAddOn + from .clievent import ( + CliEvent, + CliEventTypedDict, + GenerateBumpType, + OpenapiDiffBumpType, + ) + from .codesampleschemainput import ( + CodeSampleSchemaInput, + CodeSampleSchemaInputTypedDict, + SchemaFile, + SchemaFileTypedDict, + ) + from .codesamplesjobstatus import CodeSamplesJobStatus + from .diagnostic import Diagnostic, DiagnosticTypedDict + from .featureflag import FeatureFlag, FeatureFlagTypedDict + from .getnamespacesresponse import ( + GetNamespacesResponse, + GetNamespacesResponseTypedDict, + ) + from .getrevisionsresponse import ( + GetRevisionsResponse, + GetRevisionsResponseTypedDict, + ) + from .gettagsresponse import GetTagsResponse, GetTagsResponseTypedDict + from .githubconfigurecodesamplesrequest import ( + GithubConfigureCodeSamplesRequest, + GithubConfigureCodeSamplesRequestTypedDict, + ) + from .githubconfigurecodesamplesresponse import ( + GithubConfigureCodeSamplesResponse, + GithubConfigureCodeSamplesResponseTypedDict, + ) + from .githubconfiguremintlifyreporequest import ( + GithubConfigureMintlifyRepoRequest, + GithubConfigureMintlifyRepoRequestTypedDict, + ) + from .githubconfiguretargetrequest import ( + GithubConfigureTargetRequest, + GithubConfigureTargetRequestTypedDict, + ) + from .githubgetactionresponse import ( + GithubGetActionResponse, + GithubGetActionResponseTypedDict, + ) + from .githubmissingpublishingsecretsresponse import ( + GithubMissingPublishingSecretsResponse, + GithubMissingPublishingSecretsResponseTypedDict, + ) + from .githubpublishingprresponse import ( + GithubPublishingPRResponse, + GithubPublishingPRResponseTypedDict, + PullRequestMetadata, + PullRequestMetadataTypedDict, + ) + from .githubsetupstateresponse import ( + Actions, + ActionsTypedDict, + GithubSetupStateResponse, + GithubSetupStateResponseTypedDict, + Secrets, + SecretsTypedDict, + ) + from .githubstorepublishingsecretsrequest import ( + GithubStorePublishingSecretsRequest, + GithubStorePublishingSecretsRequestTypedDict, + ) + from .githubtriggeractionrequest import ( + GithubTriggerActionRequest, + GithubTriggerActionRequestTypedDict, + ) + from .httpmethod import HTTPMethod + from .interactiontype import InteractionType + from .manifest import Manifest, ManifestTypedDict + from .namespace import ( + CompositeSpecMetadata, + CompositeSpecMetadataTypedDict, + Namespace, + NamespaceTypedDict, + ) + from .oasinfo import License, LicenseTypedDict, OASInfo, OASInfoTypedDict + from .oasoperation import OASOperation, OASOperationTypedDict + from .oassummary import OASSummary, OASSummaryTypedDict + from .organization import Organization, OrganizationTypedDict + from .organizationbillingaddonrequest import ( + OrganizationBillingAddOnRequest, + OrganizationBillingAddOnRequestTypedDict, + ) + from .organizationbillingaddonresponse import ( + OrganizationBillingAddOnResponse, + OrganizationBillingAddOnResponseTypedDict, + ) + from .organizationusage import OrganizationUsage, OrganizationUsageTypedDict + from .organizationusageresponse import ( + OrganizationUsageResponse, + OrganizationUsageResponseTypedDict, + ) + from .preflightrequest import PreflightRequest, PreflightRequestTypedDict + from .preflighttoken import PreflightToken, PreflightTokenTypedDict + from .publishingtoken import ( + PublishingToken, + PublishingTokenTypedDict, + TargetResource, + ) + from .remotedocument import RemoteDocument, RemoteDocumentTypedDict + from .remotesource import RemoteSource, RemoteSourceTypedDict + from .remotesourcesubscriptionsettings import ( + RemoteSourceSubscriptionSettings, + RemoteSourceSubscriptionSettingsTypedDict, + ) + from .report import Report, ReportTypedDict, Type + from .revision import Revision, RevisionTypedDict + from .revisioncontentsmetadata import ( + RevisionContentsMetadata, + RevisionContentsMetadataType, + RevisionContentsMetadataTypedDict, + ) + from .schemastoreitem import Format, SchemaStoreItem, SchemaStoreItemTypedDict + from .security import Security, SecurityTypedDict + from .shorturl import ShortURL, ShortURLTypedDict + from .ssometadata import SSOMetadata, SSOMetadataTypedDict + from .suggestitemsrequestbody import ( + SuggestItemsRequestBody, + SuggestItemsRequestBodyTypedDict, + ) + from .suggestoptsold import SuggestOptsOld, SuggestOptsOldTypedDict, SuggestionType + from .suggestrequestbody import ( + SuggestRequestBody, + SuggestRequestBodySuggestionType, + SuggestRequestBodyTypedDict, + ) + from .tag import Tag, TagTypedDict + from .targetsdk import TargetSDK, TargetSDKTypedDict + from .usagesnippet import UsageSnippet, UsageSnippetTypedDict + from .usagesnippets import UsageSnippets, UsageSnippetsTypedDict + from .user import User, UserTypedDict + from .v2descriptor import V2Descriptor, V2DescriptorTypedDict + from .workflowdocument import ( + Auth, + AuthTypedDict, + WorkflowDocument, + WorkflowDocumentTypedDict, + ) + from .workspace import Workspace, WorkspaceTypedDict + from .workspaceandorganization import ( + WorkspaceAndOrganization, + WorkspaceAndOrganizationTypedDict, + ) + from .workspacefeatureflag import WorkspaceFeatureFlag + from .workspacefeatureflagrequest import ( + WorkspaceFeatureFlagRequest, + WorkspaceFeatureFlagRequestTypedDict, + ) + from .workspacefeatureflagresponse import ( + WorkspaceFeatureFlagResponse, + WorkspaceFeatureFlagResponseTypedDict, + ) + from .workspaceinviteresponse import ( + Relationship, + RelationshipTypedDict, + WorkspaceInviteResponse, + WorkspaceInviteResponseTypedDict, + ) + from .workspacesettings import WorkspaceSettings, WorkspaceSettingsTypedDict + from .workspaceteamresponse import ( + WorkspaceTeamResponse, + WorkspaceTeamResponseTypedDict, + ) + from .workspacetoken import WorkspaceToken, WorkspaceTokenTypedDict __all__ = [ "APIKeyDetails", @@ -161,6 +207,7 @@ "AnnotationsTypedDict", "Auth", "AuthTypedDict", + "BillingAddOn", "Claims", "ClaimsTypedDict", "CliEvent", @@ -174,6 +221,7 @@ "DiagnosticTypedDict", "FeatureFlag", "FeatureFlagTypedDict", + "Format", "GenerateBumpType", "GetNamespacesResponse", "GetNamespacesResponseTypedDict", @@ -201,6 +249,7 @@ "GithubStorePublishingSecretsRequestTypedDict", "GithubTriggerActionRequest", "GithubTriggerActionRequestTypedDict", + "HTTPMethod", "InteractionType", "Level", "License", @@ -217,6 +266,10 @@ "OASSummaryTypedDict", "OpenapiDiffBumpType", "Organization", + "OrganizationBillingAddOnRequest", + "OrganizationBillingAddOnRequestTypedDict", + "OrganizationBillingAddOnResponse", + "OrganizationBillingAddOnResponseTypedDict", "OrganizationTypedDict", "OrganizationUsage", "OrganizationUsageResponse", @@ -226,6 +279,10 @@ "PreflightRequestTypedDict", "PreflightToken", "PreflightTokenTypedDict", + "PublishingToken", + "PublishingTokenTypedDict", + "PullRequestMetadata", + "PullRequestMetadataTypedDict", "Relationship", "RelationshipTypedDict", "RemoteDocument", @@ -237,11 +294,16 @@ "Report", "ReportTypedDict", "Revision", + "RevisionContentsMetadata", + "RevisionContentsMetadataType", + "RevisionContentsMetadataTypedDict", "RevisionTypedDict", "SSOMetadata", "SSOMetadataTypedDict", "SchemaFile", "SchemaFileTypedDict", + "SchemaStoreItem", + "SchemaStoreItemTypedDict", "Secrets", "SecretsTypedDict", "Security", @@ -258,6 +320,7 @@ "SuggestionType", "Tag", "TagTypedDict", + "TargetResource", "TargetSDK", "TargetSDKTypedDict", "Type", @@ -274,6 +337,9 @@ "Workspace", "WorkspaceAndOrganization", "WorkspaceAndOrganizationTypedDict", + "WorkspaceFeatureFlag", + "WorkspaceFeatureFlagRequest", + "WorkspaceFeatureFlagRequestTypedDict", "WorkspaceFeatureFlagResponse", "WorkspaceFeatureFlagResponseTypedDict", "WorkspaceInviteResponse", @@ -288,3 +354,195 @@ "Workspaces", "WorkspacesTypedDict", ] + +_dynamic_imports: dict[str, str] = { + "AccessDetails": ".accessdetails", + "AccessDetailsTypedDict": ".accessdetails", + "Level": ".accessdetails", + "AccessToken": ".accesstoken", + "AccessTokenTypedDict": ".accesstoken", + "AccessTokenUser": ".accesstoken", + "AccessTokenUserTypedDict": ".accesstoken", + "Claims": ".accesstoken", + "ClaimsTypedDict": ".accesstoken", + "Workspaces": ".accesstoken", + "WorkspacesTypedDict": ".accesstoken", + "AccountType": ".accounttype", + "AddTags": ".addtags", + "AddTagsTypedDict": ".addtags", + "Annotations": ".annotations", + "AnnotationsTypedDict": ".annotations", + "APIKeyDetails": ".apikeydetails", + "APIKeyDetailsTypedDict": ".apikeydetails", + "BillingAddOn": ".billingaddon", + "CliEvent": ".clievent", + "CliEventTypedDict": ".clievent", + "GenerateBumpType": ".clievent", + "OpenapiDiffBumpType": ".clievent", + "CodeSampleSchemaInput": ".codesampleschemainput", + "CodeSampleSchemaInputTypedDict": ".codesampleschemainput", + "SchemaFile": ".codesampleschemainput", + "SchemaFileTypedDict": ".codesampleschemainput", + "CodeSamplesJobStatus": ".codesamplesjobstatus", + "Diagnostic": ".diagnostic", + "DiagnosticTypedDict": ".diagnostic", + "FeatureFlag": ".featureflag", + "FeatureFlagTypedDict": ".featureflag", + "GetNamespacesResponse": ".getnamespacesresponse", + "GetNamespacesResponseTypedDict": ".getnamespacesresponse", + "GetRevisionsResponse": ".getrevisionsresponse", + "GetRevisionsResponseTypedDict": ".getrevisionsresponse", + "GetTagsResponse": ".gettagsresponse", + "GetTagsResponseTypedDict": ".gettagsresponse", + "GithubConfigureCodeSamplesRequest": ".githubconfigurecodesamplesrequest", + "GithubConfigureCodeSamplesRequestTypedDict": ".githubconfigurecodesamplesrequest", + "GithubConfigureCodeSamplesResponse": ".githubconfigurecodesamplesresponse", + "GithubConfigureCodeSamplesResponseTypedDict": ".githubconfigurecodesamplesresponse", + "GithubConfigureMintlifyRepoRequest": ".githubconfiguremintlifyreporequest", + "GithubConfigureMintlifyRepoRequestTypedDict": ".githubconfiguremintlifyreporequest", + "GithubConfigureTargetRequest": ".githubconfiguretargetrequest", + "GithubConfigureTargetRequestTypedDict": ".githubconfiguretargetrequest", + "GithubGetActionResponse": ".githubgetactionresponse", + "GithubGetActionResponseTypedDict": ".githubgetactionresponse", + "GithubMissingPublishingSecretsResponse": ".githubmissingpublishingsecretsresponse", + "GithubMissingPublishingSecretsResponseTypedDict": ".githubmissingpublishingsecretsresponse", + "GithubPublishingPRResponse": ".githubpublishingprresponse", + "GithubPublishingPRResponseTypedDict": ".githubpublishingprresponse", + "PullRequestMetadata": ".githubpublishingprresponse", + "PullRequestMetadataTypedDict": ".githubpublishingprresponse", + "Actions": ".githubsetupstateresponse", + "ActionsTypedDict": ".githubsetupstateresponse", + "GithubSetupStateResponse": ".githubsetupstateresponse", + "GithubSetupStateResponseTypedDict": ".githubsetupstateresponse", + "Secrets": ".githubsetupstateresponse", + "SecretsTypedDict": ".githubsetupstateresponse", + "GithubStorePublishingSecretsRequest": ".githubstorepublishingsecretsrequest", + "GithubStorePublishingSecretsRequestTypedDict": ".githubstorepublishingsecretsrequest", + "GithubTriggerActionRequest": ".githubtriggeractionrequest", + "GithubTriggerActionRequestTypedDict": ".githubtriggeractionrequest", + "HTTPMethod": ".httpmethod", + "InteractionType": ".interactiontype", + "Manifest": ".manifest", + "ManifestTypedDict": ".manifest", + "CompositeSpecMetadata": ".namespace", + "CompositeSpecMetadataTypedDict": ".namespace", + "Namespace": ".namespace", + "NamespaceTypedDict": ".namespace", + "License": ".oasinfo", + "LicenseTypedDict": ".oasinfo", + "OASInfo": ".oasinfo", + "OASInfoTypedDict": ".oasinfo", + "OASOperation": ".oasoperation", + "OASOperationTypedDict": ".oasoperation", + "OASSummary": ".oassummary", + "OASSummaryTypedDict": ".oassummary", + "Organization": ".organization", + "OrganizationTypedDict": ".organization", + "OrganizationBillingAddOnRequest": ".organizationbillingaddonrequest", + "OrganizationBillingAddOnRequestTypedDict": ".organizationbillingaddonrequest", + "OrganizationBillingAddOnResponse": ".organizationbillingaddonresponse", + "OrganizationBillingAddOnResponseTypedDict": ".organizationbillingaddonresponse", + "OrganizationUsage": ".organizationusage", + "OrganizationUsageTypedDict": ".organizationusage", + "OrganizationUsageResponse": ".organizationusageresponse", + "OrganizationUsageResponseTypedDict": ".organizationusageresponse", + "PreflightRequest": ".preflightrequest", + "PreflightRequestTypedDict": ".preflightrequest", + "PreflightToken": ".preflighttoken", + "PreflightTokenTypedDict": ".preflighttoken", + "PublishingToken": ".publishingtoken", + "PublishingTokenTypedDict": ".publishingtoken", + "TargetResource": ".publishingtoken", + "RemoteDocument": ".remotedocument", + "RemoteDocumentTypedDict": ".remotedocument", + "RemoteSource": ".remotesource", + "RemoteSourceTypedDict": ".remotesource", + "RemoteSourceSubscriptionSettings": ".remotesourcesubscriptionsettings", + "RemoteSourceSubscriptionSettingsTypedDict": ".remotesourcesubscriptionsettings", + "Report": ".report", + "ReportTypedDict": ".report", + "Type": ".report", + "Revision": ".revision", + "RevisionTypedDict": ".revision", + "RevisionContentsMetadata": ".revisioncontentsmetadata", + "RevisionContentsMetadataType": ".revisioncontentsmetadata", + "RevisionContentsMetadataTypedDict": ".revisioncontentsmetadata", + "Format": ".schemastoreitem", + "SchemaStoreItem": ".schemastoreitem", + "SchemaStoreItemTypedDict": ".schemastoreitem", + "Security": ".security", + "SecurityTypedDict": ".security", + "ShortURL": ".shorturl", + "ShortURLTypedDict": ".shorturl", + "SSOMetadata": ".ssometadata", + "SSOMetadataTypedDict": ".ssometadata", + "SuggestItemsRequestBody": ".suggestitemsrequestbody", + "SuggestItemsRequestBodyTypedDict": ".suggestitemsrequestbody", + "SuggestOptsOld": ".suggestoptsold", + "SuggestOptsOldTypedDict": ".suggestoptsold", + "SuggestionType": ".suggestoptsold", + "SuggestRequestBody": ".suggestrequestbody", + "SuggestRequestBodySuggestionType": ".suggestrequestbody", + "SuggestRequestBodyTypedDict": ".suggestrequestbody", + "Tag": ".tag", + "TagTypedDict": ".tag", + "TargetSDK": ".targetsdk", + "TargetSDKTypedDict": ".targetsdk", + "UsageSnippet": ".usagesnippet", + "UsageSnippetTypedDict": ".usagesnippet", + "UsageSnippets": ".usagesnippets", + "UsageSnippetsTypedDict": ".usagesnippets", + "User": ".user", + "UserTypedDict": ".user", + "V2Descriptor": ".v2descriptor", + "V2DescriptorTypedDict": ".v2descriptor", + "Auth": ".workflowdocument", + "AuthTypedDict": ".workflowdocument", + "WorkflowDocument": ".workflowdocument", + "WorkflowDocumentTypedDict": ".workflowdocument", + "Workspace": ".workspace", + "WorkspaceTypedDict": ".workspace", + "WorkspaceAndOrganization": ".workspaceandorganization", + "WorkspaceAndOrganizationTypedDict": ".workspaceandorganization", + "WorkspaceFeatureFlag": ".workspacefeatureflag", + "WorkspaceFeatureFlagRequest": ".workspacefeatureflagrequest", + "WorkspaceFeatureFlagRequestTypedDict": ".workspacefeatureflagrequest", + "WorkspaceFeatureFlagResponse": ".workspacefeatureflagresponse", + "WorkspaceFeatureFlagResponseTypedDict": ".workspacefeatureflagresponse", + "Relationship": ".workspaceinviteresponse", + "RelationshipTypedDict": ".workspaceinviteresponse", + "WorkspaceInviteResponse": ".workspaceinviteresponse", + "WorkspaceInviteResponseTypedDict": ".workspaceinviteresponse", + "WorkspaceSettings": ".workspacesettings", + "WorkspaceSettingsTypedDict": ".workspacesettings", + "WorkspaceTeamResponse": ".workspaceteamresponse", + "WorkspaceTeamResponseTypedDict": ".workspaceteamresponse", + "WorkspaceToken": ".workspacetoken", + "WorkspaceTokenTypedDict": ".workspacetoken", +} + + +def __getattr__(attr_name: str) -> object: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError( + f"No {attr_name} found in _dynamic_imports for module name -> {__name__} " + ) + + try: + module = import_module(module_name, __package__) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError( + f"Failed to import {attr_name} from {module_name}: {e}" + ) from e + except AttributeError as e: + raise AttributeError( + f"Failed to get {attr_name} from {module_name}: {e}" + ) from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) diff --git a/src/speakeasy_client_sdk_python/models/shared/apikeydetails.py b/src/speakeasy_client_sdk_python/models/shared/apikeydetails.py index 34146f75..df12f51d 100644 --- a/src/speakeasy_client_sdk_python/models/shared/apikeydetails.py +++ b/src/speakeasy_client_sdk_python/models/shared/apikeydetails.py @@ -2,6 +2,7 @@ from __future__ import annotations from .accounttype import AccountType +from .billingaddon import BillingAddOn from datetime import datetime import pydantic from pydantic.functional_validators import PlainValidator @@ -13,6 +14,7 @@ class APIKeyDetailsTypedDict(TypedDict): account_type_v2: AccountType + billing_add_ons: List[BillingAddOn] enabled_features: List[str] org_slug: str telemetry_disabled: bool @@ -27,6 +29,10 @@ class APIKeyDetailsTypedDict(TypedDict): class APIKeyDetails(BaseModel): account_type_v2: Annotated[AccountType, PlainValidator(validate_open_enum(False))] + billing_add_ons: List[ + Annotated[BillingAddOn, PlainValidator(validate_open_enum(False))] + ] + enabled_features: List[str] org_slug: str diff --git a/src/speakeasy_client_sdk_python/models/shared/billingaddon.py b/src/speakeasy_client_sdk_python/models/shared/billingaddon.py new file mode 100644 index 00000000..cbc512fd --- /dev/null +++ b/src/speakeasy_client_sdk_python/models/shared/billingaddon.py @@ -0,0 +1,12 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum +from speakeasy_client_sdk_python import utils + + +class BillingAddOn(str, Enum, metaclass=utils.OpenEnumMeta): + WEBHOOKS = "webhooks" + SDK_TESTING = "sdk_testing" + CUSTOM_CODE_REGIONS = "custom_code_regions" + SNIPPET_AI = "snippet_ai" diff --git a/src/speakeasy_client_sdk_python/models/shared/clievent.py b/src/speakeasy_client_sdk_python/models/shared/clievent.py index 4d583bcb..50ed445d 100644 --- a/src/speakeasy_client_sdk_python/models/shared/clievent.py +++ b/src/speakeasy_client_sdk_python/models/shared/clievent.py @@ -185,6 +185,8 @@ class CliEventTypedDict(TypedDict): r"""The namespace name of the source.""" source_revision_digest: NotRequired[str] r"""The revision digest of the source.""" + test_report_raw: NotRequired[str] + r"""The raw test report xml""" workflow_lock_post_raw: NotRequired[str] r"""Workflow lock file (post execution)""" workflow_lock_pre_raw: NotRequired[str] @@ -427,6 +429,9 @@ class CliEvent(BaseModel): source_revision_digest: Optional[str] = None r"""The revision digest of the source.""" + test_report_raw: Optional[str] = None + r"""The raw test report xml""" + workflow_lock_post_raw: Optional[str] = None r"""Workflow lock file (post execution)""" diff --git a/src/speakeasy_client_sdk_python/models/shared/codesampleschemainput.py b/src/speakeasy_client_sdk_python/models/shared/codesampleschemainput.py index d02ee76b..99343c45 100644 --- a/src/speakeasy_client_sdk_python/models/shared/codesampleschemainput.py +++ b/src/speakeasy_client_sdk_python/models/shared/codesampleschemainput.py @@ -34,10 +34,12 @@ class SchemaFile(BaseModel): class CodeSampleSchemaInputTypedDict(TypedDict): - languages: List[str] - r"""A list of languages to generate code samples for""" + language: str + r"""The language to generate code samples for""" schema_file: SchemaFileTypedDict r"""The OpenAPI file to be uploaded""" + operation_ids: NotRequired[List[str]] + r"""A list of operations IDs to generate code samples for""" package_name: NotRequired[str] r"""The name of the package""" sdk_class_name: NotRequired[str] @@ -45,14 +47,17 @@ class CodeSampleSchemaInputTypedDict(TypedDict): class CodeSampleSchemaInput(BaseModel): - languages: Annotated[List[str], FieldMetadata(multipart=True)] - r"""A list of languages to generate code samples for""" + language: Annotated[str, FieldMetadata(multipart=True)] + r"""The language to generate code samples for""" schema_file: Annotated[ SchemaFile, FieldMetadata(multipart=MultipartFormMetadata(file=True)) ] r"""The OpenAPI file to be uploaded""" + operation_ids: Annotated[Optional[List[str]], FieldMetadata(multipart=True)] = None + r"""A list of operations IDs to generate code samples for""" + package_name: Annotated[Optional[str], FieldMetadata(multipart=True)] = None r"""The name of the package""" diff --git a/src/speakeasy_client_sdk_python/models/shared/featureflag.py b/src/speakeasy_client_sdk_python/models/shared/featureflag.py index 3fc81057..a323c21f 100644 --- a/src/speakeasy_client_sdk_python/models/shared/featureflag.py +++ b/src/speakeasy_client_sdk_python/models/shared/featureflag.py @@ -1,8 +1,10 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations +from .workspacefeatureflag import WorkspaceFeatureFlag from datetime import datetime from pydantic import model_serializer +from pydantic.functional_validators import PlainValidator from speakeasy_client_sdk_python.types import ( BaseModel, Nullable, @@ -10,20 +12,25 @@ UNSET, UNSET_SENTINEL, ) -from typing_extensions import NotRequired, TypedDict +from speakeasy_client_sdk_python.utils import validate_open_enum +from typing_extensions import Annotated, NotRequired, TypedDict class FeatureFlagTypedDict(TypedDict): r"""A feature flag is a key-value pair that can be used to enable or disable features.""" - feature_flag: str + feature_flag: WorkspaceFeatureFlag + r"""enum value workspace feature flag""" trial_ends_at: NotRequired[Nullable[datetime]] class FeatureFlag(BaseModel): r"""A feature flag is a key-value pair that can be used to enable or disable features.""" - feature_flag: str + feature_flag: Annotated[ + WorkspaceFeatureFlag, PlainValidator(validate_open_enum(False)) + ] + r"""enum value workspace feature flag""" trial_ends_at: OptionalNullable[datetime] = UNSET @@ -37,7 +44,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/speakeasy_client_sdk_python/models/shared/githubpublishingprresponse.py b/src/speakeasy_client_sdk_python/models/shared/githubpublishingprresponse.py index 562354d1..82aed2d2 100644 --- a/src/speakeasy_client_sdk_python/models/shared/githubpublishingprresponse.py +++ b/src/speakeasy_client_sdk_python/models/shared/githubpublishingprresponse.py @@ -1,21 +1,69 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations +from datetime import datetime from speakeasy_client_sdk_python.types import BaseModel -from typing import Optional +from typing import List, Optional from typing_extensions import NotRequired, TypedDict +class PullRequestMetadataTypedDict(TypedDict): + r"""This can only be populated when the github app is installed for a repo""" + + base_branch: NotRequired[str] + can_merge: NotRequired[bool] + created_at: NotRequired[datetime] + description: NotRequired[str] + r"""truncated to first 1000 characters""" + head_branch: NotRequired[str] + labels: NotRequired[List[str]] + r"""List of github labels""" + requested_reviewers: NotRequired[List[str]] + r"""List of github handles""" + status: NotRequired[str] + title: NotRequired[str] + + +class PullRequestMetadata(BaseModel): + r"""This can only be populated when the github app is installed for a repo""" + + base_branch: Optional[str] = None + + can_merge: Optional[bool] = None + + created_at: Optional[datetime] = None + + description: Optional[str] = None + r"""truncated to first 1000 characters""" + + head_branch: Optional[str] = None + + labels: Optional[List[str]] = None + r"""List of github labels""" + + requested_reviewers: Optional[List[str]] = None + r"""List of github handles""" + + status: Optional[str] = None + + title: Optional[str] = None + + class GithubPublishingPRResponseTypedDict(TypedDict): r"""Open generation PRs pending publishing""" - generation_pull_request: NotRequired[str] pending_version: NotRequired[str] + pull_request: NotRequired[str] + pull_request_metadata: NotRequired[PullRequestMetadataTypedDict] + r"""This can only be populated when the github app is installed for a repo""" class GithubPublishingPRResponse(BaseModel): r"""Open generation PRs pending publishing""" - generation_pull_request: Optional[str] = None - pending_version: Optional[str] = None + + pull_request: Optional[str] = None + + pull_request_metadata: Optional[PullRequestMetadata] = None + r"""This can only be populated when the github app is installed for a repo""" diff --git a/src/speakeasy_client_sdk_python/models/shared/httpmethod.py b/src/speakeasy_client_sdk_python/models/shared/httpmethod.py new file mode 100644 index 00000000..b943efaa --- /dev/null +++ b/src/speakeasy_client_sdk_python/models/shared/httpmethod.py @@ -0,0 +1,15 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class HTTPMethod(str, Enum): + GET = "get" + POST = "post" + PUT = "put" + PATCH = "patch" + DELETE = "delete" + HEAD = "head" + OPTIONS = "options" + TRACE = "trace" diff --git a/src/speakeasy_client_sdk_python/models/shared/interactiontype.py b/src/speakeasy_client_sdk_python/models/shared/interactiontype.py index a321c553..43bf4623 100644 --- a/src/speakeasy_client_sdk_python/models/shared/interactiontype.py +++ b/src/speakeasy_client_sdk_python/models/shared/interactiontype.py @@ -18,3 +18,4 @@ class InteractionType(str, Enum): RUN = "RUN" CONFIGURE = "CONFIGURE" PUBLISH = "PUBLISH" + TEST = "TEST" diff --git a/src/speakeasy_client_sdk_python/models/shared/namespace.py b/src/speakeasy_client_sdk_python/models/shared/namespace.py index 3e23c5af..e2d3a9d6 100644 --- a/src/speakeasy_client_sdk_python/models/shared/namespace.py +++ b/src/speakeasy_client_sdk_python/models/shared/namespace.py @@ -5,6 +5,10 @@ RemoteSourceSubscriptionSettings, RemoteSourceSubscriptionSettingsTypedDict, ) +from .revisioncontentsmetadata import ( + RevisionContentsMetadata, + RevisionContentsMetadataTypedDict, +) from datetime import datetime from speakeasy_client_sdk_python.types import BaseModel from typing import Optional @@ -33,7 +37,9 @@ class NamespaceTypedDict(TypedDict): name: str r"""A human-readable name for the namespace.""" updated_at: datetime + archived_at: NotRequired[datetime] composite_spec_metadata: NotRequired[CompositeSpecMetadataTypedDict] + latest_revision_metadata: NotRequired[RevisionContentsMetadataTypedDict] public: NotRequired[bool] r"""Indicates whether the namespace is publicly accessible""" @@ -51,7 +57,11 @@ class Namespace(BaseModel): updated_at: datetime + archived_at: Optional[datetime] = None + composite_spec_metadata: Optional[CompositeSpecMetadata] = None + latest_revision_metadata: Optional[RevisionContentsMetadata] = None + public: Optional[bool] = None r"""Indicates whether the namespace is publicly accessible""" diff --git a/src/speakeasy_client_sdk_python/models/shared/organization.py b/src/speakeasy_client_sdk_python/models/shared/organization.py index a3913774..7e36195b 100644 --- a/src/speakeasy_client_sdk_python/models/shared/organization.py +++ b/src/speakeasy_client_sdk_python/models/shared/organization.py @@ -68,7 +68,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/speakeasy_client_sdk_python/models/shared/organizationbillingaddonrequest.py b/src/speakeasy_client_sdk_python/models/shared/organizationbillingaddonrequest.py new file mode 100644 index 00000000..f9dbd137 --- /dev/null +++ b/src/speakeasy_client_sdk_python/models/shared/organizationbillingaddonrequest.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .billingaddon import BillingAddOn +from pydantic.functional_validators import PlainValidator +from speakeasy_client_sdk_python.types import BaseModel +from speakeasy_client_sdk_python.utils import validate_open_enum +from typing import List +from typing_extensions import Annotated, TypedDict + + +class OrganizationBillingAddOnRequestTypedDict(TypedDict): + r"""A request to add billing add ons""" + + add_ons: List[BillingAddOn] + + +class OrganizationBillingAddOnRequest(BaseModel): + r"""A request to add billing add ons""" + + add_ons: List[Annotated[BillingAddOn, PlainValidator(validate_open_enum(False))]] diff --git a/src/speakeasy_client_sdk_python/models/shared/organizationbillingaddonresponse.py b/src/speakeasy_client_sdk_python/models/shared/organizationbillingaddonresponse.py new file mode 100644 index 00000000..48b1be92 --- /dev/null +++ b/src/speakeasy_client_sdk_python/models/shared/organizationbillingaddonresponse.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .billingaddon import BillingAddOn +from pydantic.functional_validators import PlainValidator +from speakeasy_client_sdk_python.types import BaseModel +from speakeasy_client_sdk_python.utils import validate_open_enum +from typing import List +from typing_extensions import Annotated, TypedDict + + +class OrganizationBillingAddOnResponseTypedDict(TypedDict): + r"""Billing add on response""" + + add_ons: List[BillingAddOn] + + +class OrganizationBillingAddOnResponse(BaseModel): + r"""Billing add on response""" + + add_ons: List[Annotated[BillingAddOn, PlainValidator(validate_open_enum(False))]] diff --git a/src/speakeasy_client_sdk_python/models/shared/publishingtoken.py b/src/speakeasy_client_sdk_python/models/shared/publishingtoken.py new file mode 100644 index 00000000..f3626c7c --- /dev/null +++ b/src/speakeasy_client_sdk_python/models/shared/publishingtoken.py @@ -0,0 +1,57 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from datetime import datetime +from enum import Enum +from speakeasy_client_sdk_python.types import BaseModel +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class TargetResource(str, Enum): + DOCUMENT = "document" + + +class PublishingTokenTypedDict(TypedDict): + r"""A token used to publish to a target""" + + created_at: datetime + created_by: str + id: str + organization_id: str + target_id: str + target_resource: TargetResource + token: str + token_name: str + valid_until: datetime + workspace_id: str + updated_at: NotRequired[datetime] + updated_by: NotRequired[str] + + +class PublishingToken(BaseModel): + r"""A token used to publish to a target""" + + created_at: datetime + + created_by: str + + id: str + + organization_id: str + + target_id: str + + target_resource: TargetResource + + token: str + + token_name: str + + valid_until: datetime + + workspace_id: str + + updated_at: Optional[datetime] = None + + updated_by: Optional[str] = None diff --git a/src/speakeasy_client_sdk_python/models/shared/revision.py b/src/speakeasy_client_sdk_python/models/shared/revision.py index 549bdba9..bcb87746 100644 --- a/src/speakeasy_client_sdk_python/models/shared/revision.py +++ b/src/speakeasy_client_sdk_python/models/shared/revision.py @@ -1,10 +1,14 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations +from .revisioncontentsmetadata import ( + RevisionContentsMetadata, + RevisionContentsMetadataTypedDict, +) from datetime import datetime from speakeasy_client_sdk_python.types import BaseModel -from typing import List -from typing_extensions import TypedDict +from typing import List, Optional +from typing_extensions import NotRequired, TypedDict class RevisionTypedDict(TypedDict): @@ -15,6 +19,7 @@ class RevisionTypedDict(TypedDict): namespace_name: str tags: List[str] updated_at: datetime + contents_metadata: NotRequired[RevisionContentsMetadataTypedDict] class Revision(BaseModel): @@ -30,3 +35,5 @@ class Revision(BaseModel): tags: List[str] updated_at: datetime + + contents_metadata: Optional[RevisionContentsMetadata] = None diff --git a/src/speakeasy_client_sdk_python/models/shared/revisioncontentsmetadata.py b/src/speakeasy_client_sdk_python/models/shared/revisioncontentsmetadata.py new file mode 100644 index 00000000..3e896002 --- /dev/null +++ b/src/speakeasy_client_sdk_python/models/shared/revisioncontentsmetadata.py @@ -0,0 +1,79 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from datetime import datetime +from enum import Enum +from speakeasy_client_sdk_python.types import BaseModel +from typing import List +from typing_extensions import TypedDict + + +class RevisionContentsMetadataType(str, Enum): + OPENAPI_BUNDLE = "OPENAPI_BUNDLE" + OPENAPI_OVERLAY = "OPENAPI_OVERLAY" + + +class RevisionContentsMetadataTypedDict(TypedDict): + contains_code_samples: bool + r"""Whether the OAS contains code samples.""" + created_at: datetime + description: str + r"""The OAS description""" + hash: str + r"""The hash of the contents""" + namespace: str + r"""The fully qualified namespace""" + num_overlay_actions: int + r"""The number of overlay actions in the OAS. Will be 0 if the OAS is not an overlay.""" + operation_ids: List[str] + r"""The operation IDs contained in the OAS. Will be empty if the OAS is an overlay.""" + revision_digest: str + r"""The digest of the parent bundle""" + tags: List[str] + r"""The tags contained in the OAS -- NOT the OCI tags. Will be empty if the OAS is an overlay.""" + title: str + r"""The OAS title""" + type: RevisionContentsMetadataType + version: str + r"""The OAS version""" + workspace_id: str + r"""The workspace ID""" + + +class RevisionContentsMetadata(BaseModel): + contains_code_samples: bool + r"""Whether the OAS contains code samples.""" + + created_at: datetime + + description: str + r"""The OAS description""" + + hash: str + r"""The hash of the contents""" + + namespace: str + r"""The fully qualified namespace""" + + num_overlay_actions: int + r"""The number of overlay actions in the OAS. Will be 0 if the OAS is not an overlay.""" + + operation_ids: List[str] + r"""The operation IDs contained in the OAS. Will be empty if the OAS is an overlay.""" + + revision_digest: str + r"""The digest of the parent bundle""" + + tags: List[str] + r"""The tags contained in the OAS -- NOT the OCI tags. Will be empty if the OAS is an overlay.""" + + title: str + r"""The OAS title""" + + type: RevisionContentsMetadataType + + version: str + r"""The OAS version""" + + workspace_id: str + r"""The workspace ID""" diff --git a/src/speakeasy_client_sdk_python/models/shared/schemastoreitem.py b/src/speakeasy_client_sdk_python/models/shared/schemastoreitem.py new file mode 100644 index 00000000..d1fa9eb3 --- /dev/null +++ b/src/speakeasy_client_sdk_python/models/shared/schemastoreitem.py @@ -0,0 +1,36 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from datetime import datetime +from enum import Enum +import pydantic +from speakeasy_client_sdk_python.types import BaseModel +from typing_extensions import Annotated, TypedDict + + +class Format(str, Enum): + JSON = "json" + YAML = "yaml" + + +class SchemaStoreItemTypedDict(TypedDict): + created_at: datetime + format_: Format + id: str + package_name: str + sdk_classname: str + spec: str + + +class SchemaStoreItem(BaseModel): + created_at: datetime + + format_: Annotated[Format, pydantic.Field(alias="format")] + + id: str + + package_name: Annotated[str, pydantic.Field(alias="packageName")] + + sdk_classname: Annotated[str, pydantic.Field(alias="sdkClassname")] + + spec: str diff --git a/src/speakeasy_client_sdk_python/models/shared/usagesnippet.py b/src/speakeasy_client_sdk_python/models/shared/usagesnippet.py index b7ed66ff..011ea49b 100644 --- a/src/speakeasy_client_sdk_python/models/shared/usagesnippet.py +++ b/src/speakeasy_client_sdk_python/models/shared/usagesnippet.py @@ -3,6 +3,7 @@ from __future__ import annotations import pydantic from speakeasy_client_sdk_python.types import BaseModel +from typing import Any from typing_extensions import Annotated, TypedDict @@ -11,8 +12,12 @@ class UsageSnippetTypedDict(TypedDict): r"""The code snippet""" language: str r"""The language of the snippet""" + method: Any + r"""The HTTP method of the operation""" operation_id: str r"""The operation ID for the snippet""" + path: str + r"""The path of the operation""" class UsageSnippet(BaseModel): @@ -22,5 +27,11 @@ class UsageSnippet(BaseModel): language: str r"""The language of the snippet""" + method: Any + r"""The HTTP method of the operation""" + operation_id: Annotated[str, pydantic.Field(alias="operationId")] r"""The operation ID for the snippet""" + + path: str + r"""The path of the operation""" diff --git a/src/speakeasy_client_sdk_python/models/shared/user.py b/src/speakeasy_client_sdk_python/models/shared/user.py index f250ddb5..c667907c 100644 --- a/src/speakeasy_client_sdk_python/models/shared/user.py +++ b/src/speakeasy_client_sdk_python/models/shared/user.py @@ -37,12 +37,16 @@ class UserTypedDict(TypedDict): r"""Identifier of the default workspace.""" github_handle: NotRequired[Nullable[str]] r"""GitHub handle of the user.""" + has_created_api_key: NotRequired[bool] + r"""Indicates whether the user has created an API key. Not always populated""" internal: NotRequired[bool] r"""Indicates whether the user is internal.""" last_login_at: NotRequired[Nullable[datetime]] r"""Timestamp of the last login.""" photo_url: NotRequired[Nullable[str]] r"""URL of the user's photo.""" + pylon_identity_hash: NotRequired[str] + r"""Hash used for pylon identity verification returned on v1/user.""" class User(BaseModel): @@ -79,6 +83,9 @@ class User(BaseModel): github_handle: OptionalNullable[str] = UNSET r"""GitHub handle of the user.""" + has_created_api_key: Optional[bool] = None + r"""Indicates whether the user has created an API key. Not always populated""" + internal: Optional[bool] = None r"""Indicates whether the user is internal.""" @@ -88,14 +95,19 @@ class User(BaseModel): photo_url: OptionalNullable[str] = UNSET r"""URL of the user's photo.""" + pylon_identity_hash: Optional[str] = None + r"""Hash used for pylon identity verification returned on v1/user.""" + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = [ "default_workspace_id", "github_handle", + "has_created_api_key", "internal", "last_login_at", "photo_url", + "pylon_identity_hash", ] nullable_fields = [ "default_workspace_id", @@ -109,7 +121,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/speakeasy_client_sdk_python/models/shared/workspacefeatureflag.py b/src/speakeasy_client_sdk_python/models/shared/workspacefeatureflag.py new file mode 100644 index 00000000..f445ac9a --- /dev/null +++ b/src/speakeasy_client_sdk_python/models/shared/workspacefeatureflag.py @@ -0,0 +1,14 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum +from speakeasy_client_sdk_python import utils + + +class WorkspaceFeatureFlag(str, Enum, metaclass=utils.OpenEnumMeta): + r"""enum value workspace feature flag""" + + SCHEMA_REGISTRY = "schema_registry" + CHANGES_REPORT = "changes_report" + SKIP_SCHEMA_REGISTRY = "skip_schema_registry" + WEBHOOKS = "webhooks" diff --git a/src/speakeasy_client_sdk_python/models/shared/workspacefeatureflagrequest.py b/src/speakeasy_client_sdk_python/models/shared/workspacefeatureflagrequest.py new file mode 100644 index 00000000..a448a2d2 --- /dev/null +++ b/src/speakeasy_client_sdk_python/models/shared/workspacefeatureflagrequest.py @@ -0,0 +1,23 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .workspacefeatureflag import WorkspaceFeatureFlag +from pydantic.functional_validators import PlainValidator +from speakeasy_client_sdk_python.types import BaseModel +from speakeasy_client_sdk_python.utils import validate_open_enum +from typing import List +from typing_extensions import Annotated, TypedDict + + +class WorkspaceFeatureFlagRequestTypedDict(TypedDict): + r"""A request to add workspace feature flags""" + + feature_flags: List[WorkspaceFeatureFlag] + + +class WorkspaceFeatureFlagRequest(BaseModel): + r"""A request to add workspace feature flags""" + + feature_flags: List[ + Annotated[WorkspaceFeatureFlag, PlainValidator(validate_open_enum(False))] + ] diff --git a/src/speakeasy_client_sdk_python/models/shared/workspaceinviteresponse.py b/src/speakeasy_client_sdk_python/models/shared/workspaceinviteresponse.py index f818ff00..8f71413f 100644 --- a/src/speakeasy_client_sdk_python/models/shared/workspaceinviteresponse.py +++ b/src/speakeasy_client_sdk_python/models/shared/workspaceinviteresponse.py @@ -47,7 +47,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/speakeasy_client_sdk_python/models/shared/workspacetoken.py b/src/speakeasy_client_sdk_python/models/shared/workspacetoken.py index 2359e28c..a40c17e5 100644 --- a/src/speakeasy_client_sdk_python/models/shared/workspacetoken.py +++ b/src/speakeasy_client_sdk_python/models/shared/workspacetoken.py @@ -23,6 +23,8 @@ class WorkspaceTokenTypedDict(TypedDict): name: str workspace_id: str created_by: NotRequired[Nullable[str]] + created_by_name: NotRequired[Nullable[str]] + created_by_photo_url: NotRequired[Nullable[str]] email: NotRequired[Nullable[str]] last_used: NotRequired[Nullable[datetime]] @@ -44,21 +46,37 @@ class WorkspaceToken(BaseModel): created_by: OptionalNullable[str] = UNSET + created_by_name: OptionalNullable[str] = UNSET + + created_by_photo_url: OptionalNullable[str] = UNSET + email: OptionalNullable[str] = UNSET last_used: OptionalNullable[datetime] = UNSET @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = ["created_by", "email", "last_used"] - nullable_fields = ["created_by", "email", "last_used"] + optional_fields = [ + "created_by", + "created_by_name", + "created_by_photo_url", + "email", + "last_used", + ] + nullable_fields = [ + "created_by", + "created_by_name", + "created_by_photo_url", + "email", + "last_used", + ] null_default_fields = [] serialized = handler(self) m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/speakeasy_client_sdk_python/organizations.py b/src/speakeasy_client_sdk_python/organizations.py index e32c4c98..07c064ff 100644 --- a/src/speakeasy_client_sdk_python/organizations.py +++ b/src/speakeasy_client_sdk_python/organizations.py @@ -5,6 +5,9 @@ from speakeasy_client_sdk_python._hooks import HookContext from speakeasy_client_sdk_python.models import errors, operations, shared from speakeasy_client_sdk_python.types import BaseModel, OptionalNullable, UNSET +from speakeasy_client_sdk_python.utils.unmarshal_json_response import ( + unmarshal_json_response, +) from typing import Any, List, Mapping, Optional, Union, cast @@ -37,6 +40,8 @@ def create( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, shared.Organization) @@ -71,6 +76,8 @@ def create( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="createOrganization", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -80,33 +87,24 @@ def create( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "application/json"): return operations.CreateOrganizationResponse( - organization=utils.unmarshal_json( - http_res.text, Optional[shared.Organization] + organization=unmarshal_json_response( + Optional[shared.Organization], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def create_async( self, @@ -134,6 +132,8 @@ async def create_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, shared.Organization) @@ -168,6 +168,8 @@ async def create_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="createOrganization", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -177,34 +179,211 @@ async def create_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "application/json"): return operations.CreateOrganizationResponse( - organization=utils.unmarshal_json( - http_res.text, Optional[shared.Organization] + organization=unmarshal_json_response( + Optional[shared.Organization], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def create_billing_add_ons( + self, + *, + request: Union[ + shared.OrganizationBillingAddOnRequest, + shared.OrganizationBillingAddOnRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.CreateBillingAddOnsResponse: + r"""Create billing add ons + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, shared.OrganizationBillingAddOnRequest) + request = cast(shared.OrganizationBillingAddOnRequest, request) + + req = self._build_request( + method="POST", + path="/v1/organization/add_ons", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", shared.OrganizationBillingAddOnRequest + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="createBillingAddOns", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return operations.CreateBillingAddOnsResponse( + organization_billing_add_on_response=unmarshal_json_response( + Optional[shared.OrganizationBillingAddOnResponse], http_res + ), + status_code=http_res.status_code, + content_type=http_res.headers.get("Content-Type") or "", + raw_response=http_res, ) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "application/json"): + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) + + raise errors.SDKError("Unexpected response received", http_res) + + async def create_billing_add_ons_async( + self, + *, + request: Union[ + shared.OrganizationBillingAddOnRequest, + shared.OrganizationBillingAddOnRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.CreateBillingAddOnsResponse: + r"""Create billing add ons + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, shared.OrganizationBillingAddOnRequest) + request = cast(shared.OrganizationBillingAddOnRequest, request) + + req = self._build_request_async( + method="POST", + path="/v1/organization/add_ons", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", shared.OrganizationBillingAddOnRequest + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="createBillingAddOns", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, ) + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return operations.CreateBillingAddOnsResponse( + organization_billing_add_on_response=unmarshal_json_response( + Optional[shared.OrganizationBillingAddOnResponse], http_res + ), + status_code=http_res.status_code, + content_type=http_res.headers.get("Content-Type") or "", + raw_response=http_res, + ) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "application/json"): + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) + + raise errors.SDKError("Unexpected response received", http_res) + def create_free_trial( self, *, @@ -229,6 +408,8 @@ def create_free_trial( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) req = self._build_request( method="POST", path="/v1/organization/free_trial", @@ -255,6 +436,8 @@ def create_free_trial( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="createFreeTrial", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -264,7 +447,7 @@ def create_free_trial( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "*"): return operations.CreateFreeTrialResponse( status_code=http_res.status_code, @@ -272,22 +455,13 @@ def create_free_trial( raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def create_free_trial_async( self, @@ -313,6 +487,8 @@ async def create_free_trial_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) req = self._build_request_async( method="POST", path="/v1/organization/free_trial", @@ -339,6 +515,8 @@ async def create_free_trial_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="createFreeTrial", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -348,7 +526,7 @@ async def create_free_trial_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "*"): return operations.CreateFreeTrialResponse( status_code=http_res.status_code, @@ -356,23 +534,188 @@ async def create_free_trial_async( raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def delete_billing_add_on( + self, + *, + request: Union[ + operations.DeleteBillingAddOnRequest, + operations.DeleteBillingAddOnRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.DeleteBillingAddOnResponse: + r"""Delete billing add ons + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.DeleteBillingAddOnRequest) + request = cast(operations.DeleteBillingAddOnRequest, request) + + req = self._build_request( + method="DELETE", + path="/v1/organization/add_ons/{add_on}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="deleteBillingAddOn", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "*"): + return operations.DeleteBillingAddOnResponse( + status_code=http_res.status_code, + content_type=http_res.headers.get("Content-Type") or "", + raw_response=http_res, ) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "application/json"): + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) + + raise errors.SDKError("Unexpected response received", http_res) + + async def delete_billing_add_on_async( + self, + *, + request: Union[ + operations.DeleteBillingAddOnRequest, + operations.DeleteBillingAddOnRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.DeleteBillingAddOnResponse: + r"""Delete billing add ons + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.DeleteBillingAddOnRequest) + request = cast(operations.DeleteBillingAddOnRequest, request) + + req = self._build_request_async( + method="DELETE", + path="/v1/organization/add_ons/{add_on}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="deleteBillingAddOn", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, ) + response_data: Any = None + if utils.match_response(http_res, "200", "*"): + return operations.DeleteBillingAddOnResponse( + status_code=http_res.status_code, + content_type=http_res.headers.get("Content-Type") or "", + raw_response=http_res, + ) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "application/json"): + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) + + raise errors.SDKError("Unexpected response received", http_res) + def get( self, *, @@ -402,6 +745,8 @@ def get( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetOrganizationRequest) @@ -433,6 +778,8 @@ def get( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="getOrganization", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -442,33 +789,24 @@ def get( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "application/json"): return operations.GetOrganizationResponse( - organization=utils.unmarshal_json( - http_res.text, Optional[shared.Organization] + organization=unmarshal_json_response( + Optional[shared.Organization], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def get_async( self, @@ -499,6 +837,8 @@ async def get_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetOrganizationRequest) @@ -530,6 +870,8 @@ async def get_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="getOrganization", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -539,33 +881,24 @@ async def get_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "application/json"): return operations.GetOrganizationResponse( - organization=utils.unmarshal_json( - http_res.text, Optional[shared.Organization] + organization=unmarshal_json_response( + Optional[shared.Organization], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) def get_all( self, @@ -591,6 +924,8 @@ def get_all( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) req = self._build_request( method="GET", path="/v1/organizations", @@ -617,6 +952,8 @@ def get_all( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="getOrganizations", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -626,33 +963,24 @@ def get_all( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "application/json"): return operations.GetOrganizationsResponse( - organizations=utils.unmarshal_json( - http_res.text, Optional[List[shared.Organization]] + organizations=unmarshal_json_response( + Optional[List[shared.Organization]], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def get_all_async( self, @@ -678,6 +1006,8 @@ async def get_all_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) req = self._build_request_async( method="GET", path="/v1/organizations", @@ -704,6 +1034,8 @@ async def get_all_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="getOrganizations", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -713,34 +1045,185 @@ async def get_all_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "application/json"): return operations.GetOrganizationsResponse( - organizations=utils.unmarshal_json( - http_res.text, Optional[List[shared.Organization]] + organizations=unmarshal_json_response( + Optional[List[shared.Organization]], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def get_billing_add_ons( + self, + *, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.GetBillingAddOnsResponse: + r"""Get billing add ons + + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + req = self._build_request( + method="GET", + path="/v1/organization/add_ons", + base_url=base_url, + url_variables=url_variables, + request=None, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="getBillingAddOns", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return operations.GetBillingAddOnsResponse( + organization_billing_add_on_response=unmarshal_json_response( + Optional[shared.OrganizationBillingAddOnResponse], http_res + ), + status_code=http_res.status_code, + content_type=http_res.headers.get("Content-Type") or "", + raw_response=http_res, ) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "application/json"): + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) + + raise errors.SDKError("Unexpected response received", http_res) + + async def get_billing_add_ons_async( + self, + *, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.GetBillingAddOnsResponse: + r"""Get billing add ons + + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + req = self._build_request_async( + method="GET", + path="/v1/organization/add_ons", + base_url=base_url, + url_variables=url_variables, + request=None, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, ) + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="getBillingAddOns", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return operations.GetBillingAddOnsResponse( + organization_billing_add_on_response=unmarshal_json_response( + Optional[shared.OrganizationBillingAddOnResponse], http_res + ), + status_code=http_res.status_code, + content_type=http_res.headers.get("Content-Type") or "", + raw_response=http_res, + ) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "application/json"): + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) + + raise errors.SDKError("Unexpected response received", http_res) + def get_usage( self, *, @@ -765,6 +1248,8 @@ def get_usage( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) req = self._build_request( method="GET", path="/v1/organization/usage", @@ -791,6 +1276,8 @@ def get_usage( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="getOrganizationUsage", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -800,33 +1287,24 @@ def get_usage( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "application/json"): return operations.GetOrganizationUsageResponse( - organization_usage_response=utils.unmarshal_json( - http_res.text, Optional[shared.OrganizationUsageResponse] + organization_usage_response=unmarshal_json_response( + Optional[shared.OrganizationUsageResponse], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def get_usage_async( self, @@ -852,6 +1330,8 @@ async def get_usage_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) req = self._build_request_async( method="GET", path="/v1/organization/usage", @@ -878,6 +1358,8 @@ async def get_usage_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="getOrganizationUsage", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -887,30 +1369,21 @@ async def get_usage_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "application/json"): return operations.GetOrganizationUsageResponse( - organization_usage_response=utils.unmarshal_json( - http_res.text, Optional[shared.OrganizationUsageResponse] + organization_usage_response=unmarshal_json_response( + Optional[shared.OrganizationUsageResponse], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) diff --git a/src/speakeasy_client_sdk_python/publishingtokens.py b/src/speakeasy_client_sdk_python/publishingtokens.py new file mode 100644 index 00000000..7dbe5e7f --- /dev/null +++ b/src/speakeasy_client_sdk_python/publishingtokens.py @@ -0,0 +1,1315 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from speakeasy_client_sdk_python import utils +from speakeasy_client_sdk_python._hooks import HookContext +from speakeasy_client_sdk_python.models import errors, operations, shared +from speakeasy_client_sdk_python.types import BaseModel, OptionalNullable, UNSET +from speakeasy_client_sdk_python.utils.unmarshal_json_response import ( + unmarshal_json_response, +) +from typing import Any, List, Mapping, Optional, Union, cast + + +class PublishingTokens(BaseSDK): + def create( + self, + *, + request: Optional[ + Union[ + operations.CreatePublishingTokenRequestBody, + operations.CreatePublishingTokenRequestBodyTypedDict, + ] + ] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.CreatePublishingTokenResponse: + r"""Create a publishing token for a workspace + + Creates a publishing token for the current workspace + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, Optional[operations.CreatePublishingTokenRequestBody] + ) + request = cast(Optional[operations.CreatePublishingTokenRequestBody], request) + + req = self._build_request( + method="POST", + path="/v1/publishing-tokens", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, + False, + True, + "json", + Optional[operations.CreatePublishingTokenRequestBody], + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="createPublishingToken", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return operations.CreatePublishingTokenResponse( + publishing_token=unmarshal_json_response( + Optional[shared.PublishingToken], http_res + ), + status_code=http_res.status_code, + content_type=http_res.headers.get("Content-Type") or "", + raw_response=http_res, + ) + if utils.match_response(http_res, "4XX", "application/json"): + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def create_async( + self, + *, + request: Optional[ + Union[ + operations.CreatePublishingTokenRequestBody, + operations.CreatePublishingTokenRequestBodyTypedDict, + ] + ] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.CreatePublishingTokenResponse: + r"""Create a publishing token for a workspace + + Creates a publishing token for the current workspace + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, Optional[operations.CreatePublishingTokenRequestBody] + ) + request = cast(Optional[operations.CreatePublishingTokenRequestBody], request) + + req = self._build_request_async( + method="POST", + path="/v1/publishing-tokens", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, + False, + True, + "json", + Optional[operations.CreatePublishingTokenRequestBody], + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="createPublishingToken", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return operations.CreatePublishingTokenResponse( + publishing_token=unmarshal_json_response( + Optional[shared.PublishingToken], http_res + ), + status_code=http_res.status_code, + content_type=http_res.headers.get("Content-Type") or "", + raw_response=http_res, + ) + if utils.match_response(http_res, "4XX", "application/json"): + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def delete( + self, + *, + request: Union[ + operations.DeletePublishingTokenRequest, + operations.DeletePublishingTokenRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.DeletePublishingTokenResponse: + r"""Delete a specific publishing token + + Delete a particular publishing token. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.DeletePublishingTokenRequest) + request = cast(operations.DeletePublishingTokenRequest, request) + + req = self._build_request( + method="DELETE", + path="/v1/publishing-tokens/{tokenID}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="deletePublishingToken", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "*"): + return operations.DeletePublishingTokenResponse( + status_code=http_res.status_code, + content_type=http_res.headers.get("Content-Type") or "", + raw_response=http_res, + ) + if utils.match_response(http_res, "4XX", "application/json"): + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def delete_async( + self, + *, + request: Union[ + operations.DeletePublishingTokenRequest, + operations.DeletePublishingTokenRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.DeletePublishingTokenResponse: + r"""Delete a specific publishing token + + Delete a particular publishing token. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.DeletePublishingTokenRequest) + request = cast(operations.DeletePublishingTokenRequest, request) + + req = self._build_request_async( + method="DELETE", + path="/v1/publishing-tokens/{tokenID}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="deletePublishingToken", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "*"): + return operations.DeletePublishingTokenResponse( + status_code=http_res.status_code, + content_type=http_res.headers.get("Content-Type") or "", + raw_response=http_res, + ) + if utils.match_response(http_res, "4XX", "application/json"): + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def get( + self, + *, + request: Union[ + operations.GetPublishingTokenByIDRequest, + operations.GetPublishingTokenByIDRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.GetPublishingTokenByIDResponse: + r"""Get a specific publishing token + + Get information about a particular publishing token. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.GetPublishingTokenByIDRequest) + request = cast(operations.GetPublishingTokenByIDRequest, request) + + req = self._build_request( + method="GET", + path="/v1/publishing-tokens/{tokenID}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="getPublishingTokenByID", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return operations.GetPublishingTokenByIDResponse( + publishing_token=unmarshal_json_response( + Optional[shared.PublishingToken], http_res + ), + status_code=http_res.status_code, + content_type=http_res.headers.get("Content-Type") or "", + raw_response=http_res, + ) + if utils.match_response(http_res, "4XX", "application/json"): + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def get_async( + self, + *, + request: Union[ + operations.GetPublishingTokenByIDRequest, + operations.GetPublishingTokenByIDRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.GetPublishingTokenByIDResponse: + r"""Get a specific publishing token + + Get information about a particular publishing token. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.GetPublishingTokenByIDRequest) + request = cast(operations.GetPublishingTokenByIDRequest, request) + + req = self._build_request_async( + method="GET", + path="/v1/publishing-tokens/{tokenID}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="getPublishingTokenByID", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return operations.GetPublishingTokenByIDResponse( + publishing_token=unmarshal_json_response( + Optional[shared.PublishingToken], http_res + ), + status_code=http_res.status_code, + content_type=http_res.headers.get("Content-Type") or "", + raw_response=http_res, + ) + if utils.match_response(http_res, "4XX", "application/json"): + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def list( + self, + *, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.GetPublishingTokenResponse: + r"""Get publishing tokens for a workspace + + Returns a publishing token for the current workspace + + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + req = self._build_request( + method="GET", + path="/v1/publishing-tokens", + base_url=base_url, + url_variables=url_variables, + request=None, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="getPublishingToken", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return operations.GetPublishingTokenResponse( + classes=unmarshal_json_response( + Optional[List[shared.PublishingToken]], http_res + ), + status_code=http_res.status_code, + content_type=http_res.headers.get("Content-Type") or "", + raw_response=http_res, + ) + if utils.match_response(http_res, "4XX", "application/json"): + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def list_async( + self, + *, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.GetPublishingTokenResponse: + r"""Get publishing tokens for a workspace + + Returns a publishing token for the current workspace + + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + req = self._build_request_async( + method="GET", + path="/v1/publishing-tokens", + base_url=base_url, + url_variables=url_variables, + request=None, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="getPublishingToken", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return operations.GetPublishingTokenResponse( + classes=unmarshal_json_response( + Optional[List[shared.PublishingToken]], http_res + ), + status_code=http_res.status_code, + content_type=http_res.headers.get("Content-Type") or "", + raw_response=http_res, + ) + if utils.match_response(http_res, "4XX", "application/json"): + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def resolve_metadata( + self, + *, + request: Union[ + operations.GetPublishingTokenPublicMetadataRequest, + operations.GetPublishingTokenPublicMetadataRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.GetPublishingTokenPublicMetadataResponse: + r"""Get metadata about the token + + Get information about a particular publishing token. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.GetPublishingTokenPublicMetadataRequest + ) + request = cast(operations.GetPublishingTokenPublicMetadataRequest, request) + + req = self._build_request( + method="GET", + path="/v1/publishing-tokens/{tokenID}/metadata", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="getPublishingTokenPublicMetadata", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return operations.GetPublishingTokenPublicMetadataResponse( + object=unmarshal_json_response( + Optional[operations.GetPublishingTokenPublicMetadataResponseBody], + http_res, + ), + status_code=http_res.status_code, + content_type=http_res.headers.get("Content-Type") or "", + raw_response=http_res, + ) + if utils.match_response(http_res, "4XX", "application/json"): + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def resolve_metadata_async( + self, + *, + request: Union[ + operations.GetPublishingTokenPublicMetadataRequest, + operations.GetPublishingTokenPublicMetadataRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.GetPublishingTokenPublicMetadataResponse: + r"""Get metadata about the token + + Get information about a particular publishing token. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.GetPublishingTokenPublicMetadataRequest + ) + request = cast(operations.GetPublishingTokenPublicMetadataRequest, request) + + req = self._build_request_async( + method="GET", + path="/v1/publishing-tokens/{tokenID}/metadata", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="getPublishingTokenPublicMetadata", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return operations.GetPublishingTokenPublicMetadataResponse( + object=unmarshal_json_response( + Optional[operations.GetPublishingTokenPublicMetadataResponseBody], + http_res, + ), + status_code=http_res.status_code, + content_type=http_res.headers.get("Content-Type") or "", + raw_response=http_res, + ) + if utils.match_response(http_res, "4XX", "application/json"): + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def resolve_target( + self, + *, + request: Union[ + operations.GetPublishingTokenTargetByIDRequest, + operations.GetPublishingTokenTargetByIDRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.GetPublishingTokenTargetByIDResponse: + r"""Get a specific publishing token target + + Get information about a particular publishing token target. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.GetPublishingTokenTargetByIDRequest + ) + request = cast(operations.GetPublishingTokenTargetByIDRequest, request) + + req = self._build_request( + method="GET", + path="/v1/publishing-tokens/{tokenID}/target", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="text/plain", + http_headers=http_headers, + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="getPublishingTokenTargetByID", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "text/plain"): + return operations.GetPublishingTokenTargetByIDResponse( + res=http_res.text, + status_code=http_res.status_code, + content_type=http_res.headers.get("Content-Type") or "", + raw_response=http_res, + ) + if utils.match_response(http_res, "4XX", "application/json"): + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def resolve_target_async( + self, + *, + request: Union[ + operations.GetPublishingTokenTargetByIDRequest, + operations.GetPublishingTokenTargetByIDRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.GetPublishingTokenTargetByIDResponse: + r"""Get a specific publishing token target + + Get information about a particular publishing token target. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.GetPublishingTokenTargetByIDRequest + ) + request = cast(operations.GetPublishingTokenTargetByIDRequest, request) + + req = self._build_request_async( + method="GET", + path="/v1/publishing-tokens/{tokenID}/target", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="text/plain", + http_headers=http_headers, + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="getPublishingTokenTargetByID", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "text/plain"): + return operations.GetPublishingTokenTargetByIDResponse( + res=http_res.text, + status_code=http_res.status_code, + content_type=http_res.headers.get("Content-Type") or "", + raw_response=http_res, + ) + if utils.match_response(http_res, "4XX", "application/json"): + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def update( + self, + *, + request: Union[ + operations.UpdatePublishingTokenExpirationRequest, + operations.UpdatePublishingTokenExpirationRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.UpdatePublishingTokenExpirationResponse: + r"""Updates the validitity period of a publishing token + + Updates the validity period of a particular publishing token. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.UpdatePublishingTokenExpirationRequest + ) + request = cast(operations.UpdatePublishingTokenExpirationRequest, request) + + req = self._build_request( + method="PUT", + path="/v1/publishing-tokens/{tokenID}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.request_body, + False, + True, + "json", + Optional[operations.UpdatePublishingTokenExpirationRequestBody], + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="updatePublishingTokenExpiration", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "*"): + return operations.UpdatePublishingTokenExpirationResponse( + status_code=http_res.status_code, + content_type=http_res.headers.get("Content-Type") or "", + raw_response=http_res, + ) + if utils.match_response(http_res, "4XX", "application/json"): + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def update_async( + self, + *, + request: Union[ + operations.UpdatePublishingTokenExpirationRequest, + operations.UpdatePublishingTokenExpirationRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.UpdatePublishingTokenExpirationResponse: + r"""Updates the validitity period of a publishing token + + Updates the validity period of a particular publishing token. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.UpdatePublishingTokenExpirationRequest + ) + request = cast(operations.UpdatePublishingTokenExpirationRequest, request) + + req = self._build_request_async( + method="PUT", + path="/v1/publishing-tokens/{tokenID}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.request_body, + False, + True, + "json", + Optional[operations.UpdatePublishingTokenExpirationRequestBody], + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="updatePublishingTokenExpiration", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "*"): + return operations.UpdatePublishingTokenExpirationResponse( + status_code=http_res.status_code, + content_type=http_res.headers.get("Content-Type") or "", + raw_response=http_res, + ) + if utils.match_response(http_res, "4XX", "application/json"): + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) diff --git a/src/speakeasy_client_sdk_python/reports.py b/src/speakeasy_client_sdk_python/reports.py index 3caa2e8d..2b9299e6 100644 --- a/src/speakeasy_client_sdk_python/reports.py +++ b/src/speakeasy_client_sdk_python/reports.py @@ -5,6 +5,9 @@ from speakeasy_client_sdk_python._hooks import HookContext from speakeasy_client_sdk_python.models import errors, operations from speakeasy_client_sdk_python.types import BaseModel, OptionalNullable, UNSET +from speakeasy_client_sdk_python.utils.unmarshal_json_response import ( + unmarshal_json_response, +) from typing import Mapping, Optional, Union, cast @@ -38,6 +41,8 @@ def get_changes_report_signed_url( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal( @@ -71,6 +76,8 @@ def get_changes_report_signed_url( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="getChangesReportSignedUrl", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -82,28 +89,21 @@ def get_changes_report_signed_url( if utils.match_response(http_res, "2XX", "application/json"): return operations.GetChangesReportSignedURLResponse( - signed_access=utils.unmarshal_json( - http_res.text, - Optional[operations.GetChangesReportSignedURLSignedAccess], + signed_access=unmarshal_json_response( + Optional[operations.GetChangesReportSignedURLSignedAccess], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def get_changes_report_signed_url_async( self, @@ -132,6 +132,8 @@ async def get_changes_report_signed_url_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal( @@ -165,6 +167,8 @@ async def get_changes_report_signed_url_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="getChangesReportSignedUrl", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -176,28 +180,21 @@ async def get_changes_report_signed_url_async( if utils.match_response(http_res, "2XX", "application/json"): return operations.GetChangesReportSignedURLResponse( - signed_access=utils.unmarshal_json( - http_res.text, - Optional[operations.GetChangesReportSignedURLSignedAccess], + signed_access=unmarshal_json_response( + Optional[operations.GetChangesReportSignedURLSignedAccess], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) def get_linting_report_signed_url( self, @@ -226,6 +223,8 @@ def get_linting_report_signed_url( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal( @@ -259,6 +258,8 @@ def get_linting_report_signed_url( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="getLintingReportSignedUrl", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -270,28 +271,21 @@ def get_linting_report_signed_url( if utils.match_response(http_res, "2XX", "application/json"): return operations.GetLintingReportSignedURLResponse( - signed_access=utils.unmarshal_json( - http_res.text, - Optional[operations.GetLintingReportSignedURLSignedAccess], + signed_access=unmarshal_json_response( + Optional[operations.GetLintingReportSignedURLSignedAccess], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def get_linting_report_signed_url_async( self, @@ -320,6 +314,8 @@ async def get_linting_report_signed_url_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal( @@ -353,6 +349,8 @@ async def get_linting_report_signed_url_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="getLintingReportSignedUrl", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -364,28 +362,21 @@ async def get_linting_report_signed_url_async( if utils.match_response(http_res, "2XX", "application/json"): return operations.GetLintingReportSignedURLResponse( - signed_access=utils.unmarshal_json( - http_res.text, - Optional[operations.GetLintingReportSignedURLSignedAccess], + signed_access=unmarshal_json_response( + Optional[operations.GetLintingReportSignedURLSignedAccess], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) def upload_report( self, @@ -414,6 +405,8 @@ def upload_report( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.UploadReportRequestBody) @@ -448,6 +441,8 @@ def upload_report( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="uploadReport", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -459,27 +454,21 @@ def upload_report( if utils.match_response(http_res, "2XX", "application/json"): return operations.UploadReportResponse( - uploaded_report=utils.unmarshal_json( - http_res.text, Optional[operations.UploadReportUploadedReport] + uploaded_report=unmarshal_json_response( + Optional[operations.UploadReportUploadedReport], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def upload_report_async( self, @@ -508,6 +497,8 @@ async def upload_report_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.UploadReportRequestBody) @@ -542,6 +533,8 @@ async def upload_report_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="uploadReport", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -553,24 +546,18 @@ async def upload_report_async( if utils.match_response(http_res, "2XX", "application/json"): return operations.UploadReportResponse( - uploaded_report=utils.unmarshal_json( - http_res.text, Optional[operations.UploadReportUploadedReport] + uploaded_report=unmarshal_json_response( + Optional[operations.UploadReportUploadedReport], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) diff --git a/src/speakeasy_client_sdk_python/schemastore.py b/src/speakeasy_client_sdk_python/schemastore.py new file mode 100644 index 00000000..c7e7dc81 --- /dev/null +++ b/src/speakeasy_client_sdk_python/schemastore.py @@ -0,0 +1,413 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from speakeasy_client_sdk_python import utils +from speakeasy_client_sdk_python._hooks import HookContext +from speakeasy_client_sdk_python.models import errors, operations, shared +from speakeasy_client_sdk_python.types import BaseModel, OptionalNullable, UNSET +from speakeasy_client_sdk_python.utils.unmarshal_json_response import ( + unmarshal_json_response, +) +from typing import Any, Mapping, Optional, Union, cast + + +class SchemaStore(BaseSDK): + def create_schema_store_item( + self, + *, + request: Union[ + operations.CreateSchemaStoreItemRequestBody, + operations.CreateSchemaStoreItemRequestBodyTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.CreateSchemaStoreItemResponse: + r"""Create a schema in the schema store + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.CreateSchemaStoreItemRequestBody + ) + request = cast(operations.CreateSchemaStoreItemRequestBody, request) + + req = self._build_request( + method="POST", + path="/v1/schema_store", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, + False, + False, + "json", + operations.CreateSchemaStoreItemRequestBody, + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="createSchemaStoreItem", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "2XX", "application/json"): + return operations.CreateSchemaStoreItemResponse( + schema_store_item=unmarshal_json_response( + Optional[shared.SchemaStoreItem], http_res + ), + status_code=http_res.status_code, + content_type=http_res.headers.get("Content-Type") or "", + raw_response=http_res, + ) + if utils.match_response(http_res, "4XX", "application/json"): + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def create_schema_store_item_async( + self, + *, + request: Union[ + operations.CreateSchemaStoreItemRequestBody, + operations.CreateSchemaStoreItemRequestBodyTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.CreateSchemaStoreItemResponse: + r"""Create a schema in the schema store + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.CreateSchemaStoreItemRequestBody + ) + request = cast(operations.CreateSchemaStoreItemRequestBody, request) + + req = self._build_request_async( + method="POST", + path="/v1/schema_store", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, + False, + False, + "json", + operations.CreateSchemaStoreItemRequestBody, + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="createSchemaStoreItem", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "2XX", "application/json"): + return operations.CreateSchemaStoreItemResponse( + schema_store_item=unmarshal_json_response( + Optional[shared.SchemaStoreItem], http_res + ), + status_code=http_res.status_code, + content_type=http_res.headers.get("Content-Type") or "", + raw_response=http_res, + ) + if utils.match_response(http_res, "4XX", "application/json"): + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def get_schema_store_item( + self, + *, + request: Optional[ + Union[ + operations.GetSchemaStoreItemRequestBody, + operations.GetSchemaStoreItemRequestBodyTypedDict, + ] + ] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.GetSchemaStoreItemResponse: + r"""Get a OAS schema from the schema store + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, Optional[operations.GetSchemaStoreItemRequestBody] + ) + request = cast(Optional[operations.GetSchemaStoreItemRequestBody], request) + + req = self._build_request( + method="GET", + path="/v1/schema_store", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, + False, + True, + "json", + Optional[operations.GetSchemaStoreItemRequestBody], + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="getSchemaStoreItem", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "2XX", "application/json"): + return operations.GetSchemaStoreItemResponse( + schema_store_item=unmarshal_json_response( + Optional[shared.SchemaStoreItem], http_res + ), + status_code=http_res.status_code, + content_type=http_res.headers.get("Content-Type") or "", + raw_response=http_res, + ) + if utils.match_response(http_res, "4XX", "application/json"): + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def get_schema_store_item_async( + self, + *, + request: Optional[ + Union[ + operations.GetSchemaStoreItemRequestBody, + operations.GetSchemaStoreItemRequestBodyTypedDict, + ] + ] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.GetSchemaStoreItemResponse: + r"""Get a OAS schema from the schema store + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, Optional[operations.GetSchemaStoreItemRequestBody] + ) + request = cast(Optional[operations.GetSchemaStoreItemRequestBody], request) + + req = self._build_request_async( + method="GET", + path="/v1/schema_store", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, + False, + True, + "json", + Optional[operations.GetSchemaStoreItemRequestBody], + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="getSchemaStoreItem", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "2XX", "application/json"): + return operations.GetSchemaStoreItemResponse( + schema_store_item=unmarshal_json_response( + Optional[shared.SchemaStoreItem], http_res + ), + status_code=http_res.status_code, + content_type=http_res.headers.get("Content-Type") or "", + raw_response=http_res, + ) + if utils.match_response(http_res, "4XX", "application/json"): + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) diff --git a/src/speakeasy_client_sdk_python/sdk.py b/src/speakeasy_client_sdk_python/sdk.py index 608cba3a..42baea54 100644 --- a/src/speakeasy_client_sdk_python/sdk.py +++ b/src/speakeasy_client_sdk_python/sdk.py @@ -1,27 +1,33 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from .basesdk import BaseSDK -from .httpclient import AsyncHttpClient, HttpClient +from .httpclient import AsyncHttpClient, ClientOwner, HttpClient, close_clients from .sdkconfiguration import SDKConfiguration from .utils.logger import Logger, get_default_logger from .utils.retries import RetryConfig import httpx +import importlib from speakeasy_client_sdk_python import utils from speakeasy_client_sdk_python._hooks import SDKHooks -from speakeasy_client_sdk_python.artifacts import Artifacts -from speakeasy_client_sdk_python.auth import Auth -from speakeasy_client_sdk_python.codesamples import CodeSamples -from speakeasy_client_sdk_python.events import Events -from speakeasy_client_sdk_python.github import Github from speakeasy_client_sdk_python.models import internal, shared -from speakeasy_client_sdk_python.organizations import Organizations -from speakeasy_client_sdk_python.reports import Reports -from speakeasy_client_sdk_python.shorturls import ShortURLs -from speakeasy_client_sdk_python.subscriptions import Subscriptions -from speakeasy_client_sdk_python.suggest import Suggest from speakeasy_client_sdk_python.types import OptionalNullable, UNSET -from speakeasy_client_sdk_python.workspaces import Workspaces -from typing import Callable, Dict, Optional, Union +from typing import Callable, Dict, Optional, TYPE_CHECKING, Union, cast +import weakref + +if TYPE_CHECKING: + from speakeasy_client_sdk_python.artifacts import Artifacts + from speakeasy_client_sdk_python.auth import Auth + from speakeasy_client_sdk_python.codesamples import CodeSamples + from speakeasy_client_sdk_python.events import Events + from speakeasy_client_sdk_python.github import Github + from speakeasy_client_sdk_python.organizations import Organizations + from speakeasy_client_sdk_python.publishingtokens import PublishingTokens + from speakeasy_client_sdk_python.reports import Reports + from speakeasy_client_sdk_python.schemastore import SchemaStore + from speakeasy_client_sdk_python.shorturls import ShortURLs + from speakeasy_client_sdk_python.subscriptions import Subscriptions + from speakeasy_client_sdk_python.suggest import Suggest + from speakeasy_client_sdk_python.workspaces import Workspaces class Speakeasy(BaseSDK): @@ -29,28 +35,48 @@ class Speakeasy(BaseSDK): /docs - The Speakeasy Platform Documentation """ - artifacts: Artifacts + artifacts: "Artifacts" r"""REST APIs for working with Registry artifacts""" - auth: Auth + auth: "Auth" r"""REST APIs for managing Authentication""" - code_samples: CodeSamples + code_samples: "CodeSamples" r"""REST APIs for retrieving Code Samples""" - github: Github + github: "Github" r"""REST APIs for managing the github integration""" - organizations: Organizations + organizations: "Organizations" r"""REST APIs for managing Organizations (speakeasy L1 Tenancy construct)""" - reports: Reports + publishing_tokens: "PublishingTokens" + reports: "Reports" r"""REST APIs for managing reports (lint reports, change reports, etc)""" - short_ur_ls: ShortURLs + schema_store: "SchemaStore" + short_ur_ls: "ShortURLs" r"""REST APIs for managing short URLs""" - subscriptions: Subscriptions + subscriptions: "Subscriptions" r"""REST APIs for managing subscriptions""" - suggest: Suggest + suggest: "Suggest" r"""REST APIs for managing LLM OAS suggestions""" - workspaces: Workspaces + workspaces: "Workspaces" r"""REST APIs for managing Workspaces (speakeasy tenancy)""" - events: Events + events: "Events" r"""REST APIs for managing events captured by a speakeasy binary (CLI, GitHub Action etc)""" + _sub_sdk_map = { + "artifacts": ("speakeasy_client_sdk_python.artifacts", "Artifacts"), + "auth": ("speakeasy_client_sdk_python.auth", "Auth"), + "code_samples": ("speakeasy_client_sdk_python.codesamples", "CodeSamples"), + "github": ("speakeasy_client_sdk_python.github", "Github"), + "organizations": ("speakeasy_client_sdk_python.organizations", "Organizations"), + "publishing_tokens": ( + "speakeasy_client_sdk_python.publishingtokens", + "PublishingTokens", + ), + "reports": ("speakeasy_client_sdk_python.reports", "Reports"), + "schema_store": ("speakeasy_client_sdk_python.schemastore", "SchemaStore"), + "short_ur_ls": ("speakeasy_client_sdk_python.shorturls", "ShortURLs"), + "subscriptions": ("speakeasy_client_sdk_python.subscriptions", "Subscriptions"), + "suggest": ("speakeasy_client_sdk_python.suggest", "Suggest"), + "workspaces": ("speakeasy_client_sdk_python.workspaces", "Workspaces"), + "events": ("speakeasy_client_sdk_python.events", "Events"), + } def __init__( self, @@ -79,15 +105,19 @@ def __init__( :param retry_config: The retry configuration to use for all supported methods :param timeout_ms: Optional request timeout applied to each operation in milliseconds """ + client_supplied = True if client is None: client = httpx.Client() + client_supplied = False assert issubclass( type(client), HttpClient ), "The provided client must implement the HttpClient protocol." + async_client_supplied = True if async_client is None: async_client = httpx.AsyncClient() + async_client_supplied = False if debug_logger is None: debug_logger = get_default_logger() @@ -108,7 +138,9 @@ def __init__( self, SDKConfiguration( client=client, + client_supplied=client_supplied, async_client=async_client, + async_client_supplied=async_client_supplied, globals=_globals, security=security, server_url=server_url, @@ -121,30 +153,52 @@ def __init__( hooks = SDKHooks() + # pylint: disable=protected-access + self.sdk_configuration.__dict__["_hooks"] = hooks + current_server_url, *_ = self.sdk_configuration.get_server_details() server_url, self.sdk_configuration.client = hooks.sdk_init( - current_server_url, self.sdk_configuration.client + current_server_url, client ) if current_server_url != server_url: self.sdk_configuration.server_url = server_url - # pylint: disable=protected-access - self.sdk_configuration.__dict__["_hooks"] = hooks + weakref.finalize( + self, + close_clients, + cast(ClientOwner, self.sdk_configuration), + self.sdk_configuration.client, + self.sdk_configuration.client_supplied, + self.sdk_configuration.async_client, + self.sdk_configuration.async_client_supplied, + ) + + def __getattr__(self, name: str): + if name in self._sub_sdk_map: + module_path, class_name = self._sub_sdk_map[name] + try: + module = importlib.import_module(module_path) + klass = getattr(module, class_name) + instance = klass(self.sdk_configuration) + setattr(self, name, instance) + return instance + except ImportError as e: + raise AttributeError( + f"Failed to import module {module_path} for attribute {name}: {e}" + ) from e + except AttributeError as e: + raise AttributeError( + f"Failed to find class {class_name} in module {module_path} for attribute {name}: {e}" + ) from e + + raise AttributeError( + f"'{type(self).__name__}' object has no attribute '{name}'" + ) - self._init_sdks() - - def _init_sdks(self): - self.artifacts = Artifacts(self.sdk_configuration) - self.auth = Auth(self.sdk_configuration) - self.code_samples = CodeSamples(self.sdk_configuration) - self.github = Github(self.sdk_configuration) - self.organizations = Organizations(self.sdk_configuration) - self.reports = Reports(self.sdk_configuration) - self.short_ur_ls = ShortURLs(self.sdk_configuration) - self.subscriptions = Subscriptions(self.sdk_configuration) - self.suggest = Suggest(self.sdk_configuration) - self.workspaces = Workspaces(self.sdk_configuration) - self.events = Events(self.sdk_configuration) + def __dir__(self): + default_attrs = list(super().__dir__()) + lazy_attrs = list(self._sub_sdk_map.keys()) + return sorted(list(set(default_attrs + lazy_attrs))) def __enter__(self): return self @@ -153,9 +207,17 @@ async def __aenter__(self): return self def __exit__(self, exc_type, exc_val, exc_tb): - if self.sdk_configuration.client is not None: + if ( + self.sdk_configuration.client is not None + and not self.sdk_configuration.client_supplied + ): self.sdk_configuration.client.close() + self.sdk_configuration.client = None async def __aexit__(self, exc_type, exc_val, exc_tb): - if self.sdk_configuration.async_client is not None: + if ( + self.sdk_configuration.async_client is not None + and not self.sdk_configuration.async_client_supplied + ): await self.sdk_configuration.async_client.aclose() + self.sdk_configuration.async_client = None diff --git a/src/speakeasy_client_sdk_python/sdkconfiguration.py b/src/speakeasy_client_sdk_python/sdkconfiguration.py index bf614611..5350b91a 100644 --- a/src/speakeasy_client_sdk_python/sdkconfiguration.py +++ b/src/speakeasy_client_sdk_python/sdkconfiguration.py @@ -1,6 +1,11 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" -from ._hooks import SDKHooks +from ._version import ( + __gen_version__, + __openapi_doc_version__, + __user_agent__, + __version__, +) from .httpclient import AsyncHttpClient, HttpClient from .utils import Logger, RetryConfig, remove_suffix from dataclasses import dataclass @@ -12,33 +17,30 @@ SERVER_PROD = "prod" SERVERS = { - SERVER_PROD: "https://api.prod.speakeasyapi.dev", + SERVER_PROD: "https://api.prod.speakeasy.com", } """Contains the list of servers available to the SDK""" @dataclass class SDKConfiguration: - client: HttpClient - async_client: AsyncHttpClient + client: Union[HttpClient, None] + client_supplied: bool + async_client: Union[AsyncHttpClient, None] + async_client_supplied: bool debug_logger: Logger globals: internal.Globals security: Optional[Union[shared.Security, Callable[[], shared.Security]]] = None server_url: Optional[str] = "" server: Optional[str] = "" language: str = "python" - openapi_doc_version: str = "0.4.0" - sdk_version: str = "7.0.0-rc.2" - gen_version: str = "2.486.1" - user_agent: str = ( - "speakeasy-sdk/python 7.0.0-rc.2 2.486.1 0.4.0 speakeasy-client-sdk-python" - ) + openapi_doc_version: str = __openapi_doc_version__ + sdk_version: str = __version__ + gen_version: str = __gen_version__ + user_agent: str = __user_agent__ retry_config: OptionalNullable[RetryConfig] = Field(default_factory=lambda: UNSET) timeout_ms: Optional[int] = None - def __post_init__(self): - self._hooks = SDKHooks() - def get_server_details(self) -> Tuple[str, Dict[str, str]]: if self.server_url is not None and self.server_url: return remove_suffix(self.server_url, "/"), {} @@ -49,6 +51,3 @@ def get_server_details(self) -> Tuple[str, Dict[str, str]]: raise ValueError(f'Invalid server "{self.server}"') return SERVERS[self.server], {} - - def get_hooks(self) -> SDKHooks: - return self._hooks diff --git a/src/speakeasy_client_sdk_python/shorturls.py b/src/speakeasy_client_sdk_python/shorturls.py index 31220d9c..112f94cc 100644 --- a/src/speakeasy_client_sdk_python/shorturls.py +++ b/src/speakeasy_client_sdk_python/shorturls.py @@ -5,6 +5,9 @@ from speakeasy_client_sdk_python._hooks import HookContext from speakeasy_client_sdk_python.models import errors, operations, shared from speakeasy_client_sdk_python.types import BaseModel, OptionalNullable, UNSET +from speakeasy_client_sdk_python.utils.unmarshal_json_response import ( + unmarshal_json_response, +) from typing import Mapping, Optional, Union, cast @@ -37,6 +40,8 @@ def create( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.CreateRequestBody) @@ -71,6 +76,8 @@ def create( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="create", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -82,27 +89,19 @@ def create( if utils.match_response(http_res, "2XX", "application/json"): return operations.CreateResponse( - short_url=utils.unmarshal_json( - http_res.text, Optional[shared.ShortURL] - ), + short_url=unmarshal_json_response(Optional[shared.ShortURL], http_res), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def create_async( self, @@ -130,6 +129,8 @@ async def create_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.CreateRequestBody) @@ -164,6 +165,8 @@ async def create_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="create", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -175,24 +178,16 @@ async def create_async( if utils.match_response(http_res, "2XX", "application/json"): return operations.CreateResponse( - short_url=utils.unmarshal_json( - http_res.text, Optional[shared.ShortURL] - ), + short_url=unmarshal_json_response(Optional[shared.ShortURL], http_res), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) diff --git a/src/speakeasy_client_sdk_python/subscriptions.py b/src/speakeasy_client_sdk_python/subscriptions.py index 072d86b2..331e012f 100644 --- a/src/speakeasy_client_sdk_python/subscriptions.py +++ b/src/speakeasy_client_sdk_python/subscriptions.py @@ -5,6 +5,9 @@ from speakeasy_client_sdk_python._hooks import HookContext from speakeasy_client_sdk_python.models import errors, operations from speakeasy_client_sdk_python.types import BaseModel, OptionalNullable, UNSET +from speakeasy_client_sdk_python.utils.unmarshal_json_response import ( + unmarshal_json_response, +) from typing import Any, Mapping, Optional, Union, cast @@ -38,6 +41,8 @@ def activate_subscription_namespace( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal( @@ -71,6 +76,8 @@ def activate_subscription_namespace( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="activateSubscriptionNamespace", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -80,7 +87,7 @@ def activate_subscription_namespace( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "*"): return operations.ActivateSubscriptionNamespaceResponse( status_code=http_res.status_code, @@ -88,22 +95,13 @@ def activate_subscription_namespace( raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def activate_subscription_namespace_async( self, @@ -132,6 +130,8 @@ async def activate_subscription_namespace_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal( @@ -165,6 +165,8 @@ async def activate_subscription_namespace_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="activateSubscriptionNamespace", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -174,7 +176,7 @@ async def activate_subscription_namespace_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "*"): return operations.ActivateSubscriptionNamespaceResponse( status_code=http_res.status_code, @@ -182,22 +184,13 @@ async def activate_subscription_namespace_async( raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) def ignore_subscription_namespace( self, @@ -226,6 +219,8 @@ def ignore_subscription_namespace( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal( @@ -259,6 +254,8 @@ def ignore_subscription_namespace( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="ignoreSubscriptionNamespace", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -268,7 +265,7 @@ def ignore_subscription_namespace( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "*"): return operations.IgnoreSubscriptionNamespaceResponse( status_code=http_res.status_code, @@ -276,22 +273,13 @@ def ignore_subscription_namespace( raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def ignore_subscription_namespace_async( self, @@ -320,6 +308,8 @@ async def ignore_subscription_namespace_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal( @@ -353,6 +343,8 @@ async def ignore_subscription_namespace_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="ignoreSubscriptionNamespace", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -362,7 +354,7 @@ async def ignore_subscription_namespace_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "*"): return operations.IgnoreSubscriptionNamespaceResponse( status_code=http_res.status_code, @@ -370,19 +362,10 @@ async def ignore_subscription_namespace_async( raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) diff --git a/src/speakeasy_client_sdk_python/suggest.py b/src/speakeasy_client_sdk_python/suggest.py index 9c37b0b6..aee842cd 100644 --- a/src/speakeasy_client_sdk_python/suggest.py +++ b/src/speakeasy_client_sdk_python/suggest.py @@ -5,6 +5,9 @@ from speakeasy_client_sdk_python._hooks import HookContext from speakeasy_client_sdk_python.models import errors, operations, shared from speakeasy_client_sdk_python.types import BaseModel, OptionalNullable, UNSET +from speakeasy_client_sdk_python.utils.unmarshal_json_response import ( + unmarshal_json_response, +) from typing import List, Mapping, Optional, Union, cast @@ -37,6 +40,8 @@ def suggest( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.SuggestRequest) @@ -75,6 +80,8 @@ def suggest( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="suggest", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -92,20 +99,15 @@ def suggest( content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res, http_res_text) async def suggest_async( self, @@ -133,6 +135,8 @@ async def suggest_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.SuggestRequest) @@ -171,6 +175,8 @@ async def suggest_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="suggest", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -188,20 +194,15 @@ async def suggest_async( content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res, http_res_text) def suggest_items( self, @@ -229,6 +230,8 @@ def suggest_items( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, shared.SuggestItemsRequestBody) @@ -263,6 +266,8 @@ def suggest_items( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="suggestItems", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -274,25 +279,19 @@ def suggest_items( if utils.match_response(http_res, "2XX", "application/json"): return operations.SuggestItemsResponse( - strings=utils.unmarshal_json(http_res.text, Optional[List[str]]), + strings=unmarshal_json_response(Optional[List[str]], http_res), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def suggest_items_async( self, @@ -320,6 +319,8 @@ async def suggest_items_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, shared.SuggestItemsRequestBody) @@ -354,6 +355,8 @@ async def suggest_items_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="suggestItems", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -365,25 +368,19 @@ async def suggest_items_async( if utils.match_response(http_res, "2XX", "application/json"): return operations.SuggestItemsResponse( - strings=utils.unmarshal_json(http_res.text, Optional[List[str]]), + strings=unmarshal_json_response(Optional[List[str]], http_res), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) def suggest_open_api( self, @@ -413,6 +410,8 @@ def suggest_open_api( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.SuggestOpenAPIRequest) @@ -451,6 +450,8 @@ def suggest_open_api( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="suggestOpenAPI", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -468,20 +469,15 @@ def suggest_open_api( content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res, http_res_text) async def suggest_open_api_async( self, @@ -511,6 +507,8 @@ async def suggest_open_api_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.SuggestOpenAPIRequest) @@ -549,6 +547,8 @@ async def suggest_open_api_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="suggestOpenAPI", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -566,20 +566,15 @@ async def suggest_open_api_async( content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res, http_res_text) def suggest_open_api_registry( self, @@ -610,6 +605,8 @@ def suggest_open_api_registry( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.SuggestOpenAPIRegistryRequest) @@ -648,6 +645,8 @@ def suggest_open_api_registry( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="suggestOpenAPIRegistry", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -665,20 +664,15 @@ def suggest_open_api_registry( content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res, http_res_text) async def suggest_open_api_registry_async( self, @@ -709,6 +703,8 @@ async def suggest_open_api_registry_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.SuggestOpenAPIRegistryRequest) @@ -747,6 +743,8 @@ async def suggest_open_api_registry_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="suggestOpenAPIRegistry", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -764,17 +762,12 @@ async def suggest_open_api_registry_async( content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res, http_res_text) diff --git a/src/speakeasy_client_sdk_python/types/basemodel.py b/src/speakeasy_client_sdk_python/types/basemodel.py index a6187efa..231c2e37 100644 --- a/src/speakeasy_client_sdk_python/types/basemodel.py +++ b/src/speakeasy_client_sdk_python/types/basemodel.py @@ -2,7 +2,7 @@ from pydantic import ConfigDict, model_serializer from pydantic import BaseModel as PydanticBaseModel -from typing import TYPE_CHECKING, Literal, Optional, TypeVar, Union, NewType +from typing import TYPE_CHECKING, Literal, Optional, TypeVar, Union from typing_extensions import TypeAliasType, TypeAlias @@ -35,5 +35,5 @@ def __bool__(self) -> Literal[False]: "OptionalNullable", Union[Optional[Nullable[T]], Unset], type_params=(T,) ) -UnrecognizedInt = NewType("UnrecognizedInt", int) -UnrecognizedStr = NewType("UnrecognizedStr", str) +UnrecognizedInt: TypeAlias = int +UnrecognizedStr: TypeAlias = str diff --git a/src/speakeasy_client_sdk_python/utils/__init__.py b/src/speakeasy_client_sdk_python/utils/__init__.py index 26d51ae8..dd4aa4b3 100644 --- a/src/speakeasy_client_sdk_python/utils/__init__.py +++ b/src/speakeasy_client_sdk_python/utils/__init__.py @@ -1,49 +1,55 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" -from .annotations import get_discriminator -from .enums import OpenEnumMeta -from .headers import get_headers, get_response_headers -from .metadata import ( - FieldMetadata, - find_metadata, - FormMetadata, - HeaderMetadata, - MultipartFormMetadata, - PathParamMetadata, - QueryParamMetadata, - RequestMetadata, - SecurityMetadata, -) -from .queryparams import get_query_params -from .retries import BackoffStrategy, Retries, retry, retry_async, RetryConfig -from .requestbodies import serialize_request_body, SerializedRequestBody -from .security import get_security -from .serializers import ( - get_pydantic_model, - marshal_json, - unmarshal, - unmarshal_json, - serialize_decimal, - serialize_float, - serialize_int, - stream_to_text, - stream_to_text_async, - stream_to_bytes, - stream_to_bytes_async, - validate_const, - validate_decimal, - validate_float, - validate_int, - validate_open_enum, -) -from .url import generate_url, template_url, remove_suffix -from .values import ( - get_global_from_env, - match_content_type, - match_status_codes, - match_response, -) -from .logger import Logger, get_body_content, get_default_logger +from typing import TYPE_CHECKING +from importlib import import_module + +if TYPE_CHECKING: + from .annotations import get_discriminator + from .datetimes import parse_datetime + from .enums import OpenEnumMeta + from .headers import get_headers, get_response_headers + from .metadata import ( + FieldMetadata, + find_metadata, + FormMetadata, + HeaderMetadata, + MultipartFormMetadata, + PathParamMetadata, + QueryParamMetadata, + RequestMetadata, + SecurityMetadata, + ) + from .queryparams import get_query_params + from .retries import BackoffStrategy, Retries, retry, retry_async, RetryConfig + from .requestbodies import serialize_request_body, SerializedRequestBody + from .security import get_security + from .serializers import ( + get_pydantic_model, + marshal_json, + unmarshal, + unmarshal_json, + serialize_decimal, + serialize_float, + serialize_int, + stream_to_text, + stream_to_text_async, + stream_to_bytes, + stream_to_bytes_async, + validate_const, + validate_decimal, + validate_float, + validate_int, + validate_open_enum, + ) + from .url import generate_url, template_url, remove_suffix + from .values import ( + get_global_from_env, + match_content_type, + match_status_codes, + match_response, + cast_partial, + ) + from .logger import Logger, get_body_content, get_default_logger __all__ = [ "BackoffStrategy", @@ -54,6 +60,7 @@ "get_body_content", "get_default_logger", "get_discriminator", + "parse_datetime", "get_global_from_env", "get_headers", "get_pydantic_model", @@ -94,4 +101,84 @@ "validate_float", "validate_int", "validate_open_enum", + "cast_partial", ] + +_dynamic_imports: dict[str, str] = { + "BackoffStrategy": ".retries", + "FieldMetadata": ".metadata", + "find_metadata": ".metadata", + "FormMetadata": ".metadata", + "generate_url": ".url", + "get_body_content": ".logger", + "get_default_logger": ".logger", + "get_discriminator": ".annotations", + "parse_datetime": ".datetimes", + "get_global_from_env": ".values", + "get_headers": ".headers", + "get_pydantic_model": ".serializers", + "get_query_params": ".queryparams", + "get_response_headers": ".headers", + "get_security": ".security", + "HeaderMetadata": ".metadata", + "Logger": ".logger", + "marshal_json": ".serializers", + "match_content_type": ".values", + "match_status_codes": ".values", + "match_response": ".values", + "MultipartFormMetadata": ".metadata", + "OpenEnumMeta": ".enums", + "PathParamMetadata": ".metadata", + "QueryParamMetadata": ".metadata", + "remove_suffix": ".url", + "Retries": ".retries", + "retry": ".retries", + "retry_async": ".retries", + "RetryConfig": ".retries", + "RequestMetadata": ".metadata", + "SecurityMetadata": ".metadata", + "serialize_decimal": ".serializers", + "serialize_float": ".serializers", + "serialize_int": ".serializers", + "serialize_request_body": ".requestbodies", + "SerializedRequestBody": ".requestbodies", + "stream_to_text": ".serializers", + "stream_to_text_async": ".serializers", + "stream_to_bytes": ".serializers", + "stream_to_bytes_async": ".serializers", + "template_url": ".url", + "unmarshal": ".serializers", + "unmarshal_json": ".serializers", + "validate_decimal": ".serializers", + "validate_const": ".serializers", + "validate_float": ".serializers", + "validate_int": ".serializers", + "validate_open_enum": ".serializers", + "cast_partial": ".values", +} + + +def __getattr__(attr_name: str) -> object: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError( + f"no {attr_name} found in _dynamic_imports, module name -> {__name__} " + ) + + try: + module = import_module(module_name, __package__) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError( + f"Failed to import {attr_name} from {module_name}: {e}" + ) from e + except AttributeError as e: + raise AttributeError( + f"Failed to get {attr_name} from {module_name}: {e}" + ) from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) diff --git a/src/speakeasy_client_sdk_python/utils/datetimes.py b/src/speakeasy_client_sdk_python/utils/datetimes.py new file mode 100644 index 00000000..a6c52cd6 --- /dev/null +++ b/src/speakeasy_client_sdk_python/utils/datetimes.py @@ -0,0 +1,23 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from datetime import datetime +import sys + + +def parse_datetime(datetime_string: str) -> datetime: + """ + Convert a RFC 3339 / ISO 8601 formatted string into a datetime object. + Python versions 3.11 and later support parsing RFC 3339 directly with + datetime.fromisoformat(), but for earlier versions, this function + encapsulates the necessary extra logic. + """ + # Python 3.11 and later can parse RFC 3339 directly + if sys.version_info >= (3, 11): + return datetime.fromisoformat(datetime_string) + + # For Python 3.10 and earlier, a common ValueError is trailing 'Z' suffix, + # so fix that upfront. + if datetime_string.endswith("Z"): + datetime_string = datetime_string[:-1] + "+00:00" + + return datetime.fromisoformat(datetime_string) diff --git a/src/speakeasy_client_sdk_python/utils/enums.py b/src/speakeasy_client_sdk_python/utils/enums.py index c650b10c..c3bc13cf 100644 --- a/src/speakeasy_client_sdk_python/utils/enums.py +++ b/src/speakeasy_client_sdk_python/utils/enums.py @@ -1,34 +1,74 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" import enum - +import sys class OpenEnumMeta(enum.EnumMeta): - def __call__( - cls, value, names=None, *, module=None, qualname=None, type=None, start=1 - ): - # The `type` kwarg also happens to be a built-in that pylint flags as - # redeclared. Safe to ignore this lint rule with this scope. - # pylint: disable=redefined-builtin + # The __call__ method `boundary` kwarg was added in 3.11 and must be present + # for pyright. Refer also: https://github.com/pylint-dev/pylint/issues/9622 + # pylint: disable=unexpected-keyword-arg + # The __call__ method `values` varg must be named for pyright. + # pylint: disable=keyword-arg-before-vararg + + if sys.version_info >= (3, 11): + def __call__( + cls, value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None + ): + # The `type` kwarg also happens to be a built-in that pylint flags as + # redeclared. Safe to ignore this lint rule with this scope. + # pylint: disable=redefined-builtin + + if names is not None: + return super().__call__( + value, + names=names, + *values, + module=module, + qualname=qualname, + type=type, + start=start, + boundary=boundary, + ) + + try: + return super().__call__( + value, + names=names, # pyright: ignore[reportArgumentType] + *values, + module=module, + qualname=qualname, + type=type, + start=start, + boundary=boundary, + ) + except ValueError: + return value + else: + def __call__( + cls, value, names=None, *, module=None, qualname=None, type=None, start=1 + ): + # The `type` kwarg also happens to be a built-in that pylint flags as + # redeclared. Safe to ignore this lint rule with this scope. + # pylint: disable=redefined-builtin - if names is not None: - return super().__call__( - value, - names=names, - module=module, - qualname=qualname, - type=type, - start=start, - ) + if names is not None: + return super().__call__( + value, + names=names, + module=module, + qualname=qualname, + type=type, + start=start, + ) - try: - return super().__call__( - value, - names=names, # pyright: ignore[reportArgumentType] - module=module, - qualname=qualname, - type=type, - start=start, - ) - except ValueError: - return value + try: + return super().__call__( + value, + names=names, # pyright: ignore[reportArgumentType] + module=module, + qualname=qualname, + type=type, + start=start, + ) + except ValueError: + return value diff --git a/src/speakeasy_client_sdk_python/utils/forms.py b/src/speakeasy_client_sdk_python/utils/forms.py index 0472aba8..e873495f 100644 --- a/src/speakeasy_client_sdk_python/utils/forms.py +++ b/src/speakeasy_client_sdk_python/utils/forms.py @@ -86,11 +86,39 @@ def _populate_form( return form +def _extract_file_properties(file_obj: Any) -> Tuple[str, Any, Any]: + """Extract file name, content, and content type from a file object.""" + file_fields: Dict[str, FieldInfo] = file_obj.__class__.model_fields + + file_name = "" + content = None + content_type = None + + for file_field_name in file_fields: + file_field = file_fields[file_field_name] + + file_metadata = find_field_metadata(file_field, MultipartFormMetadata) + if file_metadata is None: + continue + + if file_metadata.content: + content = getattr(file_obj, file_field_name, None) + elif file_field_name == "content_type": + content_type = getattr(file_obj, file_field_name, None) + else: + file_name = getattr(file_obj, file_field_name) + + if file_name == "" or content is None: + raise ValueError("invalid multipart/form-data file") + + return file_name, content, content_type + + def serialize_multipart_form( media_type: str, request: Any -) -> Tuple[str, Dict[str, Any], Dict[str, Any]]: +) -> Tuple[str, Dict[str, Any], List[Tuple[str, Any]]]: form: Dict[str, Any] = {} - files: Dict[str, Any] = {} + files: List[Tuple[str, Any]] = [] if not isinstance(request, BaseModel): raise TypeError("invalid request body type") @@ -112,39 +140,32 @@ def serialize_multipart_form( f_name = field.alias if field.alias else name if field_metadata.file: - file_fields: Dict[str, FieldInfo] = val.__class__.model_fields - - file_name = "" - content = None - content_type = None - - for file_field_name in file_fields: - file_field = file_fields[file_field_name] + if isinstance(val, List): + # Handle array of files + for file_obj in val: + if not _is_set(file_obj): + continue + + file_name, content, content_type = _extract_file_properties(file_obj) - file_metadata = find_field_metadata(file_field, MultipartFormMetadata) - if file_metadata is None: - continue + if content_type is not None: + files.append((f_name + "[]", (file_name, content, content_type))) + else: + files.append((f_name + "[]", (file_name, content))) + else: + # Handle single file + file_name, content, content_type = _extract_file_properties(val) - if file_metadata.content: - content = getattr(val, file_field_name, None) - elif file_field_name == "content_type": - content_type = getattr(val, file_field_name, None) + if content_type is not None: + files.append((f_name, (file_name, content, content_type))) else: - file_name = getattr(val, file_field_name) - - if file_name == "" or content is None: - raise ValueError("invalid multipart/form-data file") - - if content_type is not None: - files[f_name] = (file_name, content, content_type) - else: - files[f_name] = (file_name, content) + files.append((f_name, (file_name, content))) elif field_metadata.json: - files[f_name] = ( + files.append((f_name, ( None, marshal_json(val, request_field_types[name]), "application/json", - ) + ))) else: if isinstance(val, List): values = [] diff --git a/src/speakeasy_client_sdk_python/utils/serializers.py b/src/speakeasy_client_sdk_python/utils/serializers.py index c5eb3659..378a14c0 100644 --- a/src/speakeasy_client_sdk_python/utils/serializers.py +++ b/src/speakeasy_client_sdk_python/utils/serializers.py @@ -1,20 +1,24 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from decimal import Decimal +import functools import json -from typing import Any, Dict, List, Union, get_args -import httpx +import typing +from typing import Any, Dict, List, Tuple, Union, get_args +import typing_extensions from typing_extensions import get_origin + +import httpx from pydantic import ConfigDict, create_model from pydantic_core import from_json -from typing_inspect import is_optional_type from ..types.basemodel import BaseModel, Nullable, OptionalNullable, Unset def serialize_decimal(as_str: bool): def serialize(d): - if is_optional_type(type(d)) and d is None: + # Optional[T] is a Union[T, None] + if is_union(type(d)) and type(None) in get_args(type(d)) and d is None: return None if isinstance(d, Unset): return d @@ -42,7 +46,8 @@ def validate_decimal(d): def serialize_float(as_str: bool): def serialize(f): - if is_optional_type(type(f)) and f is None: + # Optional[T] is a Union[T, None] + if is_union(type(f)) and type(None) in get_args(type(f)) and f is None: return None if isinstance(f, Unset): return f @@ -70,7 +75,8 @@ def validate_float(f): def serialize_int(as_str: bool): def serialize(i): - if is_optional_type(type(i)) and i is None: + # Optional[T] is a Union[T, None] + if is_union(type(i)) and type(None) in get_args(type(i)) and i is None: return None if isinstance(i, Unset): return i @@ -118,7 +124,8 @@ def validate(e): def validate_const(v): def validate(c): - if is_optional_type(type(c)) and c is None: + # Optional[T] is a Union[T, None] + if is_union(type(c)) and type(None) in get_args(type(c)) and c is None: return None if v != c: @@ -163,7 +170,7 @@ def marshal_json(val, typ): if len(d) == 0: return "" - return json.dumps(d[next(iter(d))], separators=(",", ":"), sort_keys=True) + return json.dumps(d[next(iter(d))], separators=(",", ":")) def is_nullable(field): @@ -181,6 +188,15 @@ def is_nullable(field): return False +def is_union(obj: object) -> bool: + """ + Returns True if the given object is a typing.Union or typing_extensions.Union. + """ + return any( + obj is typing_obj for typing_obj in _get_typing_objects_by_name_of("Union") + ) + + def stream_to_text(stream: httpx.Response) -> str: return "".join(stream.iter_text()) @@ -213,3 +229,21 @@ def _contains_pydantic_model(data: Any) -> bool: return any(_contains_pydantic_model(value) for value in data.values()) return False + + +@functools.cache +def _get_typing_objects_by_name_of(name: str) -> Tuple[Any, ...]: + """ + Get typing objects by name from typing and typing_extensions. + Reference: https://typing-extensions.readthedocs.io/en/latest/#runtime-use-of-types + """ + result = tuple( + getattr(module, name) + for module in (typing, typing_extensions) + if hasattr(module, name) + ) + if not result: + raise ValueError( + f"Neither typing nor typing_extensions has an object called {name!r}" + ) + return result diff --git a/src/speakeasy_client_sdk_python/utils/unmarshal_json_response.py b/src/speakeasy_client_sdk_python/utils/unmarshal_json_response.py new file mode 100644 index 00000000..4753e648 --- /dev/null +++ b/src/speakeasy_client_sdk_python/utils/unmarshal_json_response.py @@ -0,0 +1,24 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from typing import Any, Optional + +import httpx + +from .serializers import unmarshal_json +from speakeasy_client_sdk_python.models import errors + + +def unmarshal_json_response( + typ: Any, http_res: httpx.Response, body: Optional[str] = None +) -> Any: + if body is None: + body = http_res.text + try: + return unmarshal_json(body, typ) + except Exception as e: + raise errors.ResponseValidationError( + "Response validation failed", + http_res, + e, + body, + ) from e diff --git a/src/speakeasy_client_sdk_python/utils/values.py b/src/speakeasy_client_sdk_python/utils/values.py index 2b4b6832..dae01a44 100644 --- a/src/speakeasy_client_sdk_python/utils/values.py +++ b/src/speakeasy_client_sdk_python/utils/values.py @@ -3,8 +3,9 @@ from datetime import datetime from enum import Enum from email.message import Message +from functools import partial import os -from typing import Any, Callable, Dict, List, Optional, Tuple, TypeVar, Union +from typing import Any, Callable, Dict, List, Optional, Tuple, TypeVar, Union, cast from httpx import Response from pydantic import BaseModel @@ -51,6 +52,8 @@ def match_status_codes(status_codes: List[str], status_code: int) -> bool: T = TypeVar("T") +def cast_partial(typ): + return partial(cast, typ) def get_global_from_env( value: Optional[T], env_key: str, type_cast: Callable[[str], T] diff --git a/src/speakeasy_client_sdk_python/workspaces.py b/src/speakeasy_client_sdk_python/workspaces.py index 65477b00..74e8a97d 100644 --- a/src/speakeasy_client_sdk_python/workspaces.py +++ b/src/speakeasy_client_sdk_python/workspaces.py @@ -5,6 +5,9 @@ from speakeasy_client_sdk_python._hooks import HookContext from speakeasy_client_sdk_python.models import errors, operations, shared from speakeasy_client_sdk_python.types import BaseModel, OptionalNullable, UNSET +from speakeasy_client_sdk_python.utils.unmarshal_json_response import ( + unmarshal_json_response, +) from typing import Any, List, Mapping, Optional, Union, cast @@ -37,6 +40,8 @@ def create( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, shared.Workspace) @@ -71,6 +76,8 @@ def create( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="createWorkspace", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -80,33 +87,22 @@ def create( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "application/json"): return operations.CreateWorkspaceResponse( - workspace=utils.unmarshal_json( - http_res.text, Optional[shared.Workspace] - ), + workspace=unmarshal_json_response(Optional[shared.Workspace], http_res), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def create_async( self, @@ -134,6 +130,8 @@ async def create_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, shared.Workspace) @@ -168,6 +166,8 @@ async def create_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="createWorkspace", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -177,33 +177,22 @@ async def create_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "application/json"): return operations.CreateWorkspaceResponse( - workspace=utils.unmarshal_json( - http_res.text, Optional[shared.Workspace] - ), + workspace=unmarshal_json_response(Optional[shared.Workspace], http_res), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) def create_token( self, @@ -232,6 +221,8 @@ def create_token( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.CreateWorkspaceTokenRequest) @@ -269,6 +260,8 @@ def create_token( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="createWorkspaceToken", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -278,7 +271,7 @@ def create_token( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "*"): return operations.CreateWorkspaceTokenResponse( status_code=http_res.status_code, @@ -286,22 +279,13 @@ def create_token( raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def create_token_async( self, @@ -330,6 +314,8 @@ async def create_token_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.CreateWorkspaceTokenRequest) @@ -367,6 +353,8 @@ async def create_token_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="createWorkspaceToken", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -376,7 +364,7 @@ async def create_token_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "*"): return operations.CreateWorkspaceTokenResponse( status_code=http_res.status_code, @@ -384,22 +372,13 @@ async def create_token_async( raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) def delete_token( self, @@ -428,6 +407,8 @@ def delete_token( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.DeleteWorkspaceTokenRequest) @@ -462,6 +443,8 @@ def delete_token( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="deleteWorkspaceToken", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -471,7 +454,7 @@ def delete_token( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "*"): return operations.DeleteWorkspaceTokenResponse( status_code=http_res.status_code, @@ -479,22 +462,13 @@ def delete_token( raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def delete_token_async( self, @@ -523,6 +497,8 @@ async def delete_token_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.DeleteWorkspaceTokenRequest) @@ -557,6 +533,8 @@ async def delete_token_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="deleteWorkspaceToken", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -566,7 +544,7 @@ async def delete_token_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "*"): return operations.DeleteWorkspaceTokenResponse( status_code=http_res.status_code, @@ -574,22 +552,13 @@ async def delete_token_async( raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) def get( self, @@ -615,6 +584,8 @@ def get( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) req = self._build_request( method="GET", path="/v1/workspace", @@ -641,6 +612,8 @@ def get( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="getWorkspaceByContext", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -650,33 +623,24 @@ def get( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "application/json"): return operations.GetWorkspaceByContextResponse( - workspace_and_organization=utils.unmarshal_json( - http_res.text, Optional[shared.WorkspaceAndOrganization] + workspace_and_organization=unmarshal_json_response( + Optional[shared.WorkspaceAndOrganization], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def get_async( self, @@ -702,6 +666,8 @@ async def get_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) req = self._build_request_async( method="GET", path="/v1/workspace", @@ -728,6 +694,8 @@ async def get_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="getWorkspaceByContext", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -737,33 +705,24 @@ async def get_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "application/json"): return operations.GetWorkspaceByContextResponse( - workspace_and_organization=utils.unmarshal_json( - http_res.text, Optional[shared.WorkspaceAndOrganization] + workspace_and_organization=unmarshal_json_response( + Optional[shared.WorkspaceAndOrganization], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) def get_all( self, @@ -789,6 +748,8 @@ def get_all( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) req = self._build_request( method="GET", path="/v1/workspaces", @@ -815,6 +776,8 @@ def get_all( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="getWorkspaces", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -824,33 +787,24 @@ def get_all( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "application/json"): return operations.GetWorkspacesResponse( - workspaces=utils.unmarshal_json( - http_res.text, Optional[List[shared.Workspace]] + workspaces=unmarshal_json_response( + Optional[List[shared.Workspace]], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def get_all_async( self, @@ -876,6 +830,8 @@ async def get_all_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) req = self._build_request_async( method="GET", path="/v1/workspaces", @@ -902,6 +858,8 @@ async def get_all_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="getWorkspaces", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -911,33 +869,24 @@ async def get_all_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "application/json"): return operations.GetWorkspacesResponse( - workspaces=utils.unmarshal_json( - http_res.text, Optional[List[shared.Workspace]] + workspaces=unmarshal_json_response( + Optional[List[shared.Workspace]], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) def get_by_id( self, @@ -967,6 +916,8 @@ def get_by_id( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetWorkspaceRequest) @@ -1001,6 +952,8 @@ def get_by_id( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="getWorkspace", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1010,33 +963,22 @@ def get_by_id( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "application/json"): return operations.GetWorkspaceResponse( - workspace=utils.unmarshal_json( - http_res.text, Optional[shared.Workspace] - ), + workspace=unmarshal_json_response(Optional[shared.Workspace], http_res), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def get_by_id_async( self, @@ -1066,6 +1008,8 @@ async def get_by_id_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetWorkspaceRequest) @@ -1100,6 +1044,8 @@ async def get_by_id_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="getWorkspace", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1109,33 +1055,22 @@ async def get_by_id_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "application/json"): return operations.GetWorkspaceResponse( - workspace=utils.unmarshal_json( - http_res.text, Optional[shared.Workspace] - ), + workspace=unmarshal_json_response(Optional[shared.Workspace], http_res), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) def get_feature_flags( self, @@ -1164,6 +1099,8 @@ def get_feature_flags( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal( @@ -1200,6 +1137,8 @@ def get_feature_flags( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="getWorkspaceFeatureFlags", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1209,11 +1148,11 @@ def get_feature_flags( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetWorkspaceFeatureFlagsResponse( - workspace_feature_flag_response=utils.unmarshal_json( - http_res.text, Optional[shared.WorkspaceFeatureFlagResponse] + workspace_feature_flag_response=unmarshal_json_response( + Optional[shared.WorkspaceFeatureFlagResponse], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", @@ -1221,21 +1160,12 @@ def get_feature_flags( ) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) - - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) + + raise errors.SDKError("Unexpected response received", http_res) async def get_feature_flags_async( self, @@ -1264,6 +1194,8 @@ async def get_feature_flags_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal( @@ -1300,6 +1232,8 @@ async def get_feature_flags_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="getWorkspaceFeatureFlags", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1309,11 +1243,11 @@ async def get_feature_flags_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetWorkspaceFeatureFlagsResponse( - workspace_feature_flag_response=utils.unmarshal_json( - http_res.text, Optional[shared.WorkspaceFeatureFlagResponse] + workspace_feature_flag_response=unmarshal_json_response( + Optional[shared.WorkspaceFeatureFlagResponse], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", @@ -1321,21 +1255,12 @@ async def get_feature_flags_async( ) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) - - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) + + raise errors.SDKError("Unexpected response received", http_res) def get_settings( self, @@ -1366,6 +1291,8 @@ def get_settings( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetWorkspaceSettingsRequest) @@ -1400,6 +1327,8 @@ def get_settings( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="getWorkspaceSettings", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1409,33 +1338,24 @@ def get_settings( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "application/json"): return operations.GetWorkspaceSettingsResponse( - workspace_settings=utils.unmarshal_json( - http_res.text, Optional[shared.WorkspaceSettings] + workspace_settings=unmarshal_json_response( + Optional[shared.WorkspaceSettings], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def get_settings_async( self, @@ -1466,6 +1386,8 @@ async def get_settings_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetWorkspaceSettingsRequest) @@ -1500,6 +1422,8 @@ async def get_settings_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="getWorkspaceSettings", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1509,33 +1433,24 @@ async def get_settings_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "application/json"): return operations.GetWorkspaceSettingsResponse( - workspace_settings=utils.unmarshal_json( - http_res.text, Optional[shared.WorkspaceSettings] + workspace_settings=unmarshal_json_response( + Optional[shared.WorkspaceSettings], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) def get_team( self, @@ -1564,6 +1479,8 @@ def get_team( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetWorkspaceTeamRequest) @@ -1598,6 +1515,8 @@ def get_team( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="getWorkspaceTeam", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1607,33 +1526,24 @@ def get_team( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "application/json"): return operations.GetWorkspaceTeamResponse( - workspace_team_response=utils.unmarshal_json( - http_res.text, Optional[shared.WorkspaceTeamResponse] + workspace_team_response=unmarshal_json_response( + Optional[shared.WorkspaceTeamResponse], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def get_team_async( self, @@ -1662,6 +1572,8 @@ async def get_team_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetWorkspaceTeamRequest) @@ -1696,6 +1608,8 @@ async def get_team_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="getWorkspaceTeam", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1705,33 +1619,24 @@ async def get_team_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "application/json"): return operations.GetWorkspaceTeamResponse( - workspace_team_response=utils.unmarshal_json( - http_res.text, Optional[shared.WorkspaceTeamResponse] + workspace_team_response=unmarshal_json_response( + Optional[shared.WorkspaceTeamResponse], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) def get_tokens( self, @@ -1760,6 +1665,8 @@ def get_tokens( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetWorkspaceTokensRequest) @@ -1794,6 +1701,8 @@ def get_tokens( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="getWorkspaceTokens", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1803,33 +1712,24 @@ def get_tokens( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "application/json"): return operations.GetWorkspaceTokensResponse( - classes=utils.unmarshal_json( - http_res.text, Optional[List[shared.WorkspaceToken]] + classes=unmarshal_json_response( + Optional[List[shared.WorkspaceToken]], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def get_tokens_async( self, @@ -1858,6 +1758,8 @@ async def get_tokens_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetWorkspaceTokensRequest) @@ -1892,6 +1794,8 @@ async def get_tokens_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="getWorkspaceTokens", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1901,33 +1805,24 @@ async def get_tokens_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "application/json"): return operations.GetWorkspaceTokensResponse( - classes=utils.unmarshal_json( - http_res.text, Optional[List[shared.WorkspaceToken]] + classes=unmarshal_json_response( + Optional[List[shared.WorkspaceToken]], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) def grant_access( self, @@ -1956,6 +1851,8 @@ def grant_access( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal( @@ -1992,6 +1889,8 @@ def grant_access( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="grantUserAccessToWorkspace", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -2001,33 +1900,24 @@ def grant_access( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GrantUserAccessToWorkspaceResponse( - workspace_invite_response=utils.unmarshal_json( - http_res.text, Optional[shared.WorkspaceInviteResponse] + workspace_invite_response=unmarshal_json_response( + Optional[shared.WorkspaceInviteResponse], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def grant_access_async( self, @@ -2056,6 +1946,8 @@ async def grant_access_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal( @@ -2092,6 +1984,8 @@ async def grant_access_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="grantUserAccessToWorkspace", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -2101,33 +1995,24 @@ async def grant_access_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GrantUserAccessToWorkspaceResponse( - workspace_invite_response=utils.unmarshal_json( - http_res.text, Optional[shared.WorkspaceInviteResponse] + workspace_invite_response=unmarshal_json_response( + Optional[shared.WorkspaceInviteResponse], http_res ), status_code=http_res.status_code, content_type=http_res.headers.get("Content-Type") or "", raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) def revoke_access( self, @@ -2156,6 +2041,8 @@ def revoke_access( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal( @@ -2192,6 +2079,8 @@ def revoke_access( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="revokeUserAccessToWorkspace", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -2201,7 +2090,7 @@ def revoke_access( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "*"): return operations.RevokeUserAccessToWorkspaceResponse( status_code=http_res.status_code, @@ -2209,22 +2098,13 @@ def revoke_access( raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def revoke_access_async( self, @@ -2253,6 +2133,8 @@ async def revoke_access_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal( @@ -2289,6 +2171,8 @@ async def revoke_access_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="revokeUserAccessToWorkspace", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -2298,7 +2182,7 @@ async def revoke_access_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "*"): return operations.RevokeUserAccessToWorkspaceResponse( status_code=http_res.status_code, @@ -2306,23 +2190,200 @@ async def revoke_access_async( raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def set_feature_flags( + self, + *, + request: Union[ + shared.WorkspaceFeatureFlagRequest, + shared.WorkspaceFeatureFlagRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.SetWorkspaceFeatureFlagsResponse: + r"""Set workspace feature flags + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, shared.WorkspaceFeatureFlagRequest) + request = cast(shared.WorkspaceFeatureFlagRequest, request) + + req = self._build_request( + method="POST", + path="/v1/workspace/feature_flags", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", shared.WorkspaceFeatureFlagRequest + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="setWorkspaceFeatureFlags", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return operations.SetWorkspaceFeatureFlagsResponse( + workspace_feature_flag_response=unmarshal_json_response( + Optional[shared.WorkspaceFeatureFlagResponse], http_res + ), + status_code=http_res.status_code, + content_type=http_res.headers.get("Content-Type") or "", + raw_response=http_res, ) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "application/json"): + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) + + raise errors.SDKError("Unexpected response received", http_res) + + async def set_feature_flags_async( + self, + *, + request: Union[ + shared.WorkspaceFeatureFlagRequest, + shared.WorkspaceFeatureFlagRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.SetWorkspaceFeatureFlagsResponse: + r"""Set workspace feature flags + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, shared.WorkspaceFeatureFlagRequest) + request = cast(shared.WorkspaceFeatureFlagRequest, request) + + req = self._build_request_async( + method="POST", + path="/v1/workspace/feature_flags", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", shared.WorkspaceFeatureFlagRequest + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="setWorkspaceFeatureFlags", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, ) + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return operations.SetWorkspaceFeatureFlagsResponse( + workspace_feature_flag_response=unmarshal_json_response( + Optional[shared.WorkspaceFeatureFlagResponse], http_res + ), + status_code=http_res.status_code, + content_type=http_res.headers.get("Content-Type") or "", + raw_response=http_res, + ) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "application/json"): + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) + + raise errors.SDKError("Unexpected response received", http_res) + def update( self, *, @@ -2352,6 +2413,8 @@ def update( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.UpdateWorkspaceDetailsRequest) @@ -2389,6 +2452,8 @@ def update( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="updateWorkspaceDetails", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -2398,7 +2463,7 @@ def update( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "*"): return operations.UpdateWorkspaceDetailsResponse( status_code=http_res.status_code, @@ -2406,22 +2471,13 @@ def update( raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def update_async( self, @@ -2452,6 +2508,8 @@ async def update_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.UpdateWorkspaceDetailsRequest) @@ -2489,6 +2547,8 @@ async def update_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="updateWorkspaceDetails", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -2498,7 +2558,7 @@ async def update_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "*"): return operations.UpdateWorkspaceDetailsResponse( status_code=http_res.status_code, @@ -2506,22 +2566,13 @@ async def update_async( raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) def update_settings( self, @@ -2552,6 +2603,8 @@ def update_settings( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal( @@ -2595,6 +2648,8 @@ def update_settings( http_res = self.do_request( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="updateWorkspaceSettings", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -2604,7 +2659,7 @@ def update_settings( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "*"): return operations.UpdateWorkspaceSettingsResponse( status_code=http_res.status_code, @@ -2612,22 +2667,13 @@ def update_settings( raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) async def update_settings_async( self, @@ -2658,6 +2704,8 @@ async def update_settings_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal( @@ -2701,6 +2749,8 @@ async def update_settings_async( http_res = await self.do_request_async( hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", operation_id="updateWorkspaceSettings", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -2710,7 +2760,7 @@ async def update_settings_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "2XX", "*"): return operations.UpdateWorkspaceSettingsResponse( status_code=http_res.status_code, @@ -2718,19 +2768,10 @@ async def update_settings_async( raw_response=http_res, ) if utils.match_response(http_res, "4XX", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) + response_data = unmarshal_json_response(errors.ErrorData, http_res) + raise errors.Error(response_data, http_res) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) + raise errors.SDKError("API error occurred", http_res, http_res_text) - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) + raise errors.SDKError("Unexpected response received", http_res) From e53ea0e7b620df231aa82abe23f2999bf0238713 Mon Sep 17 00:00:00 2001 From: "speakeasy-github[bot]" <128539517+speakeasy-github[bot]@users.noreply.github.com> Date: Fri, 1 Aug 2025 00:39:56 +0000 Subject: [PATCH 2/2] empty commit to trigger [run-tests] workflow