From 79a87241c3e85b8776e1663d98ed39879855475a Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Sun, 6 Jul 2025 00:27:31 +0000 Subject: [PATCH 1/2] ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.575.5 --- .gitignore | 5 +- .speakeasy/gen.lock | 1273 +++++++---------- .speakeasy/workflow.lock | 14 +- CONTRIBUTING.md | 26 + NUGET.md | 76 +- README.md | 96 +- RELEASES.md | 12 +- USAGE.md | 12 +- codeSamples.yaml | 574 +++++--- .../Operations/ArchiveNamespaceRequest.md | 9 + .../Operations/ArchiveNamespaceRequestBody.md | 10 + .../Operations/ArchiveNamespaceResponse.md | 10 + .../Operations/CreateBillingAddOnsResponse.md | 11 + .../CreatePublishingTokenRequestBody.md | 13 + .../CreatePublishingTokenResponse.md | 11 + .../CreateSchemaStoreItemRequestBody.md | 11 + .../CreateSchemaStoreItemResponse.md | 11 + .../Operations/DeleteBillingAddOnRequest.md | 8 + .../Operations/DeleteBillingAddOnResponse.md | 10 + .../DeletePublishingTokenRequest.md | 8 + .../DeletePublishingTokenResponse.md | 10 + docs/Models/Operations/Format.md | 11 + .../GenerateCodeSamplePreviewResponse.md | 5 +- .../Operations/GetBillingAddOnsResponse.md | 11 + .../GetCodeSamplePreviewAsyncResponse.md | 7 +- .../Operations/GetCodeSamplesRequest.md | 10 - .../GetPublishingTokenByIDRequest.md | 8 + .../GetPublishingTokenByIDResponse.md | 11 + ...GetPublishingTokenPublicMetadataRequest.md | 8 + ...etPublishingTokenPublicMetadataResponse.md | 11 + ...blishingTokenPublicMetadataResponseBody.md | 14 + ...ponse.md => GetPublishingTokenResponse.md} | 4 +- .../GetPublishingTokenTargetByIDRequest.md | 8 + .../GetPublishingTokenTargetByIDResponse.md | 11 + .../GetSchemaStoreItemRequestBody.md | 8 + .../Operations/GetSchemaStoreItemResponse.md | 11 + .../GetWorkspaceEventsByTargetRequest.md | 2 +- docs/Models/Operations/PostTagsRequest.md | 4 +- .../Models/Operations/SetVisibilityRequest.md | 4 +- .../SuggestOpenAPIRegistryRequest.md | 4 +- .../UpdatePublishingTokenExpirationRequest.md | 9 + ...atePublishingTokenExpirationRequestBody.md | 11 + ...UpdatePublishingTokenExpirationResponse.md | 10 + docs/Models/Shared/ApiKeyDetails.md | 1 + docs/Models/Shared/BillingAddOn.md | 11 + docs/Models/Shared/CliEvent.md | 1 + docs/Models/Shared/CodeSampleSchemaInput.md | 13 +- docs/Models/Shared/Format.md | 9 + .../Shared/GithubTriggerActionRequest.md | 2 +- docs/Models/Shared/InteractionType.md | 3 +- docs/Models/Shared/Namespace.md | 2 + docs/Models/Shared/Organization.md | 8 +- .../Shared/OrganizationBillingAddOnRequest.md | 10 + .../OrganizationBillingAddOnResponse.md | 10 + docs/Models/Shared/PublishingToken.md | 21 + docs/Models/Shared/Revision.md | 1 + .../Models/Shared/RevisionContentsMetadata.md | 20 + .../Shared/RevisionContentsMetadataType.md | 9 + docs/Models/Shared/SchemaStoreItem.md | 13 + docs/Models/Shared/TargetResource.md | 8 + docs/Models/Shared/UsageSnippet.md | 4 +- docs/Models/Shared/User.md | 2 + docs/Models/Shared/Workspace.md | 6 +- docs/Models/Shared/WorkspaceToken.md | 2 + docs/sdks/artifacts/README.md | 58 +- docs/sdks/auth/README.md | 2 +- docs/sdks/codesamples/README.md | 69 +- docs/sdks/events/README.md | 54 +- docs/sdks/github/README.md | 4 +- docs/sdks/organizations/README.md | 121 +- docs/sdks/publishingtokens/README.md | 288 ++++ docs/sdks/reports/README.md | 4 +- docs/sdks/schemastore/README.md | 92 ++ docs/sdks/shorturls/README.md | 2 +- docs/sdks/suggest/README.md | 17 +- docs/sdks/workspaces/README.md | 151 +- gen.yaml | 12 +- src/SpeakeasySDK/Artifacts.cs | 200 ++- src/SpeakeasySDK/Auth.cs | 57 +- src/SpeakeasySDK/CodeSamples.cs | 184 +-- src/SpeakeasySDK/Events.cs | 65 +- src/SpeakeasySDK/Github.cs | 123 +- src/SpeakeasySDK/Hooks/HookTypes.cs | 21 +- src/SpeakeasySDK/Hooks/SDKHooks.cs | 4 +- .../Operations/ArchiveNamespaceRequest.cs | 27 + .../Operations/ArchiveNamespaceRequestBody.cs | 24 + .../Operations/ArchiveNamespaceResponse.cs | 34 + .../Operations/CreateBillingAddOnsResponse.cs | 40 + .../CreatePublishingTokenRequestBody.cs | 34 + .../CreatePublishingTokenResponse.cs | 40 + .../CreateSchemaStoreItemRequestBody.cs | 43 + .../CreateSchemaStoreItemResponse.cs | 40 + ...equest.cs => DeleteBillingAddOnRequest.cs} | 19 +- .../Operations/DeleteBillingAddOnResponse.cs | 34 + .../DeletePublishingTokenRequest.cs | 23 + .../DeletePublishingTokenResponse.cs | 34 + src/SpeakeasySDK/Models/Operations/Format.cs | 60 + .../GenerateCodeSamplePreviewResponse.cs | 16 +- .../Operations/GetBillingAddOnsResponse.cs | 40 + .../GetCodeSamplePreviewAsyncResponse.cs | 26 +- .../GetPublishingTokenByIDRequest.cs | 23 + .../GetPublishingTokenByIDResponse.cs | 40 + ...GetPublishingTokenPublicMetadataRequest.cs | 23 + ...etPublishingTokenPublicMetadataResponse.cs | 40 + ...blishingTokenPublicMetadataResponseBody.cs | 37 + .../Operations/GetPublishingTokenResponse.cs | 41 + .../GetPublishingTokenTargetByIDRequest.cs | 23 + .../GetPublishingTokenTargetByIDResponse.cs | 39 + .../GetSchemaStoreItemRequestBody.cs | 21 + ...ponse.cs => GetSchemaStoreItemResponse.cs} | 12 +- .../GetWorkspaceEventsByTargetRequest.cs | 12 +- .../Models/Operations/PostTagsRequest.cs | 6 +- .../Models/Operations/SetVisibilityRequest.cs | 6 +- .../SuggestOpenAPIRegistryRequest.cs | 12 +- .../UpdatePublishingTokenExpirationRequest.cs | 30 + ...atePublishingTokenExpirationRequestBody.cs | 34 + ...UpdatePublishingTokenExpirationResponse.cs | 34 + src/SpeakeasySDK/Models/Shared/AccountType.cs | 92 +- .../Models/Shared/ApiKeyDetails.cs | 5 + .../Models/Shared/BillingAddOn.cs | 79 + src/SpeakeasySDK/Models/Shared/CliEvent.cs | 6 + .../Models/Shared/CodeSampleSchemaInput.cs | 18 +- src/SpeakeasySDK/Models/Shared/FeatureFlag.cs | 3 + src/SpeakeasySDK/Models/Shared/Format.cs | 57 + .../Shared/GithubTriggerActionRequest.cs | 12 +- .../Models/Shared/InteractionType.cs | 2 + src/SpeakeasySDK/Models/Shared/Namespace.cs | 6 + .../Models/Shared/Organization.cs | 21 +- .../Shared/OrganizationBillingAddOnRequest.cs | 29 + .../OrganizationBillingAddOnResponse.cs | 29 + .../Models/Shared/PublishingToken.cs | 59 + src/SpeakeasySDK/Models/Shared/Revision.cs | 4 + .../Models/Shared/RevisionContentsMetadata.cs | 93 ++ .../Shared/RevisionContentsMetadataType.cs | 57 + .../Models/Shared/SchemaStoreItem.cs | 38 + .../Models/Shared/TargetResource.cs | 55 + .../Models/Shared/UsageSnippet.cs | 12 + src/SpeakeasySDK/Models/Shared/User.cs | 12 + src/SpeakeasySDK/Models/Shared/Workspace.cs | 18 +- .../Models/Shared/WorkspaceFeatureFlag.cs | 86 +- .../Shared/WorkspaceFeatureFlagRequest.cs | 3 + .../Models/Shared/WorkspaceToken.cs | 6 + src/SpeakeasySDK/Models/Shared/Workspaces.cs | 3 + src/SpeakeasySDK/Organizations.cs | 330 ++++- src/SpeakeasySDK/PublishingTokens.cs | 690 +++++++++ src/SpeakeasySDK/Reports.cs | 61 +- src/SpeakeasySDK/SDK.cs | 205 +-- src/SpeakeasySDK/SDKConfig.cs | 81 ++ src/SpeakeasySDK/SchemaStore.cs | 234 +++ src/SpeakeasySDK/ShortURLs.cs | 29 +- src/SpeakeasySDK/SpeakeasySDK.csproj | 2 +- src/SpeakeasySDK/Subscriptions.cs | 33 +- src/SpeakeasySDK/Suggest.cs | 77 +- src/SpeakeasySDK/Utils/OpenEnumConverter.cs | 62 + .../Utils/RequestBodySerializer.cs | 102 +- src/SpeakeasySDK/Utils/SecurityMetadata.cs | 2 + src/SpeakeasySDK/Workspaces.cs | 163 +-- 157 files changed, 5752 insertions(+), 2167 deletions(-) create mode 100644 CONTRIBUTING.md 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 delete mode 100644 docs/Models/Operations/GetCodeSamplesRequest.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 rename docs/Models/Operations/{GetCodeSamplesResponse.md => GetPublishingTokenResponse.md} (92%) 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/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/OrganizationBillingAddOnRequest.md create mode 100644 docs/Models/Shared/OrganizationBillingAddOnResponse.md create mode 100644 docs/Models/Shared/PublishingToken.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/sdks/publishingtokens/README.md create mode 100644 docs/sdks/schemastore/README.md create mode 100644 src/SpeakeasySDK/Models/Operations/ArchiveNamespaceRequest.cs create mode 100644 src/SpeakeasySDK/Models/Operations/ArchiveNamespaceRequestBody.cs create mode 100644 src/SpeakeasySDK/Models/Operations/ArchiveNamespaceResponse.cs create mode 100644 src/SpeakeasySDK/Models/Operations/CreateBillingAddOnsResponse.cs create mode 100644 src/SpeakeasySDK/Models/Operations/CreatePublishingTokenRequestBody.cs create mode 100644 src/SpeakeasySDK/Models/Operations/CreatePublishingTokenResponse.cs create mode 100644 src/SpeakeasySDK/Models/Operations/CreateSchemaStoreItemRequestBody.cs create mode 100644 src/SpeakeasySDK/Models/Operations/CreateSchemaStoreItemResponse.cs rename src/SpeakeasySDK/Models/Operations/{GetCodeSamplesRequest.cs => DeleteBillingAddOnRequest.cs} (50%) create mode 100644 src/SpeakeasySDK/Models/Operations/DeleteBillingAddOnResponse.cs create mode 100644 src/SpeakeasySDK/Models/Operations/DeletePublishingTokenRequest.cs create mode 100644 src/SpeakeasySDK/Models/Operations/DeletePublishingTokenResponse.cs create mode 100644 src/SpeakeasySDK/Models/Operations/Format.cs create mode 100644 src/SpeakeasySDK/Models/Operations/GetBillingAddOnsResponse.cs create mode 100644 src/SpeakeasySDK/Models/Operations/GetPublishingTokenByIDRequest.cs create mode 100644 src/SpeakeasySDK/Models/Operations/GetPublishingTokenByIDResponse.cs create mode 100644 src/SpeakeasySDK/Models/Operations/GetPublishingTokenPublicMetadataRequest.cs create mode 100644 src/SpeakeasySDK/Models/Operations/GetPublishingTokenPublicMetadataResponse.cs create mode 100644 src/SpeakeasySDK/Models/Operations/GetPublishingTokenPublicMetadataResponseBody.cs create mode 100644 src/SpeakeasySDK/Models/Operations/GetPublishingTokenResponse.cs create mode 100644 src/SpeakeasySDK/Models/Operations/GetPublishingTokenTargetByIDRequest.cs create mode 100644 src/SpeakeasySDK/Models/Operations/GetPublishingTokenTargetByIDResponse.cs create mode 100644 src/SpeakeasySDK/Models/Operations/GetSchemaStoreItemRequestBody.cs rename src/SpeakeasySDK/Models/Operations/{GetCodeSamplesResponse.cs => GetSchemaStoreItemResponse.cs} (91%) create mode 100644 src/SpeakeasySDK/Models/Operations/UpdatePublishingTokenExpirationRequest.cs create mode 100644 src/SpeakeasySDK/Models/Operations/UpdatePublishingTokenExpirationRequestBody.cs create mode 100644 src/SpeakeasySDK/Models/Operations/UpdatePublishingTokenExpirationResponse.cs create mode 100644 src/SpeakeasySDK/Models/Shared/BillingAddOn.cs create mode 100644 src/SpeakeasySDK/Models/Shared/Format.cs create mode 100644 src/SpeakeasySDK/Models/Shared/OrganizationBillingAddOnRequest.cs create mode 100644 src/SpeakeasySDK/Models/Shared/OrganizationBillingAddOnResponse.cs create mode 100644 src/SpeakeasySDK/Models/Shared/PublishingToken.cs create mode 100644 src/SpeakeasySDK/Models/Shared/RevisionContentsMetadata.cs create mode 100644 src/SpeakeasySDK/Models/Shared/RevisionContentsMetadataType.cs create mode 100644 src/SpeakeasySDK/Models/Shared/SchemaStoreItem.cs create mode 100644 src/SpeakeasySDK/Models/Shared/TargetResource.cs create mode 100644 src/SpeakeasySDK/PublishingTokens.cs create mode 100644 src/SpeakeasySDK/SDKConfig.cs create mode 100644 src/SpeakeasySDK/SchemaStore.cs create mode 100644 src/SpeakeasySDK/Utils/OpenEnumConverter.cs diff --git a/.gitignore b/.gitignore index 10179e56..463169cc 100755 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,7 @@ +.DS_Store +**/.speakeasy/temp/ +**/.speakeasy/logs/ obj/ bin/ debug/ -.idea/ \ No newline at end of file +.idea/ diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 64277a85..78213ef1 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,31 +1,34 @@ lockVersion: 2.0.0 id: f73d2126-985b-4d69-88ee-b7c69254d8bf management: - docChecksum: 52df6f1f34dfe76968f8ed009cc2bfd3 + docChecksum: 17226457b23fc2563102eb22d263bc30 docVersion: 0.4.0 - speakeasyVersion: 1.468.2 - generationVersion: 2.493.4 - releaseVersion: 5.12.0 - configChecksum: 4ac5f7ce74e22b4b8247f447fc0fc3c9 + speakeasyVersion: 1.575.5 + generationVersion: 2.648.7 + releaseVersion: 5.13.0 + configChecksum: 9ff231d9eb4ff7bc6b865b63266e29d2 repoURL: https://github.com/speakeasy-api/speakeasy-client-sdk-csharp.git repoSubDirectory: . published: true features: csharp: additionalDependencies: 0.1.0 - core: 3.10.10 + constsAndDefaults: 0.0.1 + core: 3.11.1 deprecations: 2.81.2 - globalSecurity: 2.83.6 + getRequestBodies: 2.81.1 + globalSecurity: 2.83.7 globalSecurityCallbacks: 0.1.0 - globalServerURLs: 2.82.3 + globalServerURLs: 2.82.4 globals: 2.82.1 intellisenseMarkdownSupport: 0.1.0 methodArguments: 0.2.0 nameOverrides: 2.81.2 - nullables: 0.1.0 + nullables: 0.1.1 + openEnums: 0.1.0 responseFormat: 0.0.4 retries: 0.0.1 - sdkHooks: 0.1.0 + sdkHooks: 0.2.0 serverIDs: 2.82.1 generatedFiles: - .gitattributes @@ -35,24 +38,38 @@ generatedFiles: - docs/Models/Errors/Error.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/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/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 @@ -61,8 +78,6 @@ generatedFiles: - docs/Models/Operations/GetCodeSamplePreviewAsyncRequest.md - docs/Models/Operations/GetCodeSamplePreviewAsyncResponse.md - docs/Models/Operations/GetCodeSamplePreviewAsyncResponseBody.md - - docs/Models/Operations/GetCodeSamplesRequest.md - - docs/Models/Operations/GetCodeSamplesResponse.md - docs/Models/Operations/GetGitHubActionRequest.md - docs/Models/Operations/GetGitHubActionResponse.md - docs/Models/Operations/GetGithubSetupStateRequest.md @@ -77,8 +92,18 @@ generatedFiles: - docs/Models/Operations/GetOrganizationResponse.md - docs/Models/Operations/GetOrganizationUsageResponse.md - docs/Models/Operations/GetOrganizationsResponse.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 @@ -141,6 +166,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/UpdateWorkspaceDetailsRequest.md - docs/Models/Operations/UpdateWorkspaceDetailsResponse.md - docs/Models/Operations/UpdateWorkspaceSettingsRequest.md @@ -158,6 +186,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 @@ -165,6 +194,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 @@ -189,10 +219,13 @@ 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 @@ -200,8 +233,11 @@ generatedFiles: - 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/SSOMetadata.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 @@ -211,6 +247,7 @@ generatedFiles: - docs/Models/Shared/SuggestRequestBodySuggestionType.md - docs/Models/Shared/SuggestionType.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 @@ -234,7 +271,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/sdk/README.md - docs/sdks/shorturls/README.md - docs/sdks/subscriptions/README.md @@ -252,24 +291,38 @@ generatedFiles: - src/SpeakeasySDK/Models/Errors/SDKException.cs - src/SpeakeasySDK/Models/Operations/ActivateSubscriptionNamespaceRequest.cs - src/SpeakeasySDK/Models/Operations/ActivateSubscriptionNamespaceResponse.cs + - src/SpeakeasySDK/Models/Operations/ArchiveNamespaceRequest.cs + - src/SpeakeasySDK/Models/Operations/ArchiveNamespaceRequestBody.cs + - src/SpeakeasySDK/Models/Operations/ArchiveNamespaceResponse.cs - src/SpeakeasySDK/Models/Operations/CheckGithubAccessRequest.cs - src/SpeakeasySDK/Models/Operations/CheckGithubAccessResponse.cs + - src/SpeakeasySDK/Models/Operations/CreateBillingAddOnsResponse.cs - src/SpeakeasySDK/Models/Operations/CreateFreeTrialResponse.cs - src/SpeakeasySDK/Models/Operations/CreateOrganizationResponse.cs + - src/SpeakeasySDK/Models/Operations/CreatePublishingTokenRequestBody.cs + - src/SpeakeasySDK/Models/Operations/CreatePublishingTokenResponse.cs - src/SpeakeasySDK/Models/Operations/CreateRemoteSourceResponse.cs - src/SpeakeasySDK/Models/Operations/CreateRequestBody.cs - src/SpeakeasySDK/Models/Operations/CreateResponse.cs + - src/SpeakeasySDK/Models/Operations/CreateSchemaStoreItemRequestBody.cs + - src/SpeakeasySDK/Models/Operations/CreateSchemaStoreItemResponse.cs - src/SpeakeasySDK/Models/Operations/CreateWorkspaceResponse.cs - src/SpeakeasySDK/Models/Operations/CreateWorkspaceTokenRequest.cs - src/SpeakeasySDK/Models/Operations/CreateWorkspaceTokenResponse.cs + - src/SpeakeasySDK/Models/Operations/DeleteBillingAddOnRequest.cs + - src/SpeakeasySDK/Models/Operations/DeleteBillingAddOnResponse.cs + - src/SpeakeasySDK/Models/Operations/DeletePublishingTokenRequest.cs + - src/SpeakeasySDK/Models/Operations/DeletePublishingTokenResponse.cs - src/SpeakeasySDK/Models/Operations/DeleteWorkspaceTokenRequest.cs - src/SpeakeasySDK/Models/Operations/DeleteWorkspaceTokenResponse.cs - src/SpeakeasySDK/Models/Operations/File.cs + - src/SpeakeasySDK/Models/Operations/Format.cs - src/SpeakeasySDK/Models/Operations/GenerateCodeSamplePreviewAsyncResponse.cs - src/SpeakeasySDK/Models/Operations/GenerateCodeSamplePreviewAsyncResponseBody.cs - src/SpeakeasySDK/Models/Operations/GenerateCodeSamplePreviewResponse.cs - src/SpeakeasySDK/Models/Operations/GetAccessTokenRequest.cs - src/SpeakeasySDK/Models/Operations/GetAccessTokenResponse.cs + - src/SpeakeasySDK/Models/Operations/GetBillingAddOnsResponse.cs - src/SpeakeasySDK/Models/Operations/GetBlobRequest.cs - src/SpeakeasySDK/Models/Operations/GetBlobResponse.cs - src/SpeakeasySDK/Models/Operations/GetChangesReportSignedUrlRequest.cs @@ -278,8 +331,6 @@ generatedFiles: - src/SpeakeasySDK/Models/Operations/GetCodeSamplePreviewAsyncRequest.cs - src/SpeakeasySDK/Models/Operations/GetCodeSamplePreviewAsyncResponse.cs - src/SpeakeasySDK/Models/Operations/GetCodeSamplePreviewAsyncResponseBody.cs - - src/SpeakeasySDK/Models/Operations/GetCodeSamplesRequest.cs - - src/SpeakeasySDK/Models/Operations/GetCodeSamplesResponse.cs - src/SpeakeasySDK/Models/Operations/GetGitHubActionRequest.cs - src/SpeakeasySDK/Models/Operations/GetGitHubActionResponse.cs - src/SpeakeasySDK/Models/Operations/GetGithubSetupStateRequest.cs @@ -294,8 +345,18 @@ generatedFiles: - src/SpeakeasySDK/Models/Operations/GetOrganizationResponse.cs - src/SpeakeasySDK/Models/Operations/GetOrganizationUsageResponse.cs - src/SpeakeasySDK/Models/Operations/GetOrganizationsResponse.cs + - src/SpeakeasySDK/Models/Operations/GetPublishingTokenByIDRequest.cs + - src/SpeakeasySDK/Models/Operations/GetPublishingTokenByIDResponse.cs + - src/SpeakeasySDK/Models/Operations/GetPublishingTokenPublicMetadataRequest.cs + - src/SpeakeasySDK/Models/Operations/GetPublishingTokenPublicMetadataResponse.cs + - src/SpeakeasySDK/Models/Operations/GetPublishingTokenPublicMetadataResponseBody.cs + - src/SpeakeasySDK/Models/Operations/GetPublishingTokenResponse.cs + - src/SpeakeasySDK/Models/Operations/GetPublishingTokenTargetByIDRequest.cs + - src/SpeakeasySDK/Models/Operations/GetPublishingTokenTargetByIDResponse.cs - src/SpeakeasySDK/Models/Operations/GetRevisionsRequest.cs - src/SpeakeasySDK/Models/Operations/GetRevisionsResponse.cs + - src/SpeakeasySDK/Models/Operations/GetSchemaStoreItemRequestBody.cs + - src/SpeakeasySDK/Models/Operations/GetSchemaStoreItemResponse.cs - src/SpeakeasySDK/Models/Operations/GetTagsRequest.cs - src/SpeakeasySDK/Models/Operations/GetTagsResponse.cs - src/SpeakeasySDK/Models/Operations/GetUserResponse.cs @@ -358,6 +419,9 @@ generatedFiles: - src/SpeakeasySDK/Models/Operations/SuggestOpenAPIResponse.cs - src/SpeakeasySDK/Models/Operations/SuggestRequest.cs - src/SpeakeasySDK/Models/Operations/SuggestResponse.cs + - src/SpeakeasySDK/Models/Operations/UpdatePublishingTokenExpirationRequest.cs + - src/SpeakeasySDK/Models/Operations/UpdatePublishingTokenExpirationRequestBody.cs + - src/SpeakeasySDK/Models/Operations/UpdatePublishingTokenExpirationResponse.cs - src/SpeakeasySDK/Models/Operations/UpdateWorkspaceDetailsRequest.cs - src/SpeakeasySDK/Models/Operations/UpdateWorkspaceDetailsResponse.cs - src/SpeakeasySDK/Models/Operations/UpdateWorkspaceSettingsRequest.cs @@ -375,6 +439,7 @@ generatedFiles: - src/SpeakeasySDK/Models/Shared/Annotations.cs - src/SpeakeasySDK/Models/Shared/ApiKeyDetails.cs - src/SpeakeasySDK/Models/Shared/Auth.cs + - src/SpeakeasySDK/Models/Shared/BillingAddOn.cs - src/SpeakeasySDK/Models/Shared/Claims.cs - src/SpeakeasySDK/Models/Shared/CliEvent.cs - src/SpeakeasySDK/Models/Shared/CodeSampleSchemaInput.cs @@ -382,6 +447,7 @@ generatedFiles: - src/SpeakeasySDK/Models/Shared/CompositeSpecMetadata.cs - src/SpeakeasySDK/Models/Shared/Diagnostic.cs - src/SpeakeasySDK/Models/Shared/FeatureFlag.cs + - src/SpeakeasySDK/Models/Shared/Format.cs - src/SpeakeasySDK/Models/Shared/GenerateBumpType.cs - src/SpeakeasySDK/Models/Shared/GetNamespacesResponse.cs - src/SpeakeasySDK/Models/Shared/GetRevisionsResponse.cs @@ -406,10 +472,13 @@ generatedFiles: - src/SpeakeasySDK/Models/Shared/OASSummary.cs - src/SpeakeasySDK/Models/Shared/OpenapiDiffBumpType.cs - src/SpeakeasySDK/Models/Shared/Organization.cs + - src/SpeakeasySDK/Models/Shared/OrganizationBillingAddOnRequest.cs + - src/SpeakeasySDK/Models/Shared/OrganizationBillingAddOnResponse.cs - src/SpeakeasySDK/Models/Shared/OrganizationUsage.cs - src/SpeakeasySDK/Models/Shared/OrganizationUsageResponse.cs - src/SpeakeasySDK/Models/Shared/PreflightRequest.cs - src/SpeakeasySDK/Models/Shared/PreflightToken.cs + - src/SpeakeasySDK/Models/Shared/PublishingToken.cs - src/SpeakeasySDK/Models/Shared/PullRequestMetadata.cs - src/SpeakeasySDK/Models/Shared/Relationship.cs - src/SpeakeasySDK/Models/Shared/RemoteDocument.cs @@ -417,8 +486,11 @@ generatedFiles: - src/SpeakeasySDK/Models/Shared/RemoteSourceSubscriptionSettings.cs - src/SpeakeasySDK/Models/Shared/Report.cs - src/SpeakeasySDK/Models/Shared/Revision.cs + - src/SpeakeasySDK/Models/Shared/RevisionContentsMetadata.cs + - src/SpeakeasySDK/Models/Shared/RevisionContentsMetadataType.cs - src/SpeakeasySDK/Models/Shared/SSOMetadata.cs - src/SpeakeasySDK/Models/Shared/SchemaFile.cs + - src/SpeakeasySDK/Models/Shared/SchemaStoreItem.cs - src/SpeakeasySDK/Models/Shared/Secrets.cs - src/SpeakeasySDK/Models/Shared/Security.cs - src/SpeakeasySDK/Models/Shared/ShortURL.cs @@ -428,6 +500,7 @@ generatedFiles: - src/SpeakeasySDK/Models/Shared/SuggestRequestBodySuggestionType.cs - src/SpeakeasySDK/Models/Shared/SuggestionType.cs - src/SpeakeasySDK/Models/Shared/Tag.cs + - src/SpeakeasySDK/Models/Shared/TargetResource.cs - src/SpeakeasySDK/Models/Shared/TargetSDK.cs - src/SpeakeasySDK/Models/Shared/Type.cs - src/SpeakeasySDK/Models/Shared/UsageSnippet.cs @@ -446,8 +519,11 @@ generatedFiles: - src/SpeakeasySDK/Models/Shared/WorkspaceToken.cs - src/SpeakeasySDK/Models/Shared/Workspaces.cs - src/SpeakeasySDK/Organizations.cs + - src/SpeakeasySDK/PublishingTokens.cs - src/SpeakeasySDK/Reports.cs - src/SpeakeasySDK/SDK.cs + - src/SpeakeasySDK/SDKConfig.cs + - src/SpeakeasySDK/SchemaStore.cs - src/SpeakeasySDK/ShortURLs.cs - src/SpeakeasySDK/SpeakeasySDK.csproj - src/SpeakeasySDK/Subscriptions.cs @@ -459,6 +535,7 @@ generatedFiles: - src/SpeakeasySDK/Utils/FlexibleObjectDeserializer.cs - src/SpeakeasySDK/Utils/HeaderSerializer.cs - src/SpeakeasySDK/Utils/IsoDateTimeSerializer.cs + - src/SpeakeasySDK/Utils/OpenEnumConverter.cs - src/SpeakeasySDK/Utils/RequestBodySerializer.cs - src/SpeakeasySDK/Utils/ResponseBodyDeserializer.cs - src/SpeakeasySDK/Utils/Retries/BackoffStrategy.cs @@ -471,288 +548,11 @@ generatedFiles: - src/SpeakeasySDK/Utils/Utilities.cs - src/SpeakeasySDK/Workspaces.cs examples: - deleteApi: - speakeasy-default-delete-api: - parameters: - path: - apiID: "" - versionID: "" - responses: - default: - application/json: {"message": "", "status_code": 875451} - generateOpenApiSpec: - speakeasy-default-generate-open-api-spec: - parameters: - path: - apiID: "" - versionID: "" - responses: - "200": - application/json: {"current_schema": "", "new_schema": ""} - default: - application/json: {"message": "", "status_code": 871055} - generatePostmanCollection: - speakeasy-default-generate-postman-collection: - parameters: - path: - apiID: "" - versionID: "" - responses: - "200": - application/octet-stream: "0xd6Be621e7F" - default: - application/json: {"message": "", "status_code": 697008} - getAllApiVersions: - speakeasy-default-get-all-api-versions: - parameters: - path: - apiID: "" - query: {} - responses: - "200": - application/json: [] - default: - application/json: {"message": "", "status_code": 784529} - getApis: - speakeasy-default-get-apis: - responses: - "200": - application/json: [] - default: - application/json: {"message": "", "status_code": 11490} - upsertApi: - speakeasy-default-upsert-api: - parameters: - path: - apiID: "" - requestBody: - application/json: {"api_id": "", "description": "Synchronised 5th generation knowledge user", "version_id": ""} - responses: - "200": - application/json: {"api_id": "", "created_at": "2022-11-30T03:11:22.096Z", "description": "Visionary 4th generation focus group", "updated_at": "2022-03-06T16:10:22.154Z", "version_id": "", "workspace_id": ""} - default: - application/json: {"message": "", "status_code": 17590} - deleteApiEndpoint: - speakeasy-default-delete-api-endpoint: - parameters: - path: - apiID: "" - versionID: "" - apiEndpointID: "" - responses: - default: - application/json: {"message": "", "status_code": 788324} - findApiEndpoint: - speakeasy-default-find-api-endpoint: - parameters: - path: - apiID: "" - versionID: "" - displayName: "Don.Strosin" - responses: - "200": - application/json: {"api_endpoint_id": "", "api_id": "", "created_at": "2023-05-01T15:36:31.538Z", "description": "Programmable uniform adapter", "display_name": "Gracie23", "method": "", "path": "/srv", "updated_at": "2024-01-26T05:16:49.540Z", "version_id": "", "workspace_id": ""} - default: - application/json: {"message": "", "status_code": 398024} - generateOpenApiSpecForApiEndpoint: - speakeasy-default-generate-open-api-spec-for-api-endpoint: - parameters: - path: - apiID: "" - versionID: "" - apiEndpointID: "" - responses: - "200": - application/json: {"current_schema": "", "new_schema": ""} - default: - application/json: {"message": "", "status_code": 833540} - generatePostmanCollectionForApiEndpoint: - speakeasy-default-generate-postman-collection-for-api-endpoint: - parameters: - path: - apiID: "" - versionID: "" - apiEndpointID: "" - responses: - "200": - application/octet-stream: "0xBBF5e24c4D" - default: - application/json: {"message": "", "status_code": 870898} - getAllApiEndpoints: - speakeasy-default-get-all-api-endpoints: - parameters: - path: - apiID: "" - responses: - "200": - application/json: [] - default: - application/json: {"message": "", "status_code": 909400} - getAllForVersionApiEndpoints: - speakeasy-default-get-all-for-version-api-endpoints: - parameters: - path: - apiID: "" - versionID: "" - responses: - "200": - application/json: [] - default: - application/json: {"message": "", "status_code": 908203} - getApiEndpoint: - speakeasy-default-get-api-endpoint: - parameters: - path: - apiID: "" - versionID: "" - apiEndpointID: "" - responses: - "200": - application/json: {"api_endpoint_id": "", "api_id": "", "created_at": "2024-12-16T12:54:49.054Z", "description": "Grass-roots interactive orchestration", "display_name": "Mylene_Kozey58", "method": "", "path": "/rescue", "updated_at": "2024-07-01T02:49:47.888Z", "version_id": "", "workspace_id": ""} - default: - application/json: {"message": "", "status_code": 572524} - upsertApiEndpoint: - speakeasy-default-upsert-api-endpoint: - parameters: - path: - apiID: "" - versionID: "" - apiEndpointID: "" - requestBody: - application/json: {"api_endpoint_id": "", "description": "Public-key systematic attitude", "display_name": "Camille.Schaefer11", "method": "", "path": "/Library", "version_id": ""} - responses: - "200": - application/json: {"api_endpoint_id": "", "api_id": "", "created_at": "2023-05-11T02:25:34.515Z", "description": "Triple-buffered optimal methodology", "display_name": "Nolan_Corwin58", "method": "", "path": "/home/user", "updated_at": "2022-04-29T18:24:21.535Z", "version_id": "", "workspace_id": ""} - default: - application/json: {"message": "", "status_code": 462700} - deleteVersionMetadata: - speakeasy-default-delete-version-metadata: - parameters: - path: - apiID: "" - versionID: "" - metaKey: "" - metaValue: "" - responses: - default: - application/json: {"message": "", "status_code": 730807} - getVersionMetadata: - speakeasy-default-get-version-metadata: - parameters: - path: - apiID: "" - versionID: "" - responses: - "200": - application/json: [] - default: - application/json: {"message": "", "status_code": 269133} - insertVersionMetadata: - speakeasy-default-insert-version-metadata: - parameters: - path: - apiID: "" - versionID: "" - requestBody: - application/json: {"meta_key": "", "meta_value": ""} - responses: - "200": - application/json: {"api_id": "", "created_at": "2022-03-18T13:32:09.395Z", "meta_key": "", "meta_value": "", "version_id": "", "workspace_id": ""} - default: - application/json: {"message": "", "status_code": 516378} - deleteSchema: - speakeasy-default-delete-schema: - parameters: - path: - apiID: "" - versionID: "" - revisionID: "" - responses: - default: - application/json: {"message": "", "status_code": 9376} - downloadSchema: - speakeasy-default-download-schema: - parameters: - path: - apiID: "" - versionID: "" - responses: - "200": - application/json: "0xaf6D2e8557" - application/x-yaml: "0x5EFea906ee" - default: - application/json: {"message": "", "status_code": 375177} - downloadSchemaRevision: - speakeasy-default-download-schema-revision: - parameters: - path: - apiID: "" - versionID: "" - revisionID: "" - responses: - "200": - application/json: "0xC11b2bbEC4" - application/x-yaml: "0xE04B837904" - default: - application/json: {"message": "", "status_code": 298817} - getSchema: - speakeasy-default-get-schema: - parameters: - path: - apiID: "" - versionID: "" - responses: - "200": - application/json: {"api_id": "", "created_at": "2022-09-09T00:58:17.303Z", "description": "Quality-focused scalable superstructure", "revision_id": "", "version_id": "", "workspace_id": ""} - default: - application/json: {"message": "", "status_code": 983881} - getSchemaDiff: - speakeasy-default-get-schema-diff: - parameters: - path: - apiID: "" - versionID: "" - baseRevisionID: "" - targetRevisionID: "" - responses: - "200": - application/json: {"additions": [], "deletions": [], "modifications": {}} - default: - application/json: {"message": "", "status_code": 201370} - getSchemaRevision: - speakeasy-default-get-schema-revision: - parameters: - path: - apiID: "" - versionID: "" - revisionID: "" - responses: - "200": - application/json: {"api_id": "", "created_at": "2022-01-23T10:21:45.287Z", "description": "Managed intermediate flexibility", "revision_id": "", "version_id": "", "workspace_id": ""} - default: - application/json: {"message": "", "status_code": 941905} - getSchemas: - speakeasy-default-get-schemas: - parameters: - path: - apiID: "" - versionID: "" - responses: - "200": - application/json: [] - default: - application/json: {"message": "", "status_code": 170115} - registerSchema: - speakeasy-default-register-schema: - parameters: - path: - apiID: "" - versionID: "" - requestBody: - multipart/form-data: {"file": {"": "example.file"}} + createRemoteSource: + speakeasy-default-create-remote-source: responses: - default: - application/json: {"message": "", "status_code": 867990} + 4XX: + application/json: {"message": "", "status_code": 314779} getBlob: speakeasy-default-get-blob: parameters: @@ -762,14 +562,10 @@ examples: namespace_name: "" digest: "" responses: - "200": - application/octet-stream: "0x211ECBAE5E" - default: - application/json: {"message": "", "status_code": 279725} 2XX: - application/octet-stream: "0x21CA56a82d" + application/octet-stream: "0xdf01BE863D" 4XX: - application/json: {"message": "", "status_code": 940661} + application/json: {"message": "", "status_code": 803552} getManifest: speakeasy-default-get-manifest: parameters: @@ -779,497 +575,133 @@ examples: namespace_name: "" revision_reference: "" responses: - "200": - 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} - default: - application/json: {"message": "", "status_code": 707258} 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: - "200": - application/json: {"items": []} - default: - application/json: {"message": "", "status_code": 917991} 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} - getOASSummary: - speakeasy-default-get-OAS-summary: - parameters: - path: - namespace_name: "" - revision_reference: "" - responses: - "200": - application/json: {"info": {"description": "Fully-configurable neutral software", "summary": "", "title": "", "version": ""}, "operations": []} - default: - application/json: {"message": "", "status_code": 963960} + application/json: {"message": "", "status_code": 442334} getRevisions: speakeasy-default-get-revisions: parameters: path: namespace_name: "" - query: {} responses: - "200": - application/json: {"items": [], "next_page_token": ""} - default: - application/json: {"message": "", "status_code": 284614} 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: path: namespace_name: "" responses: - "200": - application/json: {"items": []} - default: - application/json: {"message": "", "status_code": 136548} 2XX: - application/json: {"items": []} - 4XX: - application/json: {"message": "", "status_code": 50428} - postTags: - speakeasy-default-post-tags: - parameters: - path: - namespace_name: "" - responses: - default: - application/json: {"message": "", "status_code": 581484} + application/json: {"items": [{"id": "", "name": "", "namespace_name": "", "revision_digest": ""}]} 4XX: - application/json: {"message": "", "status_code": 581484} - preflight: - speakeasy-default-preflight: - responses: - default: - application/json: {"message": "", "status_code": 820828} - "200": {} - 2XX: - application/json: {} - 4XX: - application/json: {"message": "", "status_code": 820828} - getAccessToken: - speakeasy-default-get-access-token: - parameters: - query: - workspace_id: "" - responses: - "200": - application/json: {"access_token": ""} - default: - application/json: {"message": "", "status_code": 299050} - 2XX: - application/json: {"access_token": ""} - 4XX: - application/json: {"message": "", "status_code": 299050} - getUser: - speakeasy-default-get-user: - responses: - "200": - application/json: {"admin": true, "confirmed": false, "created_at": "2022-06-27T09:27:02.992Z", "display_name": "Kendrick92", "email": "Kirstin.Kautzer61@yahoo.com", "email_verified": false, "id": "", "last_login_at": "2023-04-23T00:14:06.093Z", "updated_at": "2023-07-11T14:17:50.684Z", "whitelisted": false} - default: - application/json: {"message": "", "status_code": 502060} - 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} - 4XX: - application/json: {"message": "", "status_code": 237845} - getWorkspaceAccess: - speakeasy-default-get-workspace-access: - responses: - "200": - application/json: {"generation_allowed": false, "message": ""} - 2XX: - application/json: {"generation_allowed": true, "message": ""} - validateApiKey: - speakeasy-default-validate-api-key: - responses: - "200": - application/json: {"account_type_v2": "enterprise", "enabled_features": [], "org_slug": "", "telemetry_disabled": true, "workspace_id": "", "workspace_slug": ""} - default: - application/json: {"message": "", "status_code": 858745} - 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": ""} - 4XX: - application/json: {"message": "", "status_code": 150892} - generateRequestPostmanCollection: - speakeasy-default-generate-request-postman-collection: - parameters: - path: - requestID: "" - responses: - "200": - application/octet-stream: "0xe9bfc5350A" - default: - application/json: {"message": "", "status_code": 319220} - getRequestFromEventLog: - speakeasy-default-get-request-from-event-log: - parameters: - path: - requestID: "" - responses: - "200": - application/json: {"created_at": "2024-07-06T20:33:24.663Z", "har": "", "har_size_bytes": 205280, "request_id": "", "workspace_id": ""} - default: - application/json: {"message": "", "status_code": 659422} - queryEventLog: - speakeasy-default-query-event-log: - responses: - "200": - application/json: [] - default: - application/json: {"message": "", "status_code": 241978} - checkAccess: - speakeasy-default-check-access: - parameters: - query: - org: "" - repo: "" - responses: - default: - application/json: {"message": "", "status_code": 74604} - configureCodeSamples: - speakeasy-default-configure-code-samples: - requestBody: - application/json: {"org": "", "repo": "", "targetName": ""} - responses: - "200": - application/json: {"codeSampleOverlayRegistryURL": "", "source": {"location": ""}} - default: - application/json: {"message": "", "status_code": 968093} - configureMintlifyRepo: - speakeasy-default-configure-mintlify-repo: - requestBody: - application/json: {"input": "", "org": "", "overlays": [], "repo": ""} - responses: - default: - application/json: {"message": "", "status_code": 310607} - configureTarget: - speakeasy-default-configure-target: - requestBody: - application/json: {"org": "", "repo_name": ""} - responses: - default: - application/json: {"message": "", "status_code": 210299} - fetchPublishingPRs: - speakeasy-default-fetch-publishing-P-rs: - parameters: - query: - generate_gen_lock_id: "" - org: "" - repo: "" - responses: - default: - application/json: {"message": "", "status_code": 192607} - "200": {} - getAction: - speakeasy-default-get-action: - parameters: - query: - org: "" - repo: "" - responses: - default: - application/json: {"message": "", "status_code": 252330} - "200": {} - githubCheckPublishingSecrets: - speakeasy-default-github-check-publishing-secrets: + application/json: {"message": "", "status_code": 293534} + listRemoteSources: + speakeasy-default-list-remote-sources: parameters: query: - generate_gen_lock_id: "" - responses: - default: - application/json: {"message": "", "status_code": 445560} - "200": {} - 2XX: - application/json: {} - 4XX: - application/json: {"message": "", "status_code": 749379} - githubStorePublishingSecrets: - speakeasy-default-github-store-publishing-secrets: - requestBody: - application/json: {"generate_gen_lock_id": ""} - responses: - default: - application/json: {"message": "", "status_code": 802162} - 4XX: - application/json: {"message": "", "status_code": 444361} - triggerAction: - speakeasy-default-trigger-action: - requestBody: - application/json: {"gen_lock_id": "", "org": "", "repo_name": ""} - responses: - default: - application/json: {"message": "", "status_code": 689611} - createFreeTrial: - speakeasy-default-create-free-trial: - responses: - default: - application/json: {"message": "", "status_code": 728627} - 4XX: - application/json: {"message": "", "status_code": 728627} - getOrganization: - speakeasy-default-get-organization: - parameters: - path: - organizationID: "" - responses: - "200": - application/json: {"account_type": "scale-up", "id": "", "name": "", "telemetry_disabled": true} - default: - application/json: {"message": "", "status_code": 492205} - 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"} - 4XX: - application/json: {"message": "", "status_code": 458049} - getOrganizationUsage: - speakeasy-default-get-organization-usage: - responses: - "200": - application/json: {"allowed_languages": [], "total_allowed_languages": 85188, "usage": []} - default: - application/json: {"message": "", "status_code": 689787} - 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": []}]} - 4XX: - application/json: {"message": "", "status_code": 804495} - getOrganizations: - speakeasy-default-get-organizations: + namespace_name: "" responses: - "200": - application/json: [] - default: - application/json: {"message": "", "status_code": 952344} 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: {"inputs": [], "output": {"registry_url": "https://happy-substitution.com"}} 4XX: - application/json: {"message": "", "status_code": 621425} - getChangesReportSignedUrl: - speakeasy-default-get-changes-report-signed-url: - parameters: - path: - documentChecksum: "" - responses: - "200": - application/json: {"url": "http://precious-pressure.biz"} - 2XX: - application/json: {"url": "https://rosy-masterpiece.biz/"} - getLintingReportSignedUrl: - speakeasy-default-get-linting-report-signed-url: - parameters: - path: - documentChecksum: "" - responses: - "200": - application/json: {"url": "https://overdue-maybe.net"} - 2XX: - application/json: {"url": "https://negligible-merit.info"} - uploadReport: - speakeasy-default-upload-report: - requestBody: - multipart/form-data: {"file": {"": "example.file"}} - responses: - "200": - application/json: {"url": "http://earnest-upgrade.com"} - 2XX: - application/json: {"url": "https://cluttered-stall.info"} - create: - speakeasy-default-create: - requestBody: - application/json: {"url": "http://limp-pastry.org"} - responses: - "200": - application/json: {"full_url": "", "short_url": ""} - 2XX: - application/json: {"full_url": "https://probable-heating.com/", "short_url": "https://standard-utilization.com/"} - suggest: - speakeasy-default-suggest: - parameters: - header: - x-session-id: "" - requestBody: - application/json: {"diagnostics": [], "oas_summary": {"info": {"description": "Operative impactful monitoring", "summary": "", "title": "", "version": ""}, "operations": []}, "suggestion_type": "diagnostics-only"} - responses: - "200": - application/json: "0x8D9A3DCDEa" - 2XX: - application/json: "0xbe893CEca6" - suggestOpenAPI: - speakeasy-default-suggest-open-API: - parameters: - header: - x-session-id: "" - requestBody: - multipart/form-data: {"schema": {"": "example.file"}} - responses: - "200": - application/json: "0xB470c0FE6E" - 2XX: - application/json: "0x0beEcB7cF6" - suggestOpenAPIRegistry: - speakeasy-default-suggest-open-API-registry: + application/json: {"message": "", "status_code": 672449} + postTags: + speakeasy-default-post-tags: parameters: path: namespace_name: "" - revision_reference: "" - header: - x-session-id: "" - responses: - "200": - application/json: "0x94DFDbB4df" - 2XX: - application/json: "0x9DDBdD905F" - getEmbedAccessToken: - speakeasy-default-get-embed-access-token: - responses: - "200": - application/json: {"access_token": ""} - default: - application/json: {"message": "", "status_code": 964408} - getValidEmbedAccessTokens: - speakeasy-default-get-valid-embed-access-tokens: - responses: - "200": - application/json: [] - default: - application/json: {"message": "", "status_code": 806352} - revokeEmbedAccessToken: - speakeasy-default-revoke-embed-access-token: - parameters: - path: - tokenID: "" - responses: - default: - application/json: {"message": "", "status_code": 217594} - getWorkspace: - speakeasy-default-get-workspace: - parameters: - path: - workspace_id: "" responses: - "200": - application/json: {"created_at": "2024-06-17T21:39:51.489Z", "id": "", "name": "", "organization_id": "", "slug": "", "telemetry_disabled": true, "updated_at": "2022-01-05T09:55:04.665Z", "verified": false} - default: - application/json: {"message": "", "status_code": 488095} - 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} 4XX: - application/json: {"message": "", "status_code": 868924} - getWorkspaceFeatureFlags: - speakeasy-default-get-workspace-feature-flags: - parameters: - path: - workspace_id: "" + application/json: {"message": "", "status_code": 418537} + preflight: + speakeasy-default-preflight: responses: - 5XX: - application/json: {"message": "", "status_code": 365854} - "200": + 2XX: application/json: {} - getWorkspaceEventsByTarget: - speakeasy-default-get-workspace-events-by-target: - parameters: - path: - targetID: "" - target_id: "" - workspace_id: "" - query: {} - responses: - "200": - application/json: [] - 5XX: - application/json: {"message": "", "status_code": 749240} - getWorkspaceTargets: - speakeasy-default-get-workspace-targets: - responses: - "200": - application/json: [] - 5XX: - application/json: {"message": "", "status_code": 966013} - postWorkspaceEvents: - speakeasy-default-post-workspace-events: + 4XX: + application/json: {"message": "", "status_code": 626529} + archiveNamespace: + speakeasy-default-archive-namespace: parameters: path: - workspace_id: "" - requestBody: - application/json: [] + namespace_name: "" responses: - 5XX: - application/json: {"message": "", "status_code": 962857} - searchWorkspaceEvents: - speakeasy-default-search-workspace-events: + 4XX: + application/json: {"message": "", "status_code": 726683} + setVisibility: + speakeasy-default-set-visibility: parameters: path: + namespace_name: "" + responses: + 4XX: + application/json: {"message": "", "status_code": 669253} + getWorkspaceAccess: + speakeasy-default-get-workspace-access: + responses: + 2XX: + application/json: {"generation_allowed": false, "message": ""} + getAccessToken: + speakeasy-default-get-access-token: + parameters: + query: workspace_id: "" - query: {} responses: - "200": - application/json: [] - 5XX: - application/json: {"message": "", "status_code": 750032} + 2XX: + application/json: {"access_token": "", "claims": {}, "user": {}} + 4XX: + application/json: {"message": "", "status_code": 646748} + getUser: + speakeasy-default-get-user: + responses: + 2XX: + 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": 527542} + validateApiKey: + speakeasy-default-validate-api-key: + responses: + 2XX: + 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": 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: - "200": - application/json: "0x28e0E3f5d1" - application/x-yaml: "0xfA011e0be4" - 4XX: - application/json: {"message": "", "status_code": 396101} + 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": 394086} + application/json: {"message": "", "status_code": 431188} + 5XX: + application/json: {"message": "", "status_code": 431188} getCodeSamplePreviewAsync: - speakeasy-default-get-code-sample-preview-async: + default: parameters: path: jobID: "" - responses: - "200": - application/json: "0x2090d4E1A7" - application/x-yaml: "0x14456CbEbA" - "202": - application/json: {"status": "running"} - 4XX: - application/json: {"message": "", "status_code": 462062} - createRemoteSource: - speakeasy-default-create-remote-source: - responses: - 4XX: - application/json: {"message": "", "status_code": 580557} - listRemoteSources: - speakeasy-default-list-remote-sources: - parameters: - query: - 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"}} - 4XX: - application/json: {"message": "", "status_code": 754391} - setVisibility: - speakeasy-default-set-visibility: - parameters: - path: - namespace_name: "" - responses: - 4XX: - application/json: {"message": "", "status_code": 651364} + 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: @@ -1278,7 +710,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: @@ -1290,30 +722,40 @@ 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: + query: + generate_gen_lock_id: "" + responses: + 2XX: + application/json: {} + 4XX: + 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: @@ -1324,7 +766,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: @@ -1334,30 +776,196 @@ 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": 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": "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": 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": 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: + path: + organizationID: "" + responses: + 2XX: + 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": 924479} + getOrganizations: + speakeasy-default-get-organizations: + responses: + 2XX: + 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": 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": 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": 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: + path: + documentChecksum: "" + responses: + 2XX: + application/json: {"url": "https://babyish-foodstuffs.info/"} + getLintingReportSignedUrl: + speakeasy-default-get-linting-report-signed-url: + parameters: + path: + documentChecksum: "" + responses: + 2XX: + application/json: {"url": "https://somber-lashes.org/"} + uploadReport: + speakeasy-default-upload-report: + requestBody: + 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: {"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: {"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: {"created_at": "2024-08-18T15:04:44.601Z", "format": "yaml", "id": "", "packageName": "", "sdkClassname": "", "spec": ""} 4XX: - application/json: {"message": "", "status_code": 792620} + application/json: {"message": "", "status_code": 59948} + create: + speakeasy-default-create: + requestBody: + application/json: {"url": "https://exalted-heroine.org/"} + responses: + 2XX: + application/json: {"full_url": "https://merry-luck.info", "short_url": "https://stable-tomb.biz/"} activateSubscriptionNamespace: speakeasy-default-activate-subscription-namespace: parameters: @@ -1366,7 +974,7 @@ examples: namespaceName: "" responses: 4XX: - application/json: {"message": "", "status_code": 566510} + application/json: {"message": "", "status_code": 496630} ignoreSubscriptionNamespace: speakeasy-default-ignore-subscription-namespace: parameters: @@ -1375,56 +983,107 @@ 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": ["/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: "0xC68Fcf8d14" suggestItems: speakeasy-default-suggest-items: requestBody: - application/json: {"items": [], "prompt": ""} + application/json: {"items": [""], "prompt": ""} + responses: + 2XX: + application/json: ["", ""] + suggestOpenAPI: + speakeasy-default-suggest-open-API: + parameters: + header: + x-session-id: "" + requestBody: + multipart/form-data: {"schema": "x-file: example.file"} + responses: + 2XX: + application/json: "0x01aCDEb8da" + suggestOpenAPIRegistry: + speakeasy-default-suggest-open-API-registry: + parameters: + path: + namespace_name: "" + revision_reference: "" + header: + x-session-id: "" responses: 2XX: - application/json: ["", ""] + application/json: "0x8AEEbCebEa" 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: path: - tokenID: "" workspace_id: "" + 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": 660531} + getWorkspace: + speakeasy-default-get-workspace: + parameters: + path: + workspace_id: "" + responses: + 2XX: + 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": 16308} + application/json: {"message": "", "status_code": 239288} + getWorkspaceFeatureFlags: + speakeasy-default-get-workspace-feature-flags: + parameters: + path: + workspace_id: "" + responses: + "200": + application/json: {} + 5XX: + application/json: {"message": "", "status_code": 689983} getWorkspaceSettings: speakeasy-default-get-workspace-settings: parameters: @@ -1432,9 +1091,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: @@ -1444,7 +1103,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: @@ -1452,77 +1111,105 @@ 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: - email: "Lucinda.Batz8@hotmail.com" workspace_id: "" + 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: path: - userId: "" workspace_id: "" + 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: "" + responses: + "200": + 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": 224805} + getWorkspaceTargets: + speakeasy-default-get-workspace-targets: + responses: + "200": + 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": 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} - getCodeSamples: - speakeasy-default-get-code-samples: + application/json: {"message": "", "status_code": 397013} + postWorkspaceEvents: + speakeasy-default-post-workspace-events: parameters: - query: - registry_url: "https://normal-making.name" - responses: - 2XX: - application/json: {"snippets": [{"code": "", "language": "", "operationId": ""}, {"code": "", "language": "", "operationId": ""}, {"code": "", "language": "", "operationId": ""}]} - 4XX: - application/json: {"message": "", "status_code": 458049} - setWorkspaceFeatureFlags: - speakeasy-default-set-workspace-feature-flags: + path: + workspace_id: "" requestBody: - application/json: {"feature_flags": ["skip_schema_registry", "webhooks"]} + 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": 104921} + searchWorkspaceEvents: + speakeasy-default-search-workspace-events: + parameters: + path: + workspace_id: "" responses: "200": - application/json: {} + 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": 264889} + application/json: {"message": "", "status_code": 436496} +examplesVersion: 1.0.2 generatedTests: {} diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index d3a7000c..db721108 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,21 +1,21 @@ -speakeasyVersion: 1.468.2 +speakeasyVersion: 1.575.5 sources: speakeasy: sourceNamespace: speakeasy - sourceRevisionDigest: sha256:8af7ebde12785185cdbd700c1b3b6b8848b43d34f1fe8c06fff5ae4af471faf2 - sourceBlobDigest: sha256:952a58da1511e3191ea8e470c7f01a4e3785d11d9152f490a3e5a7173c8542e7 + sourceRevisionDigest: sha256:9128c3df436950ca04fec9dfc74e769e8b492d434b115b197d68da656ae17d23 + sourceBlobDigest: sha256:6eb8a6e215c36d3e11d86fc67d5ce7af499bdb934e0f7fbad17efcdde9bffd73 tags: - latest - - speakeasy-sdk-regen-1735949986 + - speakeasy-sdk-regen-1746490985 - 0.4.0 targets: speakeasy-client-sdk-csharp: source: speakeasy sourceNamespace: speakeasy - sourceRevisionDigest: sha256:8af7ebde12785185cdbd700c1b3b6b8848b43d34f1fe8c06fff5ae4af471faf2 - sourceBlobDigest: sha256:952a58da1511e3191ea8e470c7f01a4e3785d11d9152f490a3e5a7173c8542e7 + sourceRevisionDigest: sha256:9128c3df436950ca04fec9dfc74e769e8b492d434b115b197d68da656ae17d23 + sourceBlobDigest: sha256:6eb8a6e215c36d3e11d86fc67d5ce7af499bdb934e0f7fbad17efcdde9bffd73 codeSamplesNamespace: code-samples-csharp-speakeasy-client-sdk-csharp - codeSamplesRevisionDigest: sha256:aacf508e82244f7628670bda7c73bdda3a36059c4143c3566f2b4d4935251ec8 + codeSamplesRevisionDigest: sha256:5bd7be9243a2f6947204e1fd175daa26df77b55ba82b14a386e385e5e812f956 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..d585717f --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,26 @@ +# Contributing to This Repository + +Thank you for your interest in contributing to this repository. Please note that this repository contains generated code. As such, we do not accept direct changes or pull requests. Instead, we encourage you to follow the guidelines below to report issues and suggest improvements. + +## How to Report Issues + +If you encounter any bugs or have suggestions for improvements, please open an issue on GitHub. When reporting an issue, please provide as much detail as possible to help us reproduce the problem. This includes: + +- A clear and descriptive title +- Steps to reproduce the issue +- Expected and actual behavior +- Any relevant logs, screenshots, or error messages +- Information about your environment (e.g., operating system, software versions) + - For example can be collected using the `npx envinfo` command from your terminal if you have Node.js installed + +## Issue Triage and Upstream Fixes + +We will review and triage issues as quickly as possible. Our goal is to address bugs and incorporate improvements in the upstream source code. Fixes will be included in the next generation of the generated code. + +## Contact + +If you have any questions or need further assistance, please feel free to reach out by opening an issue. + +Thank you for your understanding and cooperation! + +The Maintainers diff --git a/NUGET.md b/NUGET.md index 711d23aa..6d32c2da 100644 --- a/NUGET.md +++ b/NUGET.md @@ -9,22 +9,12 @@ ```csharp using SpeakeasySDK; using SpeakeasySDK.Models.Shared; -using System.Collections.Generic; var sdk = new SDK(security: new Security() { APIKey = "", }); -RemoteSource req = new RemoteSource() { - Inputs = new List() { - new RemoteDocument() { - RegistryUrl = "https://productive-swine.net", - }, - }, - Output = new RemoteDocument() { - RegistryUrl = "https://spiteful-apricot.info", - }, -}; +RemoteSource req = ; var res = await sdk.Artifacts.CreateRemoteSourceAsync(req); @@ -49,22 +39,12 @@ You can set the security parameters through the `security` optional parameter wh ```csharp using SpeakeasySDK; using SpeakeasySDK.Models.Shared; -using System.Collections.Generic; var sdk = new SDK(security: new Security() { APIKey = "", }); -RemoteSource req = new RemoteSource() { - Inputs = new List() { - new RemoteDocument() { - RegistryUrl = "https://productive-swine.net", - }, - }, - Output = new RemoteDocument() { - RegistryUrl = "https://spiteful-apricot.info", - }, -}; +RemoteSource req = ; var res = await sdk.Artifacts.CreateRemoteSourceAsync(req); @@ -94,7 +74,7 @@ The following global parameter is available. using SpeakeasySDK; using SpeakeasySDK.Models.Operations; -var sdk = new SDK(); +var sdk = new SDK(workspaceId: ""); GetAccessTokenRequest req = new GetAccessTokenRequest() { WorkspaceId = "", @@ -121,7 +101,7 @@ var sdk = new SDK(security: new Security() { APIKey = "", }); -GetWorkspaceAccessRequest req = new GetWorkspaceAccessRequest() {}; +GetWorkspaceAccessRequest req = ; var res = await sdk.Auth.GetAccessAsync( retryConfig: new RetryConfig( @@ -162,7 +142,7 @@ var sdk = new SDK( } ); -GetWorkspaceAccessRequest req = new GetWorkspaceAccessRequest() {}; +GetWorkspaceAccessRequest req = ; var res = await sdk.Auth.GetAccessAsync(req); @@ -197,7 +177,6 @@ When custom error responses are specified for an operation, the SDK may also thr using SpeakeasySDK; using SpeakeasySDK.Models.Errors; using SpeakeasySDK.Models.Shared; -using System.Collections.Generic; var sdk = new SDK(security: new Security() { APIKey = "", @@ -205,16 +184,7 @@ var sdk = new SDK(security: new Security() { try { - RemoteSource req = new RemoteSource() { - Inputs = new List() { - new RemoteDocument() { - RegistryUrl = "https://productive-swine.net", - }, - }, - Output = new RemoteDocument() { - RegistryUrl = "https://spiteful-apricot.info", - }, - }; + RemoteSource req = ; var res = await sdk.Artifacts.CreateRemoteSourceAsync(req); @@ -243,34 +213,24 @@ catch (Exception ex) You can override the default server globally by passing a server name to the `server: string` 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 | -| ------ | ----------------------------------- | -| `prod` | `https://api.prod.speakeasyapi.dev` | +| Name | Server | Description | +| ------ | -------------------------------- | ----------- | +| `prod` | `https://api.prod.speakeasy.com` | | #### Example ```csharp using SpeakeasySDK; using SpeakeasySDK.Models.Shared; -using System.Collections.Generic; var sdk = new SDK( - server: "prod", + server: SDKConfig.Server.Prod, security: new Security() { APIKey = "", } ); -RemoteSource req = new RemoteSource() { - Inputs = new List() { - new RemoteDocument() { - RegistryUrl = "https://productive-swine.net", - }, - }, - Output = new RemoteDocument() { - RegistryUrl = "https://spiteful-apricot.info", - }, -}; +RemoteSource req = ; var res = await sdk.Artifacts.CreateRemoteSourceAsync(req); @@ -283,25 +243,15 @@ The default server can also be overridden globally by passing a URL to the `serv ```csharp using SpeakeasySDK; using SpeakeasySDK.Models.Shared; -using System.Collections.Generic; var sdk = new SDK( - serverUrl: "https://api.prod.speakeasyapi.dev", + serverUrl: "https://api.prod.speakeasy.com", security: new Security() { APIKey = "", } ); -RemoteSource req = new RemoteSource() { - Inputs = new List() { - new RemoteDocument() { - RegistryUrl = "https://productive-swine.net", - }, - }, - Output = new RemoteDocument() { - RegistryUrl = "https://spiteful-apricot.info", - }, -}; +RemoteSource req = ; var res = await sdk.Artifacts.CreateRemoteSourceAsync(req); diff --git a/README.md b/README.md index 1b233214..e24d30e9 100755 --- a/README.md +++ b/README.md @@ -49,22 +49,12 @@ dotnet add reference src/SpeakeasySDK/SpeakeasySDK.csproj ```csharp using SpeakeasySDK; using SpeakeasySDK.Models.Shared; -using System.Collections.Generic; var sdk = new SDK(security: new Security() { APIKey = "", }); -RemoteSource req = new RemoteSource() { - Inputs = new List() { - new RemoteDocument() { - RegistryUrl = "https://productive-swine.net", - }, - }, - Output = new RemoteDocument() { - RegistryUrl = "https://spiteful-apricot.info", - }, -}; +RemoteSource req = ; var res = await sdk.Artifacts.CreateRemoteSourceAsync(req); @@ -89,6 +79,7 @@ var res = await sdk.Artifacts.CreateRemoteSourceAsync(req); * [ListRemoteSources](docs/sdks/artifacts/README.md#listremotesources) - Get remote sources attached to a particular namespace * [PostTags](docs/sdks/artifacts/README.md#posttags) - Add tags to an existing revision * [Preflight](docs/sdks/artifacts/README.md#preflight) - Get access token for communicating with OCI distribution endpoints +* [SetArchived](docs/sdks/artifacts/README.md#setarchived) - Set whether a namespace is archived * [SetVisibility](docs/sdks/artifacts/README.md#setvisibility) - Set visibility of a namespace with an existing metadata entry ### [Auth](docs/sdks/auth/README.md) @@ -102,7 +93,6 @@ var res = await sdk.Artifacts.CreateRemoteSourceAsync(req); * [GenerateCodeSamplePreview](docs/sdks/codesamples/README.md#generatecodesamplepreview) - Generate Code Sample previews from a file and configuration parameters. * [GenerateCodeSamplePreviewAsync](docs/sdks/codesamples/README.md#generatecodesamplepreviewasync) - 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 from document stored in the registry * [GetCodeSamplePreviewAsync](docs/sdks/codesamples/README.md#getcodesamplepreviewasync) - Poll for the result of an asynchronous Code Sample preview generation. ### [Events](docs/sdks/events/README.md) @@ -130,17 +120,35 @@ var res = await sdk.Artifacts.CreateRemoteSourceAsync(req); ### [Organizations](docs/sdks/organizations/README.md) * [Create](docs/sdks/organizations/README.md#create) - Create an organization +* [CreateBillingAddOns](docs/sdks/organizations/README.md#createbillingaddons) - Create billing add ons * [CreateFreeTrial](docs/sdks/organizations/README.md#createfreetrial) - Create a free trial for an organization +* [DeleteBillingAddOn](docs/sdks/organizations/README.md#deletebillingaddon) - Delete billing add ons * [Get](docs/sdks/organizations/README.md#get) - Get organization * [GetAll](docs/sdks/organizations/README.md#getall) - Get organizations for a user +* [GetBillingAddOns](docs/sdks/organizations/README.md#getbillingaddons) - Get billing add ons * [GetUsage](docs/sdks/organizations/README.md#getusage) - Get billing usage summary for a particular organization +### [PublishingTokens](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 +* [ResolveMetadata](docs/sdks/publishingtokens/README.md#resolvemetadata) - Get metadata about the token +* [ResolveTarget](docs/sdks/publishingtokens/README.md#resolvetarget) - 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) * [GetChangesReportSignedUrl](docs/sdks/reports/README.md#getchangesreportsignedurl) - Get the signed access url for the change reports for a particular document. * [GetLintingReportSignedUrl](docs/sdks/reports/README.md#getlintingreportsignedurl) - Get the signed access url for the linting reports for a particular document. * [UploadReport](docs/sdks/reports/README.md#uploadreport) - Upload a report. +### [SchemaStore](docs/sdks/schemastore/README.md) + +* [CreateSchemaStoreItem](docs/sdks/schemastore/README.md#createschemastoreitem) - Create a schema in the schema store +* [GetSchemaStoreItem](docs/sdks/schemastore/README.md#getschemastoreitem) - Get a OAS schema from the schema store + ### [ShortURLs](docs/sdks/shorturls/README.md) @@ -188,34 +196,24 @@ var res = await sdk.Artifacts.CreateRemoteSourceAsync(req); You can override the default server globally by passing a server name to the `server: string` 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 | -| ------ | ----------------------------------- | -| `prod` | `https://api.prod.speakeasyapi.dev` | +| Name | Server | Description | +| ------ | -------------------------------- | ----------- | +| `prod` | `https://api.prod.speakeasy.com` | | #### Example ```csharp using SpeakeasySDK; using SpeakeasySDK.Models.Shared; -using System.Collections.Generic; var sdk = new SDK( - server: "prod", + server: SDKConfig.Server.Prod, security: new Security() { APIKey = "", } ); -RemoteSource req = new RemoteSource() { - Inputs = new List() { - new RemoteDocument() { - RegistryUrl = "https://productive-swine.net", - }, - }, - Output = new RemoteDocument() { - RegistryUrl = "https://spiteful-apricot.info", - }, -}; +RemoteSource req = ; var res = await sdk.Artifacts.CreateRemoteSourceAsync(req); @@ -228,25 +226,15 @@ The default server can also be overridden globally by passing a URL to the `serv ```csharp using SpeakeasySDK; using SpeakeasySDK.Models.Shared; -using System.Collections.Generic; var sdk = new SDK( - serverUrl: "https://api.prod.speakeasyapi.dev", + serverUrl: "https://api.prod.speakeasy.com", security: new Security() { APIKey = "", } ); -RemoteSource req = new RemoteSource() { - Inputs = new List() { - new RemoteDocument() { - RegistryUrl = "https://productive-swine.net", - }, - }, - Output = new RemoteDocument() { - RegistryUrl = "https://spiteful-apricot.info", - }, -}; +RemoteSource req = ; var res = await sdk.Artifacts.CreateRemoteSourceAsync(req); @@ -271,22 +259,12 @@ You can set the security parameters through the `security` optional parameter wh ```csharp using SpeakeasySDK; using SpeakeasySDK.Models.Shared; -using System.Collections.Generic; var sdk = new SDK(security: new Security() { APIKey = "", }); -RemoteSource req = new RemoteSource() { - Inputs = new List() { - new RemoteDocument() { - RegistryUrl = "https://productive-swine.net", - }, - }, - Output = new RemoteDocument() { - RegistryUrl = "https://spiteful-apricot.info", - }, -}; +RemoteSource req = ; var res = await sdk.Artifacts.CreateRemoteSourceAsync(req); @@ -316,7 +294,7 @@ The following global parameter is available. using SpeakeasySDK; using SpeakeasySDK.Models.Operations; -var sdk = new SDK(); +var sdk = new SDK(workspaceId: ""); GetAccessTokenRequest req = new GetAccessTokenRequest() { WorkspaceId = "", @@ -355,7 +333,6 @@ When custom error responses are specified for an operation, the SDK may also thr using SpeakeasySDK; using SpeakeasySDK.Models.Errors; using SpeakeasySDK.Models.Shared; -using System.Collections.Generic; var sdk = new SDK(security: new Security() { APIKey = "", @@ -363,16 +340,7 @@ var sdk = new SDK(security: new Security() { try { - RemoteSource req = new RemoteSource() { - Inputs = new List() { - new RemoteDocument() { - RegistryUrl = "https://productive-swine.net", - }, - }, - Output = new RemoteDocument() { - RegistryUrl = "https://spiteful-apricot.info", - }, - }; + RemoteSource req = ; var res = await sdk.Artifacts.CreateRemoteSourceAsync(req); @@ -409,7 +377,7 @@ var sdk = new SDK(security: new Security() { APIKey = "", }); -GetWorkspaceAccessRequest req = new GetWorkspaceAccessRequest() {}; +GetWorkspaceAccessRequest req = ; var res = await sdk.Auth.GetAccessAsync( retryConfig: new RetryConfig( @@ -450,7 +418,7 @@ var sdk = new SDK( } ); -GetWorkspaceAccessRequest req = new GetWorkspaceAccessRequest() {}; +GetWorkspaceAccessRequest req = ; var res = await sdk.Auth.GetAccessAsync(req); diff --git a/RELEASES.md b/RELEASES.md index 4df5c678..7bb9bbb0 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -949,4 +949,14 @@ Based on: ### Generated - [csharp v5.12.0] . ### Releases -- [NuGet v5.12.0] https://www.nuget.org/packages/SpeakeasySDK/5.12.0 - . \ No newline at end of file +- [NuGet v5.12.0] https://www.nuget.org/packages/SpeakeasySDK/5.12.0 - . + +## 2025-07-06 00:26:33 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.575.5 (2.648.7) https://github.com/speakeasy-api/speakeasy +### Generated +- [csharp v5.13.0] . +### Releases +- [NuGet v5.13.0] https://www.nuget.org/packages/SpeakeasySDK/5.13.0 - . \ No newline at end of file diff --git a/USAGE.md b/USAGE.md index 1c71495d..8aa33cc4 100644 --- a/USAGE.md +++ b/USAGE.md @@ -2,22 +2,12 @@ ```csharp using SpeakeasySDK; using SpeakeasySDK.Models.Shared; -using System.Collections.Generic; var sdk = new SDK(security: new Security() { APIKey = "", }); -RemoteSource req = new RemoteSource() { - Inputs = new List() { - new RemoteDocument() { - RegistryUrl = "https://productive-swine.net", - }, - }, - Output = new RemoteDocument() { - RegistryUrl = "https://spiteful-apricot.info", - }, -}; +RemoteSource req = ; var res = await sdk.Artifacts.CreateRemoteSourceAsync(req); diff --git a/codeSamples.yaml b/codeSamples.yaml index 6ded62a4..68db9b49 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -18,6 +18,27 @@ actions: var res = await sdk.Artifacts.GetNamespacesAsync(); + // handle response + - target: $["paths"]["/v1/artifacts/namespaces/{namespace_name}/archive"]["post"] + update: + x-codeSamples: + - lang: csharp + label: archiveNamespace + source: |- + using SpeakeasySDK; + using SpeakeasySDK.Models.Operations; + using SpeakeasySDK.Models.Shared; + + var sdk = new SDK(security: new Security() { + APIKey = "", + }); + + ArchiveNamespaceRequest req = new ArchiveNamespaceRequest() { + NamespaceName = "", + }; + + var res = await sdk.Artifacts.SetArchivedAsync(req); + // handle response - target: $["paths"]["/v1/artifacts/namespaces/{namespace_name}/revisions"]["get"] update: @@ -116,9 +137,7 @@ actions: APIKey = "", }); - PreflightRequest req = new PreflightRequest() { - NamespaceName = "", - }; + PreflightRequest req = ; var res = await sdk.Artifacts.PreflightAsync(req); @@ -152,22 +171,12 @@ actions: source: |- using SpeakeasySDK; using SpeakeasySDK.Models.Shared; - using System.Collections.Generic; var sdk = new SDK(security: new Security() { APIKey = "", }); - RemoteSource req = new RemoteSource() { - Inputs = new List() { - new RemoteDocument() { - RegistryUrl = "https://productive-swine.net", - }, - }, - Output = new RemoteDocument() { - RegistryUrl = "https://spiteful-apricot.info", - }, - }; + RemoteSource req = ; var res = await sdk.Artifacts.CreateRemoteSourceAsync(req); @@ -205,27 +214,6 @@ actions: var res = await sdk.Auth.ValidateApiKeyAsync(); - // handle response - - target: $["paths"]["/v1/code_sample"]["get"] - update: - x-codeSamples: - - lang: csharp - label: getCodeSamples - source: |- - using SpeakeasySDK; - using SpeakeasySDK.Models.Operations; - using SpeakeasySDK.Models.Shared; - - var sdk = new SDK(security: new Security() { - APIKey = "", - }); - - GetCodeSamplesRequest req = new GetCodeSamplesRequest() { - RegistryUrl = "https://normal-making.name", - }; - - var res = await sdk.CodeSamples.GetAsync(req); - // handle response - target: $["paths"]["/v1/code_sample/preview"]["post"] update: @@ -235,20 +223,17 @@ actions: source: |- using SpeakeasySDK; using SpeakeasySDK.Models.Shared; - using System; - using System.Collections.Generic; + using System.IO; var sdk = new SDK(security: new Security() { APIKey = "", }); CodeSampleSchemaInput req = new CodeSampleSchemaInput() { - Languages = new List() { - "", - }, + Language = "", SchemaFile = new SchemaFile() { FileName = "example.file", - Content = System.Text.Encoding.UTF8.GetBytes("0xc3dD8BfBef"), + Content = File.ReadAllBytes("example.file"), }, }; @@ -263,20 +248,17 @@ actions: source: |- using SpeakeasySDK; using SpeakeasySDK.Models.Shared; - using System; - using System.Collections.Generic; + using System.IO; var sdk = new SDK(security: new Security() { APIKey = "", }); CodeSampleSchemaInput req = new CodeSampleSchemaInput() { - Languages = new List() { - "", - }, + Language = "", SchemaFile = new SchemaFile() { FileName = "example.file", - Content = System.Text.Encoding.UTF8.GetBytes("0xED5CDd177E"), + Content = File.ReadAllBytes("example.file"), }, }; @@ -389,7 +371,7 @@ actions: Repo = "", Input = "", Overlays = new List() { - "", + "", }, }; @@ -431,7 +413,7 @@ actions: APIKey = "", }); - LinkGithubAccessRequest req = new LinkGithubAccessRequest() {}; + LinkGithubAccessRequest req = ; var res = await sdk.Github.LinkGithubAsync(req); @@ -613,13 +595,73 @@ actions: Slug = "", AccountType = AccountType.ScaleUp, TelemetryDisabled = false, - CreatedAt = System.DateTime.Parse("2024-11-30T17:06:07.804Z"), - UpdatedAt = System.DateTime.Parse("2024-04-02T12:48:32.253Z"), - SsoActivated = false, + CreatedAt = System.DateTime.Parse("2025-12-17T21:02:28.497Z"), + UpdatedAt = System.DateTime.Parse("2025-07-22T00:26:10.078Z"), + SsoActivated = true, }; var res = await sdk.Organizations.CreateAsync(req); + // handle response + - target: $["paths"]["/v1/organization/add_ons"]["get"] + update: + x-codeSamples: + - lang: csharp + label: getBillingAddOns + source: |- + using SpeakeasySDK; + using SpeakeasySDK.Models.Shared; + + var sdk = new SDK(security: new Security() { + APIKey = "", + }); + + var res = await sdk.Organizations.GetBillingAddOnsAsync(); + + // handle response + - target: $["paths"]["/v1/organization/add_ons"]["post"] + update: + x-codeSamples: + - lang: csharp + label: createBillingAddOns + source: |- + using SpeakeasySDK; + using SpeakeasySDK.Models.Shared; + using System.Collections.Generic; + + var sdk = new SDK(security: new Security() { + APIKey = "", + }); + + OrganizationBillingAddOnRequest req = new OrganizationBillingAddOnRequest() { + AddOns = new List() { + BillingAddOn.CustomCodeRegions, + }, + }; + + var res = await sdk.Organizations.CreateBillingAddOnsAsync(req); + + // handle response + - target: $["paths"]["/v1/organization/add_ons/{add_on}"]["delete"] + update: + x-codeSamples: + - lang: csharp + label: deleteBillingAddOn + source: |- + using SpeakeasySDK; + using SpeakeasySDK.Models.Operations; + using SpeakeasySDK.Models.Shared; + + var sdk = new SDK(security: new Security() { + APIKey = "", + }); + + DeleteBillingAddOnRequest req = new DeleteBillingAddOnRequest() { + AddOn = BillingAddOn.SDKTesting, + }; + + var res = await sdk.Organizations.DeleteBillingAddOnAsync(req); + // handle response - target: $["paths"]["/v1/organization/free_trial"]["post"] update: @@ -689,6 +731,146 @@ actions: var res = await sdk.Organizations.GetAllAsync(); + // handle response + - target: $["paths"]["/v1/publishing-tokens"]["get"] + update: + x-codeSamples: + - lang: csharp + label: getPublishingToken + source: |- + using SpeakeasySDK; + using SpeakeasySDK.Models.Shared; + + var sdk = new SDK(security: new Security() { + APIKey = "", + }); + + var res = await sdk.PublishingTokens.ListAsync(); + + // handle response + - target: $["paths"]["/v1/publishing-tokens"]["post"] + update: + x-codeSamples: + - lang: csharp + label: createPublishingToken + source: |- + using SpeakeasySDK; + using SpeakeasySDK.Models.Operations; + using SpeakeasySDK.Models.Shared; + + var sdk = new SDK(security: new Security() { + APIKey = "", + }); + + CreatePublishingTokenRequestBody req = ; + + var res = await sdk.PublishingTokens.CreateAsync(req); + + // handle response + - target: $["paths"]["/v1/publishing-tokens/{tokenID}"]["delete"] + update: + x-codeSamples: + - lang: csharp + label: deletePublishingToken + source: |- + using SpeakeasySDK; + using SpeakeasySDK.Models.Operations; + using SpeakeasySDK.Models.Shared; + + var sdk = new SDK(security: new Security() { + APIKey = "", + }); + + DeletePublishingTokenRequest req = new DeletePublishingTokenRequest() { + TokenID = "", + }; + + var res = await sdk.PublishingTokens.DeleteAsync(req); + + // handle response + - target: $["paths"]["/v1/publishing-tokens/{tokenID}"]["get"] + update: + x-codeSamples: + - lang: csharp + label: getPublishingTokenByID + source: |- + using SpeakeasySDK; + using SpeakeasySDK.Models.Operations; + using SpeakeasySDK.Models.Shared; + + var sdk = new SDK(security: new Security() { + APIKey = "", + }); + + GetPublishingTokenByIDRequest req = new GetPublishingTokenByIDRequest() { + TokenID = "", + }; + + var res = await sdk.PublishingTokens.GetAsync(req); + + // handle response + - target: $["paths"]["/v1/publishing-tokens/{tokenID}"]["put"] + update: + x-codeSamples: + - lang: csharp + label: updatePublishingTokenExpiration + source: |- + using SpeakeasySDK; + using SpeakeasySDK.Models.Operations; + using SpeakeasySDK.Models.Shared; + + var sdk = new SDK(security: new Security() { + APIKey = "", + }); + + UpdatePublishingTokenExpirationRequest req = new UpdatePublishingTokenExpirationRequest() { + TokenID = "", + }; + + var res = await sdk.PublishingTokens.UpdateAsync(req); + + // handle response + - target: $["paths"]["/v1/publishing-tokens/{tokenID}/metadata"]["get"] + update: + x-codeSamples: + - lang: csharp + label: getPublishingTokenPublicMetadata + source: |- + using SpeakeasySDK; + using SpeakeasySDK.Models.Operations; + using SpeakeasySDK.Models.Shared; + + var sdk = new SDK(security: new Security() { + APIKey = "", + }); + + GetPublishingTokenPublicMetadataRequest req = new GetPublishingTokenPublicMetadataRequest() { + TokenID = "", + }; + + var res = await sdk.PublishingTokens.ResolveMetadataAsync(req); + + // handle response + - target: $["paths"]["/v1/publishing-tokens/{tokenID}/target"]["get"] + update: + x-codeSamples: + - lang: csharp + label: getPublishingTokenTargetByID + source: |- + using SpeakeasySDK; + using SpeakeasySDK.Models.Operations; + using SpeakeasySDK.Models.Shared; + + var sdk = new SDK(security: new Security() { + APIKey = "", + }); + + GetPublishingTokenTargetByIDRequest req = new GetPublishingTokenTargetByIDRequest() { + TokenID = "", + }; + + var res = await sdk.PublishingTokens.ResolveTargetAsync(req); + // handle response - target: $["paths"]["/v1/reports"]["post"] update: @@ -699,7 +881,7 @@ actions: using SpeakeasySDK; using SpeakeasySDK.Models.Operations; using SpeakeasySDK.Models.Shared; - using System; + using System.IO; var sdk = new SDK(security: new Security() { APIKey = "", @@ -709,7 +891,7 @@ actions: Data = new Report() {}, File = new File() { FileName = "example.file", - Content = System.Text.Encoding.UTF8.GetBytes("0xA2Ca85EFA5"), + Content = File.ReadAllBytes("example.file"), }, }; @@ -757,6 +939,49 @@ actions: var res = await sdk.Reports.GetLintingReportSignedUrlAsync(req); + // handle response + - target: $["paths"]["/v1/schema_store"]["get"] + update: + x-codeSamples: + - lang: csharp + label: getSchemaStoreItem + source: |- + using SpeakeasySDK; + using SpeakeasySDK.Models.Operations; + using SpeakeasySDK.Models.Shared; + + var sdk = new SDK(security: new Security() { + APIKey = "", + }); + + GetSchemaStoreItemRequestBody req = ; + + var res = await sdk.SchemaStore.GetSchemaStoreItemAsync(req); + + // handle response + - target: $["paths"]["/v1/schema_store"]["post"] + update: + x-codeSamples: + - lang: csharp + label: createSchemaStoreItem + source: |- + using SpeakeasySDK; + using SpeakeasySDK.Models.Operations; + using SpeakeasySDK.Models.Shared; + + var sdk = new SDK(security: new Security() { + APIKey = "", + }); + + CreateSchemaStoreItemRequestBody req = new CreateSchemaStoreItemRequestBody() { + Spec = "", + PackageName = "", + SDKClassname = "", + Format = Format.Yaml, + }; + + var res = await sdk.SchemaStore.CreateSchemaStoreItemAsync(req); + // handle response - target: $["paths"]["/v1/short_urls"]["post"] update: @@ -773,7 +998,7 @@ actions: }); CreateRequestBody req = new CreateRequestBody() { - Url = "https://probable-heating.com/", + Url = "https://exalted-heroine.org/", }; var res = await sdk.ShortURLs.CreateAsync(req); @@ -840,7 +1065,7 @@ actions: SuggestItemsRequestBody req = new SuggestItemsRequestBody() { Prompt = "", Items = new List() { - "", + "", }, }; @@ -856,7 +1081,7 @@ actions: using SpeakeasySDK; using SpeakeasySDK.Models.Operations; using SpeakeasySDK.Models.Shared; - using System; + using System.IO; var sdk = new SDK(security: new Security() { APIKey = "", @@ -867,7 +1092,7 @@ actions: RequestBody = new SuggestOpenAPIRequestBody() { Schema = new Schema() { FileName = "example.file", - Content = System.Text.Encoding.UTF8.GetBytes("0x0beEcB7cF6"), + Content = File.ReadAllBytes("example.file"), }, }, }; @@ -920,32 +1145,14 @@ actions: Info = new OASInfo() { Title = "", Summary = "", - Description = "ugh which garrote ashamed sarong fiddle really", + Description = "strictly shyly who and than majority unit boohoo", Version = "", License = new License() {}, }, - Operations = new List() { - new OASOperation() { - Method = "", - Path = "/etc/ppp", - OperationId = "", - Description = "meanwhile via apparatus gray whether opposite what down blah", - Tags = new List() { - "", - }, - }, - }, + Operations = new List() {}, }, SuggestionType = SuggestRequestBodySuggestionType.MethodNames, - Diagnostics = new List() { - new Diagnostic() { - Message = "", - Path = new List() { - "/etc/mail", - }, - Type = "", - }, - }, + Diagnostics = new List() {}, }, }; @@ -999,13 +1206,13 @@ actions: }); Workspace req = new Workspace() { - CreatedAt = System.DateTime.Parse("2024-06-17T07:14:55.338Z"), + CreatedAt = System.DateTime.Parse("2023-11-18T13:41:10.525Z"), Id = "", Name = "", OrganizationId = "", Slug = "", - UpdatedAt = System.DateTime.Parse("2024-11-30T17:06:07.804Z"), - Verified = false, + UpdatedAt = System.DateTime.Parse("2024-11-21T08:36:32.740Z"), + Verified = true, }; var res = await sdk.Workspaces.CreateAsync(req); @@ -1025,7 +1232,7 @@ actions: APIKey = "", }); - GetWorkspaceAccessRequest req = new GetWorkspaceAccessRequest() {}; + GetWorkspaceAccessRequest req = ; var res = await sdk.Auth.GetAccessAsync(req); @@ -1044,7 +1251,7 @@ actions: APIKey = "", }); - GetWorkspaceTargetsRequest req = new GetWorkspaceTargetsRequest() {}; + GetWorkspaceTargetsRequest req = ; var res = await sdk.Events.GetTargetsAsync(req); @@ -1064,9 +1271,7 @@ actions: }); WorkspaceFeatureFlagRequest req = new WorkspaceFeatureFlagRequest() { - FeatureFlags = new List() { - WorkspaceFeatureFlag.SkipSchemaRegistry, - }, + FeatureFlags = new List() {}, }; var res = await sdk.Workspaces.SetFeatureFlagsAsync(req); @@ -1082,13 +1287,14 @@ actions: using SpeakeasySDK.Models.Operations; using SpeakeasySDK.Models.Shared; - var sdk = new SDK(security: new Security() { - APIKey = "", - }); + var sdk = new SDK( + workspaceId: "", + security: new Security() { + APIKey = "", + } + ); - GetWorkspaceRequest req = new GetWorkspaceRequest() { - WorkspaceId = "", - }; + GetWorkspaceRequest req = new GetWorkspaceRequest() {}; var res = await sdk.Workspaces.GetByIDAsync(req); @@ -1104,20 +1310,22 @@ actions: using SpeakeasySDK.Models.Shared; using System; - var sdk = new SDK(security: new Security() { - APIKey = "", - }); + var sdk = new SDK( + workspaceId: "", + security: new Security() { + APIKey = "", + } + ); UpdateWorkspaceDetailsRequest req = new UpdateWorkspaceDetailsRequest() { - WorkspaceId = "", Workspace = new Workspace() { - CreatedAt = System.DateTime.Parse("2025-07-28T19:04:48.565Z"), + CreatedAt = System.DateTime.Parse("2023-08-02T22:30:24.264Z"), Id = "", Name = "", OrganizationId = "", Slug = "", - UpdatedAt = System.DateTime.Parse("2024-10-16T10:52:42.015Z"), - Verified = false, + UpdatedAt = System.DateTime.Parse("2025-01-24T03:53:13.581Z"), + Verified = true, }, }; @@ -1134,13 +1342,14 @@ actions: using SpeakeasySDK.Models.Operations; using SpeakeasySDK.Models.Shared; - var sdk = new SDK(security: new Security() { - APIKey = "", - }); + var sdk = new SDK( + workspaceId: "", + security: new Security() { + APIKey = "", + } + ); - SearchWorkspaceEventsRequest req = new SearchWorkspaceEventsRequest() { - WorkspaceId = "", - }; + SearchWorkspaceEventsRequest req = new SearchWorkspaceEventsRequest() {}; var res = await sdk.Events.SearchAsync(req); @@ -1157,23 +1366,25 @@ actions: using System; using System.Collections.Generic; - var sdk = new SDK(security: new Security() { - APIKey = "", - }); + var sdk = new SDK( + workspaceId: "", + security: new Security() { + APIKey = "", + } + ); PostWorkspaceEventsRequest req = new PostWorkspaceEventsRequest() { - WorkspaceId = "", RequestBody = new List() { new CliEvent() { Id = "", ExecutionId = "", WorkspaceId = "", SpeakeasyApiKeyName = "", - InteractionType = InteractionType.TargetGenerate, - LocalStartedAt = System.DateTime.Parse("2025-03-02T10:07:28.113Z"), - CreatedAt = System.DateTime.Parse("2024-09-08T05:59:33.876Z"), + InteractionType = InteractionType.CiExec, + LocalStartedAt = System.DateTime.Parse("2024-12-22T21:01:06.740Z"), + CreatedAt = System.DateTime.Parse("2024-01-24T01:13:51.002Z"), SpeakeasyVersion = "", - Success = false, + Success = true, }, }, }; @@ -1191,13 +1402,14 @@ actions: using SpeakeasySDK.Models.Operations; using SpeakeasySDK.Models.Shared; - var sdk = new SDK(security: new Security() { - APIKey = "", - }); + var sdk = new SDK( + workspaceId: "", + security: new Security() { + APIKey = "", + } + ); - GetWorkspaceTargetsDeprecatedRequest req = new GetWorkspaceTargetsDeprecatedRequest() { - WorkspaceId = "", - }; + GetWorkspaceTargetsDeprecatedRequest req = new GetWorkspaceTargetsDeprecatedRequest() {}; var res = await sdk.Events.GetTargetsDeprecatedAsync(req); @@ -1212,12 +1424,14 @@ actions: using SpeakeasySDK.Models.Operations; using SpeakeasySDK.Models.Shared; - var sdk = new SDK(security: new Security() { - APIKey = "", - }); + var sdk = new SDK( + workspaceId: "", + security: new Security() { + APIKey = "", + } + ); GetWorkspaceEventsByTargetRequest req = new GetWorkspaceEventsByTargetRequest() { - WorkspaceId = "", TargetId = "", }; @@ -1234,13 +1448,14 @@ actions: using SpeakeasySDK.Models.Operations; using SpeakeasySDK.Models.Shared; - var sdk = new SDK(security: new Security() { - APIKey = "", - }); + var sdk = new SDK( + workspaceId: "", + security: new Security() { + APIKey = "", + } + ); - GetWorkspaceFeatureFlagsRequest req = new GetWorkspaceFeatureFlagsRequest() { - WorkspaceId = "", - }; + GetWorkspaceFeatureFlagsRequest req = new GetWorkspaceFeatureFlagsRequest() {}; var res = await sdk.Workspaces.GetFeatureFlagsAsync(req); @@ -1255,13 +1470,14 @@ actions: using SpeakeasySDK.Models.Operations; using SpeakeasySDK.Models.Shared; - var sdk = new SDK(security: new Security() { - APIKey = "", - }); + var sdk = new SDK( + workspaceId: "", + security: new Security() { + APIKey = "", + } + ); - GetWorkspaceSettingsRequest req = new GetWorkspaceSettingsRequest() { - WorkspaceId = "", - }; + GetWorkspaceSettingsRequest req = new GetWorkspaceSettingsRequest() {}; var res = await sdk.Workspaces.GetSettingsAsync(req); @@ -1277,17 +1493,19 @@ actions: using SpeakeasySDK.Models.Shared; using System; - var sdk = new SDK(security: new Security() { - APIKey = "", - }); + var sdk = new SDK( + workspaceId: "", + security: new Security() { + APIKey = "", + } + ); UpdateWorkspaceSettingsRequest req = new UpdateWorkspaceSettingsRequest() { - WorkspaceId = "", WorkspaceSettings = new WorkspaceSettings() { WorkspaceId = "", - WebhookUrl = "https://last-suspension.info/", - CreatedAt = System.DateTime.Parse("2024-12-28T06:46:35.807Z"), - UpdatedAt = System.DateTime.Parse("2025-02-03T10:37:56.725Z"), + WebhookUrl = "https://wicked-reboot.org", + CreatedAt = System.DateTime.Parse("2024-07-27T10:14:11.397Z"), + UpdatedAt = System.DateTime.Parse("2025-12-12T17:54:28.990Z"), }, }; @@ -1304,13 +1522,14 @@ actions: using SpeakeasySDK.Models.Operations; using SpeakeasySDK.Models.Shared; - var sdk = new SDK(security: new Security() { - APIKey = "", - }); + var sdk = new SDK( + workspaceId: "", + security: new Security() { + APIKey = "", + } + ); - GetWorkspaceTeamRequest req = new GetWorkspaceTeamRequest() { - WorkspaceId = "", - }; + GetWorkspaceTeamRequest req = new GetWorkspaceTeamRequest() {}; var res = await sdk.Workspaces.GetTeamAsync(req); @@ -1325,13 +1544,15 @@ actions: using SpeakeasySDK.Models.Operations; using SpeakeasySDK.Models.Shared; - var sdk = new SDK(security: new Security() { - APIKey = "", - }); + var sdk = new SDK( + workspaceId: "", + security: new Security() { + APIKey = "", + } + ); GrantUserAccessToWorkspaceRequest req = new GrantUserAccessToWorkspaceRequest() { - WorkspaceId = "", - Email = "Lucinda.Batz8@hotmail.com", + Email = "Idella24@gmail.com", }; var res = await sdk.Workspaces.GrantAccessAsync(req); @@ -1347,12 +1568,14 @@ actions: using SpeakeasySDK.Models.Operations; using SpeakeasySDK.Models.Shared; - var sdk = new SDK(security: new Security() { - APIKey = "", - }); + var sdk = new SDK( + workspaceId: "", + security: new Security() { + APIKey = "", + } + ); RevokeUserAccessToWorkspaceRequest req = new RevokeUserAccessToWorkspaceRequest() { - WorkspaceId = "", UserId = "", }; @@ -1369,13 +1592,14 @@ actions: using SpeakeasySDK.Models.Operations; using SpeakeasySDK.Models.Shared; - var sdk = new SDK(security: new Security() { - APIKey = "", - }); + var sdk = new SDK( + workspaceId: "", + security: new Security() { + APIKey = "", + } + ); - GetWorkspaceTokensRequest req = new GetWorkspaceTokensRequest() { - WorkspaceId = "", - }; + GetWorkspaceTokensRequest req = new GetWorkspaceTokensRequest() {}; var res = await sdk.Workspaces.GetTokensAsync(req); @@ -1391,19 +1615,21 @@ actions: using SpeakeasySDK.Models.Shared; using System; - var sdk = new SDK(security: new Security() { - APIKey = "", - }); + var sdk = new SDK( + workspaceId: "", + security: new Security() { + APIKey = "", + } + ); CreateWorkspaceTokenRequest req = new CreateWorkspaceTokenRequest() { - WorkspaceId = "", WorkspaceToken = new WorkspaceToken() { Id = "", Name = "", WorkspaceId = "", Alg = "", Key = "", - CreatedAt = System.DateTime.Parse("2023-08-16T02:33:00.784Z"), + CreatedAt = System.DateTime.Parse("2024-10-04T10:23:04.522Z"), }, }; @@ -1420,12 +1646,14 @@ actions: using SpeakeasySDK.Models.Operations; using SpeakeasySDK.Models.Shared; - var sdk = new SDK(security: new Security() { - APIKey = "", - }); + var sdk = new SDK( + workspaceId: "", + security: new Security() { + APIKey = "", + } + ); DeleteWorkspaceTokenRequest req = new DeleteWorkspaceTokenRequest() { - WorkspaceId = "", TokenID = "", }; diff --git a/docs/Models/Operations/ArchiveNamespaceRequest.md b/docs/Models/Operations/ArchiveNamespaceRequest.md new file mode 100644 index 00000000..e631a8a9 --- /dev/null +++ b/docs/Models/Operations/ArchiveNamespaceRequest.md @@ -0,0 +1,9 @@ +# ArchiveNamespaceRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `RequestBody` | [ArchiveNamespaceRequestBody](../../Models/Operations/ArchiveNamespaceRequestBody.md) | :heavy_minus_sign: | Archived status | +| `NamespaceName` | *string* | :heavy_check_mark: | N/A | \ 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..79e11679 --- /dev/null +++ b/docs/Models/Operations/ArchiveNamespaceRequestBody.md @@ -0,0 +1,10 @@ +# ArchiveNamespaceRequestBody + +Archived status + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `Archived` | *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..0588677a --- /dev/null +++ b/docs/Models/Operations/ArchiveNamespaceResponse.md @@ -0,0 +1,10 @@ +# ArchiveNamespaceResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :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..904b25d2 --- /dev/null +++ b/docs/Models/Operations/CreateBillingAddOnsResponse.md @@ -0,0 +1,11 @@ +# CreateBillingAddOnsResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `OrganizationBillingAddOnResponse` | [OrganizationBillingAddOnResponse](../../Models/Shared/OrganizationBillingAddOnResponse.md) | :heavy_minus_sign: | Success | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :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..1b8cf980 --- /dev/null +++ b/docs/Models/Operations/CreatePublishingTokenRequestBody.md @@ -0,0 +1,13 @@ +# CreatePublishingTokenRequestBody + +The publishing token to create + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `TargetId` | *string* | :heavy_check_mark: | N/A | +| `TargetResource` | *string* | :heavy_check_mark: | N/A | +| `TokenName` | *string* | :heavy_check_mark: | N/A | +| `ValidUntil` | [DateTime](https://learn.microsoft.com/en-us/dotnet/api/system.datetime?view=net-5.0) | :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..ef8d18e1 --- /dev/null +++ b/docs/Models/Operations/CreatePublishingTokenResponse.md @@ -0,0 +1,11 @@ +# CreatePublishingTokenResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `PublishingToken` | [PublishingToken](../../Models/Shared/PublishingToken.md) | :heavy_minus_sign: | OK | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :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..fb894351 --- /dev/null +++ b/docs/Models/Operations/CreateSchemaStoreItemRequestBody.md @@ -0,0 +1,11 @@ +# CreateSchemaStoreItemRequestBody + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Format` | [Models.Operations.Format](../../Models/Operations/Format.md) | :heavy_check_mark: | The format of the OpenAPI specification. | +| `PackageName` | *string* | :heavy_check_mark: | The package name to use in code snippets / quickstart. | +| `SDKClassname` | *string* | :heavy_check_mark: | The classname of the SDK to use in code snippets / quickstart. | +| `Spec` | *string* | :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..169f2fa7 --- /dev/null +++ b/docs/Models/Operations/CreateSchemaStoreItemResponse.md @@ -0,0 +1,11 @@ +# CreateSchemaStoreItemResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `SchemaStoreItem` | [SchemaStoreItem](../../Models/Shared/SchemaStoreItem.md) | :heavy_minus_sign: | OK | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ 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..c57b957d --- /dev/null +++ b/docs/Models/Operations/DeleteBillingAddOnRequest.md @@ -0,0 +1,8 @@ +# DeleteBillingAddOnRequest + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | +| `AddOn` | [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..82cbd9df --- /dev/null +++ b/docs/Models/Operations/DeleteBillingAddOnResponse.md @@ -0,0 +1,10 @@ +# DeleteBillingAddOnResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :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..2269b729 --- /dev/null +++ b/docs/Models/Operations/DeletePublishingTokenRequest.md @@ -0,0 +1,8 @@ +# DeletePublishingTokenRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| `TokenID` | *string* | :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..54cb5247 --- /dev/null +++ b/docs/Models/Operations/DeletePublishingTokenResponse.md @@ -0,0 +1,10 @@ +# DeletePublishingTokenResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ 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..ddbf6464 --- /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 d4cbe9b5..a22ef0d4 100644 --- a/docs/Models/Operations/GenerateCodeSamplePreviewResponse.md +++ b/docs/Models/Operations/GenerateCodeSamplePreviewResponse.md @@ -5,8 +5,7 @@ | Field | Type | Required | Description | | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -| `TwoHundredApplicationJsonBytes` | *byte[]* | :heavy_minus_sign: | Successfully returned codeSample overlay file | -| `TwoHundredApplicationXYamlBytes` | *byte[]* | :heavy_minus_sign: | Successfully returned codeSample overlay file | | `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `UsageSnippets` | [UsageSnippets](../../Models/Shared/UsageSnippets.md) | :heavy_minus_sign: | OK | \ 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..8484eb31 --- /dev/null +++ b/docs/Models/Operations/GetBillingAddOnsResponse.md @@ -0,0 +1,11 @@ +# GetBillingAddOnsResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `OrganizationBillingAddOnResponse` | [OrganizationBillingAddOnResponse](../../Models/Shared/OrganizationBillingAddOnResponse.md) | :heavy_minus_sign: | Success | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :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 b967f295..e72dab96 100644 --- a/docs/Models/Operations/GetCodeSamplePreviewAsyncResponse.md +++ b/docs/Models/Operations/GetCodeSamplePreviewAsyncResponse.md @@ -5,9 +5,8 @@ | Field | Type | Required | Description | | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -| `TwoHundredApplicationJsonBytes` | *byte[]* | :heavy_minus_sign: | Successfully returned codeSample overlay file | -| `TwoHundredApplicationXYamlBytes` | *byte[]* | :heavy_minus_sign: | Successfully returned codeSample overlay file | -| `TwoHundredAndTwoApplicationJsonObject` | [GetCodeSamplePreviewAsyncResponseBody](../../Models/Operations/GetCodeSamplePreviewAsyncResponseBody.md) | :heavy_minus_sign: | Job is still in progress | | `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `UsageSnippets` | [UsageSnippets](../../Models/Shared/UsageSnippets.md) | :heavy_minus_sign: | OK | +| `Object` | [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 deleted file mode 100644 index 679b5b87..00000000 --- a/docs/Models/Operations/GetCodeSamplesRequest.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetCodeSamplesRequest - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | -| `RegistryUrl` | *string* | :heavy_check_mark: | The registry URL from which to retrieve the snippets. E.g. https://spec.speakeasy.com/org/ws/my-source | -| `Languages` | List<*string*> | :heavy_minus_sign: | N/A | -| `OperationIds` | List<*string*> | :heavy_minus_sign: | N/A | \ 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..04349e8f --- /dev/null +++ b/docs/Models/Operations/GetPublishingTokenByIDRequest.md @@ -0,0 +1,8 @@ +# GetPublishingTokenByIDRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| `TokenID` | *string* | :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..8be1113f --- /dev/null +++ b/docs/Models/Operations/GetPublishingTokenByIDResponse.md @@ -0,0 +1,11 @@ +# GetPublishingTokenByIDResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `PublishingToken` | [PublishingToken](../../Models/Shared/PublishingToken.md) | :heavy_minus_sign: | OK | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :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..2a8ff252 --- /dev/null +++ b/docs/Models/Operations/GetPublishingTokenPublicMetadataRequest.md @@ -0,0 +1,8 @@ +# GetPublishingTokenPublicMetadataRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| `TokenID` | *string* | :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..499ab4f0 --- /dev/null +++ b/docs/Models/Operations/GetPublishingTokenPublicMetadataResponse.md @@ -0,0 +1,11 @@ +# GetPublishingTokenPublicMetadataResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `Object` | [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..b7326464 --- /dev/null +++ b/docs/Models/Operations/GetPublishingTokenPublicMetadataResponseBody.md @@ -0,0 +1,14 @@ +# GetPublishingTokenPublicMetadataResponseBody + +OK + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `OrganizationId` | *string* | :heavy_minus_sign: | N/A | +| `TargetId` | *string* | :heavy_minus_sign: | N/A | +| `TargetResource` | *string* | :heavy_minus_sign: | N/A | +| `ValidUntil` | [DateTime](https://learn.microsoft.com/en-us/dotnet/api/system.datetime?view=net-5.0) | :heavy_minus_sign: | N/A | +| `WorkspaceId` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/GetCodeSamplesResponse.md b/docs/Models/Operations/GetPublishingTokenResponse.md similarity index 92% rename from docs/Models/Operations/GetCodeSamplesResponse.md rename to docs/Models/Operations/GetPublishingTokenResponse.md index ab675241..d67a1bf3 100644 --- a/docs/Models/Operations/GetCodeSamplesResponse.md +++ b/docs/Models/Operations/GetPublishingTokenResponse.md @@ -1,4 +1,4 @@ -# GetCodeSamplesResponse +# GetPublishingTokenResponse ## Fields @@ -8,4 +8,4 @@ | `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `UsageSnippets` | [UsageSnippets](../../Models/Shared/UsageSnippets.md) | :heavy_minus_sign: | OK | \ No newline at end of file +| `Classes` | List<[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..ca0835ab --- /dev/null +++ b/docs/Models/Operations/GetPublishingTokenTargetByIDRequest.md @@ -0,0 +1,8 @@ +# GetPublishingTokenTargetByIDRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| `TokenID` | *string* | :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..ad34969c --- /dev/null +++ b/docs/Models/Operations/GetPublishingTokenTargetByIDResponse.md @@ -0,0 +1,11 @@ +# GetPublishingTokenTargetByIDResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `Res` | *string* | :heavy_minus_sign: | OK | \ 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..657adc49 --- /dev/null +++ b/docs/Models/Operations/GetSchemaStoreItemRequestBody.md @@ -0,0 +1,8 @@ +# GetSchemaStoreItemRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `Id` | *string* | :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..87b51c25 --- /dev/null +++ b/docs/Models/Operations/GetSchemaStoreItemResponse.md @@ -0,0 +1,11 @@ +# GetSchemaStoreItemResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `SchemaStoreItem` | [SchemaStoreItem](../../Models/Shared/SchemaStoreItem.md) | :heavy_minus_sign: | OK | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :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 1d5583fc..eb0cbd6b 100644 --- a/docs/Models/Operations/GetWorkspaceEventsByTargetRequest.md +++ b/docs/Models/Operations/GetWorkspaceEventsByTargetRequest.md @@ -5,6 +5,6 @@ | Field | Type | Required | Description | | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | -| `TargetId` | *string* | :heavy_check_mark: | Filter to only return events corresponding to a particular gen_lock_id (gen_lock_id uniquely identifies a target) | | `AfterCreatedAt` | [DateTime](https://learn.microsoft.com/en-us/dotnet/api/system.datetime?view=net-5.0) | :heavy_minus_sign: | Filter to only return events created after this timestamp | +| `TargetId` | *string* | :heavy_check_mark: | Filter to only return events corresponding to a particular gen_lock_id (gen_lock_id uniquely identifies a target) | | `WorkspaceId` | *string* | :heavy_minus_sign: | Unique identifier of the workspace. | \ No newline at end of file diff --git a/docs/Models/Operations/PostTagsRequest.md b/docs/Models/Operations/PostTagsRequest.md index d5bf446b..b48dd5fc 100644 --- a/docs/Models/Operations/PostTagsRequest.md +++ b/docs/Models/Operations/PostTagsRequest.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| `NamespaceName` | *string* | :heavy_check_mark: | N/A | -| `AddTags` | [AddTags](../../Models/Shared/AddTags.md) | :heavy_minus_sign: | A JSON representation of the tags to add | \ No newline at end of file +| `AddTags` | [AddTags](../../Models/Shared/AddTags.md) | :heavy_minus_sign: | A JSON representation of the tags to add | +| `NamespaceName` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/SetVisibilityRequest.md b/docs/Models/Operations/SetVisibilityRequest.md index dc728016..3ad763ce 100644 --- a/docs/Models/Operations/SetVisibilityRequest.md +++ b/docs/Models/Operations/SetVisibilityRequest.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | -| `NamespaceName` | *string* | :heavy_check_mark: | N/A | -| `RequestBody` | [SetVisibilityRequestBody](../../Models/Operations/SetVisibilityRequestBody.md) | :heavy_minus_sign: | Namespace visibility | \ No newline at end of file +| `RequestBody` | [SetVisibilityRequestBody](../../Models/Operations/SetVisibilityRequestBody.md) | :heavy_minus_sign: | Namespace visibility | +| `NamespaceName` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/SuggestOpenAPIRegistryRequest.md b/docs/Models/Operations/SuggestOpenAPIRegistryRequest.md index 97212eeb..bb9a33e2 100644 --- a/docs/Models/Operations/SuggestOpenAPIRegistryRequest.md +++ b/docs/Models/Operations/SuggestOpenAPIRegistryRequest.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | +| `SuggestRequestBody` | [SuggestRequestBody](../../Models/Shared/SuggestRequestBody.md) | :heavy_minus_sign: | Suggest options | | `NamespaceName` | *string* | :heavy_check_mark: | N/A | | `RevisionReference` | *string* | :heavy_check_mark: | Tag or digest | -| `XSessionId` | *string* | :heavy_check_mark: | N/A | -| `SuggestRequestBody` | [SuggestRequestBody](../../Models/Shared/SuggestRequestBody.md) | :heavy_minus_sign: | Suggest options | \ No newline at end of file +| `XSessionId` | *string* | :heavy_check_mark: | N/A | \ 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..dd630299 --- /dev/null +++ b/docs/Models/Operations/UpdatePublishingTokenExpirationRequest.md @@ -0,0 +1,9 @@ +# UpdatePublishingTokenExpirationRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | +| `RequestBody` | [UpdatePublishingTokenExpirationRequestBody](../../Models/Operations/UpdatePublishingTokenExpirationRequestBody.md) | :heavy_minus_sign: | The publishing token to update | +| `TokenID` | *string* | :heavy_check_mark: | Unique identifier of the publishing token. | \ 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..69a52196 --- /dev/null +++ b/docs/Models/Operations/UpdatePublishingTokenExpirationRequestBody.md @@ -0,0 +1,11 @@ +# UpdatePublishingTokenExpirationRequestBody + +The publishing token to update + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `TokenName` | *string* | :heavy_minus_sign: | The new name for the publishing token. | +| `ValidUntil` | [DateTime](https://learn.microsoft.com/en-us/dotnet/api/system.datetime?view=net-5.0) | :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..9bb34299 --- /dev/null +++ b/docs/Models/Operations/UpdatePublishingTokenExpirationResponse.md @@ -0,0 +1,10 @@ +# UpdatePublishingTokenExpirationResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/Models/Shared/ApiKeyDetails.md b/docs/Models/Shared/ApiKeyDetails.md index 8ea0e489..e5c0b01d 100644 --- a/docs/Models/Shared/ApiKeyDetails.md +++ b/docs/Models/Shared/ApiKeyDetails.md @@ -6,6 +6,7 @@ | Field | Type | Required | Description | | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | | `AccountTypeV2` | [AccountType](../../Models/Shared/AccountType.md) | :heavy_check_mark: | N/A | +| `BillingAddOns` | List<[BillingAddOn](../../Models/Shared/BillingAddOn.md)> | :heavy_check_mark: | N/A | | `EnabledFeatures` | List<*string*> | :heavy_check_mark: | N/A | | ~~`FeatureFlags`~~ | List<*string*> | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | | `GenerationAccessUnlimited` | *bool* | :heavy_minus_sign: | N/A | diff --git a/docs/Models/Shared/BillingAddOn.md b/docs/Models/Shared/BillingAddOn.md new file mode 100644 index 00000000..f02a5990 --- /dev/null +++ b/docs/Models/Shared/BillingAddOn.md @@ -0,0 +1,11 @@ +# BillingAddOn + + +## Values + +| Name | Value | +| ------------------- | ------------------- | +| `Webhooks` | webhooks | +| `SDKTesting` | sdk_testing | +| `CustomCodeRegions` | custom_code_regions | +| `SnippetAi` | snippet_ai | \ No newline at end of file diff --git a/docs/Models/Shared/CliEvent.md b/docs/Models/Shared/CliEvent.md index 59461fb5..3698ca07 100644 --- a/docs/Models/Shared/CliEvent.md +++ b/docs/Models/Shared/CliEvent.md @@ -81,6 +81,7 @@ | `SpeakeasyApiKeyName` | *string* | :heavy_check_mark: | Identifier of the Speakeasy API key. | | `SpeakeasyVersion` | *string* | :heavy_check_mark: | Version of the Speakeasy CLI. | | `Success` | *bool* | :heavy_check_mark: | Indicates whether the event was successful. | +| `TestReportRaw` | *string* | :heavy_minus_sign: | The raw test report xml | | `WorkflowLockPostRaw` | *string* | :heavy_minus_sign: | Workflow lock file (post execution) | | `WorkflowLockPreRaw` | *string* | :heavy_minus_sign: | Workflow lock file (prior to execution) | | `WorkflowPostRaw` | *string* | :heavy_minus_sign: | Workflow file (post execution) | diff --git a/docs/Models/Shared/CodeSampleSchemaInput.md b/docs/Models/Shared/CodeSampleSchemaInput.md index 0253e80c..c29710b5 100644 --- a/docs/Models/Shared/CodeSampleSchemaInput.md +++ b/docs/Models/Shared/CodeSampleSchemaInput.md @@ -3,9 +3,10 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | -| `Languages` | List<*string*> | :heavy_check_mark: | A list of languages to generate code samples for | -| `SchemaFile` | [SchemaFile](../../Models/Shared/SchemaFile.md) | :heavy_check_mark: | The OpenAPI file to be uploaded | -| `PackageName` | *string* | :heavy_minus_sign: | The name of the package | -| `SDKClassName` | *string* | :heavy_minus_sign: | The SDK class name | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `Language` | *string* | :heavy_check_mark: | The language to generate code samples for | +| `OperationIds` | List<*string*> | :heavy_minus_sign: | A list of operations IDs to generate code samples for | +| `PackageName` | *string* | :heavy_minus_sign: | The name of the package | +| `SchemaFile` | [SchemaFile](../../Models/Shared/SchemaFile.md) | :heavy_check_mark: | The OpenAPI file to be uploaded | +| `SDKClassName` | *string* | :heavy_minus_sign: | The SDK class name | \ 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..dc66a53a --- /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/GithubTriggerActionRequest.md b/docs/Models/Shared/GithubTriggerActionRequest.md index 72feb339..86844565 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` | *bool* | :heavy_minus_sign: | Force an SDK generation | | `GenLockId` | *string* | :heavy_check_mark: | The generation lock ID | | `Org` | *string* | :heavy_check_mark: | The GitHub organization name | | `RepoName` | *string* | :heavy_check_mark: | The GitHub repository name | -| `Force` | *bool* | :heavy_minus_sign: | Force an SDK generation | | `SetVersion` | *string* | :heavy_minus_sign: | A version to override the SDK too in workflow dispatch | | `TargetName` | *string* | :heavy_minus_sign: | The target name for the action | \ No newline at end of file diff --git a/docs/Models/Shared/InteractionType.md b/docs/Models/Shared/InteractionType.md index 8acd51a2..1f503a9f 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 1741b841..b42d60ec 100644 --- a/docs/Models/Shared/Namespace.md +++ b/docs/Models/Shared/Namespace.md @@ -7,9 +7,11 @@ A namespace contains many revisions. | Field | Type | Required | Description | | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `ArchivedAt` | [DateTime](https://learn.microsoft.com/en-us/dotnet/api/system.datetime?view=net-5.0) | :heavy_minus_sign: | N/A | | `CompositeSpecMetadata` | [CompositeSpecMetadata](../../Models/Shared/CompositeSpecMetadata.md) | :heavy_minus_sign: | N/A | | `CreatedAt` | [DateTime](https://learn.microsoft.com/en-us/dotnet/api/system.datetime?view=net-5.0) | :heavy_check_mark: | N/A | | `Id` | *string* | :heavy_check_mark: | {organization_slug}/{workspace_slug}/{namespace_name} | +| `LatestRevisionMetadata` | [RevisionContentsMetadata](../../Models/Shared/RevisionContentsMetadata.md) | :heavy_minus_sign: | N/A | | `Name` | *string* | :heavy_check_mark: | A human-readable name for the namespace. | | `Public` | *bool* | :heavy_minus_sign: | Indicates whether the namespace is publicly accessible | | `UpdatedAt` | [DateTime](https://learn.microsoft.com/en-us/dotnet/api/system.datetime?view=net-5.0) | :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 d981ebad..68a8f7b4 100644 --- a/docs/Models/Shared/Organization.md +++ b/docs/Models/Shared/Organization.md @@ -9,12 +9,12 @@ A speakeasy organization | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | | `AccountType` | [AccountType](../../Models/Shared/AccountType.md) | :heavy_check_mark: | N/A | | `CreatedAt` | [DateTime](https://learn.microsoft.com/en-us/dotnet/api/system.datetime?view=net-5.0) | :heavy_check_mark: | N/A | +| `FreeTrialExpiry` | [DateTime](https://learn.microsoft.com/en-us/dotnet/api/system.datetime?view=net-5.0) | :heavy_minus_sign: | N/A | | `Id` | *string* | :heavy_check_mark: | N/A | +| `Internal` | *bool* | :heavy_minus_sign: | N/A | | `Name` | *string* | :heavy_check_mark: | N/A | | `Slug` | *string* | :heavy_check_mark: | N/A | | `SsoActivated` | *bool* | :heavy_check_mark: | N/A | +| `SsoConnectionId` | *string* | :heavy_minus_sign: | N/A | | `TelemetryDisabled` | *bool* | :heavy_check_mark: | N/A | -| `UpdatedAt` | [DateTime](https://learn.microsoft.com/en-us/dotnet/api/system.datetime?view=net-5.0) | :heavy_check_mark: | N/A | -| `FreeTrialExpiry` | [DateTime](https://learn.microsoft.com/en-us/dotnet/api/system.datetime?view=net-5.0) | :heavy_minus_sign: | N/A | -| `Internal` | *bool* | :heavy_minus_sign: | N/A | -| `SsoConnectionId` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file +| `UpdatedAt` | [DateTime](https://learn.microsoft.com/en-us/dotnet/api/system.datetime?view=net-5.0) | :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..4cb7e621 --- /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 | +| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | +| `AddOns` | List<[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..d51fcf17 --- /dev/null +++ b/docs/Models/Shared/OrganizationBillingAddOnResponse.md @@ -0,0 +1,10 @@ +# OrganizationBillingAddOnResponse + +Billing add on response + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | +| `AddOns` | List<[BillingAddOn](../../Models/Shared/BillingAddOn.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..fcc9a1e5 --- /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 | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `CreatedAt` | [DateTime](https://learn.microsoft.com/en-us/dotnet/api/system.datetime?view=net-5.0) | :heavy_check_mark: | N/A | +| `CreatedBy` | *string* | :heavy_check_mark: | N/A | +| `Id` | *string* | :heavy_check_mark: | N/A | +| `OrganizationId` | *string* | :heavy_check_mark: | N/A | +| `TargetId` | *string* | :heavy_check_mark: | N/A | +| `TargetResource` | [TargetResource](../../Models/Shared/TargetResource.md) | :heavy_check_mark: | N/A | +| `Token` | *string* | :heavy_check_mark: | N/A | +| `TokenName` | *string* | :heavy_check_mark: | N/A | +| `UpdatedAt` | [DateTime](https://learn.microsoft.com/en-us/dotnet/api/system.datetime?view=net-5.0) | :heavy_minus_sign: | N/A | +| `UpdatedBy` | *string* | :heavy_minus_sign: | N/A | +| `ValidUntil` | [DateTime](https://learn.microsoft.com/en-us/dotnet/api/system.datetime?view=net-5.0) | :heavy_check_mark: | N/A | +| `WorkspaceId` | *string* | :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 adeb8407..030fd435 100644 --- a/docs/Models/Shared/Revision.md +++ b/docs/Models/Shared/Revision.md @@ -5,6 +5,7 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `ContentsMetadata` | [RevisionContentsMetadata](../../Models/Shared/RevisionContentsMetadata.md) | :heavy_minus_sign: | N/A | | | `CreatedAt` | [DateTime](https://learn.microsoft.com/en-us/dotnet/api/system.datetime?view=net-5.0) | :heavy_check_mark: | N/A | | | `Digest` | *string* | :heavy_check_mark: | N/A | sha256:6d1ef012b5674ad8a127ecfa9b5e6f5178d171b90ee462846974177fd9bdd39f | | `Id` | *string* | :heavy_check_mark: | Format {namespace_id}/{revision_digest} | | diff --git a/docs/Models/Shared/RevisionContentsMetadata.md b/docs/Models/Shared/RevisionContentsMetadata.md new file mode 100644 index 00000000..2169b106 --- /dev/null +++ b/docs/Models/Shared/RevisionContentsMetadata.md @@ -0,0 +1,20 @@ +# RevisionContentsMetadata + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `ContainsCodeSamples` | *bool* | :heavy_check_mark: | Whether the OAS contains code samples. | +| `CreatedAt` | [DateTime](https://learn.microsoft.com/en-us/dotnet/api/system.datetime?view=net-5.0) | :heavy_check_mark: | N/A | +| `Description` | *string* | :heavy_check_mark: | The OAS description | +| `Hash` | *string* | :heavy_check_mark: | The hash of the contents | +| `Namespace` | *string* | :heavy_check_mark: | The fully qualified namespace | +| `NumOverlayActions` | *long* | :heavy_check_mark: | The number of overlay actions in the OAS. Will be 0 if the OAS is not an overlay. | +| `OperationIds` | List<*string*> | :heavy_check_mark: | The operation IDs contained in the OAS. Will be empty if the OAS is an overlay. | +| `RevisionDigest` | *string* | :heavy_check_mark: | The digest of the parent bundle | +| `Tags` | List<*string*> | :heavy_check_mark: | The tags contained in the OAS -- NOT the OCI tags. Will be empty if the OAS is an overlay. | +| `Title` | *string* | :heavy_check_mark: | The OAS title | +| `Type` | [RevisionContentsMetadataType](../../Models/Shared/RevisionContentsMetadataType.md) | :heavy_check_mark: | N/A | +| `Version` | *string* | :heavy_check_mark: | The OAS version | +| `WorkspaceId` | *string* | :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..1b3b6020 --- /dev/null +++ b/docs/Models/Shared/RevisionContentsMetadataType.md @@ -0,0 +1,9 @@ +# RevisionContentsMetadataType + + +## Values + +| Name | Value | +| ---------------- | ---------------- | +| `OpenapiBundle` | OPENAPI_BUNDLE | +| `OpenapiOverlay` | OPENAPI_OVERLAY | \ 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..443f13e8 --- /dev/null +++ b/docs/Models/Shared/SchemaStoreItem.md @@ -0,0 +1,13 @@ +# SchemaStoreItem + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `CreatedAt` | [DateTime](https://learn.microsoft.com/en-us/dotnet/api/system.datetime?view=net-5.0) | :heavy_check_mark: | N/A | +| `Format` | [Models.Shared.Format](../../Models/Shared/Format.md) | :heavy_check_mark: | N/A | +| `Id` | *string* | :heavy_check_mark: | N/A | +| `PackageName` | *string* | :heavy_check_mark: | N/A | +| `SDKClassname` | *string* | :heavy_check_mark: | N/A | +| `Spec` | *string* | :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..c0e0116c --- /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/UsageSnippet.md b/docs/Models/Shared/UsageSnippet.md index c75a9015..3acfd939 100644 --- a/docs/Models/Shared/UsageSnippet.md +++ b/docs/Models/Shared/UsageSnippet.md @@ -7,4 +7,6 @@ | -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | | `Code` | *string* | :heavy_check_mark: | The code snippet | | `Language` | *string* | :heavy_check_mark: | The language of the snippet | -| `OperationId` | *string* | :heavy_check_mark: | The operation ID for the snippet | \ No newline at end of file +| `Method` | *object* | :heavy_check_mark: | The HTTP method of the operation | +| `OperationId` | *string* | :heavy_check_mark: | The operation ID for the snippet | +| `Path` | *string* | :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 0f8eb716..56257cea 100644 --- a/docs/Models/Shared/User.md +++ b/docs/Models/Shared/User.md @@ -13,9 +13,11 @@ | `Email` | *string* | :heavy_check_mark: | Email address of the user. | | `EmailVerified` | *bool* | :heavy_check_mark: | Indicates whether the email address has been verified. | | `GithubHandle` | *string* | :heavy_minus_sign: | GitHub handle of the user. | +| `HasCreatedApiKey` | *bool* | :heavy_minus_sign: | Indicates whether the user has created an API key. Not always populated | | `Id` | *string* | :heavy_check_mark: | Unique identifier for the user. | | `Internal` | *bool* | :heavy_minus_sign: | Indicates whether the user is internal. | | `LastLoginAt` | [DateTime](https://learn.microsoft.com/en-us/dotnet/api/system.datetime?view=net-5.0) | :heavy_minus_sign: | Timestamp of the last login. | | `PhotoUrl` | *string* | :heavy_minus_sign: | URL of the user's photo. | +| `PylonIdentityHash` | *string* | :heavy_minus_sign: | Hash used for pylon identity verification returned on v1/user. | | `UpdatedAt` | [DateTime](https://learn.microsoft.com/en-us/dotnet/api/system.datetime?view=net-5.0) | :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/Workspace.md b/docs/Models/Shared/Workspace.md index fd474e40..5e9f6ba6 100644 --- a/docs/Models/Shared/Workspace.md +++ b/docs/Models/Shared/Workspace.md @@ -9,10 +9,10 @@ A speakeasy workspace | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `CreatedAt` | [DateTime](https://learn.microsoft.com/en-us/dotnet/api/system.datetime?view=net-5.0) | :heavy_check_mark: | N/A | | `Id` | *string* | :heavy_check_mark: | N/A | +| `Inactive` | *bool* | :heavy_minus_sign: | N/A | | `Name` | *string* | :heavy_check_mark: | N/A | | `OrganizationId` | *string* | :heavy_check_mark: | N/A | | `Slug` | *string* | :heavy_check_mark: | N/A | +| ~~`TelemetryDisabled`~~ | *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. | | `UpdatedAt` | [DateTime](https://learn.microsoft.com/en-us/dotnet/api/system.datetime?view=net-5.0) | :heavy_check_mark: | N/A | -| `Verified` | *bool* | :heavy_check_mark: | N/A | -| `Inactive` | *bool* | :heavy_minus_sign: | N/A | -| ~~`TelemetryDisabled`~~ | *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/WorkspaceToken.md b/docs/Models/Shared/WorkspaceToken.md index f4748c81..2562449c 100644 --- a/docs/Models/Shared/WorkspaceToken.md +++ b/docs/Models/Shared/WorkspaceToken.md @@ -10,6 +10,8 @@ A workspace token | `Alg` | *string* | :heavy_check_mark: | N/A | | `CreatedAt` | [DateTime](https://learn.microsoft.com/en-us/dotnet/api/system.datetime?view=net-5.0) | :heavy_check_mark: | N/A | | `CreatedBy` | *string* | :heavy_minus_sign: | N/A | +| `CreatedByName` | *string* | :heavy_minus_sign: | N/A | +| `CreatedByPhotoUrl` | *string* | :heavy_minus_sign: | N/A | | `Email` | *string* | :heavy_minus_sign: | N/A | | `Id` | *string* | :heavy_check_mark: | N/A | | `Key` | *string* | :heavy_check_mark: | N/A | diff --git a/docs/sdks/artifacts/README.md b/docs/sdks/artifacts/README.md index 9291801c..86ba9aa5 100644 --- a/docs/sdks/artifacts/README.md +++ b/docs/sdks/artifacts/README.md @@ -16,6 +16,7 @@ REST APIs for working with Registry artifacts * [ListRemoteSources](#listremotesources) - Get remote sources attached to a particular namespace * [PostTags](#posttags) - Add tags to an existing revision * [Preflight](#preflight) - Get access token for communicating with OCI distribution endpoints +* [SetArchived](#setarchived) - Set whether a namespace is archived * [SetVisibility](#setvisibility) - Set visibility of a namespace with an existing metadata entry ## CreateRemoteSource @@ -27,22 +28,12 @@ Configure a new remote source ```csharp using SpeakeasySDK; using SpeakeasySDK.Models.Shared; -using System.Collections.Generic; var sdk = new SDK(security: new Security() { APIKey = "", }); -RemoteSource req = new RemoteSource() { - Inputs = new List() { - new RemoteDocument() { - RegistryUrl = "https://productive-swine.net", - }, - }, - Output = new RemoteDocument() { - RegistryUrl = "https://spiteful-apricot.info", - }, -}; +RemoteSource req = ; var res = await sdk.Artifacts.CreateRemoteSourceAsync(req); @@ -358,9 +349,7 @@ var sdk = new SDK(security: new Security() { APIKey = "", }); -PreflightRequest req = new PreflightRequest() { - NamespaceName = "", -}; +PreflightRequest req = ; var res = await sdk.Artifacts.PreflightAsync(req); @@ -384,6 +373,47 @@ var res = await sdk.Artifacts.PreflightAsync(req); | SpeakeasySDK.Models.Errors.Error | 4XX | application/json | | SpeakeasySDK.Models.Errors.SDKException | 5XX | \*/\* | +## SetArchived + +Set whether a namespace is archived + +### Example Usage + +```csharp +using SpeakeasySDK; +using SpeakeasySDK.Models.Operations; +using SpeakeasySDK.Models.Shared; + +var sdk = new SDK(security: new Security() { + APIKey = "", +}); + +ArchiveNamespaceRequest req = new ArchiveNamespaceRequest() { + NamespaceName = "", +}; + +var res = await sdk.Artifacts.SetArchivedAsync(req); + +// handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | +| `request` | [ArchiveNamespaceRequest](../../Models/Operations/ArchiveNamespaceRequest.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[ArchiveNamespaceResponse](../../Models/Operations/ArchiveNamespaceResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------------- | --------------------------------------- | --------------------------------------- | +| SpeakeasySDK.Models.Errors.Error | 4XX | application/json | +| SpeakeasySDK.Models.Errors.SDKException | 5XX | \*/\* | + ## SetVisibility Set visibility of a namespace with an existing metadata entry diff --git a/docs/sdks/auth/README.md b/docs/sdks/auth/README.md index edbde9f6..fd853bfa 100644 --- a/docs/sdks/auth/README.md +++ b/docs/sdks/auth/README.md @@ -27,7 +27,7 @@ var sdk = new SDK(security: new Security() { APIKey = "", }); -GetWorkspaceAccessRequest req = new GetWorkspaceAccessRequest() {}; +GetWorkspaceAccessRequest req = ; var res = await sdk.Auth.GetAccessAsync(req); diff --git a/docs/sdks/codesamples/README.md b/docs/sdks/codesamples/README.md index f814ab3a..d7df7341 100644 --- a/docs/sdks/codesamples/README.md +++ b/docs/sdks/codesamples/README.md @@ -9,7 +9,6 @@ REST APIs for retrieving Code Samples * [GenerateCodeSamplePreview](#generatecodesamplepreview) - Generate Code Sample previews from a file and configuration parameters. * [GenerateCodeSamplePreviewAsync](#generatecodesamplepreviewasync) - 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 * [GetCodeSamplePreviewAsync](#getcodesamplepreviewasync) - Poll for the result of an asynchronous Code Sample preview generation. ## GenerateCodeSamplePreview @@ -21,19 +20,16 @@ This endpoint generates Code Sample previews from a file and configuration param ```csharp using SpeakeasySDK; using SpeakeasySDK.Models.Shared; -using System; -using System.Collections.Generic; +using System.IO; var sdk = new SDK(security: new Security() { APIKey = "", }); CodeSampleSchemaInput req = new CodeSampleSchemaInput() { - Languages = new List() { - "", - }, + Language = "", SchemaFile = new SchemaFile() { - Content = System.Text.Encoding.UTF8.GetBytes("0xc3dD8BfBef"), + Content = File.ReadAllBytes("example.file"), FileName = "example.file", }, }; @@ -57,7 +53,8 @@ var res = await sdk.CodeSamples.GenerateCodeSamplePreviewAsync(req); | Error Type | Status Code | Content Type | | -------------------------------- | -------------------------------- | -------------------------------- | -| SpeakeasySDK.Models.Errors.Error | 4XX, 5XX | application/json | +| SpeakeasySDK.Models.Errors.Error | 4XX | application/json | +| SpeakeasySDK.Models.Errors.Error | 5XX | application/json | ## GenerateCodeSamplePreviewAsync @@ -68,19 +65,16 @@ This endpoint generates Code Sample previews from a file and configuration param ```csharp using SpeakeasySDK; using SpeakeasySDK.Models.Shared; -using System; -using System.Collections.Generic; +using System.IO; var sdk = new SDK(security: new Security() { APIKey = "", }); CodeSampleSchemaInput req = new CodeSampleSchemaInput() { - Languages = new List() { - "", - }, + Language = "", SchemaFile = new SchemaFile() { - Content = System.Text.Encoding.UTF8.GetBytes("0xED5CDd177E"), + Content = File.ReadAllBytes("example.file"), FileName = "example.file", }, }; @@ -104,48 +98,8 @@ var res = await sdk.CodeSamples.GenerateCodeSamplePreviewAsyncAsync(req); | Error Type | Status Code | Content Type | | -------------------------------- | -------------------------------- | -------------------------------- | -| SpeakeasySDK.Models.Errors.Error | 4XX, 5XX | application/json | - -## Get - -Retrieve usage snippets from document stored in the registry. Supports filtering by language and operation ID. - -### Example Usage - -```csharp -using SpeakeasySDK; -using SpeakeasySDK.Models.Operations; -using SpeakeasySDK.Models.Shared; - -var sdk = new SDK(security: new Security() { - APIKey = "", -}); - -GetCodeSamplesRequest req = new GetCodeSamplesRequest() { - RegistryUrl = "https://normal-making.name", -}; - -var res = await sdk.CodeSamples.GetAsync(req); - -// handle response -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -| `request` | [GetCodeSamplesRequest](../../Models/Operations/GetCodeSamplesRequest.md) | :heavy_check_mark: | The request object to use for the request. | - -### Response - -**[GetCodeSamplesResponse](../../Models/Operations/GetCodeSamplesResponse.md)** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------------------------------- | --------------------------------------- | --------------------------------------- | -| SpeakeasySDK.Models.Errors.Error | 4XX | application/json | -| SpeakeasySDK.Models.Errors.SDKException | 5XX | \*/\* | +| SpeakeasySDK.Models.Errors.Error | 4XX | application/json | +| SpeakeasySDK.Models.Errors.Error | 5XX | application/json | ## GetCodeSamplePreviewAsync @@ -185,4 +139,5 @@ var res = await sdk.CodeSamples.GetCodeSamplePreviewAsyncAsync(req); | Error Type | Status Code | Content Type | | -------------------------------- | -------------------------------- | -------------------------------- | -| SpeakeasySDK.Models.Errors.Error | 4XX, 5XX | application/json | \ No newline at end of file +| SpeakeasySDK.Models.Errors.Error | 4XX | application/json | +| SpeakeasySDK.Models.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 b0945553..efada9ee 100644 --- a/docs/sdks/events/README.md +++ b/docs/sdks/events/README.md @@ -24,13 +24,15 @@ using SpeakeasySDK; using SpeakeasySDK.Models.Operations; using SpeakeasySDK.Models.Shared; -var sdk = new SDK(security: new Security() { - APIKey = "", -}); +var sdk = new SDK( + workspaceId: "", + security: new Security() { + APIKey = "", + } +); GetWorkspaceEventsByTargetRequest req = new GetWorkspaceEventsByTargetRequest() { TargetId = "", - WorkspaceId = "", }; var res = await sdk.Events.GetEventsByTargetAsync(req); @@ -70,7 +72,7 @@ var sdk = new SDK(security: new Security() { APIKey = "", }); -GetWorkspaceTargetsRequest req = new GetWorkspaceTargetsRequest() {}; +GetWorkspaceTargetsRequest req = ; var res = await sdk.Events.GetTargetsAsync(req); @@ -105,13 +107,14 @@ using SpeakeasySDK; using SpeakeasySDK.Models.Operations; using SpeakeasySDK.Models.Shared; -var sdk = new SDK(security: new Security() { - APIKey = "", -}); +var sdk = new SDK( + workspaceId: "", + security: new Security() { + APIKey = "", + } +); -GetWorkspaceTargetsDeprecatedRequest req = new GetWorkspaceTargetsDeprecatedRequest() { - WorkspaceId = "", -}; +GetWorkspaceTargetsDeprecatedRequest req = new GetWorkspaceTargetsDeprecatedRequest() {}; var res = await sdk.Events.GetTargetsDeprecatedAsync(req); @@ -148,25 +151,27 @@ using SpeakeasySDK.Models.Shared; using System; using System.Collections.Generic; -var sdk = new SDK(security: new Security() { - APIKey = "", -}); +var sdk = new SDK( + workspaceId: "", + security: new Security() { + APIKey = "", + } +); PostWorkspaceEventsRequest req = new PostWorkspaceEventsRequest() { RequestBody = new List() { new CliEvent() { - CreatedAt = System.DateTime.Parse("2024-05-07T03:24:39.583Z"), + CreatedAt = System.DateTime.Parse("2023-02-16T09:12:42.397Z"), ExecutionId = "", Id = "", InteractionType = InteractionType.Quickstart, - LocalStartedAt = System.DateTime.Parse("2024-09-08T05:59:33.876Z"), + LocalStartedAt = System.DateTime.Parse("2024-01-24T01:13:51.002Z"), SpeakeasyApiKeyName = "", SpeakeasyVersion = "", - Success = false, + Success = true, WorkspaceId = "", }, }, - WorkspaceId = "", }; var res = await sdk.Events.PostAsync(req); @@ -202,13 +207,14 @@ using SpeakeasySDK; using SpeakeasySDK.Models.Operations; using SpeakeasySDK.Models.Shared; -var sdk = new SDK(security: new Security() { - APIKey = "", -}); +var sdk = new SDK( + workspaceId: "", + security: new Security() { + APIKey = "", + } +); -SearchWorkspaceEventsRequest req = new SearchWorkspaceEventsRequest() { - WorkspaceId = "", -}; +SearchWorkspaceEventsRequest req = new SearchWorkspaceEventsRequest() {}; var res = await sdk.Events.SearchAsync(req); diff --git a/docs/sdks/github/README.md b/docs/sdks/github/README.md index 44955281..5cb05507 100644 --- a/docs/sdks/github/README.md +++ b/docs/sdks/github/README.md @@ -196,7 +196,7 @@ GithubConfigureMintlifyRepoRequest req = new GithubConfigureMintlifyRepoRequest( Input = "", Org = "", Overlays = new List() { - "", + "", }, Repo = "", }; @@ -356,7 +356,7 @@ var sdk = new SDK(security: new Security() { APIKey = "", }); -LinkGithubAccessRequest req = new LinkGithubAccessRequest() {}; +LinkGithubAccessRequest req = ; var res = await sdk.Github.LinkGithubAsync(req); diff --git a/docs/sdks/organizations/README.md b/docs/sdks/organizations/README.md index d5394d19..0717f8e4 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 +* [CreateBillingAddOns](#createbillingaddons) - Create billing add ons * [CreateFreeTrial](#createfreetrial) - Create a free trial for an organization +* [DeleteBillingAddOn](#deletebillingaddon) - Delete billing add ons * [Get](#get) - Get organization * [GetAll](#getall) - Get organizations for a user +* [GetBillingAddOns](#getbillingaddons) - Get billing add ons * [GetUsage](#getusage) - Get billing usage summary for a particular organization ## Create @@ -30,13 +33,13 @@ var sdk = new SDK(security: new Security() { Organization req = new Organization() { AccountType = AccountType.ScaleUp, - CreatedAt = System.DateTime.Parse("2024-11-30T17:06:07.804Z"), + CreatedAt = System.DateTime.Parse("2025-10-26T09:05:00.560Z"), Id = "", Name = "", Slug = "", SsoActivated = false, TelemetryDisabled = false, - UpdatedAt = System.DateTime.Parse("2024-04-02T12:48:32.253Z"), + UpdatedAt = System.DateTime.Parse("2023-12-23T08:00:51.380Z"), }; var res = await sdk.Organizations.CreateAsync(req); @@ -61,6 +64,49 @@ var res = await sdk.Organizations.CreateAsync(req); | SpeakeasySDK.Models.Errors.Error | 4XX | application/json | | SpeakeasySDK.Models.Errors.SDKException | 5XX | \*/\* | +## CreateBillingAddOns + +Create billing add ons + +### Example Usage + +```csharp +using SpeakeasySDK; +using SpeakeasySDK.Models.Shared; +using System.Collections.Generic; + +var sdk = new SDK(security: new Security() { + APIKey = "", +}); + +OrganizationBillingAddOnRequest req = new OrganizationBillingAddOnRequest() { + AddOns = new List() { + BillingAddOn.CustomCodeRegions, + }, +}; + +var res = await sdk.Organizations.CreateBillingAddOnsAsync(req); + +// handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `request` | [OrganizationBillingAddOnRequest](../../Models/Shared/OrganizationBillingAddOnRequest.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[CreateBillingAddOnsResponse](../../Models/Operations/CreateBillingAddOnsResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------------- | --------------------------------------- | --------------------------------------- | +| SpeakeasySDK.Models.Errors.Error | 5XX | application/json | +| SpeakeasySDK.Models.Errors.SDKException | 4XX | \*/\* | + ## CreateFreeTrial Creates a free trial for an organization @@ -91,6 +137,47 @@ var res = await sdk.Organizations.CreateFreeTrialAsync(); | SpeakeasySDK.Models.Errors.Error | 4XX | application/json | | SpeakeasySDK.Models.Errors.SDKException | 5XX | \*/\* | +## DeleteBillingAddOn + +Delete billing add ons + +### Example Usage + +```csharp +using SpeakeasySDK; +using SpeakeasySDK.Models.Operations; +using SpeakeasySDK.Models.Shared; + +var sdk = new SDK(security: new Security() { + APIKey = "", +}); + +DeleteBillingAddOnRequest req = new DeleteBillingAddOnRequest() { + AddOn = BillingAddOn.SDKTesting, +}; + +var res = await sdk.Organizations.DeleteBillingAddOnAsync(req); + +// handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | +| `request` | [DeleteBillingAddOnRequest](../../Models/Operations/DeleteBillingAddOnRequest.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[DeleteBillingAddOnResponse](../../Models/Operations/DeleteBillingAddOnResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------------- | --------------------------------------- | --------------------------------------- | +| SpeakeasySDK.Models.Errors.Error | 5XX | application/json | +| SpeakeasySDK.Models.Errors.SDKException | 4XX | \*/\* | + ## Get Get information about a particular organization. @@ -162,6 +249,36 @@ var res = await sdk.Organizations.GetAllAsync(); | SpeakeasySDK.Models.Errors.Error | 4XX | application/json | | SpeakeasySDK.Models.Errors.SDKException | 5XX | \*/\* | +## GetBillingAddOns + +Get billing add ons + +### Example Usage + +```csharp +using SpeakeasySDK; +using SpeakeasySDK.Models.Shared; + +var sdk = new SDK(security: new Security() { + APIKey = "", +}); + +var res = await sdk.Organizations.GetBillingAddOnsAsync(); + +// handle response +``` + +### Response + +**[GetBillingAddOnsResponse](../../Models/Operations/GetBillingAddOnsResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------------- | --------------------------------------- | --------------------------------------- | +| SpeakeasySDK.Models.Errors.Error | 5XX | application/json | +| SpeakeasySDK.Models.Errors.SDKException | 4XX | \*/\* | + ## GetUsage Returns a billing usage summary by target languages for a particular organization diff --git a/docs/sdks/publishingtokens/README.md b/docs/sdks/publishingtokens/README.md new file mode 100644 index 00000000..534f3dae --- /dev/null +++ b/docs/sdks/publishingtokens/README.md @@ -0,0 +1,288 @@ +# PublishingTokens +(*PublishingTokens*) + +## 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 +* [ResolveMetadata](#resolvemetadata) - Get metadata about the token +* [ResolveTarget](#resolvetarget) - 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 + +```csharp +using SpeakeasySDK; +using SpeakeasySDK.Models.Operations; +using SpeakeasySDK.Models.Shared; + +var sdk = new SDK(security: new Security() { + APIKey = "", +}); + +CreatePublishingTokenRequestBody req = ; + +var res = await sdk.PublishingTokens.CreateAsync(req); + +// handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `request` | [CreatePublishingTokenRequestBody](../../Models/Operations/CreatePublishingTokenRequestBody.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[CreatePublishingTokenResponse](../../Models/Operations/CreatePublishingTokenResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------------- | --------------------------------------- | --------------------------------------- | +| SpeakeasySDK.Models.Errors.Error | 4XX | application/json | +| SpeakeasySDK.Models.Errors.SDKException | 5XX | \*/\* | + +## Delete + +Delete a particular publishing token. + +### Example Usage + +```csharp +using SpeakeasySDK; +using SpeakeasySDK.Models.Operations; +using SpeakeasySDK.Models.Shared; + +var sdk = new SDK(security: new Security() { + APIKey = "", +}); + +DeletePublishingTokenRequest req = new DeletePublishingTokenRequest() { + TokenID = "", +}; + +var res = await sdk.PublishingTokens.DeleteAsync(req); + +// handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | +| `request` | [DeletePublishingTokenRequest](../../Models/Operations/DeletePublishingTokenRequest.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[DeletePublishingTokenResponse](../../Models/Operations/DeletePublishingTokenResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------------- | --------------------------------------- | --------------------------------------- | +| SpeakeasySDK.Models.Errors.Error | 4XX | application/json | +| SpeakeasySDK.Models.Errors.SDKException | 5XX | \*/\* | + +## Get + +Get information about a particular publishing token. + +### Example Usage + +```csharp +using SpeakeasySDK; +using SpeakeasySDK.Models.Operations; +using SpeakeasySDK.Models.Shared; + +var sdk = new SDK(security: new Security() { + APIKey = "", +}); + +GetPublishingTokenByIDRequest req = new GetPublishingTokenByIDRequest() { + TokenID = "", +}; + +var res = await sdk.PublishingTokens.GetAsync(req); + +// handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `request` | [GetPublishingTokenByIDRequest](../../Models/Operations/GetPublishingTokenByIDRequest.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[GetPublishingTokenByIDResponse](../../Models/Operations/GetPublishingTokenByIDResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------------- | --------------------------------------- | --------------------------------------- | +| SpeakeasySDK.Models.Errors.Error | 4XX | application/json | +| SpeakeasySDK.Models.Errors.SDKException | 5XX | \*/\* | + +## List + +Returns a publishing token for the current workspace + +### Example Usage + +```csharp +using SpeakeasySDK; +using SpeakeasySDK.Models.Shared; + +var sdk = new SDK(security: new Security() { + APIKey = "", +}); + +var res = await sdk.PublishingTokens.ListAsync(); + +// handle response +``` + +### Response + +**[GetPublishingTokenResponse](../../Models/Operations/GetPublishingTokenResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------------- | --------------------------------------- | --------------------------------------- | +| SpeakeasySDK.Models.Errors.Error | 4XX | application/json | +| SpeakeasySDK.Models.Errors.SDKException | 5XX | \*/\* | + +## ResolveMetadata + +Get information about a particular publishing token. + +### Example Usage + +```csharp +using SpeakeasySDK; +using SpeakeasySDK.Models.Operations; +using SpeakeasySDK.Models.Shared; + +var sdk = new SDK(security: new Security() { + APIKey = "", +}); + +GetPublishingTokenPublicMetadataRequest req = new GetPublishingTokenPublicMetadataRequest() { + TokenID = "", +}; + +var res = await sdk.PublishingTokens.ResolveMetadataAsync(req); + +// handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | +| `request` | [GetPublishingTokenPublicMetadataRequest](../../Models/Operations/GetPublishingTokenPublicMetadataRequest.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[GetPublishingTokenPublicMetadataResponse](../../Models/Operations/GetPublishingTokenPublicMetadataResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------------- | --------------------------------------- | --------------------------------------- | +| SpeakeasySDK.Models.Errors.Error | 4XX | application/json | +| SpeakeasySDK.Models.Errors.SDKException | 5XX | \*/\* | + +## ResolveTarget + +Get information about a particular publishing token target. + +### Example Usage + +```csharp +using SpeakeasySDK; +using SpeakeasySDK.Models.Operations; +using SpeakeasySDK.Models.Shared; + +var sdk = new SDK(security: new Security() { + APIKey = "", +}); + +GetPublishingTokenTargetByIDRequest req = new GetPublishingTokenTargetByIDRequest() { + TokenID = "", +}; + +var res = await sdk.PublishingTokens.ResolveTargetAsync(req); + +// handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | +| `request` | [GetPublishingTokenTargetByIDRequest](../../Models/Operations/GetPublishingTokenTargetByIDRequest.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[GetPublishingTokenTargetByIDResponse](../../Models/Operations/GetPublishingTokenTargetByIDResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------------- | --------------------------------------- | --------------------------------------- | +| SpeakeasySDK.Models.Errors.Error | 4XX | application/json | +| SpeakeasySDK.Models.Errors.SDKException | 5XX | \*/\* | + +## Update + +Updates the validity period of a particular publishing token. + +### Example Usage + +```csharp +using SpeakeasySDK; +using SpeakeasySDK.Models.Operations; +using SpeakeasySDK.Models.Shared; + +var sdk = new SDK(security: new Security() { + APIKey = "", +}); + +UpdatePublishingTokenExpirationRequest req = new UpdatePublishingTokenExpirationRequest() { + TokenID = "", +}; + +var res = await sdk.PublishingTokens.UpdateAsync(req); + +// handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | +| `request` | [UpdatePublishingTokenExpirationRequest](../../Models/Operations/UpdatePublishingTokenExpirationRequest.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[UpdatePublishingTokenExpirationResponse](../../Models/Operations/UpdatePublishingTokenExpirationResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------------- | --------------------------------------- | --------------------------------------- | +| SpeakeasySDK.Models.Errors.Error | 4XX | application/json | +| SpeakeasySDK.Models.Errors.SDKException | 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/reports/README.md b/docs/sdks/reports/README.md index 8100b46c..10970318 100644 --- a/docs/sdks/reports/README.md +++ b/docs/sdks/reports/README.md @@ -101,7 +101,7 @@ Upload a report. using SpeakeasySDK; using SpeakeasySDK.Models.Operations; using SpeakeasySDK.Models.Shared; -using System; +using System.IO; var sdk = new SDK(security: new Security() { APIKey = "", @@ -110,7 +110,7 @@ var sdk = new SDK(security: new Security() { UploadReportRequestBody req = new UploadReportRequestBody() { Data = new Report() {}, File = new File() { - Content = System.Text.Encoding.UTF8.GetBytes("0xA2Ca85EFA5"), + Content = File.ReadAllBytes("example.file"), FileName = "example.file", }, }; diff --git a/docs/sdks/schemastore/README.md b/docs/sdks/schemastore/README.md new file mode 100644 index 00000000..0b8c1b7f --- /dev/null +++ b/docs/sdks/schemastore/README.md @@ -0,0 +1,92 @@ +# SchemaStore +(*SchemaStore*) + +## Overview + +### Available Operations + +* [CreateSchemaStoreItem](#createschemastoreitem) - Create a schema in the schema store +* [GetSchemaStoreItem](#getschemastoreitem) - Get a OAS schema from the schema store + +## CreateSchemaStoreItem + +Create a schema in the schema store + +### Example Usage + +```csharp +using SpeakeasySDK; +using SpeakeasySDK.Models.Operations; +using SpeakeasySDK.Models.Shared; + +var sdk = new SDK(security: new Security() { + APIKey = "", +}); + +CreateSchemaStoreItemRequestBody req = new CreateSchemaStoreItemRequestBody() { + Format = Format.Yaml, + PackageName = "", + SDKClassname = "", + Spec = "", +}; + +var res = await sdk.SchemaStore.CreateSchemaStoreItemAsync(req); + +// handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `request` | [CreateSchemaStoreItemRequestBody](../../Models/Operations/CreateSchemaStoreItemRequestBody.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[CreateSchemaStoreItemResponse](../../Models/Operations/CreateSchemaStoreItemResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------------- | --------------------------------------- | --------------------------------------- | +| SpeakeasySDK.Models.Errors.Error | 4XX | application/json | +| SpeakeasySDK.Models.Errors.SDKException | 5XX | \*/\* | + +## GetSchemaStoreItem + +Get a OAS schema from the schema store + +### Example Usage + +```csharp +using SpeakeasySDK; +using SpeakeasySDK.Models.Operations; +using SpeakeasySDK.Models.Shared; + +var sdk = new SDK(security: new Security() { + APIKey = "", +}); + +GetSchemaStoreItemRequestBody req = ; + +var res = await sdk.SchemaStore.GetSchemaStoreItemAsync(req); + +// handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `request` | [GetSchemaStoreItemRequestBody](../../Models/Operations/GetSchemaStoreItemRequestBody.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[GetSchemaStoreItemResponse](../../Models/Operations/GetSchemaStoreItemResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------------- | --------------------------------------- | --------------------------------------- | +| SpeakeasySDK.Models.Errors.Error | 4XX | application/json | +| SpeakeasySDK.Models.Errors.SDKException | 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/shorturls/README.md b/docs/sdks/shorturls/README.md index 5ae572ca..6cd6b98d 100644 --- a/docs/sdks/shorturls/README.md +++ b/docs/sdks/shorturls/README.md @@ -25,7 +25,7 @@ var sdk = new SDK(security: new Security() { }); CreateRequestBody req = new CreateRequestBody() { - Url = "https://probable-heating.com/", + Url = "https://exalted-heroine.org/", }; var res = await sdk.ShortURLs.CreateAsync(req); diff --git a/docs/sdks/suggest/README.md b/docs/sdks/suggest/README.md index 78a3731c..fbd5e08d 100644 --- a/docs/sdks/suggest/README.md +++ b/docs/sdks/suggest/README.md @@ -34,14 +34,14 @@ SuggestRequest req = new SuggestRequest() { new Diagnostic() { Message = "", Path = new List() { - "/rescue", + "/usr/src", }, Type = "", }, }, OasSummary = new OASSummary() { Info = new OASInfo() { - Description = "kielbasa psst stitcher cannon devoted blindly apropos low", + Description = "prioritize bell vainly", License = new License() {}, Summary = "", Title = "", @@ -49,12 +49,13 @@ SuggestRequest req = new SuggestRequest() { }, Operations = new List() { new OASOperation() { - Description = "via apparatus gray whether opposite what", + Description = "though since instead accurate safe unnaturally charming", Method = "", OperationId = "", - Path = "/sys", + Path = "/usr/local/bin", Tags = new List() { - "", + "", + "", }, }, }, @@ -102,7 +103,7 @@ var sdk = new SDK(security: new Security() { SuggestItemsRequestBody req = new SuggestItemsRequestBody() { Items = new List() { - "", + "", }, Prompt = "", }; @@ -138,7 +139,7 @@ Get suggestions from an LLM model for improving an OpenAPI document. using SpeakeasySDK; using SpeakeasySDK.Models.Operations; using SpeakeasySDK.Models.Shared; -using System; +using System.IO; var sdk = new SDK(security: new Security() { APIKey = "", @@ -147,7 +148,7 @@ var sdk = new SDK(security: new Security() { SuggestOpenAPIRequest req = new SuggestOpenAPIRequest() { RequestBody = new SuggestOpenAPIRequestBody() { Schema = new Schema() { - Content = System.Text.Encoding.UTF8.GetBytes("0x0beEcB7cF6"), + Content = File.ReadAllBytes("example.file"), FileName = "example.file", }, }, diff --git a/docs/sdks/workspaces/README.md b/docs/sdks/workspaces/README.md index fabb51c6..fc4051e3 100644 --- a/docs/sdks/workspaces/README.md +++ b/docs/sdks/workspaces/README.md @@ -39,13 +39,13 @@ var sdk = new SDK(security: new Security() { }); Workspace req = new Workspace() { - CreatedAt = System.DateTime.Parse("2024-06-17T07:14:55.338Z"), + CreatedAt = System.DateTime.Parse("2023-11-18T13:41:10.525Z"), Id = "", Name = "", OrganizationId = "", Slug = "", - UpdatedAt = System.DateTime.Parse("2024-11-30T17:06:07.804Z"), - Verified = false, + UpdatedAt = System.DateTime.Parse("2024-11-21T08:36:32.740Z"), + Verified = true, }; var res = await sdk.Workspaces.CreateAsync(req); @@ -82,20 +82,22 @@ using SpeakeasySDK.Models.Operations; using SpeakeasySDK.Models.Shared; using System; -var sdk = new SDK(security: new Security() { - APIKey = "", -}); +var sdk = new SDK( + workspaceId: "", + security: new Security() { + APIKey = "", + } +); CreateWorkspaceTokenRequest req = new CreateWorkspaceTokenRequest() { WorkspaceToken = new WorkspaceToken() { Alg = "", - CreatedAt = System.DateTime.Parse("2023-08-16T02:33:00.784Z"), + CreatedAt = System.DateTime.Parse("2024-10-04T10:23:04.522Z"), Id = "", Key = "", Name = "", WorkspaceId = "", }, - WorkspaceId = "", }; var res = await sdk.Workspaces.CreateTokenAsync(req); @@ -131,13 +133,15 @@ using SpeakeasySDK; using SpeakeasySDK.Models.Operations; using SpeakeasySDK.Models.Shared; -var sdk = new SDK(security: new Security() { - APIKey = "", -}); +var sdk = new SDK( + workspaceId: "", + security: new Security() { + APIKey = "", + } +); DeleteWorkspaceTokenRequest req = new DeleteWorkspaceTokenRequest() { TokenID = "", - WorkspaceId = "", }; var res = await sdk.Workspaces.DeleteTokenAsync(req); @@ -233,13 +237,14 @@ using SpeakeasySDK; using SpeakeasySDK.Models.Operations; using SpeakeasySDK.Models.Shared; -var sdk = new SDK(security: new Security() { - APIKey = "", -}); +var sdk = new SDK( + workspaceId: "", + security: new Security() { + APIKey = "", + } +); -GetWorkspaceRequest req = new GetWorkspaceRequest() { - WorkspaceId = "", -}; +GetWorkspaceRequest req = new GetWorkspaceRequest() {}; var res = await sdk.Workspaces.GetByIDAsync(req); @@ -274,13 +279,14 @@ using SpeakeasySDK; using SpeakeasySDK.Models.Operations; using SpeakeasySDK.Models.Shared; -var sdk = new SDK(security: new Security() { - APIKey = "", -}); +var sdk = new SDK( + workspaceId: "", + security: new Security() { + APIKey = "", + } +); -GetWorkspaceFeatureFlagsRequest req = new GetWorkspaceFeatureFlagsRequest() { - WorkspaceId = "", -}; +GetWorkspaceFeatureFlagsRequest req = new GetWorkspaceFeatureFlagsRequest() {}; var res = await sdk.Workspaces.GetFeatureFlagsAsync(req); @@ -315,13 +321,14 @@ using SpeakeasySDK; using SpeakeasySDK.Models.Operations; using SpeakeasySDK.Models.Shared; -var sdk = new SDK(security: new Security() { - APIKey = "", -}); +var sdk = new SDK( + workspaceId: "", + security: new Security() { + APIKey = "", + } +); -GetWorkspaceSettingsRequest req = new GetWorkspaceSettingsRequest() { - WorkspaceId = "", -}; +GetWorkspaceSettingsRequest req = new GetWorkspaceSettingsRequest() {}; var res = await sdk.Workspaces.GetSettingsAsync(req); @@ -356,13 +363,14 @@ using SpeakeasySDK; using SpeakeasySDK.Models.Operations; using SpeakeasySDK.Models.Shared; -var sdk = new SDK(security: new Security() { - APIKey = "", -}); +var sdk = new SDK( + workspaceId: "", + security: new Security() { + APIKey = "", + } +); -GetWorkspaceTeamRequest req = new GetWorkspaceTeamRequest() { - WorkspaceId = "", -}; +GetWorkspaceTeamRequest req = new GetWorkspaceTeamRequest() {}; var res = await sdk.Workspaces.GetTeamAsync(req); @@ -397,13 +405,14 @@ using SpeakeasySDK; using SpeakeasySDK.Models.Operations; using SpeakeasySDK.Models.Shared; -var sdk = new SDK(security: new Security() { - APIKey = "", -}); +var sdk = new SDK( + workspaceId: "", + security: new Security() { + APIKey = "", + } +); -GetWorkspaceTokensRequest req = new GetWorkspaceTokensRequest() { - WorkspaceId = "", -}; +GetWorkspaceTokensRequest req = new GetWorkspaceTokensRequest() {}; var res = await sdk.Workspaces.GetTokensAsync(req); @@ -438,13 +447,15 @@ using SpeakeasySDK; using SpeakeasySDK.Models.Operations; using SpeakeasySDK.Models.Shared; -var sdk = new SDK(security: new Security() { - APIKey = "", -}); +var sdk = new SDK( + workspaceId: "", + security: new Security() { + APIKey = "", + } +); GrantUserAccessToWorkspaceRequest req = new GrantUserAccessToWorkspaceRequest() { - Email = "Lucinda.Batz8@hotmail.com", - WorkspaceId = "", + Email = "Idella24@gmail.com", }; var res = await sdk.Workspaces.GrantAccessAsync(req); @@ -480,13 +491,15 @@ using SpeakeasySDK; using SpeakeasySDK.Models.Operations; using SpeakeasySDK.Models.Shared; -var sdk = new SDK(security: new Security() { - APIKey = "", -}); +var sdk = new SDK( + workspaceId: "", + security: new Security() { + APIKey = "", + } +); RevokeUserAccessToWorkspaceRequest req = new RevokeUserAccessToWorkspaceRequest() { UserId = "", - WorkspaceId = "", }; var res = await sdk.Workspaces.RevokeAccessAsync(req); @@ -527,9 +540,7 @@ var sdk = new SDK(security: new Security() { }); WorkspaceFeatureFlagRequest req = new WorkspaceFeatureFlagRequest() { - FeatureFlags = new List() { - WorkspaceFeatureFlag.SkipSchemaRegistry, - }, + FeatureFlags = new List() {}, }; var res = await sdk.Workspaces.SetFeatureFlagsAsync(req); @@ -566,21 +577,23 @@ using SpeakeasySDK.Models.Operations; using SpeakeasySDK.Models.Shared; using System; -var sdk = new SDK(security: new Security() { - APIKey = "", -}); +var sdk = new SDK( + workspaceId: "", + security: new Security() { + APIKey = "", + } +); UpdateWorkspaceDetailsRequest req = new UpdateWorkspaceDetailsRequest() { Workspace = new Workspace() { - CreatedAt = System.DateTime.Parse("2025-07-28T19:04:48.565Z"), + CreatedAt = System.DateTime.Parse("2023-08-02T22:30:24.264Z"), Id = "", Name = "", OrganizationId = "", Slug = "", - UpdatedAt = System.DateTime.Parse("2024-10-16T10:52:42.015Z"), - Verified = false, + UpdatedAt = System.DateTime.Parse("2025-01-24T03:53:13.581Z"), + Verified = true, }, - WorkspaceId = "", }; var res = await sdk.Workspaces.UpdateAsync(req); @@ -617,18 +630,20 @@ using SpeakeasySDK.Models.Operations; using SpeakeasySDK.Models.Shared; using System; -var sdk = new SDK(security: new Security() { - APIKey = "", -}); +var sdk = new SDK( + workspaceId: "", + security: new Security() { + APIKey = "", + } +); UpdateWorkspaceSettingsRequest req = new UpdateWorkspaceSettingsRequest() { WorkspaceSettings = new WorkspaceSettings() { - CreatedAt = System.DateTime.Parse("2023-07-05T11:43:28.305Z"), - UpdatedAt = System.DateTime.Parse("2024-05-14T05:39:21.874Z"), - WebhookUrl = "https://grown-pharmacopoeia.net", + CreatedAt = System.DateTime.Parse("2025-03-09T15:48:09.330Z"), + UpdatedAt = System.DateTime.Parse("2025-11-24T16:37:53.492Z"), + WebhookUrl = "https://wobbly-lid.org", WorkspaceId = "", }, - WorkspaceId = "", }; var res = await sdk.Workspaces.UpdateSettingsAsync(req); diff --git a/gen.yaml b/gen.yaml index 7d57f2ac..0d164996 100755 --- a/gen.yaml +++ b/gen.yaml @@ -3,17 +3,25 @@ generation: sdkClassName: SDK usageSnippets: optionalPropertyRendering: withExample + sdkInitStyle: constructor fixes: - nameResolutionDec2023: false + nameResolutionFeb2025: false parameterOrderingFeb2024: false requestResponseComponentNamesFeb2024: false + securityFeb2025: false + sharedErrorComponentsApr2025: false auth: oAuth2ClientCredentialsEnabled: false oAuth2PasswordEnabled: false + tests: + generateTests: true + generateNewTests: false + skipResponseBodyAssertions: false csharp: - version: 5.12.0 + version: 5.13.0 additionalDependencies: [] author: Speakeasy + baseErrorName: SDKError clientServerStatusCodesAsErrors: true defaultErrorName: SDKException disableNamespacePascalCasingApr2024: false diff --git a/src/SpeakeasySDK/Artifacts.cs b/src/SpeakeasySDK/Artifacts.cs index 0b8ea240..a8818e79 100644 --- a/src/SpeakeasySDK/Artifacts.cs +++ b/src/SpeakeasySDK/Artifacts.cs @@ -65,6 +65,11 @@ public interface IArtifacts /// Task PreflightAsync(PreflightRequest? request = null); + /// + /// Set whether a namespace is archived + /// + Task SetArchivedAsync(ArchiveNamespaceRequest request); + /// /// Set visibility of a namespace with an existing metadata entry /// @@ -78,19 +83,12 @@ public class Artifacts: IArtifacts { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "5.12.0"; - private const string _sdkGenVersion = "2.493.4"; + private const string _sdkVersion = "5.13.0"; + private const string _sdkGenVersion = "2.648.7"; private const string _openapiDocVersion = "0.4.0"; - private const string _userAgent = "speakeasy-sdk/csharp 5.12.0 2.493.4 0.4.0 SpeakeasySDK"; - private string _serverUrl = ""; - private ISpeakeasyHttpClient _client; - private Func? _securitySource; - public Artifacts(ISpeakeasyHttpClient client, Func? securitySource, string serverUrl, SDKConfig config) + public Artifacts(SDKConfig config) { - _client = client; - _securitySource = securitySource; - _serverUrl = serverUrl; SDKConfiguration = config; } @@ -101,7 +99,7 @@ public async Task CreateRemoteSourceAsync(RemoteSour var urlString = baseUrl + "/v1/artifacts/remote_sources"; var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); var serializedBody = RequestBodySerializer.Serialize(request, "Request", "json", false, true); if (serializedBody != null) @@ -109,19 +107,19 @@ public async Task CreateRemoteSourceAsync(RemoteSour httpRequest.Content = serializedBody; } - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("createRemoteSource", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "createRemoteSource", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -183,21 +181,21 @@ public async Task GetBlobAsync(GetBlobRequest request) var urlString = URLBuilder.Build(baseUrl, "/v1/oci/v2/{organization_slug}/{workspace_slug}/{namespace_name}/blobs/{digest}", request); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("getBlob", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getBlob", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -266,21 +264,21 @@ public async Task GetManifestAsync(GetManifestRequest reque var urlString = URLBuilder.Build(baseUrl, "/v1/oci/v2/{organization_slug}/{workspace_slug}/{namespace_name}/manifests/{revision_reference}", request); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("getManifest", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getManifest", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -351,21 +349,21 @@ public async Task GetManifestAsync(GetManifestRequest reque var urlString = baseUrl + "/v1/artifacts/namespaces"; var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("getNamespaces", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getNamespaces", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -435,21 +433,21 @@ public async Task GetManifestAsync(GetManifestRequest reque var urlString = URLBuilder.Build(baseUrl, "/v1/artifacts/namespaces/{namespace_name}/revisions", request); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("getRevisions", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getRevisions", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -519,21 +517,21 @@ public async Task GetManifestAsync(GetManifestRequest reque var urlString = URLBuilder.Build(baseUrl, "/v1/artifacts/namespaces/{namespace_name}/tags", request); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("getTags", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getTags", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -603,21 +601,21 @@ public async Task ListRemoteSourcesAsync(ListRemoteSo var urlString = URLBuilder.Build(baseUrl, "/v1/artifacts/remote_sources", request); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("listRemoteSources", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "listRemoteSources", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -687,7 +685,7 @@ public async Task PostTagsAsync(PostTagsRequest request) var urlString = URLBuilder.Build(baseUrl, "/v1/artifacts/namespaces/{namespace_name}/tags", request); var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); var serializedBody = RequestBodySerializer.Serialize(request, "AddTags", "json", false, true); if (serializedBody != null) @@ -695,19 +693,19 @@ public async Task PostTagsAsync(PostTagsRequest request) httpRequest.Content = serializedBody; } - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("postTags", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "postTags", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -770,7 +768,7 @@ public async Task PreflightAsync(PreflightRequest? request = var urlString = baseUrl + "/v1/artifacts/preflight"; var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); var serializedBody = RequestBodySerializer.Serialize(request, "Request", "json", false, true); if (serializedBody != null) @@ -778,19 +776,19 @@ public async Task PreflightAsync(PreflightRequest? request = httpRequest.Content = serializedBody; } - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("preflight", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "preflight", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -854,13 +852,95 @@ public async Task PreflightAsync(PreflightRequest? request = throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } + public async Task SetArchivedAsync(ArchiveNamespaceRequest request) + { + string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); + var urlString = URLBuilder.Build(baseUrl, "/v1/artifacts/namespaces/{namespace_name}/archive", request); + + var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); + + var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "json", false, true); + if (serializedBody != null) + { + httpRequest.Content = serializedBody; + } + + if (SDKConfiguration.SecuritySource != null) + { + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); + } + + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "archiveNamespace", new List { }, SDKConfiguration.SecuritySource); + + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + + HttpResponseMessage httpResponse; + try + { + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); + int _statusCode = (int)httpResponse.StatusCode; + + if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + } + } + catch (Exception error) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + else + { + throw; + } + } + + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + + var contentType = httpResponse.Content.Headers.ContentType?.MediaType; + int responseStatusCode = (int)httpResponse.StatusCode; + if(responseStatusCode >= 200 && responseStatusCode < 300) + { + return new ArchiveNamespaceResponse() + { + StatusCode = responseStatusCode, + ContentType = contentType, + RawResponse = httpResponse + }; + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + throw obj!; + } + + throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + + throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + public async Task SetVisibilityAsync(SetVisibilityRequest request) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); var urlString = URLBuilder.Build(baseUrl, "/v1/artifacts/namespaces/{namespace_name}/visibility", request); var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "json", false, true); if (serializedBody != null) @@ -868,19 +948,19 @@ public async Task SetVisibilityAsync(SetVisibilityRequest httpRequest.Content = serializedBody; } - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("setVisibility", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "setVisibility", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) diff --git a/src/SpeakeasySDK/Auth.cs b/src/SpeakeasySDK/Auth.cs index 493d69b9..4eccb2d8 100644 --- a/src/SpeakeasySDK/Auth.cs +++ b/src/SpeakeasySDK/Auth.cs @@ -60,19 +60,12 @@ public class Auth: IAuth { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "5.12.0"; - private const string _sdkGenVersion = "2.493.4"; + private const string _sdkVersion = "5.13.0"; + private const string _sdkGenVersion = "2.648.7"; private const string _openapiDocVersion = "0.4.0"; - private const string _userAgent = "speakeasy-sdk/csharp 5.12.0 2.493.4 0.4.0 SpeakeasySDK"; - private string _serverUrl = ""; - private ISpeakeasyHttpClient _client; - private Func? _securitySource; - public Auth(ISpeakeasyHttpClient client, Func? securitySource, string serverUrl, SDKConfig config) + public Auth(SDKConfig config) { - _client = client; - _securitySource = securitySource; - _serverUrl = serverUrl; SDKConfiguration = config; } @@ -82,14 +75,14 @@ public async Task GetAccessAsync(GetWorkspaceAccessR var urlString = URLBuilder.Build(baseUrl, "/v1/workspace/access", request); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("getWorkspaceAccess", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getWorkspaceAccess", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -124,8 +117,8 @@ public async Task GetAccessAsync(GetWorkspaceAccessR Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new SpeakeasySDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -178,7 +171,11 @@ public async Task GetAccessAsync(GetWorkspaceAccessR throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } @@ -198,16 +195,16 @@ public async Task GetAccessTokenAsync(GetAccessTokenRequ var urlString = URLBuilder.Build(baseUrl, "/v1/auth/access_token", request); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - var hookCtx = new HookContext("getAccessToken", null, null); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getAccessToken", new List { }, null); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -278,21 +275,21 @@ public async Task GetUserAsync() var urlString = baseUrl + "/v1/user"; var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("getUser", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getUser", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -363,21 +360,21 @@ public async Task ValidateApiKeyAsync() var urlString = baseUrl + "/v1/auth/validate"; var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("validateApiKey", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "validateApiKey", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) diff --git a/src/SpeakeasySDK/CodeSamples.cs b/src/SpeakeasySDK/CodeSamples.cs index c1027ec0..16704410 100644 --- a/src/SpeakeasySDK/CodeSamples.cs +++ b/src/SpeakeasySDK/CodeSamples.cs @@ -46,15 +46,6 @@ public interface ICodeSamples /// Task GenerateCodeSamplePreviewAsyncAsync(CodeSampleSchemaInput request); - /// - /// Retrieve usage snippets from document stored in the registry - /// - /// - /// Retrieve usage snippets from document stored in the registry. Supports filtering by language and operation ID. - /// - /// - Task GetAsync(GetCodeSamplesRequest request); - /// /// Poll for the result of an asynchronous Code Sample preview generation. /// @@ -72,19 +63,12 @@ public class CodeSamples: ICodeSamples { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "5.12.0"; - private const string _sdkGenVersion = "2.493.4"; + private const string _sdkVersion = "5.13.0"; + private const string _sdkGenVersion = "2.648.7"; private const string _openapiDocVersion = "0.4.0"; - private const string _userAgent = "speakeasy-sdk/csharp 5.12.0 2.493.4 0.4.0 SpeakeasySDK"; - private string _serverUrl = ""; - private ISpeakeasyHttpClient _client; - private Func? _securitySource; - public CodeSamples(ISpeakeasyHttpClient client, Func? securitySource, string serverUrl, SDKConfig config) + public CodeSamples(SDKConfig config) { - _client = client; - _securitySource = securitySource; - _serverUrl = serverUrl; SDKConfiguration = config; } @@ -95,7 +79,7 @@ public async Task GenerateCodeSamplePreviewAs var urlString = baseUrl + "/v1/code_sample/preview"; var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); var serializedBody = RequestBodySerializer.Serialize(request, "Request", "multipart", false, false); if (serializedBody != null) @@ -103,19 +87,19 @@ public async Task GenerateCodeSamplePreviewAs httpRequest.Content = serializedBody; } - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("generateCodeSamplePreview", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "generateCodeSamplePreview", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -144,34 +128,34 @@ public async Task GenerateCodeSamplePreviewAs var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; - if(responseStatusCode == 200) + if(responseStatusCode >= 200 && responseStatusCode < 300) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); var response = new GenerateCodeSamplePreviewResponse() { StatusCode = responseStatusCode, ContentType = contentType, RawResponse = httpResponse }; - response.TwoHundredApplicationJsonBytes = await httpResponse.Content.ReadAsByteArrayAsync(); + response.UsageSnippets = obj; return response; } - else if(Utilities.IsContentTypeMatch("application/x-yaml", contentType)) + + throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var response = new GenerateCodeSamplePreviewResponse() - { - StatusCode = responseStatusCode, - ContentType = contentType, - RawResponse = httpResponse - }; - response.TwoHundredApplicationXYamlBytes = await httpResponse.Content.ReadAsByteArrayAsync(); - return response; + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + throw obj!; } throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 500 && responseStatusCode < 600) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { @@ -192,7 +176,7 @@ public async Task GenerateCodeSamplePrev var urlString = baseUrl + "/v1/code_sample/preview/async"; var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); var serializedBody = RequestBodySerializer.Serialize(request, "Request", "multipart", false, false); if (serializedBody != null) @@ -200,19 +184,19 @@ public async Task GenerateCodeSamplePrev httpRequest.Content = serializedBody; } - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("generateCodeSamplePreviewAsync", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "generateCodeSamplePreviewAsync", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -258,7 +242,7 @@ public async Task GenerateCodeSamplePrev throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { @@ -268,77 +252,7 @@ public async Task GenerateCodeSamplePrev throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); - } - - public async Task GetAsync(GetCodeSamplesRequest request) - { - string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); - var urlString = URLBuilder.Build(baseUrl, "/v1/code_sample", request); - - var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); - - if (_securitySource != null) - { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); - } - - var hookCtx = new HookContext("getCodeSamples", null, _securitySource); - - httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); - - HttpResponseMessage httpResponse; - try - { - httpResponse = await _client.SendAsync(httpRequest); - int _statusCode = (int)httpResponse.StatusCode; - - if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) - { - var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); - if (_httpResponse != null) - { - httpResponse = _httpResponse; - } - } - } - catch (Exception error) - { - var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); - if (_httpResponse != null) - { - httpResponse = _httpResponse; - } - else - { - throw; - } - } - - httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); - - var contentType = httpResponse.Content.Headers.ContentType?.MediaType; - int responseStatusCode = (int)httpResponse.StatusCode; - if(responseStatusCode >= 200 && responseStatusCode < 300) - { - if(Utilities.IsContentTypeMatch("application/json", contentType)) - { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - var response = new GetCodeSamplesResponse() - { - StatusCode = responseStatusCode, - ContentType = contentType, - RawResponse = httpResponse - }; - response.UsageSnippets = obj; - return response; - } - - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); - } - else if(responseStatusCode >= 400 && responseStatusCode < 500) + else if(responseStatusCode >= 500 && responseStatusCode < 600) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { @@ -348,10 +262,6 @@ public async Task GetAsync(GetCodeSamplesRequest request throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - else if(responseStatusCode >= 500 && responseStatusCode < 600) - { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); - } throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } @@ -362,21 +272,21 @@ public async Task GetCodeSamplePreviewAsyncAs var urlString = URLBuilder.Build(baseUrl, "/v1/code_sample/preview/async/{jobID}", request); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("getCodeSamplePreviewAsync", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getCodeSamplePreviewAsync", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -405,51 +315,51 @@ public async Task GetCodeSamplePreviewAsyncAs var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; - if(responseStatusCode == 200) + if(responseStatusCode == 202) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); var response = new GetCodeSamplePreviewAsyncResponse() { StatusCode = responseStatusCode, ContentType = contentType, RawResponse = httpResponse }; - response.TwoHundredApplicationJsonBytes = await httpResponse.Content.ReadAsByteArrayAsync(); + response.Object = obj; return response; } - else if(Utilities.IsContentTypeMatch("application/x-yaml", contentType)) + + throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + else if(responseStatusCode >= 200 && responseStatusCode < 300) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) { + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); var response = new GetCodeSamplePreviewAsyncResponse() { StatusCode = responseStatusCode, ContentType = contentType, RawResponse = httpResponse }; - response.TwoHundredApplicationXYamlBytes = await httpResponse.Content.ReadAsByteArrayAsync(); + response.UsageSnippets = obj; return response; } throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - else if(responseStatusCode == 202) + else if(responseStatusCode >= 400 && responseStatusCode < 500) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - var response = new GetCodeSamplePreviewAsyncResponse() - { - StatusCode = responseStatusCode, - ContentType = contentType, - RawResponse = httpResponse - }; - response.TwoHundredAndTwoApplicationJsonObject = obj; - return response; + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + throw obj!; } throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 500 && responseStatusCode < 600) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { diff --git a/src/SpeakeasySDK/Events.cs b/src/SpeakeasySDK/Events.cs index ff9266b3..5001f0d9 100644 --- a/src/SpeakeasySDK/Events.cs +++ b/src/SpeakeasySDK/Events.cs @@ -65,19 +65,12 @@ public class Events: IEvents { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "5.12.0"; - private const string _sdkGenVersion = "2.493.4"; + private const string _sdkVersion = "5.13.0"; + private const string _sdkGenVersion = "2.648.7"; private const string _openapiDocVersion = "0.4.0"; - private const string _userAgent = "speakeasy-sdk/csharp 5.12.0 2.493.4 0.4.0 SpeakeasySDK"; - private string _serverUrl = ""; - private ISpeakeasyHttpClient _client; - private Func? _securitySource; - public Events(ISpeakeasyHttpClient client, Func? securitySource, string serverUrl, SDKConfig config) + public Events(SDKConfig config) { - _client = client; - _securitySource = securitySource; - _serverUrl = serverUrl; SDKConfiguration = config; } @@ -93,21 +86,21 @@ public async Task GetEventsByTargetAsync(Get var urlString = URLBuilder.Build(baseUrl, "/v1/workspace/{workspace_id}/events/targets/{target_id}/events", request); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("getWorkspaceEventsByTarget", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getWorkspaceEventsByTarget", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -177,21 +170,21 @@ public async Task GetTargetsAsync(GetWorkspaceTarge var urlString = URLBuilder.Build(baseUrl, "/v1/workspace/events/targets", request); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("getWorkspaceTargets", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getWorkspaceTargets", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -263,21 +256,21 @@ public async Task GetTargetsDeprecatedAsy var urlString = URLBuilder.Build(baseUrl, "/v1/workspace/{workspace_id}/events/targets", request); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("getWorkspaceTargetsDeprecated", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getWorkspaceTargetsDeprecated", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -353,7 +346,7 @@ public async Task PostAsync(PostWorkspaceEventsRequ var urlString = URLBuilder.Build(baseUrl, "/v1/workspace/{workspace_id}/events", request); var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "json", false, false); if (serializedBody != null) @@ -361,12 +354,12 @@ public async Task PostAsync(PostWorkspaceEventsRequ httpRequest.Content = serializedBody; } - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("postWorkspaceEvents", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "postWorkspaceEvents", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -401,8 +394,8 @@ public async Task PostAsync(PostWorkspaceEventsRequ Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new SpeakeasySDK.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -473,21 +466,21 @@ public async Task SearchAsync(SearchWorkspaceEven var urlString = URLBuilder.Build(baseUrl, "/v1/workspace/{workspace_id}/events", request); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("searchWorkspaceEvents", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "searchWorkspaceEvents", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) diff --git a/src/SpeakeasySDK/Github.cs b/src/SpeakeasySDK/Github.cs index 6fcd317f..e9565f4a 100644 --- a/src/SpeakeasySDK/Github.cs +++ b/src/SpeakeasySDK/Github.cs @@ -47,19 +47,12 @@ public class Github: IGithub { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "5.12.0"; - private const string _sdkGenVersion = "2.493.4"; + private const string _sdkVersion = "5.13.0"; + private const string _sdkGenVersion = "2.648.7"; private const string _openapiDocVersion = "0.4.0"; - private const string _userAgent = "speakeasy-sdk/csharp 5.12.0 2.493.4 0.4.0 SpeakeasySDK"; - private string _serverUrl = ""; - private ISpeakeasyHttpClient _client; - private Func? _securitySource; - public Github(ISpeakeasyHttpClient client, Func? securitySource, string serverUrl, SDKConfig config) + public Github(SDKConfig config) { - _client = client; - _securitySource = securitySource; - _serverUrl = serverUrl; SDKConfiguration = config; } @@ -69,21 +62,21 @@ public async Task CheckAccessAsync(CheckGithubAccessR var urlString = URLBuilder.Build(baseUrl, "/v1/github/check_access", request); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("checkGithubAccess", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "checkGithubAccess", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -145,21 +138,21 @@ public async Task CheckPublishingPRsAsync(Gith var urlString = URLBuilder.Build(baseUrl, "/v1/github/publishing_prs", request); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("githubCheckPublishingPRs", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "githubCheckPublishingPRs", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -229,21 +222,21 @@ public async Task CheckPublishingSecretsAs var urlString = URLBuilder.Build(baseUrl, "/v1/github/publishing_secrets", request); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("githubCheckPublishingSecrets", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "githubCheckPublishingSecrets", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -314,7 +307,7 @@ public async Task CheckPublishingSecretsAs var urlString = baseUrl + "/v1/github/configure_code_samples"; var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); var serializedBody = RequestBodySerializer.Serialize(request, "Request", "json", false, false); if (serializedBody != null) @@ -322,19 +315,19 @@ public async Task CheckPublishingSecretsAs httpRequest.Content = serializedBody; } - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("githubConfigureCodeSamples", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "githubConfigureCodeSamples", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -405,7 +398,7 @@ public async Task ConfigureMintlifyRepoAsyn var urlString = baseUrl + "/v1/github/configure_mintlify_repo"; var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); var serializedBody = RequestBodySerializer.Serialize(request, "Request", "json", false, false); if (serializedBody != null) @@ -413,19 +406,19 @@ public async Task ConfigureMintlifyRepoAsyn httpRequest.Content = serializedBody; } - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("githubConfigureMintlifyRepo", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "githubConfigureMintlifyRepo", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -488,7 +481,7 @@ public async Task ConfigureTargetAsync(GithubConf var urlString = baseUrl + "/v1/github/configure_target"; var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); var serializedBody = RequestBodySerializer.Serialize(request, "Request", "json", false, false); if (serializedBody != null) @@ -496,19 +489,19 @@ public async Task ConfigureTargetAsync(GithubConf httpRequest.Content = serializedBody; } - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("githubConfigureTarget", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "githubConfigureTarget", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -570,21 +563,21 @@ public async Task GetActionAsync(GetGitHubActionRequest var urlString = URLBuilder.Build(baseUrl, "/v1/github/action", request); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("getGitHubAction", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getGitHubAction", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -654,21 +647,21 @@ public async Task GetSetupAsync(GetGithubSetupState var urlString = URLBuilder.Build(baseUrl, "/v1/github/setup", request); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("getGithubSetupState", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getGithubSetupState", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -738,21 +731,21 @@ public async Task LinkGithubAsync(LinkGithubAccessRequ var urlString = URLBuilder.Build(baseUrl, "/v1/github/link", request); var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("linkGithubAccess", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "linkGithubAccess", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -815,7 +808,7 @@ public async Task StorePublishingSecretsAs var urlString = baseUrl + "/v1/github/publishing_secrets"; var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); var serializedBody = RequestBodySerializer.Serialize(request, "Request", "json", false, false); if (serializedBody != null) @@ -823,19 +816,19 @@ public async Task StorePublishingSecretsAs httpRequest.Content = serializedBody; } - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("githubStorePublishingSecrets", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "githubStorePublishingSecrets", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -898,7 +891,7 @@ public async Task TriggerActionAsync(GithubTriggerA var urlString = baseUrl + "/v1/github/trigger_action"; var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); var serializedBody = RequestBodySerializer.Serialize(request, "Request", "json", false, false); if (serializedBody != null) @@ -906,19 +899,19 @@ public async Task TriggerActionAsync(GithubTriggerA httpRequest.Content = serializedBody; } - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("githubTriggerAction", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "githubTriggerAction", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) diff --git a/src/SpeakeasySDK/Hooks/HookTypes.cs b/src/SpeakeasySDK/Hooks/HookTypes.cs index fca50b8f..55c2ab3e 100644 --- a/src/SpeakeasySDK/Hooks/HookTypes.cs +++ b/src/SpeakeasySDK/Hooks/HookTypes.cs @@ -17,34 +17,47 @@ namespace SpeakeasySDK.Hooks public class HookContext { + public SDKConfig SDKConfiguration { get; set; } + public string BaseURL { get; set; } = ""; public string OperationID { get; set; } public List? Oauth2Scopes { get; set; } public Func? SecuritySource { get; set; } - public HookContext(string operationID, List? oauth2Scopes, Func? securitySource) + public HookContext(SDKConfig config, string baseURL, string operationID, List? oauth2Scopes, Func? securitySource) { + SDKConfiguration = config; + BaseURL = baseURL; OperationID = operationID; Oauth2Scopes = oauth2Scopes; SecuritySource = securitySource; } + + public HookContext(HookContext hookCtx) + { + SDKConfiguration = hookCtx.SDKConfiguration; + BaseURL = hookCtx.BaseURL; + OperationID = hookCtx.OperationID; + Oauth2Scopes = hookCtx.Oauth2Scopes; + SecuritySource = hookCtx.SecuritySource; + } } public class BeforeRequestContext : HookContext { public BeforeRequestContext(HookContext hookCtx) - : base(hookCtx.OperationID, hookCtx.Oauth2Scopes, hookCtx.SecuritySource) { } + : base(hookCtx) { } } public class AfterSuccessContext : HookContext { public AfterSuccessContext(HookContext hookCtx) - : base(hookCtx.OperationID, hookCtx.Oauth2Scopes, hookCtx.SecuritySource) { } + : base(hookCtx) { } } public class AfterErrorContext : HookContext { public AfterErrorContext(HookContext hookCtx) - : base(hookCtx.OperationID, hookCtx.Oauth2Scopes, hookCtx.SecuritySource) { } + : base(hookCtx) { } } /// diff --git a/src/SpeakeasySDK/Hooks/SDKHooks.cs b/src/SpeakeasySDK/Hooks/SDKHooks.cs index 2a35fadc..d3013b31 100644 --- a/src/SpeakeasySDK/Hooks/SDKHooks.cs +++ b/src/SpeakeasySDK/Hooks/SDKHooks.cs @@ -52,7 +52,7 @@ public void RegisterAfterErrorHook(IAfterErrorHook hook) { this.afterErrorHooks.Add(hook); } - + public (string, ISpeakeasyHttpClient) SDKInit(string baseUrl, ISpeakeasyHttpClient client) { var urlAndClient = (baseUrl, client); @@ -68,7 +68,7 @@ public void RegisterAfterErrorHook(IAfterErrorHook hook) } return urlAndClient; } - + public async Task BeforeRequestAsync(BeforeRequestContext hookCtx, HttpRequestMessage request) { foreach (var hook in this.beforeRequestHooks) diff --git a/src/SpeakeasySDK/Models/Operations/ArchiveNamespaceRequest.cs b/src/SpeakeasySDK/Models/Operations/ArchiveNamespaceRequest.cs new file mode 100644 index 00000000..61dd3e0c --- /dev/null +++ b/src/SpeakeasySDK/Models/Operations/ArchiveNamespaceRequest.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace SpeakeasySDK.Models.Operations +{ + using SpeakeasySDK.Models.Operations; + using SpeakeasySDK.Utils; + + public class ArchiveNamespaceRequest + { + + /// + /// Archived status + /// + [SpeakeasyMetadata("request:mediaType=application/json")] + public ArchiveNamespaceRequestBody? RequestBody { get; set; } + + [SpeakeasyMetadata("pathParam:style=simple,explode=false,name=namespace_name")] + public string NamespaceName { get; set; } = default!; + } +} \ No newline at end of file diff --git a/src/SpeakeasySDK/Models/Operations/ArchiveNamespaceRequestBody.cs b/src/SpeakeasySDK/Models/Operations/ArchiveNamespaceRequestBody.cs new file mode 100644 index 00000000..582758b2 --- /dev/null +++ b/src/SpeakeasySDK/Models/Operations/ArchiveNamespaceRequestBody.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace SpeakeasySDK.Models.Operations +{ + using Newtonsoft.Json; + using SpeakeasySDK.Utils; + + /// + /// Archived status + /// + public class ArchiveNamespaceRequestBody + { + + [JsonProperty("archived")] + public bool? Archived { get; set; } = true; + } +} \ No newline at end of file diff --git a/src/SpeakeasySDK/Models/Operations/ArchiveNamespaceResponse.cs b/src/SpeakeasySDK/Models/Operations/ArchiveNamespaceResponse.cs new file mode 100644 index 00000000..1e2496ba --- /dev/null +++ b/src/SpeakeasySDK/Models/Operations/ArchiveNamespaceResponse.cs @@ -0,0 +1,34 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace SpeakeasySDK.Models.Operations +{ + using SpeakeasySDK.Utils; + using System; + using System.Net.Http; + + public class ArchiveNamespaceResponse + { + + /// + /// HTTP response content type for this operation + /// + public string? ContentType { get; set; } = default!; + + /// + /// HTTP response status code for this operation + /// + public int StatusCode { get; set; } = default!; + + /// + /// Raw HTTP response; suitable for custom response parsing + /// + public HttpResponseMessage RawResponse { get; set; } = default!; + } +} \ No newline at end of file diff --git a/src/SpeakeasySDK/Models/Operations/CreateBillingAddOnsResponse.cs b/src/SpeakeasySDK/Models/Operations/CreateBillingAddOnsResponse.cs new file mode 100644 index 00000000..f1fd6180 --- /dev/null +++ b/src/SpeakeasySDK/Models/Operations/CreateBillingAddOnsResponse.cs @@ -0,0 +1,40 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace SpeakeasySDK.Models.Operations +{ + using SpeakeasySDK.Models.Shared; + using SpeakeasySDK.Utils; + using System; + using System.Net.Http; + + public class CreateBillingAddOnsResponse + { + + /// + /// HTTP response content type for this operation + /// + public string? ContentType { get; set; } = default!; + + /// + /// Success + /// + public OrganizationBillingAddOnResponse? OrganizationBillingAddOnResponse { get; set; } + + /// + /// HTTP response status code for this operation + /// + public int StatusCode { get; set; } = default!; + + /// + /// Raw HTTP response; suitable for custom response parsing + /// + public HttpResponseMessage RawResponse { get; set; } = default!; + } +} \ No newline at end of file diff --git a/src/SpeakeasySDK/Models/Operations/CreatePublishingTokenRequestBody.cs b/src/SpeakeasySDK/Models/Operations/CreatePublishingTokenRequestBody.cs new file mode 100644 index 00000000..99c7baaa --- /dev/null +++ b/src/SpeakeasySDK/Models/Operations/CreatePublishingTokenRequestBody.cs @@ -0,0 +1,34 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace SpeakeasySDK.Models.Operations +{ + using Newtonsoft.Json; + using SpeakeasySDK.Utils; + using System; + + /// + /// The publishing token to create + /// + public class CreatePublishingTokenRequestBody + { + + [JsonProperty("target_id")] + public string TargetId { get; set; } = default!; + + [JsonProperty("target_resource")] + public string TargetResource { get; set; } = default!; + + [JsonProperty("token_name")] + public string TokenName { get; set; } = default!; + + [JsonProperty("valid_until")] + public DateTime ValidUntil { get; set; } = default!; + } +} \ No newline at end of file diff --git a/src/SpeakeasySDK/Models/Operations/CreatePublishingTokenResponse.cs b/src/SpeakeasySDK/Models/Operations/CreatePublishingTokenResponse.cs new file mode 100644 index 00000000..7d146282 --- /dev/null +++ b/src/SpeakeasySDK/Models/Operations/CreatePublishingTokenResponse.cs @@ -0,0 +1,40 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace SpeakeasySDK.Models.Operations +{ + using SpeakeasySDK.Models.Shared; + using SpeakeasySDK.Utils; + using System; + using System.Net.Http; + + public class CreatePublishingTokenResponse + { + + /// + /// HTTP response content type for this operation + /// + public string? ContentType { get; set; } = default!; + + /// + /// OK + /// + public PublishingToken? PublishingToken { get; set; } + + /// + /// HTTP response status code for this operation + /// + public int StatusCode { get; set; } = default!; + + /// + /// Raw HTTP response; suitable for custom response parsing + /// + public HttpResponseMessage RawResponse { get; set; } = default!; + } +} \ No newline at end of file diff --git a/src/SpeakeasySDK/Models/Operations/CreateSchemaStoreItemRequestBody.cs b/src/SpeakeasySDK/Models/Operations/CreateSchemaStoreItemRequestBody.cs new file mode 100644 index 00000000..4beb9ecd --- /dev/null +++ b/src/SpeakeasySDK/Models/Operations/CreateSchemaStoreItemRequestBody.cs @@ -0,0 +1,43 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace SpeakeasySDK.Models.Operations +{ + using Newtonsoft.Json; + using SpeakeasySDK.Models.Operations; + using SpeakeasySDK.Utils; + + public class CreateSchemaStoreItemRequestBody + { + + /// + /// The format of the OpenAPI specification. + /// + [JsonProperty("format")] + public Models.Operations.Format Format { get; set; } = default!; + + /// + /// The package name to use in code snippets / quickstart. + /// + [JsonProperty("packageName")] + public string PackageName { get; set; } = default!; + + /// + /// The classname of the SDK to use in code snippets / quickstart. + /// + [JsonProperty("sdkClassname")] + public string SDKClassname { get; set; } = default!; + + /// + /// The OpenAPI specification to store. + /// + [JsonProperty("spec")] + public string Spec { get; set; } = default!; + } +} \ No newline at end of file diff --git a/src/SpeakeasySDK/Models/Operations/CreateSchemaStoreItemResponse.cs b/src/SpeakeasySDK/Models/Operations/CreateSchemaStoreItemResponse.cs new file mode 100644 index 00000000..05343888 --- /dev/null +++ b/src/SpeakeasySDK/Models/Operations/CreateSchemaStoreItemResponse.cs @@ -0,0 +1,40 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace SpeakeasySDK.Models.Operations +{ + using SpeakeasySDK.Models.Shared; + using SpeakeasySDK.Utils; + using System; + using System.Net.Http; + + public class CreateSchemaStoreItemResponse + { + + /// + /// HTTP response content type for this operation + /// + public string? ContentType { get; set; } = default!; + + /// + /// OK + /// + public SchemaStoreItem? SchemaStoreItem { get; set; } + + /// + /// HTTP response status code for this operation + /// + public int StatusCode { get; set; } = default!; + + /// + /// Raw HTTP response; suitable for custom response parsing + /// + public HttpResponseMessage RawResponse { get; set; } = default!; + } +} \ No newline at end of file diff --git a/src/SpeakeasySDK/Models/Operations/GetCodeSamplesRequest.cs b/src/SpeakeasySDK/Models/Operations/DeleteBillingAddOnRequest.cs similarity index 50% rename from src/SpeakeasySDK/Models/Operations/GetCodeSamplesRequest.cs rename to src/SpeakeasySDK/Models/Operations/DeleteBillingAddOnRequest.cs index c709971c..ac5ccbb6 100644 --- a/src/SpeakeasySDK/Models/Operations/GetCodeSamplesRequest.cs +++ b/src/SpeakeasySDK/Models/Operations/DeleteBillingAddOnRequest.cs @@ -9,22 +9,21 @@ #nullable enable namespace SpeakeasySDK.Models.Operations { + using Newtonsoft.Json; + using SpeakeasySDK.Models.Shared; using SpeakeasySDK.Utils; + using System; + using System.Collections.Concurrent; using System.Collections.Generic; + using System.Linq; - public class GetCodeSamplesRequest + public class DeleteBillingAddOnRequest { /// - /// The registry URL from which to retrieve the snippets. E.g. https://spec.speakeasy.com/org/ws/my-source + /// The specific add-on to delete. /// - [SpeakeasyMetadata("queryParam:style=form,explode=true,name=registry_url")] - public string RegistryUrl { get; set; } = default!; - - [SpeakeasyMetadata("queryParam:style=form,explode=true,name=languages")] - public List? Languages { get; set; } - - [SpeakeasyMetadata("queryParam:style=form,explode=true,name=operation_ids")] - public List? OperationIds { get; set; } + [SpeakeasyMetadata("pathParam:style=simple,explode=false,name=add_on")] + public BillingAddOn AddOn { get; set; } = default!; } } \ No newline at end of file diff --git a/src/SpeakeasySDK/Models/Operations/DeleteBillingAddOnResponse.cs b/src/SpeakeasySDK/Models/Operations/DeleteBillingAddOnResponse.cs new file mode 100644 index 00000000..d70442f6 --- /dev/null +++ b/src/SpeakeasySDK/Models/Operations/DeleteBillingAddOnResponse.cs @@ -0,0 +1,34 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace SpeakeasySDK.Models.Operations +{ + using SpeakeasySDK.Utils; + using System; + using System.Net.Http; + + public class DeleteBillingAddOnResponse + { + + /// + /// HTTP response content type for this operation + /// + public string? ContentType { get; set; } = default!; + + /// + /// HTTP response status code for this operation + /// + public int StatusCode { get; set; } = default!; + + /// + /// Raw HTTP response; suitable for custom response parsing + /// + public HttpResponseMessage RawResponse { get; set; } = default!; + } +} \ No newline at end of file diff --git a/src/SpeakeasySDK/Models/Operations/DeletePublishingTokenRequest.cs b/src/SpeakeasySDK/Models/Operations/DeletePublishingTokenRequest.cs new file mode 100644 index 00000000..daf42ebc --- /dev/null +++ b/src/SpeakeasySDK/Models/Operations/DeletePublishingTokenRequest.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace SpeakeasySDK.Models.Operations +{ + using SpeakeasySDK.Utils; + + public class DeletePublishingTokenRequest + { + + /// + /// Unique identifier of the publishing token. + /// + [SpeakeasyMetadata("pathParam:style=simple,explode=false,name=tokenID")] + public string TokenID { get; set; } = default!; + } +} \ No newline at end of file diff --git a/src/SpeakeasySDK/Models/Operations/DeletePublishingTokenResponse.cs b/src/SpeakeasySDK/Models/Operations/DeletePublishingTokenResponse.cs new file mode 100644 index 00000000..ea5d65f7 --- /dev/null +++ b/src/SpeakeasySDK/Models/Operations/DeletePublishingTokenResponse.cs @@ -0,0 +1,34 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace SpeakeasySDK.Models.Operations +{ + using SpeakeasySDK.Utils; + using System; + using System.Net.Http; + + public class DeletePublishingTokenResponse + { + + /// + /// HTTP response content type for this operation + /// + public string? ContentType { get; set; } = default!; + + /// + /// HTTP response status code for this operation + /// + public int StatusCode { get; set; } = default!; + + /// + /// Raw HTTP response; suitable for custom response parsing + /// + public HttpResponseMessage RawResponse { get; set; } = default!; + } +} \ No newline at end of file diff --git a/src/SpeakeasySDK/Models/Operations/Format.cs b/src/SpeakeasySDK/Models/Operations/Format.cs new file mode 100644 index 00000000..c265f104 --- /dev/null +++ b/src/SpeakeasySDK/Models/Operations/Format.cs @@ -0,0 +1,60 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace SpeakeasySDK.Models.Operations +{ + using Newtonsoft.Json; + using SpeakeasySDK.Utils; + using System; + + /// + /// The format of the OpenAPI specification. + /// + public enum Format + { + [JsonProperty("json")] + Json, + [JsonProperty("yaml")] + Yaml, + } + + public static class FormatExtension + { + public static string Value(this Format value) + { + return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString(); + } + + public static Format ToEnum(this string value) + { + foreach(var field in typeof(Format).GetFields()) + { + var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false); + if (attributes.Length == 0) + { + continue; + } + + var attribute = attributes[0] as JsonPropertyAttribute; + if (attribute != null && attribute.PropertyName == value) + { + var enumVal = field.GetValue(null); + + if (enumVal is Format) + { + return (Format)enumVal; + } + } + } + + throw new Exception($"Unknown value {value} for enum Format"); + } + } + +} \ No newline at end of file diff --git a/src/SpeakeasySDK/Models/Operations/GenerateCodeSamplePreviewResponse.cs b/src/SpeakeasySDK/Models/Operations/GenerateCodeSamplePreviewResponse.cs index 8bcb0164..10f4b041 100644 --- a/src/SpeakeasySDK/Models/Operations/GenerateCodeSamplePreviewResponse.cs +++ b/src/SpeakeasySDK/Models/Operations/GenerateCodeSamplePreviewResponse.cs @@ -9,6 +9,7 @@ #nullable enable namespace SpeakeasySDK.Models.Operations { + using SpeakeasySDK.Models.Shared; using SpeakeasySDK.Utils; using System; using System.Net.Http; @@ -16,16 +17,6 @@ namespace SpeakeasySDK.Models.Operations public class GenerateCodeSamplePreviewResponse { - /// - /// Successfully returned codeSample overlay file - /// - public byte[]? TwoHundredApplicationJsonBytes { get; set; } - - /// - /// Successfully returned codeSample overlay file - /// - public byte[]? TwoHundredApplicationXYamlBytes { get; set; } - /// /// HTTP response content type for this operation /// @@ -40,5 +31,10 @@ public class GenerateCodeSamplePreviewResponse /// Raw HTTP response; suitable for custom response parsing /// public HttpResponseMessage RawResponse { get; set; } = default!; + + /// + /// OK + /// + public UsageSnippets? UsageSnippets { get; set; } } } \ No newline at end of file diff --git a/src/SpeakeasySDK/Models/Operations/GetBillingAddOnsResponse.cs b/src/SpeakeasySDK/Models/Operations/GetBillingAddOnsResponse.cs new file mode 100644 index 00000000..d96d895c --- /dev/null +++ b/src/SpeakeasySDK/Models/Operations/GetBillingAddOnsResponse.cs @@ -0,0 +1,40 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace SpeakeasySDK.Models.Operations +{ + using SpeakeasySDK.Models.Shared; + using SpeakeasySDK.Utils; + using System; + using System.Net.Http; + + public class GetBillingAddOnsResponse + { + + /// + /// HTTP response content type for this operation + /// + public string? ContentType { get; set; } = default!; + + /// + /// Success + /// + public OrganizationBillingAddOnResponse? OrganizationBillingAddOnResponse { get; set; } + + /// + /// HTTP response status code for this operation + /// + public int StatusCode { get; set; } = default!; + + /// + /// Raw HTTP response; suitable for custom response parsing + /// + public HttpResponseMessage RawResponse { get; set; } = default!; + } +} \ No newline at end of file diff --git a/src/SpeakeasySDK/Models/Operations/GetCodeSamplePreviewAsyncResponse.cs b/src/SpeakeasySDK/Models/Operations/GetCodeSamplePreviewAsyncResponse.cs index 26c1b3b6..f13ee3ce 100644 --- a/src/SpeakeasySDK/Models/Operations/GetCodeSamplePreviewAsyncResponse.cs +++ b/src/SpeakeasySDK/Models/Operations/GetCodeSamplePreviewAsyncResponse.cs @@ -10,6 +10,7 @@ namespace SpeakeasySDK.Models.Operations { using SpeakeasySDK.Models.Operations; + using SpeakeasySDK.Models.Shared; using SpeakeasySDK.Utils; using System; using System.Net.Http; @@ -17,21 +18,6 @@ namespace SpeakeasySDK.Models.Operations public class GetCodeSamplePreviewAsyncResponse { - /// - /// Successfully returned codeSample overlay file - /// - public byte[]? TwoHundredApplicationJsonBytes { get; set; } - - /// - /// Successfully returned codeSample overlay file - /// - public byte[]? TwoHundredApplicationXYamlBytes { get; set; } - - /// - /// Job is still in progress - /// - public GetCodeSamplePreviewAsyncResponseBody? TwoHundredAndTwoApplicationJsonObject { get; set; } - /// /// HTTP response content type for this operation /// @@ -46,5 +32,15 @@ public class GetCodeSamplePreviewAsyncResponse /// Raw HTTP response; suitable for custom response parsing /// public HttpResponseMessage RawResponse { get; set; } = default!; + + /// + /// OK + /// + public UsageSnippets? UsageSnippets { get; set; } + + /// + /// Job is still in progress + /// + public GetCodeSamplePreviewAsyncResponseBody? Object { get; set; } } } \ No newline at end of file diff --git a/src/SpeakeasySDK/Models/Operations/GetPublishingTokenByIDRequest.cs b/src/SpeakeasySDK/Models/Operations/GetPublishingTokenByIDRequest.cs new file mode 100644 index 00000000..744a7fc6 --- /dev/null +++ b/src/SpeakeasySDK/Models/Operations/GetPublishingTokenByIDRequest.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace SpeakeasySDK.Models.Operations +{ + using SpeakeasySDK.Utils; + + public class GetPublishingTokenByIDRequest + { + + /// + /// Unique identifier of the publishing token. + /// + [SpeakeasyMetadata("pathParam:style=simple,explode=false,name=tokenID")] + public string TokenID { get; set; } = default!; + } +} \ No newline at end of file diff --git a/src/SpeakeasySDK/Models/Operations/GetPublishingTokenByIDResponse.cs b/src/SpeakeasySDK/Models/Operations/GetPublishingTokenByIDResponse.cs new file mode 100644 index 00000000..9bb3af37 --- /dev/null +++ b/src/SpeakeasySDK/Models/Operations/GetPublishingTokenByIDResponse.cs @@ -0,0 +1,40 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace SpeakeasySDK.Models.Operations +{ + using SpeakeasySDK.Models.Shared; + using SpeakeasySDK.Utils; + using System; + using System.Net.Http; + + public class GetPublishingTokenByIDResponse + { + + /// + /// HTTP response content type for this operation + /// + public string? ContentType { get; set; } = default!; + + /// + /// OK + /// + public PublishingToken? PublishingToken { get; set; } + + /// + /// HTTP response status code for this operation + /// + public int StatusCode { get; set; } = default!; + + /// + /// Raw HTTP response; suitable for custom response parsing + /// + public HttpResponseMessage RawResponse { get; set; } = default!; + } +} \ No newline at end of file diff --git a/src/SpeakeasySDK/Models/Operations/GetPublishingTokenPublicMetadataRequest.cs b/src/SpeakeasySDK/Models/Operations/GetPublishingTokenPublicMetadataRequest.cs new file mode 100644 index 00000000..351b097b --- /dev/null +++ b/src/SpeakeasySDK/Models/Operations/GetPublishingTokenPublicMetadataRequest.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace SpeakeasySDK.Models.Operations +{ + using SpeakeasySDK.Utils; + + public class GetPublishingTokenPublicMetadataRequest + { + + /// + /// Unique identifier of the publishing token. + /// + [SpeakeasyMetadata("pathParam:style=simple,explode=false,name=tokenID")] + public string TokenID { get; set; } = default!; + } +} \ No newline at end of file diff --git a/src/SpeakeasySDK/Models/Operations/GetPublishingTokenPublicMetadataResponse.cs b/src/SpeakeasySDK/Models/Operations/GetPublishingTokenPublicMetadataResponse.cs new file mode 100644 index 00000000..fb9246d9 --- /dev/null +++ b/src/SpeakeasySDK/Models/Operations/GetPublishingTokenPublicMetadataResponse.cs @@ -0,0 +1,40 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace SpeakeasySDK.Models.Operations +{ + using SpeakeasySDK.Models.Operations; + using SpeakeasySDK.Utils; + using System; + using System.Net.Http; + + public class GetPublishingTokenPublicMetadataResponse + { + + /// + /// HTTP response content type for this operation + /// + public string? ContentType { get; set; } = default!; + + /// + /// HTTP response status code for this operation + /// + public int StatusCode { get; set; } = default!; + + /// + /// Raw HTTP response; suitable for custom response parsing + /// + public HttpResponseMessage RawResponse { get; set; } = default!; + + /// + /// OK + /// + public GetPublishingTokenPublicMetadataResponseBody? Object { get; set; } + } +} \ No newline at end of file diff --git a/src/SpeakeasySDK/Models/Operations/GetPublishingTokenPublicMetadataResponseBody.cs b/src/SpeakeasySDK/Models/Operations/GetPublishingTokenPublicMetadataResponseBody.cs new file mode 100644 index 00000000..7afd3567 --- /dev/null +++ b/src/SpeakeasySDK/Models/Operations/GetPublishingTokenPublicMetadataResponseBody.cs @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace SpeakeasySDK.Models.Operations +{ + using Newtonsoft.Json; + using SpeakeasySDK.Utils; + using System; + + /// + /// OK + /// + public class GetPublishingTokenPublicMetadataResponseBody + { + + [JsonProperty("organization_id")] + public string? OrganizationId { get; set; } + + [JsonProperty("target_id")] + public string? TargetId { get; set; } + + [JsonProperty("target_resource")] + public string? TargetResource { get; set; } + + [JsonProperty("valid_until")] + public DateTime? ValidUntil { get; set; } + + [JsonProperty("workspace_id")] + public string? WorkspaceId { get; set; } + } +} \ No newline at end of file diff --git a/src/SpeakeasySDK/Models/Operations/GetPublishingTokenResponse.cs b/src/SpeakeasySDK/Models/Operations/GetPublishingTokenResponse.cs new file mode 100644 index 00000000..1bd46671 --- /dev/null +++ b/src/SpeakeasySDK/Models/Operations/GetPublishingTokenResponse.cs @@ -0,0 +1,41 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace SpeakeasySDK.Models.Operations +{ + using SpeakeasySDK.Models.Shared; + using SpeakeasySDK.Utils; + using System; + using System.Collections.Generic; + using System.Net.Http; + + public class GetPublishingTokenResponse + { + + /// + /// HTTP response content type for this operation + /// + public string? ContentType { get; set; } = default!; + + /// + /// HTTP response status code for this operation + /// + public int StatusCode { get; set; } = default!; + + /// + /// Raw HTTP response; suitable for custom response parsing + /// + public HttpResponseMessage RawResponse { get; set; } = default!; + + /// + /// OK + /// + public List? Classes { get; set; } + } +} \ No newline at end of file diff --git a/src/SpeakeasySDK/Models/Operations/GetPublishingTokenTargetByIDRequest.cs b/src/SpeakeasySDK/Models/Operations/GetPublishingTokenTargetByIDRequest.cs new file mode 100644 index 00000000..0732f3c6 --- /dev/null +++ b/src/SpeakeasySDK/Models/Operations/GetPublishingTokenTargetByIDRequest.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace SpeakeasySDK.Models.Operations +{ + using SpeakeasySDK.Utils; + + public class GetPublishingTokenTargetByIDRequest + { + + /// + /// Unique identifier of the publishing token. + /// + [SpeakeasyMetadata("pathParam:style=simple,explode=false,name=tokenID")] + public string TokenID { get; set; } = default!; + } +} \ No newline at end of file diff --git a/src/SpeakeasySDK/Models/Operations/GetPublishingTokenTargetByIDResponse.cs b/src/SpeakeasySDK/Models/Operations/GetPublishingTokenTargetByIDResponse.cs new file mode 100644 index 00000000..502d4384 --- /dev/null +++ b/src/SpeakeasySDK/Models/Operations/GetPublishingTokenTargetByIDResponse.cs @@ -0,0 +1,39 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace SpeakeasySDK.Models.Operations +{ + using SpeakeasySDK.Utils; + using System; + using System.Net.Http; + + public class GetPublishingTokenTargetByIDResponse + { + + /// + /// HTTP response content type for this operation + /// + public string? ContentType { get; set; } = default!; + + /// + /// HTTP response status code for this operation + /// + public int StatusCode { get; set; } = default!; + + /// + /// Raw HTTP response; suitable for custom response parsing + /// + public HttpResponseMessage RawResponse { get; set; } = default!; + + /// + /// OK + /// + public string? Res { get; set; } + } +} \ No newline at end of file diff --git a/src/SpeakeasySDK/Models/Operations/GetSchemaStoreItemRequestBody.cs b/src/SpeakeasySDK/Models/Operations/GetSchemaStoreItemRequestBody.cs new file mode 100644 index 00000000..e2322e3e --- /dev/null +++ b/src/SpeakeasySDK/Models/Operations/GetSchemaStoreItemRequestBody.cs @@ -0,0 +1,21 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace SpeakeasySDK.Models.Operations +{ + using Newtonsoft.Json; + using SpeakeasySDK.Utils; + + public class GetSchemaStoreItemRequestBody + { + + [JsonProperty("id")] + public string? Id { get; set; } + } +} \ No newline at end of file diff --git a/src/SpeakeasySDK/Models/Operations/GetCodeSamplesResponse.cs b/src/SpeakeasySDK/Models/Operations/GetSchemaStoreItemResponse.cs similarity index 91% rename from src/SpeakeasySDK/Models/Operations/GetCodeSamplesResponse.cs rename to src/SpeakeasySDK/Models/Operations/GetSchemaStoreItemResponse.cs index 03092bd0..5dbf5f8f 100644 --- a/src/SpeakeasySDK/Models/Operations/GetCodeSamplesResponse.cs +++ b/src/SpeakeasySDK/Models/Operations/GetSchemaStoreItemResponse.cs @@ -14,7 +14,7 @@ namespace SpeakeasySDK.Models.Operations using System; using System.Net.Http; - public class GetCodeSamplesResponse + public class GetSchemaStoreItemResponse { /// @@ -22,6 +22,11 @@ public class GetCodeSamplesResponse /// public string? ContentType { get; set; } = default!; + /// + /// OK + /// + public SchemaStoreItem? SchemaStoreItem { get; set; } + /// /// HTTP response status code for this operation /// @@ -31,10 +36,5 @@ public class GetCodeSamplesResponse /// Raw HTTP response; suitable for custom response parsing /// public HttpResponseMessage RawResponse { get; set; } = default!; - - /// - /// OK - /// - public UsageSnippets? UsageSnippets { get; set; } } } \ No newline at end of file diff --git a/src/SpeakeasySDK/Models/Operations/GetWorkspaceEventsByTargetRequest.cs b/src/SpeakeasySDK/Models/Operations/GetWorkspaceEventsByTargetRequest.cs index f35af538..9bcf6c34 100644 --- a/src/SpeakeasySDK/Models/Operations/GetWorkspaceEventsByTargetRequest.cs +++ b/src/SpeakeasySDK/Models/Operations/GetWorkspaceEventsByTargetRequest.cs @@ -15,18 +15,18 @@ namespace SpeakeasySDK.Models.Operations public class GetWorkspaceEventsByTargetRequest { - /// - /// Filter to only return events corresponding to a particular gen_lock_id (gen_lock_id uniquely identifies a target) - /// - [SpeakeasyMetadata("pathParam:style=simple,explode=false,name=target_id")] - public string TargetId { get; set; } = default!; - /// /// Filter to only return events created after this timestamp /// [SpeakeasyMetadata("queryParam:style=form,explode=true,name=after_created_at")] public DateTime? AfterCreatedAt { get; set; } + /// + /// Filter to only return events corresponding to a particular gen_lock_id (gen_lock_id uniquely identifies a target) + /// + [SpeakeasyMetadata("pathParam:style=simple,explode=false,name=target_id")] + public string TargetId { get; set; } = default!; + /// /// Unique identifier of the workspace. /// diff --git a/src/SpeakeasySDK/Models/Operations/PostTagsRequest.cs b/src/SpeakeasySDK/Models/Operations/PostTagsRequest.cs index a270f6b2..e9d5571e 100644 --- a/src/SpeakeasySDK/Models/Operations/PostTagsRequest.cs +++ b/src/SpeakeasySDK/Models/Operations/PostTagsRequest.cs @@ -15,13 +15,13 @@ namespace SpeakeasySDK.Models.Operations public class PostTagsRequest { - [SpeakeasyMetadata("pathParam:style=simple,explode=false,name=namespace_name")] - public string NamespaceName { get; set; } = default!; - /// /// A JSON representation of the tags to add /// [SpeakeasyMetadata("request:mediaType=application/json")] public AddTags? AddTags { get; set; } + + [SpeakeasyMetadata("pathParam:style=simple,explode=false,name=namespace_name")] + public string NamespaceName { get; set; } = default!; } } \ No newline at end of file diff --git a/src/SpeakeasySDK/Models/Operations/SetVisibilityRequest.cs b/src/SpeakeasySDK/Models/Operations/SetVisibilityRequest.cs index c1f7fcad..c17e0fa2 100644 --- a/src/SpeakeasySDK/Models/Operations/SetVisibilityRequest.cs +++ b/src/SpeakeasySDK/Models/Operations/SetVisibilityRequest.cs @@ -15,13 +15,13 @@ namespace SpeakeasySDK.Models.Operations public class SetVisibilityRequest { - [SpeakeasyMetadata("pathParam:style=simple,explode=false,name=namespace_name")] - public string NamespaceName { get; set; } = default!; - /// /// Namespace visibility /// [SpeakeasyMetadata("request:mediaType=application/json")] public SetVisibilityRequestBody? RequestBody { get; set; } + + [SpeakeasyMetadata("pathParam:style=simple,explode=false,name=namespace_name")] + public string NamespaceName { get; set; } = default!; } } \ No newline at end of file diff --git a/src/SpeakeasySDK/Models/Operations/SuggestOpenAPIRegistryRequest.cs b/src/SpeakeasySDK/Models/Operations/SuggestOpenAPIRegistryRequest.cs index 7a659cca..d9a2a55c 100644 --- a/src/SpeakeasySDK/Models/Operations/SuggestOpenAPIRegistryRequest.cs +++ b/src/SpeakeasySDK/Models/Operations/SuggestOpenAPIRegistryRequest.cs @@ -15,6 +15,12 @@ namespace SpeakeasySDK.Models.Operations public class SuggestOpenAPIRegistryRequest { + /// + /// Suggest options + /// + [SpeakeasyMetadata("request:mediaType=application/json")] + public SuggestRequestBody? SuggestRequestBody { get; set; } + [SpeakeasyMetadata("pathParam:style=simple,explode=false,name=namespace_name")] public string NamespaceName { get; set; } = default!; @@ -26,11 +32,5 @@ public class SuggestOpenAPIRegistryRequest [SpeakeasyMetadata("header:style=simple,explode=false,name=x-session-id")] public string XSessionId { get; set; } = default!; - - /// - /// Suggest options - /// - [SpeakeasyMetadata("request:mediaType=application/json")] - public SuggestRequestBody? SuggestRequestBody { get; set; } } } \ No newline at end of file diff --git a/src/SpeakeasySDK/Models/Operations/UpdatePublishingTokenExpirationRequest.cs b/src/SpeakeasySDK/Models/Operations/UpdatePublishingTokenExpirationRequest.cs new file mode 100644 index 00000000..a85f5b52 --- /dev/null +++ b/src/SpeakeasySDK/Models/Operations/UpdatePublishingTokenExpirationRequest.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace SpeakeasySDK.Models.Operations +{ + using SpeakeasySDK.Models.Operations; + using SpeakeasySDK.Utils; + + public class UpdatePublishingTokenExpirationRequest + { + + /// + /// The publishing token to update + /// + [SpeakeasyMetadata("request:mediaType=application/json")] + public UpdatePublishingTokenExpirationRequestBody? RequestBody { get; set; } + + /// + /// Unique identifier of the publishing token. + /// + [SpeakeasyMetadata("pathParam:style=simple,explode=false,name=tokenID")] + public string TokenID { get; set; } = default!; + } +} \ No newline at end of file diff --git a/src/SpeakeasySDK/Models/Operations/UpdatePublishingTokenExpirationRequestBody.cs b/src/SpeakeasySDK/Models/Operations/UpdatePublishingTokenExpirationRequestBody.cs new file mode 100644 index 00000000..b450cc59 --- /dev/null +++ b/src/SpeakeasySDK/Models/Operations/UpdatePublishingTokenExpirationRequestBody.cs @@ -0,0 +1,34 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace SpeakeasySDK.Models.Operations +{ + using Newtonsoft.Json; + using SpeakeasySDK.Utils; + using System; + + /// + /// The publishing token to update + /// + public class UpdatePublishingTokenExpirationRequestBody + { + + /// + /// The new name for the publishing token. + /// + [JsonProperty("token_name")] + public string? TokenName { get; set; } + + /// + /// The new expiration date for the publishing token. + /// + [JsonProperty("valid_until")] + public DateTime ValidUntil { get; set; } = default!; + } +} \ No newline at end of file diff --git a/src/SpeakeasySDK/Models/Operations/UpdatePublishingTokenExpirationResponse.cs b/src/SpeakeasySDK/Models/Operations/UpdatePublishingTokenExpirationResponse.cs new file mode 100644 index 00000000..a6168f9c --- /dev/null +++ b/src/SpeakeasySDK/Models/Operations/UpdatePublishingTokenExpirationResponse.cs @@ -0,0 +1,34 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace SpeakeasySDK.Models.Operations +{ + using SpeakeasySDK.Utils; + using System; + using System.Net.Http; + + public class UpdatePublishingTokenExpirationResponse + { + + /// + /// HTTP response content type for this operation + /// + public string? ContentType { get; set; } = default!; + + /// + /// HTTP response status code for this operation + /// + public int StatusCode { get; set; } = default!; + + /// + /// Raw HTTP response; suitable for custom response parsing + /// + public HttpResponseMessage RawResponse { get; set; } = default!; + } +} \ No newline at end of file diff --git a/src/SpeakeasySDK/Models/Shared/AccountType.cs b/src/SpeakeasySDK/Models/Shared/AccountType.cs index 92dc2cc3..77676a97 100644 --- a/src/SpeakeasySDK/Models/Shared/AccountType.cs +++ b/src/SpeakeasySDK/Models/Shared/AccountType.cs @@ -12,50 +12,68 @@ namespace SpeakeasySDK.Models.Shared using Newtonsoft.Json; using SpeakeasySDK.Utils; using System; - - public enum AccountType - { - [JsonProperty("free")] - Free, - [JsonProperty("scale-up")] - ScaleUp, - [JsonProperty("business")] - Business, - [JsonProperty("enterprise")] - Enterprise, - } + using System.Collections.Concurrent; + using System.Collections.Generic; + using System.Linq; - public static class AccountTypeExtension + [JsonConverter(typeof(OpenEnumConverter))] + public class AccountType : IEquatable { - public static string Value(this AccountType value) + public static readonly AccountType Free = new AccountType("free"); + public static readonly AccountType ScaleUp = new AccountType("scale-up"); + public static readonly AccountType Business = new AccountType("business"); + public static readonly AccountType Enterprise = new AccountType("enterprise"); + + private static readonly Dictionary _knownValues = + new Dictionary () + { + ["free"] = Free, + ["scale-up"] = ScaleUp, + ["business"] = Business, + ["enterprise"] = Enterprise + }; + + private static readonly ConcurrentDictionary _values = + new ConcurrentDictionary(_knownValues); + + private AccountType(string value) { - return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString(); + if (value == null) throw new ArgumentNullException(nameof(value)); + Value = value; } - public static AccountType ToEnum(this string value) + public string Value { get; } + + public static AccountType Of(string value) { - foreach(var field in typeof(AccountType).GetFields()) - { - var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false); - if (attributes.Length == 0) - { - continue; - } - - var attribute = attributes[0] as JsonPropertyAttribute; - if (attribute != null && attribute.PropertyName == value) - { - var enumVal = field.GetValue(null); - - if (enumVal is AccountType) - { - return (AccountType)enumVal; - } - } - } - - throw new Exception($"Unknown value {value} for enum AccountType"); + return _values.GetOrAdd(value, _ => new AccountType(value)); } + + public static implicit operator AccountType(string value) => Of(value); + public static implicit operator string(AccountType accounttype) => accounttype.Value; + + public static AccountType[] Values() + { + return _values.Values.ToArray(); + } + + public override string ToString() => Value.ToString(); + + public bool IsKnown() + { + return _knownValues.ContainsKey(Value); + } + + public override bool Equals(object? obj) => Equals(obj as AccountType); + + public bool Equals(AccountType? other) + { + if (ReferenceEquals(this, other)) return true; + if (other is null) return false; + return string.Equals(Value, other.Value); + } + + public override int GetHashCode() => Value.GetHashCode(); } } \ No newline at end of file diff --git a/src/SpeakeasySDK/Models/Shared/ApiKeyDetails.cs b/src/SpeakeasySDK/Models/Shared/ApiKeyDetails.cs index 318112a8..36bd6380 100644 --- a/src/SpeakeasySDK/Models/Shared/ApiKeyDetails.cs +++ b/src/SpeakeasySDK/Models/Shared/ApiKeyDetails.cs @@ -13,7 +13,9 @@ namespace SpeakeasySDK.Models.Shared using SpeakeasySDK.Models.Shared; using SpeakeasySDK.Utils; using System; + using System.Collections.Concurrent; using System.Collections.Generic; + using System.Linq; public class ApiKeyDetails { @@ -21,6 +23,9 @@ public class ApiKeyDetails [JsonProperty("account_type_v2")] public AccountType AccountTypeV2 { get; set; } = default!; + [JsonProperty("billing_add_ons")] + public List BillingAddOns { get; set; } = default!; + [JsonProperty("enabled_features")] public List EnabledFeatures { get; set; } = default!; diff --git a/src/SpeakeasySDK/Models/Shared/BillingAddOn.cs b/src/SpeakeasySDK/Models/Shared/BillingAddOn.cs new file mode 100644 index 00000000..4e37377b --- /dev/null +++ b/src/SpeakeasySDK/Models/Shared/BillingAddOn.cs @@ -0,0 +1,79 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace SpeakeasySDK.Models.Shared +{ + using Newtonsoft.Json; + using SpeakeasySDK.Utils; + using System; + using System.Collections.Concurrent; + using System.Collections.Generic; + using System.Linq; + + [JsonConverter(typeof(OpenEnumConverter))] + public class BillingAddOn : IEquatable + { + public static readonly BillingAddOn Webhooks = new BillingAddOn("webhooks"); + public static readonly BillingAddOn SDKTesting = new BillingAddOn("sdk_testing"); + public static readonly BillingAddOn CustomCodeRegions = new BillingAddOn("custom_code_regions"); + public static readonly BillingAddOn SnippetAi = new BillingAddOn("snippet_ai"); + + private static readonly Dictionary _knownValues = + new Dictionary () + { + ["webhooks"] = Webhooks, + ["sdk_testing"] = SDKTesting, + ["custom_code_regions"] = CustomCodeRegions, + ["snippet_ai"] = SnippetAi + }; + + private static readonly ConcurrentDictionary _values = + new ConcurrentDictionary(_knownValues); + + private BillingAddOn(string value) + { + if (value == null) throw new ArgumentNullException(nameof(value)); + Value = value; + } + + public string Value { get; } + + public static BillingAddOn Of(string value) + { + return _values.GetOrAdd(value, _ => new BillingAddOn(value)); + } + + public static implicit operator BillingAddOn(string value) => Of(value); + public static implicit operator string(BillingAddOn billingaddon) => billingaddon.Value; + + public static BillingAddOn[] Values() + { + return _values.Values.ToArray(); + } + + public override string ToString() => Value.ToString(); + + public bool IsKnown() + { + return _knownValues.ContainsKey(Value); + } + + public override bool Equals(object? obj) => Equals(obj as BillingAddOn); + + public bool Equals(BillingAddOn? other) + { + if (ReferenceEquals(this, other)) return true; + if (other is null) return false; + return string.Equals(Value, other.Value); + } + + public override int GetHashCode() => Value.GetHashCode(); + } + +} \ No newline at end of file diff --git a/src/SpeakeasySDK/Models/Shared/CliEvent.cs b/src/SpeakeasySDK/Models/Shared/CliEvent.cs index ecc30d78..c1182ff6 100644 --- a/src/SpeakeasySDK/Models/Shared/CliEvent.cs +++ b/src/SpeakeasySDK/Models/Shared/CliEvent.cs @@ -473,6 +473,12 @@ public class CliEvent [JsonProperty("success")] public bool Success { get; set; } = default!; + /// + /// The raw test report xml + /// + [JsonProperty("test_report_raw")] + public string? TestReportRaw { get; set; } + /// /// Workflow lock file (post execution) /// diff --git a/src/SpeakeasySDK/Models/Shared/CodeSampleSchemaInput.cs b/src/SpeakeasySDK/Models/Shared/CodeSampleSchemaInput.cs index 8beae2e8..e875fe85 100644 --- a/src/SpeakeasySDK/Models/Shared/CodeSampleSchemaInput.cs +++ b/src/SpeakeasySDK/Models/Shared/CodeSampleSchemaInput.cs @@ -17,16 +17,16 @@ public class CodeSampleSchemaInput { /// - /// A list of languages to generate code samples for + /// The language to generate code samples for /// - [SpeakeasyMetadata("multipartForm:name=languages")] - public List Languages { get; set; } = default!; + [SpeakeasyMetadata("multipartForm:name=language")] + public string Language { get; set; } = default!; /// - /// The OpenAPI file to be uploaded + /// A list of operations IDs to generate code samples for /// - [SpeakeasyMetadata("multipartForm:file,name=schema_file")] - public SchemaFile SchemaFile { get; set; } = default!; + [SpeakeasyMetadata("multipartForm:name=operation_ids")] + public List? OperationIds { get; set; } /// /// The name of the package @@ -34,6 +34,12 @@ public class CodeSampleSchemaInput [SpeakeasyMetadata("multipartForm:name=package_name")] public string? PackageName { get; set; } + /// + /// The OpenAPI file to be uploaded + /// + [SpeakeasyMetadata("multipartForm:file,name=schema_file")] + public SchemaFile SchemaFile { get; set; } = default!; + /// /// The SDK class name /// diff --git a/src/SpeakeasySDK/Models/Shared/FeatureFlag.cs b/src/SpeakeasySDK/Models/Shared/FeatureFlag.cs index 7c75ed01..e305e615 100644 --- a/src/SpeakeasySDK/Models/Shared/FeatureFlag.cs +++ b/src/SpeakeasySDK/Models/Shared/FeatureFlag.cs @@ -13,6 +13,9 @@ namespace SpeakeasySDK.Models.Shared using SpeakeasySDK.Models.Shared; using SpeakeasySDK.Utils; using System; + using System.Collections.Concurrent; + using System.Collections.Generic; + using System.Linq; /// /// A feature flag is a key-value pair that can be used to enable or disable features. diff --git a/src/SpeakeasySDK/Models/Shared/Format.cs b/src/SpeakeasySDK/Models/Shared/Format.cs new file mode 100644 index 00000000..9bdaab90 --- /dev/null +++ b/src/SpeakeasySDK/Models/Shared/Format.cs @@ -0,0 +1,57 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace SpeakeasySDK.Models.Shared +{ + using Newtonsoft.Json; + using SpeakeasySDK.Utils; + using System; + + public enum Format + { + [JsonProperty("json")] + Json, + [JsonProperty("yaml")] + Yaml, + } + + public static class FormatExtension + { + public static string Value(this Format value) + { + return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString(); + } + + public static Format ToEnum(this string value) + { + foreach(var field in typeof(Format).GetFields()) + { + var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false); + if (attributes.Length == 0) + { + continue; + } + + var attribute = attributes[0] as JsonPropertyAttribute; + if (attribute != null && attribute.PropertyName == value) + { + var enumVal = field.GetValue(null); + + if (enumVal is Format) + { + return (Format)enumVal; + } + } + } + + throw new Exception($"Unknown value {value} for enum Format"); + } + } + +} \ No newline at end of file diff --git a/src/SpeakeasySDK/Models/Shared/GithubTriggerActionRequest.cs b/src/SpeakeasySDK/Models/Shared/GithubTriggerActionRequest.cs index 8ef9d700..634d6323 100644 --- a/src/SpeakeasySDK/Models/Shared/GithubTriggerActionRequest.cs +++ b/src/SpeakeasySDK/Models/Shared/GithubTriggerActionRequest.cs @@ -18,6 +18,12 @@ namespace SpeakeasySDK.Models.Shared public class GithubTriggerActionRequest { + /// + /// Force an SDK generation + /// + [JsonProperty("force")] + public bool? Force { get; set; } + /// /// The generation lock ID /// @@ -36,12 +42,6 @@ public class GithubTriggerActionRequest [JsonProperty("repo_name")] public string RepoName { get; set; } = default!; - /// - /// Force an SDK generation - /// - [JsonProperty("force")] - public bool? Force { get; set; } - /// /// A version to override the SDK too in workflow dispatch /// diff --git a/src/SpeakeasySDK/Models/Shared/InteractionType.cs b/src/SpeakeasySDK/Models/Shared/InteractionType.cs index 2cd15282..d7b1793e 100644 --- a/src/SpeakeasySDK/Models/Shared/InteractionType.cs +++ b/src/SpeakeasySDK/Models/Shared/InteractionType.cs @@ -40,6 +40,8 @@ public enum InteractionType Configure, [JsonProperty("PUBLISH")] Publish, + [JsonProperty("TEST")] + Test, } public static class InteractionTypeExtension diff --git a/src/SpeakeasySDK/Models/Shared/Namespace.cs b/src/SpeakeasySDK/Models/Shared/Namespace.cs index 5ab49c03..f4c9bdaa 100644 --- a/src/SpeakeasySDK/Models/Shared/Namespace.cs +++ b/src/SpeakeasySDK/Models/Shared/Namespace.cs @@ -20,6 +20,9 @@ namespace SpeakeasySDK.Models.Shared public class Namespace { + [JsonProperty("archived_at")] + public DateTime? ArchivedAt { get; set; } + [JsonProperty("composite_spec_metadata")] public CompositeSpecMetadata? CompositeSpecMetadata { get; set; } @@ -32,6 +35,9 @@ public class Namespace [JsonProperty("id")] public string Id { get; set; } = default!; + [JsonProperty("latest_revision_metadata")] + public RevisionContentsMetadata? LatestRevisionMetadata { get; set; } + /// /// A human-readable name for the namespace. /// diff --git a/src/SpeakeasySDK/Models/Shared/Organization.cs b/src/SpeakeasySDK/Models/Shared/Organization.cs index caf33647..479b9b11 100644 --- a/src/SpeakeasySDK/Models/Shared/Organization.cs +++ b/src/SpeakeasySDK/Models/Shared/Organization.cs @@ -13,6 +13,9 @@ namespace SpeakeasySDK.Models.Shared using SpeakeasySDK.Models.Shared; using SpeakeasySDK.Utils; using System; + using System.Collections.Concurrent; + using System.Collections.Generic; + using System.Linq; /// /// A speakeasy organization @@ -26,9 +29,15 @@ public class Organization [JsonProperty("created_at")] public DateTime CreatedAt { get; set; } = default!; + [JsonProperty("free_trial_expiry")] + public DateTime? FreeTrialExpiry { get; set; } = null; + [JsonProperty("id")] public string Id { get; set; } = default!; + [JsonProperty("internal")] + public bool? Internal { get; set; } + [JsonProperty("name")] public string Name { get; set; } = default!; @@ -38,19 +47,13 @@ public class Organization [JsonProperty("sso_activated")] public bool SsoActivated { get; set; } = default!; + [JsonProperty("sso_connection_id")] + public string? SsoConnectionId { get; set; } = null; + [JsonProperty("telemetry_disabled")] public bool TelemetryDisabled { get; set; } = default!; [JsonProperty("updated_at")] public DateTime UpdatedAt { get; set; } = default!; - - [JsonProperty("free_trial_expiry")] - public DateTime? FreeTrialExpiry { get; set; } = null; - - [JsonProperty("internal")] - public bool? Internal { get; set; } - - [JsonProperty("sso_connection_id")] - public string? SsoConnectionId { get; set; } = null; } } \ No newline at end of file diff --git a/src/SpeakeasySDK/Models/Shared/OrganizationBillingAddOnRequest.cs b/src/SpeakeasySDK/Models/Shared/OrganizationBillingAddOnRequest.cs new file mode 100644 index 00000000..eb8fe19b --- /dev/null +++ b/src/SpeakeasySDK/Models/Shared/OrganizationBillingAddOnRequest.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace SpeakeasySDK.Models.Shared +{ + using Newtonsoft.Json; + using SpeakeasySDK.Models.Shared; + using SpeakeasySDK.Utils; + using System; + using System.Collections.Concurrent; + using System.Collections.Generic; + using System.Linq; + + /// + /// A request to add billing add ons + /// + public class OrganizationBillingAddOnRequest + { + + [JsonProperty("add_ons")] + public List AddOns { get; set; } = default!; + } +} \ No newline at end of file diff --git a/src/SpeakeasySDK/Models/Shared/OrganizationBillingAddOnResponse.cs b/src/SpeakeasySDK/Models/Shared/OrganizationBillingAddOnResponse.cs new file mode 100644 index 00000000..cb71d076 --- /dev/null +++ b/src/SpeakeasySDK/Models/Shared/OrganizationBillingAddOnResponse.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace SpeakeasySDK.Models.Shared +{ + using Newtonsoft.Json; + using SpeakeasySDK.Models.Shared; + using SpeakeasySDK.Utils; + using System; + using System.Collections.Concurrent; + using System.Collections.Generic; + using System.Linq; + + /// + /// Billing add on response + /// + public class OrganizationBillingAddOnResponse + { + + [JsonProperty("add_ons")] + public List AddOns { get; set; } = default!; + } +} \ No newline at end of file diff --git a/src/SpeakeasySDK/Models/Shared/PublishingToken.cs b/src/SpeakeasySDK/Models/Shared/PublishingToken.cs new file mode 100644 index 00000000..67fb9869 --- /dev/null +++ b/src/SpeakeasySDK/Models/Shared/PublishingToken.cs @@ -0,0 +1,59 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace SpeakeasySDK.Models.Shared +{ + using Newtonsoft.Json; + using SpeakeasySDK.Models.Shared; + using SpeakeasySDK.Utils; + using System; + + /// + /// A token used to publish to a target + /// + public class PublishingToken + { + + [JsonProperty("created_at")] + public DateTime CreatedAt { get; set; } = default!; + + [JsonProperty("created_by")] + public string CreatedBy { get; set; } = default!; + + [JsonProperty("id")] + public string Id { get; set; } = default!; + + [JsonProperty("organization_id")] + public string OrganizationId { get; set; } = default!; + + [JsonProperty("target_id")] + public string TargetId { get; set; } = default!; + + [JsonProperty("target_resource")] + public TargetResource TargetResource { get; set; } = default!; + + [JsonProperty("token")] + public string Token { get; set; } = default!; + + [JsonProperty("token_name")] + public string TokenName { get; set; } = default!; + + [JsonProperty("updated_at")] + public DateTime? UpdatedAt { get; set; } + + [JsonProperty("updated_by")] + public string? UpdatedBy { get; set; } + + [JsonProperty("valid_until")] + public DateTime ValidUntil { get; set; } = default!; + + [JsonProperty("workspace_id")] + public string WorkspaceId { get; set; } = default!; + } +} \ No newline at end of file diff --git a/src/SpeakeasySDK/Models/Shared/Revision.cs b/src/SpeakeasySDK/Models/Shared/Revision.cs index e19a985b..3cda1aa7 100644 --- a/src/SpeakeasySDK/Models/Shared/Revision.cs +++ b/src/SpeakeasySDK/Models/Shared/Revision.cs @@ -10,6 +10,7 @@ namespace SpeakeasySDK.Models.Shared { using Newtonsoft.Json; + using SpeakeasySDK.Models.Shared; using SpeakeasySDK.Utils; using System; using System.Collections.Generic; @@ -17,6 +18,9 @@ namespace SpeakeasySDK.Models.Shared public class Revision { + [JsonProperty("contents_metadata")] + public RevisionContentsMetadata? ContentsMetadata { get; set; } + [JsonProperty("created_at")] public DateTime CreatedAt { get; set; } = default!; diff --git a/src/SpeakeasySDK/Models/Shared/RevisionContentsMetadata.cs b/src/SpeakeasySDK/Models/Shared/RevisionContentsMetadata.cs new file mode 100644 index 00000000..c282b51f --- /dev/null +++ b/src/SpeakeasySDK/Models/Shared/RevisionContentsMetadata.cs @@ -0,0 +1,93 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace SpeakeasySDK.Models.Shared +{ + using Newtonsoft.Json; + using SpeakeasySDK.Models.Shared; + using SpeakeasySDK.Utils; + using System; + using System.Collections.Generic; + + public class RevisionContentsMetadata + { + + /// + /// Whether the OAS contains code samples. + /// + [JsonProperty("contains_code_samples")] + public bool ContainsCodeSamples { get; set; } = default!; + + [JsonProperty("created_at")] + public DateTime CreatedAt { get; set; } = default!; + + /// + /// The OAS description + /// + [JsonProperty("description")] + public string Description { get; set; } = default!; + + /// + /// The hash of the contents + /// + [JsonProperty("hash")] + public string Hash { get; set; } = default!; + + /// + /// The fully qualified namespace + /// + [JsonProperty("namespace")] + public string Namespace { get; set; } = default!; + + /// + /// The number of overlay actions in the OAS. Will be 0 if the OAS is not an overlay. + /// + [JsonProperty("num_overlay_actions")] + public long NumOverlayActions { get; set; } = default!; + + /// + /// The operation IDs contained in the OAS. Will be empty if the OAS is an overlay. + /// + [JsonProperty("operation_ids")] + public List OperationIds { get; set; } = default!; + + /// + /// The digest of the parent bundle + /// + [JsonProperty("revision_digest")] + public string RevisionDigest { get; set; } = default!; + + /// + /// The tags contained in the OAS -- NOT the OCI tags. Will be empty if the OAS is an overlay. + /// + [JsonProperty("tags")] + public List Tags { get; set; } = default!; + + /// + /// The OAS title + /// + [JsonProperty("title")] + public string Title { get; set; } = default!; + + [JsonProperty("type")] + public RevisionContentsMetadataType Type { get; set; } = default!; + + /// + /// The OAS version + /// + [JsonProperty("version")] + public string Version { get; set; } = default!; + + /// + /// The workspace ID + /// + [JsonProperty("workspace_id")] + public string WorkspaceId { get; set; } = default!; + } +} \ No newline at end of file diff --git a/src/SpeakeasySDK/Models/Shared/RevisionContentsMetadataType.cs b/src/SpeakeasySDK/Models/Shared/RevisionContentsMetadataType.cs new file mode 100644 index 00000000..fe811667 --- /dev/null +++ b/src/SpeakeasySDK/Models/Shared/RevisionContentsMetadataType.cs @@ -0,0 +1,57 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace SpeakeasySDK.Models.Shared +{ + using Newtonsoft.Json; + using SpeakeasySDK.Utils; + using System; + + public enum RevisionContentsMetadataType + { + [JsonProperty("OPENAPI_BUNDLE")] + OpenapiBundle, + [JsonProperty("OPENAPI_OVERLAY")] + OpenapiOverlay, + } + + public static class RevisionContentsMetadataTypeExtension + { + public static string Value(this RevisionContentsMetadataType value) + { + return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString(); + } + + public static RevisionContentsMetadataType ToEnum(this string value) + { + foreach(var field in typeof(RevisionContentsMetadataType).GetFields()) + { + var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false); + if (attributes.Length == 0) + { + continue; + } + + var attribute = attributes[0] as JsonPropertyAttribute; + if (attribute != null && attribute.PropertyName == value) + { + var enumVal = field.GetValue(null); + + if (enumVal is RevisionContentsMetadataType) + { + return (RevisionContentsMetadataType)enumVal; + } + } + } + + throw new Exception($"Unknown value {value} for enum RevisionContentsMetadataType"); + } + } + +} \ No newline at end of file diff --git a/src/SpeakeasySDK/Models/Shared/SchemaStoreItem.cs b/src/SpeakeasySDK/Models/Shared/SchemaStoreItem.cs new file mode 100644 index 00000000..ddd7a4a9 --- /dev/null +++ b/src/SpeakeasySDK/Models/Shared/SchemaStoreItem.cs @@ -0,0 +1,38 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace SpeakeasySDK.Models.Shared +{ + using Newtonsoft.Json; + using SpeakeasySDK.Models.Shared; + using SpeakeasySDK.Utils; + using System; + + public class SchemaStoreItem + { + + [JsonProperty("created_at")] + public DateTime CreatedAt { get; set; } = default!; + + [JsonProperty("format")] + public Models.Shared.Format Format { get; set; } = default!; + + [JsonProperty("id")] + public string Id { get; set; } = default!; + + [JsonProperty("packageName")] + public string PackageName { get; set; } = default!; + + [JsonProperty("sdkClassname")] + public string SDKClassname { get; set; } = default!; + + [JsonProperty("spec")] + public string Spec { get; set; } = default!; + } +} \ No newline at end of file diff --git a/src/SpeakeasySDK/Models/Shared/TargetResource.cs b/src/SpeakeasySDK/Models/Shared/TargetResource.cs new file mode 100644 index 00000000..f32f08b3 --- /dev/null +++ b/src/SpeakeasySDK/Models/Shared/TargetResource.cs @@ -0,0 +1,55 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace SpeakeasySDK.Models.Shared +{ + using Newtonsoft.Json; + using SpeakeasySDK.Utils; + using System; + + public enum TargetResource + { + [JsonProperty("document")] + Document, + } + + public static class TargetResourceExtension + { + public static string Value(this TargetResource value) + { + return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString(); + } + + public static TargetResource ToEnum(this string value) + { + foreach(var field in typeof(TargetResource).GetFields()) + { + var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false); + if (attributes.Length == 0) + { + continue; + } + + var attribute = attributes[0] as JsonPropertyAttribute; + if (attribute != null && attribute.PropertyName == value) + { + var enumVal = field.GetValue(null); + + if (enumVal is TargetResource) + { + return (TargetResource)enumVal; + } + } + } + + throw new Exception($"Unknown value {value} for enum TargetResource"); + } + } + +} \ No newline at end of file diff --git a/src/SpeakeasySDK/Models/Shared/UsageSnippet.cs b/src/SpeakeasySDK/Models/Shared/UsageSnippet.cs index 36e1ab57..4544b1c8 100644 --- a/src/SpeakeasySDK/Models/Shared/UsageSnippet.cs +++ b/src/SpeakeasySDK/Models/Shared/UsageSnippet.cs @@ -27,10 +27,22 @@ public class UsageSnippet [JsonProperty("language")] public string Language { get; set; } = default!; + /// + /// The HTTP method of the operation + /// + [JsonProperty("method")] + public object Method { get; set; } = default!; + /// /// The operation ID for the snippet /// [JsonProperty("operationId")] public string OperationId { get; set; } = default!; + + /// + /// The path of the operation + /// + [JsonProperty("path")] + public string Path { get; set; } = default!; } } \ No newline at end of file diff --git a/src/SpeakeasySDK/Models/Shared/User.cs b/src/SpeakeasySDK/Models/Shared/User.cs index 990b3fb9..62882538 100644 --- a/src/SpeakeasySDK/Models/Shared/User.cs +++ b/src/SpeakeasySDK/Models/Shared/User.cs @@ -64,6 +64,12 @@ public class User [JsonProperty("github_handle")] public string? GithubHandle { get; set; } = null; + /// + /// Indicates whether the user has created an API key. Not always populated + /// + [JsonProperty("has_created_api_key")] + public bool? HasCreatedApiKey { get; set; } + /// /// Unique identifier for the user. /// @@ -88,6 +94,12 @@ public class User [JsonProperty("photo_url")] public string? PhotoUrl { get; set; } = null; + /// + /// Hash used for pylon identity verification returned on v1/user. + /// + [JsonProperty("pylon_identity_hash")] + public string? PylonIdentityHash { get; set; } + /// /// Timestamp of the user's last update. /// diff --git a/src/SpeakeasySDK/Models/Shared/Workspace.cs b/src/SpeakeasySDK/Models/Shared/Workspace.cs index 26b6d1d5..7c28f0f8 100644 --- a/src/SpeakeasySDK/Models/Shared/Workspace.cs +++ b/src/SpeakeasySDK/Models/Shared/Workspace.cs @@ -25,6 +25,9 @@ public class Workspace [JsonProperty("id")] public string Id { get; set; } = default!; + [JsonProperty("inactive")] + public bool? Inactive { get; set; } + [JsonProperty("name")] public string Name { get; set; } = default!; @@ -34,20 +37,17 @@ public class Workspace [JsonProperty("slug")] public string Slug { get; set; } = default!; - [JsonProperty("updated_at")] - public DateTime UpdatedAt { get; set; } = default!; - - [JsonProperty("verified")] - public bool Verified { get; set; } = default!; - - [JsonProperty("inactive")] - public bool? Inactive { get; set; } - /// /// Deprecated. Use organization.telemetry_disabled instead. /// [Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible")] [JsonProperty("telemetry_disabled")] public bool? TelemetryDisabled { get; set; } + + [JsonProperty("updated_at")] + public DateTime UpdatedAt { get; set; } = default!; + + [JsonProperty("verified")] + public bool Verified { get; set; } = default!; } } \ No newline at end of file diff --git a/src/SpeakeasySDK/Models/Shared/WorkspaceFeatureFlag.cs b/src/SpeakeasySDK/Models/Shared/WorkspaceFeatureFlag.cs index 40325487..d13041a1 100644 --- a/src/SpeakeasySDK/Models/Shared/WorkspaceFeatureFlag.cs +++ b/src/SpeakeasySDK/Models/Shared/WorkspaceFeatureFlag.cs @@ -12,53 +12,71 @@ namespace SpeakeasySDK.Models.Shared using Newtonsoft.Json; using SpeakeasySDK.Utils; using System; - + using System.Collections.Concurrent; + using System.Collections.Generic; + using System.Linq; + /// /// enum value workspace feature flag /// - public enum WorkspaceFeatureFlag + [JsonConverter(typeof(OpenEnumConverter))] + public class WorkspaceFeatureFlag : IEquatable { - [JsonProperty("schema_registry")] - SchemaRegistry, - [JsonProperty("changes_report")] - ChangesReport, - [JsonProperty("skip_schema_registry")] - SkipSchemaRegistry, - [JsonProperty("webhooks")] - Webhooks, - } + public static readonly WorkspaceFeatureFlag SchemaRegistry = new WorkspaceFeatureFlag("schema_registry"); + public static readonly WorkspaceFeatureFlag ChangesReport = new WorkspaceFeatureFlag("changes_report"); + public static readonly WorkspaceFeatureFlag SkipSchemaRegistry = new WorkspaceFeatureFlag("skip_schema_registry"); + public static readonly WorkspaceFeatureFlag Webhooks = new WorkspaceFeatureFlag("webhooks"); - public static class WorkspaceFeatureFlagExtension - { - public static string Value(this WorkspaceFeatureFlag value) + private static readonly Dictionary _knownValues = + new Dictionary () + { + ["schema_registry"] = SchemaRegistry, + ["changes_report"] = ChangesReport, + ["skip_schema_registry"] = SkipSchemaRegistry, + ["webhooks"] = Webhooks + }; + + private static readonly ConcurrentDictionary _values = + new ConcurrentDictionary(_knownValues); + + private WorkspaceFeatureFlag(string value) { - return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString(); + if (value == null) throw new ArgumentNullException(nameof(value)); + Value = value; } - public static WorkspaceFeatureFlag ToEnum(this string value) + public string Value { get; } + + public static WorkspaceFeatureFlag Of(string value) { - foreach(var field in typeof(WorkspaceFeatureFlag).GetFields()) - { - var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false); - if (attributes.Length == 0) - { - continue; - } + return _values.GetOrAdd(value, _ => new WorkspaceFeatureFlag(value)); + } - var attribute = attributes[0] as JsonPropertyAttribute; - if (attribute != null && attribute.PropertyName == value) - { - var enumVal = field.GetValue(null); + public static implicit operator WorkspaceFeatureFlag(string value) => Of(value); + public static implicit operator string(WorkspaceFeatureFlag workspacefeatureflag) => workspacefeatureflag.Value; - if (enumVal is WorkspaceFeatureFlag) - { - return (WorkspaceFeatureFlag)enumVal; - } - } - } + public static WorkspaceFeatureFlag[] Values() + { + return _values.Values.ToArray(); + } + + public override string ToString() => Value.ToString(); - throw new Exception($"Unknown value {value} for enum WorkspaceFeatureFlag"); + public bool IsKnown() + { + return _knownValues.ContainsKey(Value); } + + public override bool Equals(object? obj) => Equals(obj as WorkspaceFeatureFlag); + + public bool Equals(WorkspaceFeatureFlag? other) + { + if (ReferenceEquals(this, other)) return true; + if (other is null) return false; + return string.Equals(Value, other.Value); + } + + public override int GetHashCode() => Value.GetHashCode(); } } \ No newline at end of file diff --git a/src/SpeakeasySDK/Models/Shared/WorkspaceFeatureFlagRequest.cs b/src/SpeakeasySDK/Models/Shared/WorkspaceFeatureFlagRequest.cs index ab959ef9..a2adfce0 100644 --- a/src/SpeakeasySDK/Models/Shared/WorkspaceFeatureFlagRequest.cs +++ b/src/SpeakeasySDK/Models/Shared/WorkspaceFeatureFlagRequest.cs @@ -12,7 +12,10 @@ namespace SpeakeasySDK.Models.Shared using Newtonsoft.Json; using SpeakeasySDK.Models.Shared; using SpeakeasySDK.Utils; + using System; + using System.Collections.Concurrent; using System.Collections.Generic; + using System.Linq; /// /// A request to add workspace feature flags diff --git a/src/SpeakeasySDK/Models/Shared/WorkspaceToken.cs b/src/SpeakeasySDK/Models/Shared/WorkspaceToken.cs index 4c6b27ac..7dfc7140 100644 --- a/src/SpeakeasySDK/Models/Shared/WorkspaceToken.cs +++ b/src/SpeakeasySDK/Models/Shared/WorkspaceToken.cs @@ -28,6 +28,12 @@ public class WorkspaceToken [JsonProperty("created_by")] public string? CreatedBy { get; set; } = null; + [JsonProperty("created_by_name")] + public string? CreatedByName { get; set; } = null; + + [JsonProperty("created_by_photo_url")] + public string? CreatedByPhotoUrl { get; set; } = null; + [JsonProperty("email")] public string? Email { get; set; } = null; diff --git a/src/SpeakeasySDK/Models/Shared/Workspaces.cs b/src/SpeakeasySDK/Models/Shared/Workspaces.cs index 624c65f9..9af26a22 100644 --- a/src/SpeakeasySDK/Models/Shared/Workspaces.cs +++ b/src/SpeakeasySDK/Models/Shared/Workspaces.cs @@ -13,6 +13,9 @@ namespace SpeakeasySDK.Models.Shared using SpeakeasySDK.Models.Shared; using SpeakeasySDK.Utils; using System; + using System.Collections.Concurrent; + using System.Collections.Generic; + using System.Linq; public class Workspaces { diff --git a/src/SpeakeasySDK/Organizations.cs b/src/SpeakeasySDK/Organizations.cs index e1a3903c..4f7f67d4 100644 --- a/src/SpeakeasySDK/Organizations.cs +++ b/src/SpeakeasySDK/Organizations.cs @@ -37,6 +37,11 @@ public interface IOrganizations /// Task CreateAsync(Organization request); + /// + /// Create billing add ons + /// + Task CreateBillingAddOnsAsync(OrganizationBillingAddOnRequest request); + /// /// Create a free trial for an organization /// @@ -46,6 +51,11 @@ public interface IOrganizations /// Task CreateFreeTrialAsync(); + /// + /// Delete billing add ons + /// + Task DeleteBillingAddOnAsync(DeleteBillingAddOnRequest request); + /// /// Get organization /// @@ -64,6 +74,11 @@ public interface IOrganizations /// Task GetAllAsync(); + /// + /// Get billing add ons + /// + Task GetBillingAddOnsAsync(); + /// /// Get billing usage summary for a particular organization /// @@ -81,19 +96,12 @@ public class Organizations: IOrganizations { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "5.12.0"; - private const string _sdkGenVersion = "2.493.4"; + private const string _sdkVersion = "5.13.0"; + private const string _sdkGenVersion = "2.648.7"; private const string _openapiDocVersion = "0.4.0"; - private const string _userAgent = "speakeasy-sdk/csharp 5.12.0 2.493.4 0.4.0 SpeakeasySDK"; - private string _serverUrl = ""; - private ISpeakeasyHttpClient _client; - private Func? _securitySource; - public Organizations(ISpeakeasyHttpClient client, Func? securitySource, string serverUrl, SDKConfig config) + public Organizations(SDKConfig config) { - _client = client; - _securitySource = securitySource; - _serverUrl = serverUrl; SDKConfiguration = config; } @@ -104,7 +112,7 @@ public async Task CreateAsync(Organization request) var urlString = baseUrl + "/v1/organization"; var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); var serializedBody = RequestBodySerializer.Serialize(request, "Request", "json", false, false); if (serializedBody != null) @@ -112,19 +120,19 @@ public async Task CreateAsync(Organization request) httpRequest.Content = serializedBody; } - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("createOrganization", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "createOrganization", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -188,6 +196,97 @@ public async Task CreateAsync(Organization request) throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } + public async Task CreateBillingAddOnsAsync(OrganizationBillingAddOnRequest request) + { + string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); + + var urlString = baseUrl + "/v1/organization/add_ons"; + + var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); + + var serializedBody = RequestBodySerializer.Serialize(request, "Request", "json", false, false); + if (serializedBody != null) + { + httpRequest.Content = serializedBody; + } + + if (SDKConfiguration.SecuritySource != null) + { + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); + } + + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "createBillingAddOns", new List { }, SDKConfiguration.SecuritySource); + + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + + HttpResponseMessage httpResponse; + try + { + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); + int _statusCode = (int)httpResponse.StatusCode; + + if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + } + } + catch (Exception error) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + else + { + throw; + } + } + + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + + var contentType = httpResponse.Content.Headers.ContentType?.MediaType; + int responseStatusCode = (int)httpResponse.StatusCode; + if(responseStatusCode == 200) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var response = new CreateBillingAddOnsResponse() + { + StatusCode = responseStatusCode, + ContentType = contentType, + RawResponse = httpResponse + }; + response.OrganizationBillingAddOnResponse = obj; + return response; + } + + throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + throw obj!; + } + + throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + + throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + public async Task CreateFreeTrialAsync() { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); @@ -195,21 +294,21 @@ public async Task CreateFreeTrialAsync() var urlString = baseUrl + "/v1/organization/free_trial"; var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("createFreeTrial", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "createFreeTrial", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -265,27 +364,103 @@ public async Task CreateFreeTrialAsync() throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } + public async Task DeleteBillingAddOnAsync(DeleteBillingAddOnRequest request) + { + string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); + var urlString = URLBuilder.Build(baseUrl, "/v1/organization/add_ons/{add_on}", request); + + var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); + + if (SDKConfiguration.SecuritySource != null) + { + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); + } + + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "deleteBillingAddOn", new List { }, SDKConfiguration.SecuritySource); + + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + + HttpResponseMessage httpResponse; + try + { + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); + int _statusCode = (int)httpResponse.StatusCode; + + if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + } + } + catch (Exception error) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + else + { + throw; + } + } + + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + + var contentType = httpResponse.Content.Headers.ContentType?.MediaType; + int responseStatusCode = (int)httpResponse.StatusCode; + if(responseStatusCode == 200) + { + return new DeleteBillingAddOnResponse() + { + StatusCode = responseStatusCode, + ContentType = contentType, + RawResponse = httpResponse + }; + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + throw obj!; + } + + throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + + throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + public async Task GetAsync(GetOrganizationRequest request) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); var urlString = URLBuilder.Build(baseUrl, "/v1/organization/{organizationID}", request); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("getOrganization", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getOrganization", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -356,21 +531,21 @@ public async Task GetAllAsync() var urlString = baseUrl + "/v1/organizations"; var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("getOrganizations", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getOrganizations", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -434,6 +609,91 @@ public async Task GetAllAsync() throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } + public async Task GetBillingAddOnsAsync() + { + string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); + + var urlString = baseUrl + "/v1/organization/add_ons"; + + var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); + + if (SDKConfiguration.SecuritySource != null) + { + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); + } + + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getBillingAddOns", new List { }, SDKConfiguration.SecuritySource); + + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + + HttpResponseMessage httpResponse; + try + { + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); + int _statusCode = (int)httpResponse.StatusCode; + + if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + } + } + catch (Exception error) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + else + { + throw; + } + } + + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + + var contentType = httpResponse.Content.Headers.ContentType?.MediaType; + int responseStatusCode = (int)httpResponse.StatusCode; + if(responseStatusCode == 200) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var response = new GetBillingAddOnsResponse() + { + StatusCode = responseStatusCode, + ContentType = contentType, + RawResponse = httpResponse + }; + response.OrganizationBillingAddOnResponse = obj; + return response; + } + + throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + throw obj!; + } + + throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + + throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + public async Task GetUsageAsync() { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); @@ -441,21 +701,21 @@ public async Task GetUsageAsync() var urlString = baseUrl + "/v1/organization/usage"; var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("getOrganizationUsage", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getOrganizationUsage", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) diff --git a/src/SpeakeasySDK/PublishingTokens.cs b/src/SpeakeasySDK/PublishingTokens.cs new file mode 100644 index 00000000..c58d5277 --- /dev/null +++ b/src/SpeakeasySDK/PublishingTokens.cs @@ -0,0 +1,690 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace SpeakeasySDK +{ + using Newtonsoft.Json; + using SpeakeasySDK.Hooks; + using SpeakeasySDK.Models.Errors; + using SpeakeasySDK.Models.Operations; + using SpeakeasySDK.Models.Shared; + using SpeakeasySDK.Utils; + using SpeakeasySDK.Utils.Retries; + using System; + using System.Collections.Generic; + using System.Net.Http; + using System.Net.Http.Headers; + using System.Threading.Tasks; + + public interface IPublishingTokens + { + + /// + /// Create a publishing token for a workspace + /// + /// + /// Creates a publishing token for the current workspace + /// + /// + Task CreateAsync(CreatePublishingTokenRequestBody? request = null); + + /// + /// Delete a specific publishing token + /// + /// + /// Delete a particular publishing token. + /// + /// + Task DeleteAsync(DeletePublishingTokenRequest request); + + /// + /// Get a specific publishing token + /// + /// + /// Get information about a particular publishing token. + /// + /// + Task GetAsync(GetPublishingTokenByIDRequest request); + + /// + /// Get publishing tokens for a workspace + /// + /// + /// Returns a publishing token for the current workspace + /// + /// + Task ListAsync(); + + /// + /// Get metadata about the token + /// + /// + /// Get information about a particular publishing token. + /// + /// + Task ResolveMetadataAsync(GetPublishingTokenPublicMetadataRequest request); + + /// + /// Get a specific publishing token target + /// + /// + /// Get information about a particular publishing token target. + /// + /// + Task ResolveTargetAsync(GetPublishingTokenTargetByIDRequest request); + + /// + /// Updates the validitity period of a publishing token + /// + /// + /// Updates the validity period of a particular publishing token. + /// + /// + Task UpdateAsync(UpdatePublishingTokenExpirationRequest request); + } + + public class PublishingTokens: IPublishingTokens + { + public SDKConfig SDKConfiguration { get; private set; } + private const string _language = "csharp"; + private const string _sdkVersion = "5.13.0"; + private const string _sdkGenVersion = "2.648.7"; + private const string _openapiDocVersion = "0.4.0"; + + public PublishingTokens(SDKConfig config) + { + SDKConfiguration = config; + } + + public async Task CreateAsync(CreatePublishingTokenRequestBody? request = null) + { + string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); + + var urlString = baseUrl + "/v1/publishing-tokens"; + + var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); + + var serializedBody = RequestBodySerializer.Serialize(request, "Request", "json", false, true); + if (serializedBody != null) + { + httpRequest.Content = serializedBody; + } + + if (SDKConfiguration.SecuritySource != null) + { + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); + } + + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "createPublishingToken", new List { }, SDKConfiguration.SecuritySource); + + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + + HttpResponseMessage httpResponse; + try + { + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); + int _statusCode = (int)httpResponse.StatusCode; + + if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + } + } + catch (Exception error) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + else + { + throw; + } + } + + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + + var contentType = httpResponse.Content.Headers.ContentType?.MediaType; + int responseStatusCode = (int)httpResponse.StatusCode; + if(responseStatusCode == 200) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); + var response = new CreatePublishingTokenResponse() + { + StatusCode = responseStatusCode, + ContentType = contentType, + RawResponse = httpResponse + }; + response.PublishingToken = obj; + return response; + } + + throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); + throw obj!; + } + + throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + + throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + + public async Task DeleteAsync(DeletePublishingTokenRequest request) + { + string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); + var urlString = URLBuilder.Build(baseUrl, "/v1/publishing-tokens/{tokenID}", request); + + var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); + + if (SDKConfiguration.SecuritySource != null) + { + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); + } + + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "deletePublishingToken", new List { }, SDKConfiguration.SecuritySource); + + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + + HttpResponseMessage httpResponse; + try + { + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); + int _statusCode = (int)httpResponse.StatusCode; + + if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + } + } + catch (Exception error) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + else + { + throw; + } + } + + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + + var contentType = httpResponse.Content.Headers.ContentType?.MediaType; + int responseStatusCode = (int)httpResponse.StatusCode; + if(responseStatusCode == 200) + { + return new DeletePublishingTokenResponse() + { + StatusCode = responseStatusCode, + ContentType = contentType, + RawResponse = httpResponse + }; + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + throw obj!; + } + + throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + + throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + + public async Task GetAsync(GetPublishingTokenByIDRequest request) + { + string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); + var urlString = URLBuilder.Build(baseUrl, "/v1/publishing-tokens/{tokenID}", request); + + var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); + + if (SDKConfiguration.SecuritySource != null) + { + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); + } + + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getPublishingTokenByID", new List { }, SDKConfiguration.SecuritySource); + + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + + HttpResponseMessage httpResponse; + try + { + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); + int _statusCode = (int)httpResponse.StatusCode; + + if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + } + } + catch (Exception error) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + else + { + throw; + } + } + + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + + var contentType = httpResponse.Content.Headers.ContentType?.MediaType; + int responseStatusCode = (int)httpResponse.StatusCode; + if(responseStatusCode == 200) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var response = new GetPublishingTokenByIDResponse() + { + StatusCode = responseStatusCode, + ContentType = contentType, + RawResponse = httpResponse + }; + response.PublishingToken = obj; + return response; + } + + throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + throw obj!; + } + + throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + + throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + + public async Task ListAsync() + { + string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); + + var urlString = baseUrl + "/v1/publishing-tokens"; + + var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); + + if (SDKConfiguration.SecuritySource != null) + { + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); + } + + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getPublishingToken", new List { }, SDKConfiguration.SecuritySource); + + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + + HttpResponseMessage httpResponse; + try + { + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); + int _statusCode = (int)httpResponse.StatusCode; + + if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + } + } + catch (Exception error) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + else + { + throw; + } + } + + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + + var contentType = httpResponse.Content.Headers.ContentType?.MediaType; + int responseStatusCode = (int)httpResponse.StatusCode; + if(responseStatusCode == 200) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var obj = ResponseBodyDeserializer.Deserialize>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var response = new GetPublishingTokenResponse() + { + StatusCode = responseStatusCode, + ContentType = contentType, + RawResponse = httpResponse + }; + response.Classes = obj; + return response; + } + + throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + throw obj!; + } + + throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + + throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + + public async Task ResolveMetadataAsync(GetPublishingTokenPublicMetadataRequest request) + { + string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); + var urlString = URLBuilder.Build(baseUrl, "/v1/publishing-tokens/{tokenID}/metadata", request); + + var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); + + if (SDKConfiguration.SecuritySource != null) + { + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); + } + + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getPublishingTokenPublicMetadata", new List { }, SDKConfiguration.SecuritySource); + + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + + HttpResponseMessage httpResponse; + try + { + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); + int _statusCode = (int)httpResponse.StatusCode; + + if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + } + } + catch (Exception error) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + else + { + throw; + } + } + + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + + var contentType = httpResponse.Content.Headers.ContentType?.MediaType; + int responseStatusCode = (int)httpResponse.StatusCode; + if(responseStatusCode == 200) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var response = new GetPublishingTokenPublicMetadataResponse() + { + StatusCode = responseStatusCode, + ContentType = contentType, + RawResponse = httpResponse + }; + response.Object = obj; + return response; + } + + throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + throw obj!; + } + + throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + + throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + + public async Task ResolveTargetAsync(GetPublishingTokenTargetByIDRequest request) + { + string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); + var urlString = URLBuilder.Build(baseUrl, "/v1/publishing-tokens/{tokenID}/target", request); + + var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); + + if (SDKConfiguration.SecuritySource != null) + { + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); + } + + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getPublishingTokenTargetByID", new List { }, SDKConfiguration.SecuritySource); + + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + + HttpResponseMessage httpResponse; + try + { + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); + int _statusCode = (int)httpResponse.StatusCode; + + if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + } + } + catch (Exception error) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + else + { + throw; + } + } + + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + + var contentType = httpResponse.Content.Headers.ContentType?.MediaType; + int responseStatusCode = (int)httpResponse.StatusCode; + if(responseStatusCode == 200) + { + if(Utilities.IsContentTypeMatch("text/plain", contentType)) + { + var response = new GetPublishingTokenTargetByIDResponse() + { + StatusCode = responseStatusCode, + ContentType = contentType, + RawResponse = httpResponse + }; + response.Res = await httpResponse.Content.ReadAsStringAsync(); + return response; + } + + throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + throw obj!; + } + + throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + + throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + + public async Task UpdateAsync(UpdatePublishingTokenExpirationRequest request) + { + string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); + var urlString = URLBuilder.Build(baseUrl, "/v1/publishing-tokens/{tokenID}", request); + + var httpRequest = new HttpRequestMessage(HttpMethod.Put, urlString); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); + + var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "json", false, true); + if (serializedBody != null) + { + httpRequest.Content = serializedBody; + } + + if (SDKConfiguration.SecuritySource != null) + { + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); + } + + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "updatePublishingTokenExpiration", new List { }, SDKConfiguration.SecuritySource); + + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + + HttpResponseMessage httpResponse; + try + { + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); + int _statusCode = (int)httpResponse.StatusCode; + + if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + } + } + catch (Exception error) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + else + { + throw; + } + } + + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + + var contentType = httpResponse.Content.Headers.ContentType?.MediaType; + int responseStatusCode = (int)httpResponse.StatusCode; + if(responseStatusCode == 200) + { + return new UpdatePublishingTokenExpirationResponse() + { + StatusCode = responseStatusCode, + ContentType = contentType, + RawResponse = httpResponse + }; + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + throw obj!; + } + + throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + + throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + } +} \ No newline at end of file diff --git a/src/SpeakeasySDK/Reports.cs b/src/SpeakeasySDK/Reports.cs index 1f287cac..d022ceb2 100644 --- a/src/SpeakeasySDK/Reports.cs +++ b/src/SpeakeasySDK/Reports.cs @@ -51,19 +51,12 @@ public class Reports: IReports { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "5.12.0"; - private const string _sdkGenVersion = "2.493.4"; + private const string _sdkVersion = "5.13.0"; + private const string _sdkGenVersion = "2.648.7"; private const string _openapiDocVersion = "0.4.0"; - private const string _userAgent = "speakeasy-sdk/csharp 5.12.0 2.493.4 0.4.0 SpeakeasySDK"; - private string _serverUrl = ""; - private ISpeakeasyHttpClient _client; - private Func? _securitySource; - public Reports(ISpeakeasyHttpClient client, Func? securitySource, string serverUrl, SDKConfig config) + public Reports(SDKConfig config) { - _client = client; - _securitySource = securitySource; - _serverUrl = serverUrl; SDKConfiguration = config; } @@ -73,21 +66,21 @@ public async Task GetChangesReportSignedUrlAs var urlString = URLBuilder.Build(baseUrl, "/v1/reports/changes/{documentChecksum}", request); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("getChangesReportSignedUrl", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getChangesReportSignedUrl", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -133,7 +126,11 @@ public async Task GetChangesReportSignedUrlAs throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } @@ -147,21 +144,21 @@ public async Task GetLintingReportSignedUrlAs var urlString = URLBuilder.Build(baseUrl, "/v1/reports/linting/{documentChecksum}", request); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("getLintingReportSignedUrl", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getLintingReportSignedUrl", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -207,7 +204,11 @@ public async Task GetLintingReportSignedUrlAs throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } @@ -222,7 +223,7 @@ public async Task UploadReportAsync(UploadReportRequestBod var urlString = baseUrl + "/v1/reports"; var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); var serializedBody = RequestBodySerializer.Serialize(request, "Request", "multipart", false, false); if (serializedBody != null) @@ -230,19 +231,19 @@ public async Task UploadReportAsync(UploadReportRequestBod httpRequest.Content = serializedBody; } - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("uploadReport", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "uploadReport", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -288,7 +289,11 @@ public async Task UploadReportAsync(UploadReportRequestBod throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } diff --git a/src/SpeakeasySDK/SDK.cs b/src/SpeakeasySDK/SDK.cs index a41cac0a..c8e19769 100644 --- a/src/SpeakeasySDK/SDK.cs +++ b/src/SpeakeasySDK/SDK.cs @@ -52,11 +52,13 @@ public interface ISDK /// REST APIs for managing Organizations (speakeasy L1 Tenancy construct) /// public IOrganizations Organizations { get; } + public IPublishingTokens PublishingTokens { get; } /// /// REST APIs for managing reports (lint reports, change reports, etc) /// public IReports Reports { get; } + public ISchemaStore SchemaStore { get; } /// /// REST APIs for managing short URLs @@ -84,60 +86,6 @@ public interface ISDK public IEvents Events { get; } } - public class SDKConfig - { - /// - /// Server identifiers available to the SDK. - /// - public enum Server { - Prod, - } - - /// - /// Server URLs available to the SDK. - /// - public static readonly Dictionary ServerMap = new Dictionary() - { - { Server.Prod, "https://api.prod.speakeasyapi.dev" }, - }; - - public string ServerUrl = ""; - public Server? ServerName = null; - public string? WorkspaceId; - public SDKHooks Hooks = new SDKHooks(); - public RetryConfig? RetryConfig = null; - - public string GetTemplatedServerUrl() - { - if (!String.IsNullOrEmpty(this.ServerUrl)) - { - return Utilities.TemplateUrl(Utilities.RemoveSuffix(this.ServerUrl, "/"), new Dictionary()); - } - if (this.ServerName is null) - { - this.ServerName = SDKConfig.Server.Prod; - } - else if (!SDKConfig.ServerMap.ContainsKey(this.ServerName.Value)) - { - throw new Exception($"Invalid server \"{this.ServerName.Value}\""); - } - - Dictionary serverDefault = new Dictionary(); - - return Utilities.TemplateUrl(SDKConfig.ServerMap[this.ServerName.Value], serverDefault); - } - - public ISpeakeasyHttpClient InitHooks(ISpeakeasyHttpClient client) - { - string preHooksUrl = GetTemplatedServerUrl(); - var (postHooksUrl, postHooksClient) = this.Hooks.SDKInit(preHooksUrl, client); - if (preHooksUrl != postHooksUrl) - { - this.ServerUrl = postHooksUrl; - } - return postHooksClient; - } - } /// /// Speakeasy API: The Subscriptions API manages subscriptions for CLI and registry events @@ -149,32 +97,57 @@ public class SDK: ISDK public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "5.12.0"; - private const string _sdkGenVersion = "2.493.4"; + private const string _sdkVersion = "5.13.0"; + private const string _sdkGenVersion = "2.648.7"; private const string _openapiDocVersion = "0.4.0"; - private const string _userAgent = "speakeasy-sdk/csharp 5.12.0 2.493.4 0.4.0 SpeakeasySDK"; - private string _serverUrl = ""; - private SDKConfig.Server? _server = null; - private ISpeakeasyHttpClient _client; - private Func? _securitySource; public IArtifacts Artifacts { get; private set; } public IAuth Auth { get; private set; } public ICodeSamples CodeSamples { get; private set; } public IGithub Github { get; private set; } public IOrganizations Organizations { get; private set; } + public IPublishingTokens PublishingTokens { get; private set; } public IReports Reports { get; private set; } + public ISchemaStore SchemaStore { get; private set; } public IShortURLs ShortURLs { get; private set; } public ISubscriptions Subscriptions { get; private set; } public ISuggest Suggest { get; private set; } public IWorkspaces Workspaces { get; private set; } public IEvents Events { get; private set; } + public SDK(SDKConfig config) + { + SDKConfiguration = config; + InitHooks(); + + Artifacts = new Artifacts(SDKConfiguration); + + Auth = new Auth(SDKConfiguration); + + CodeSamples = new CodeSamples(SDKConfiguration); + + Github = new Github(SDKConfiguration); + + Organizations = new Organizations(SDKConfiguration); + + PublishingTokens = new PublishingTokens(SDKConfiguration); + + Reports = new Reports(SDKConfiguration); + + SchemaStore = new SchemaStore(SDKConfiguration); + + ShortURLs = new ShortURLs(SDKConfiguration); + + Subscriptions = new Subscriptions(SDKConfiguration); + + Suggest = new Suggest(SDKConfiguration); + + Workspaces = new Workspaces(SDKConfiguration); + + Events = new Events(SDKConfiguration); + } + public SDK(SpeakeasySDK.Models.Shared.Security? security = null, Func? securitySource = null, string? workspaceId = null, SDKConfig.Server? server = null, string? serverUrl = null, Dictionary? urlParams = null, ISpeakeasyHttpClient? client = null, RetryConfig? retryConfig = null) { - if (server != null) - { - _server = server; - } if (serverUrl != null) { @@ -182,10 +155,8 @@ public SDK(SpeakeasySDK.Models.Shared.Security? security = null, Func? _securitySource = null; if(securitySource != null) { @@ -196,48 +167,116 @@ public SDK(SpeakeasySDK.Models.Shared.Security? security = null, Func security; } - SDKConfiguration = new SDKConfig() + SDKConfiguration = new SDKConfig(client) { WorkspaceId = workspaceId, - ServerName = _server, - ServerUrl = _serverUrl, + ServerName = server, + ServerUrl = serverUrl == null ? "" : serverUrl, + SecuritySource = _securitySource, RetryConfig = retryConfig }; - _client = SDKConfiguration.InitHooks(_client); + InitHooks(); + Artifacts = new Artifacts(SDKConfiguration); - Artifacts = new Artifacts(_client, _securitySource, _serverUrl, SDKConfiguration); + Auth = new Auth(SDKConfiguration); + CodeSamples = new CodeSamples(SDKConfiguration); - Auth = new Auth(_client, _securitySource, _serverUrl, SDKConfiguration); + Github = new Github(SDKConfiguration); + Organizations = new Organizations(SDKConfiguration); - CodeSamples = new CodeSamples(_client, _securitySource, _serverUrl, SDKConfiguration); + PublishingTokens = new PublishingTokens(SDKConfiguration); + Reports = new Reports(SDKConfiguration); - Github = new Github(_client, _securitySource, _serverUrl, SDKConfiguration); + SchemaStore = new SchemaStore(SDKConfiguration); + ShortURLs = new ShortURLs(SDKConfiguration); - Organizations = new Organizations(_client, _securitySource, _serverUrl, SDKConfiguration); + Subscriptions = new Subscriptions(SDKConfiguration); + Suggest = new Suggest(SDKConfiguration); - Reports = new Reports(_client, _securitySource, _serverUrl, SDKConfiguration); + Workspaces = new Workspaces(SDKConfiguration); + Events = new Events(SDKConfiguration); + } - ShortURLs = new ShortURLs(_client, _securitySource, _serverUrl, SDKConfiguration); + private void InitHooks() + { + string preHooksUrl = SDKConfiguration.GetTemplatedServerUrl(); + var (postHooksUrl, postHooksClient) = SDKConfiguration.Hooks.SDKInit(preHooksUrl, SDKConfiguration.Client); + var config = SDKConfiguration; + if (preHooksUrl != postHooksUrl) + { + config.ServerUrl = postHooksUrl; + } + config.Client = postHooksClient; + SDKConfiguration = config; + } + public class SDKBuilder + { + private SDKConfig _sdkConfig = new SDKConfig(client: new SpeakeasyHttpClient()); - Subscriptions = new Subscriptions(_client, _securitySource, _serverUrl, SDKConfiguration); + public SDKBuilder() { } + public SDKBuilder WithServer(SDKConfig.Server server) + { + _sdkConfig.ServerName = server; + return this; + } - Suggest = new Suggest(_client, _securitySource, _serverUrl, SDKConfiguration); + public SDKBuilder WithServerUrl(string serverUrl, Dictionary? serverVariables = null) + { + if (serverVariables != null) + { + serverUrl = Utilities.TemplateUrl(serverUrl, serverVariables); + } + _sdkConfig.ServerUrl = serverUrl; + return this; + } + + public SDKBuilder WithWorkspaceId(string workspaceId) + { + _sdkConfig.WorkspaceId = workspaceId; + return this; + } + + public SDKBuilder WithSecuritySource(Func securitySource) + { + _sdkConfig.SecuritySource = securitySource; + return this; + } + + public SDKBuilder WithSecurity(SpeakeasySDK.Models.Shared.Security security) + { + _sdkConfig.SecuritySource = () => security; + return this; + } + public SDKBuilder WithClient(ISpeakeasyHttpClient client) + { + _sdkConfig.Client = client; + return this; + } - Workspaces = new Workspaces(_client, _securitySource, _serverUrl, SDKConfiguration); + public SDKBuilder WithRetryConfig(RetryConfig retryConfig) + { + _sdkConfig.RetryConfig = retryConfig; + return this; + } + public SDK Build() + { + return new SDK(_sdkConfig); + } - Events = new Events(_client, _securitySource, _serverUrl, SDKConfiguration); } + + public static SDKBuilder Builder() => new SDKBuilder(); } } \ No newline at end of file diff --git a/src/SpeakeasySDK/SDKConfig.cs b/src/SpeakeasySDK/SDKConfig.cs new file mode 100644 index 00000000..9587ecd1 --- /dev/null +++ b/src/SpeakeasySDK/SDKConfig.cs @@ -0,0 +1,81 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace SpeakeasySDK +{ + using SpeakeasySDK.Hooks; + using SpeakeasySDK.Models.Shared; + using SpeakeasySDK.Utils; + using SpeakeasySDK.Utils.Retries; + using System; + using System.Collections.Generic; + using System.Linq; + + public struct SDKConfig + { + /// + /// Server identifiers available to the SDK. + /// + public enum Server { + Prod, + } + + /// + /// Server URLs available to the SDK. + /// + public static readonly Dictionary ServerMap = new Dictionary() + { + { Server.Prod, "https://api.prod.speakeasy.com" }, + }; + + public ISpeakeasyHttpClient Client; + public string ServerUrl; + public Server? ServerName; + public string? WorkspaceId; + public string UserAgent; + public Func? SecuritySource; + public SDKHooks Hooks; + public RetryConfig? RetryConfig; + + /// + /// Initializes a new instance of the SDKConfig struct with default values. + /// + public SDKConfig(ISpeakeasyHttpClient? client = null) + { + Client = client ?? new SpeakeasyHttpClient(); + ServerUrl = ""; + ServerName = null; + WorkspaceId = null; + UserAgent = "speakeasy-sdk/csharp 5.13.0 2.648.7 0.4.0 SpeakeasySDK"; + SecuritySource = null; + Hooks = new SDKHooks(); + RetryConfig = null; + } + + public string GetTemplatedServerUrl() + { + if (!String.IsNullOrEmpty(this.ServerUrl)) + { + return Utilities.TemplateUrl(Utilities.RemoveSuffix(this.ServerUrl, "/"), new Dictionary()); + } + if (this.ServerName is null) + { + this.ServerName = SDKConfig.Server.Prod; + } + else if (!SDKConfig.ServerMap.ContainsKey(this.ServerName.Value)) + { + throw new Exception($"Invalid server \"{this.ServerName.Value}\""); + } + + Dictionary serverDefault = new Dictionary(); + + return Utilities.TemplateUrl(SDKConfig.ServerMap[this.ServerName.Value], serverDefault); + } + } +} \ No newline at end of file diff --git a/src/SpeakeasySDK/SchemaStore.cs b/src/SpeakeasySDK/SchemaStore.cs new file mode 100644 index 00000000..99ff9269 --- /dev/null +++ b/src/SpeakeasySDK/SchemaStore.cs @@ -0,0 +1,234 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace SpeakeasySDK +{ + using Newtonsoft.Json; + using SpeakeasySDK.Hooks; + using SpeakeasySDK.Models.Errors; + using SpeakeasySDK.Models.Operations; + using SpeakeasySDK.Models.Shared; + using SpeakeasySDK.Utils; + using SpeakeasySDK.Utils.Retries; + using System; + using System.Collections.Generic; + using System.Net.Http; + using System.Net.Http.Headers; + using System.Threading.Tasks; + + public interface ISchemaStore + { + + /// + /// Create a schema in the schema store + /// + Task CreateSchemaStoreItemAsync(CreateSchemaStoreItemRequestBody request); + + /// + /// Get a OAS schema from the schema store + /// + Task GetSchemaStoreItemAsync(GetSchemaStoreItemRequestBody? request = null); + } + + public class SchemaStore: ISchemaStore + { + public SDKConfig SDKConfiguration { get; private set; } + private const string _language = "csharp"; + private const string _sdkVersion = "5.13.0"; + private const string _sdkGenVersion = "2.648.7"; + private const string _openapiDocVersion = "0.4.0"; + + public SchemaStore(SDKConfig config) + { + SDKConfiguration = config; + } + + public async Task CreateSchemaStoreItemAsync(CreateSchemaStoreItemRequestBody request) + { + string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); + + var urlString = baseUrl + "/v1/schema_store"; + + var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); + + var serializedBody = RequestBodySerializer.Serialize(request, "Request", "json", false, false); + if (serializedBody != null) + { + httpRequest.Content = serializedBody; + } + + if (SDKConfiguration.SecuritySource != null) + { + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); + } + + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "createSchemaStoreItem", new List { }, SDKConfiguration.SecuritySource); + + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + + HttpResponseMessage httpResponse; + try + { + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); + int _statusCode = (int)httpResponse.StatusCode; + + if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + } + } + catch (Exception error) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + else + { + throw; + } + } + + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + + var contentType = httpResponse.Content.Headers.ContentType?.MediaType; + int responseStatusCode = (int)httpResponse.StatusCode; + if(responseStatusCode >= 200 && responseStatusCode < 300) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var response = new CreateSchemaStoreItemResponse() + { + StatusCode = responseStatusCode, + ContentType = contentType, + RawResponse = httpResponse + }; + response.SchemaStoreItem = obj; + return response; + } + + throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + throw obj!; + } + + throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + + throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + + public async Task GetSchemaStoreItemAsync(GetSchemaStoreItemRequestBody? request = null) + { + string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); + + var urlString = baseUrl + "/v1/schema_store"; + + var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); + + var serializedBody = RequestBodySerializer.Serialize(request, "Request", "json", false, true); + if (serializedBody != null) + { + httpRequest.Content = serializedBody; + } + + if (SDKConfiguration.SecuritySource != null) + { + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); + } + + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getSchemaStoreItem", new List { }, SDKConfiguration.SecuritySource); + + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + + HttpResponseMessage httpResponse; + try + { + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); + int _statusCode = (int)httpResponse.StatusCode; + + if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + } + } + catch (Exception error) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + else + { + throw; + } + } + + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + + var contentType = httpResponse.Content.Headers.ContentType?.MediaType; + int responseStatusCode = (int)httpResponse.StatusCode; + if(responseStatusCode >= 200 && responseStatusCode < 300) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); + var response = new GetSchemaStoreItemResponse() + { + StatusCode = responseStatusCode, + ContentType = contentType, + RawResponse = httpResponse + }; + response.SchemaStoreItem = obj; + return response; + } + + throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); + throw obj!; + } + + throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + + throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + } +} \ No newline at end of file diff --git a/src/SpeakeasySDK/ShortURLs.cs b/src/SpeakeasySDK/ShortURLs.cs index 65c3f711..45abe002 100644 --- a/src/SpeakeasySDK/ShortURLs.cs +++ b/src/SpeakeasySDK/ShortURLs.cs @@ -41,19 +41,12 @@ public class ShortURLs: IShortURLs { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "5.12.0"; - private const string _sdkGenVersion = "2.493.4"; + private const string _sdkVersion = "5.13.0"; + private const string _sdkGenVersion = "2.648.7"; private const string _openapiDocVersion = "0.4.0"; - private const string _userAgent = "speakeasy-sdk/csharp 5.12.0 2.493.4 0.4.0 SpeakeasySDK"; - private string _serverUrl = ""; - private ISpeakeasyHttpClient _client; - private Func? _securitySource; - public ShortURLs(ISpeakeasyHttpClient client, Func? securitySource, string serverUrl, SDKConfig config) + public ShortURLs(SDKConfig config) { - _client = client; - _securitySource = securitySource; - _serverUrl = serverUrl; SDKConfiguration = config; } @@ -64,7 +57,7 @@ public async Task CreateAsync(CreateRequestBody request) var urlString = baseUrl + "/v1/short_urls"; var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); var serializedBody = RequestBodySerializer.Serialize(request, "Request", "json", false, false); if (serializedBody != null) @@ -72,19 +65,19 @@ public async Task CreateAsync(CreateRequestBody request) httpRequest.Content = serializedBody; } - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("create", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "create", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -130,7 +123,11 @@ public async Task CreateAsync(CreateRequestBody request) throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } diff --git a/src/SpeakeasySDK/SpeakeasySDK.csproj b/src/SpeakeasySDK/SpeakeasySDK.csproj index 142f8a2a..bb7026f2 100644 --- a/src/SpeakeasySDK/SpeakeasySDK.csproj +++ b/src/SpeakeasySDK/SpeakeasySDK.csproj @@ -3,7 +3,7 @@ true SpeakeasySDK - 5.12.0 + 5.13.0 net8.0 Speakeasy Copyright (c) Speakeasy 2025 diff --git a/src/SpeakeasySDK/Subscriptions.cs b/src/SpeakeasySDK/Subscriptions.cs index b2dcdbc7..35ef4dc6 100644 --- a/src/SpeakeasySDK/Subscriptions.cs +++ b/src/SpeakeasySDK/Subscriptions.cs @@ -46,19 +46,12 @@ public class Subscriptions: ISubscriptions { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "5.12.0"; - private const string _sdkGenVersion = "2.493.4"; + private const string _sdkVersion = "5.13.0"; + private const string _sdkGenVersion = "2.648.7"; private const string _openapiDocVersion = "0.4.0"; - private const string _userAgent = "speakeasy-sdk/csharp 5.12.0 2.493.4 0.4.0 SpeakeasySDK"; - private string _serverUrl = ""; - private ISpeakeasyHttpClient _client; - private Func? _securitySource; - public Subscriptions(ISpeakeasyHttpClient client, Func? securitySource, string serverUrl, SDKConfig config) + public Subscriptions(SDKConfig config) { - _client = client; - _securitySource = securitySource; - _serverUrl = serverUrl; SDKConfiguration = config; } @@ -68,21 +61,21 @@ public async Task ActivateSubscriptionNam var urlString = URLBuilder.Build(baseUrl, "/v1/subscriptions/{subscriptionID}/{namespaceName}/activate", request); var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("activateSubscriptionNamespace", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "activateSubscriptionNamespace", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -144,21 +137,21 @@ public async Task IgnoreSubscriptionNamespa var urlString = URLBuilder.Build(baseUrl, "/v1/subscriptions/{subscriptionID}/{namespaceName}/ignore", request); var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("ignoreSubscriptionNamespace", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "ignoreSubscriptionNamespace", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) diff --git a/src/SpeakeasySDK/Suggest.cs b/src/SpeakeasySDK/Suggest.cs index 241b4dfd..6af84676 100644 --- a/src/SpeakeasySDK/Suggest.cs +++ b/src/SpeakeasySDK/Suggest.cs @@ -68,19 +68,12 @@ public class Suggest: ISuggest { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "5.12.0"; - private const string _sdkGenVersion = "2.493.4"; + private const string _sdkVersion = "5.13.0"; + private const string _sdkGenVersion = "2.648.7"; private const string _openapiDocVersion = "0.4.0"; - private const string _userAgent = "speakeasy-sdk/csharp 5.12.0 2.493.4 0.4.0 SpeakeasySDK"; - private string _serverUrl = ""; - private ISpeakeasyHttpClient _client; - private Func? _securitySource; - public Suggest(ISpeakeasyHttpClient client, Func? securitySource, string serverUrl, SDKConfig config) + public Suggest(SDKConfig config) { - _client = client; - _securitySource = securitySource; - _serverUrl = serverUrl; SDKConfiguration = config; } @@ -91,7 +84,7 @@ public async Task SuggestAsync(SuggestRequest request) var urlString = baseUrl + "/v1/suggest/openapi_from_summary"; var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); HeaderSerializer.PopulateHeaders(ref httpRequest, request); var serializedBody = RequestBodySerializer.Serialize(request, "SuggestRequestBody", "json", false, false); @@ -100,19 +93,19 @@ public async Task SuggestAsync(SuggestRequest request) httpRequest.Content = serializedBody; } - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("suggest", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "suggest", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -157,7 +150,11 @@ public async Task SuggestAsync(SuggestRequest request) throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } @@ -172,7 +169,7 @@ public async Task SuggestItemsAsync(SuggestItemsRequestBod var urlString = baseUrl + "/v1/suggest/items"; var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); var serializedBody = RequestBodySerializer.Serialize(request, "Request", "json", false, false); if (serializedBody != null) @@ -180,19 +177,19 @@ public async Task SuggestItemsAsync(SuggestItemsRequestBod httpRequest.Content = serializedBody; } - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("suggestItems", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "suggestItems", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -238,7 +235,11 @@ public async Task SuggestItemsAsync(SuggestItemsRequestBod throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } @@ -253,7 +254,7 @@ public async Task SuggestOpenAPIAsync(SuggestOpenAPIRequ var urlString = baseUrl + "/v1/suggest/openapi"; var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); HeaderSerializer.PopulateHeaders(ref httpRequest, request); var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "multipart", false, false); @@ -262,19 +263,19 @@ public async Task SuggestOpenAPIAsync(SuggestOpenAPIRequ httpRequest.Content = serializedBody; } - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("suggestOpenAPI", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "suggestOpenAPI", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -319,7 +320,11 @@ public async Task SuggestOpenAPIAsync(SuggestOpenAPIRequ throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } @@ -333,7 +338,7 @@ public async Task SuggestOpenAPIRegistryAsync(Su var urlString = URLBuilder.Build(baseUrl, "/v1/suggest/openapi/{namespace_name}/{revision_reference}", request); var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); HeaderSerializer.PopulateHeaders(ref httpRequest, request); var serializedBody = RequestBodySerializer.Serialize(request, "SuggestRequestBody", "json", false, true); @@ -342,19 +347,19 @@ public async Task SuggestOpenAPIRegistryAsync(Su httpRequest.Content = serializedBody; } - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("suggestOpenAPIRegistry", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "suggestOpenAPIRegistry", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -399,7 +404,11 @@ public async Task SuggestOpenAPIRegistryAsync(Su throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) { throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } diff --git a/src/SpeakeasySDK/Utils/OpenEnumConverter.cs b/src/SpeakeasySDK/Utils/OpenEnumConverter.cs new file mode 100644 index 00000000..bb6c64b3 --- /dev/null +++ b/src/SpeakeasySDK/Utils/OpenEnumConverter.cs @@ -0,0 +1,62 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +using System; +using Newtonsoft.Json; +namespace SpeakeasySDK.Utils +{ + internal class OpenEnumConverter : JsonConverter + { + public override bool CanConvert(System.Type objectType) + { + return objectType.GetMethod("Of") != null && objectType.GetMethod("ToString") != null; + } + + public override object? ReadJson( + JsonReader reader, + System.Type objectType, + object? existingValue, + JsonSerializer serializer + ) + { + if (reader.Value == null) + { + return null; + } + + var method = objectType.GetMethod("Of"); + if (method == null) + { + throw new Exception($"Unable to find Of method on {objectType}"); + } + try { + return method.Invoke(null, new[] { reader.Value }); + } catch(System.Reflection.TargetInvocationException e) { + throw new Newtonsoft.Json.JsonSerializationException("Unable to convert value to open enum", e); + } + } + + public override void WriteJson(JsonWriter writer, object? obj, JsonSerializer serializer) + { + if (obj == null) + { + writer.WriteValue("null"); + return; + } + + var valueProp = obj.GetType().GetProperty("Value"); + if (valueProp == null) + { + throw new Exception($"{obj.GetType()} does not have a Value property"); + } + + writer.WriteValue(valueProp.GetValue(obj)); + } + } +} diff --git a/src/SpeakeasySDK/Utils/RequestBodySerializer.cs b/src/SpeakeasySDK/Utils/RequestBodySerializer.cs index 9e3f6938..e0599e85 100644 --- a/src/SpeakeasySDK/Utils/RequestBodySerializer.cs +++ b/src/SpeakeasySDK/Utils/RequestBodySerializer.cs @@ -265,48 +265,44 @@ private static HttpContent SerializeMultipart(object request, string mediaType) if (metadata.File) { - if (!Utilities.IsClass(value)) + if (Utilities.IsList(value)) { - throw new Exception( - "Cannot serialize multipart file from type " + value.GetType().Name - ); - } - - var fileProps = value.GetType().GetProperties(); - - byte[]? content = null; - string fileName = ""; - string fieldName = metadata.Name; - - foreach (var fileProp in fileProps) - { - var fileMetadata = fileProp - .GetCustomAttribute() - ?.GetMultipartFormMetadata(); - if ( - fileMetadata == null - || (!fileMetadata.Content && fileMetadata.Name == "") - ) + // Handle array/list of files - similar to how normal lists are handled + foreach (var fileItem in (IList)value) { - continue; - } + if (!Utilities.IsClass(fileItem)) + { + throw new Exception( + "Cannot serialize multipart file from type " + fileItem.GetType().Name + ); + } - if (fileMetadata.Content) - { - content = (byte[]?)fileProp.GetValue(value); - } - else - { - fileName = fileProp.GetValue(value)?.ToString() ?? ""; + var fileProps = fileItem.GetType().GetProperties(); + var (fileName, content) = ExtractFileProperties(fileProps, fileItem); + string fieldName = (metadata.Name ?? prop.Name) + "[]"; + + var fileContent = new ByteArrayContent(content); + fileContent.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); + formData.Add(fileContent, fieldName, fileName); } } - - if (fileName == "" || content == null) + else if (Utilities.IsClass(value)) { - throw new Exception("Invalid multipart/form-data file"); + // Handle single file + var fileProps = value.GetType().GetProperties(); + var (fileName, content) = ExtractFileProperties(fileProps, value); + string fieldName = metadata.Name; + + var fileContent = new ByteArrayContent(content); + fileContent.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); + formData.Add(fileContent, fieldName, fileName); + } + else + { + throw new Exception( + "Cannot serialize multipart file from type " + value.GetType().Name + ); } - - formData.Add(new ByteArrayContent(content), fieldName, fileName); } else if (metadata.Json) { @@ -520,6 +516,42 @@ ref Dictionary> form } } + private static (string fileName, byte[] content) ExtractFileProperties(PropertyInfo[] fileProps, object fileObject) + { + byte[]? content = null; + string fileName = ""; + + foreach (var fileProp in fileProps) + { + var fileMetadata = fileProp + .GetCustomAttribute() + ?.GetMultipartFormMetadata(); + if ( + fileMetadata == null + || (!fileMetadata.Content && fileMetadata.Name == "") + ) + { + continue; + } + + if (fileMetadata.Content) + { + content = (byte[]?)fileProp.GetValue(fileObject); + } + else + { + fileName = fileProp.GetValue(fileObject)?.ToString() ?? ""; + } + } + + if (fileName == "" || content == null) + { + throw new Exception("Invalid multipart/form-data file"); + } + + return (fileName, content); + } + private static PropertyInfo? GetPropertyInfo(object value, string propertyName) { try diff --git a/src/SpeakeasySDK/Utils/SecurityMetadata.cs b/src/SpeakeasySDK/Utils/SecurityMetadata.cs index d6f5982f..dafd3717 100644 --- a/src/SpeakeasySDK/Utils/SecurityMetadata.cs +++ b/src/SpeakeasySDK/Utils/SecurityMetadata.cs @@ -196,6 +196,8 @@ object value case "bearer": headerParams.Add(key, Utilities.PrefixBearer(valStr)); break; + case "custom": + break; default: throw new Exception($"Unknown http subType: {schemeMetadata.SubType}"); } diff --git a/src/SpeakeasySDK/Workspaces.cs b/src/SpeakeasySDK/Workspaces.cs index e390c6b2..12ef1b9c 100644 --- a/src/SpeakeasySDK/Workspaces.cs +++ b/src/SpeakeasySDK/Workspaces.cs @@ -139,19 +139,12 @@ public class Workspaces: IWorkspaces { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "5.12.0"; - private const string _sdkGenVersion = "2.493.4"; + private const string _sdkVersion = "5.13.0"; + private const string _sdkGenVersion = "2.648.7"; private const string _openapiDocVersion = "0.4.0"; - private const string _userAgent = "speakeasy-sdk/csharp 5.12.0 2.493.4 0.4.0 SpeakeasySDK"; - private string _serverUrl = ""; - private ISpeakeasyHttpClient _client; - private Func? _securitySource; - public Workspaces(ISpeakeasyHttpClient client, Func? securitySource, string serverUrl, SDKConfig config) + public Workspaces(SDKConfig config) { - _client = client; - _securitySource = securitySource; - _serverUrl = serverUrl; SDKConfiguration = config; } @@ -162,7 +155,7 @@ public async Task CreateAsync(Workspace request) var urlString = baseUrl + "/v1/workspace"; var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); var serializedBody = RequestBodySerializer.Serialize(request, "Request", "json", false, false); if (serializedBody != null) @@ -170,19 +163,19 @@ public async Task CreateAsync(Workspace request) httpRequest.Content = serializedBody; } - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("createWorkspace", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "createWorkspace", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -258,7 +251,7 @@ public async Task CreateTokenAsync(CreateWorkspace var urlString = URLBuilder.Build(baseUrl, "/v1/workspace/{workspace_id}/tokens", request); var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); var serializedBody = RequestBodySerializer.Serialize(request, "WorkspaceToken", "json", false, false); if (serializedBody != null) @@ -266,19 +259,19 @@ public async Task CreateTokenAsync(CreateWorkspace httpRequest.Content = serializedBody; } - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("createWorkspaceToken", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "createWorkspaceToken", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -346,21 +339,21 @@ public async Task DeleteTokenAsync(DeleteWorkspace var urlString = URLBuilder.Build(baseUrl, "/v1/workspace/{workspace_id}/tokens/{tokenID}", request); var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("deleteWorkspaceToken", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "deleteWorkspaceToken", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -423,21 +416,21 @@ public async Task GetAsync() var urlString = baseUrl + "/v1/workspace"; var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("getWorkspaceByContext", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getWorkspaceByContext", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -508,21 +501,21 @@ public async Task GetAllAsync() var urlString = baseUrl + "/v1/workspaces"; var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("getWorkspaces", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getWorkspaces", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -594,21 +587,21 @@ public async Task GetByIDAsync(GetWorkspaceRequest? reques var urlString = URLBuilder.Build(baseUrl, "/v1/workspace/{workspace_id}", request); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("getWorkspace", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getWorkspace", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -680,21 +673,21 @@ public async Task GetFeatureFlagsAsync(GetWork var urlString = URLBuilder.Build(baseUrl, "/v1/workspace/{workspace_id}/feature_flags", request); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("getWorkspaceFeatureFlags", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getWorkspaceFeatureFlags", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -766,21 +759,21 @@ public async Task GetSettingsAsync(GetWorkspaceSet var urlString = URLBuilder.Build(baseUrl, "/v1/workspace/{workspace_id}/settings", request); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("getWorkspaceSettings", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getWorkspaceSettings", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -852,21 +845,21 @@ public async Task GetTeamAsync(GetWorkspaceTeamRequest var urlString = URLBuilder.Build(baseUrl, "/v1/workspace/{workspace_id}/team", request); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("getWorkspaceTeam", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getWorkspaceTeam", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -938,21 +931,21 @@ public async Task GetTokensAsync(GetWorkspaceTokensR var urlString = URLBuilder.Build(baseUrl, "/v1/workspace/{workspace_id}/tokens", request); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("getWorkspaceTokens", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "getWorkspaceTokens", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -1028,21 +1021,21 @@ public async Task GrantAccessAsync(GrantUser var urlString = URLBuilder.Build(baseUrl, "/v1/workspace/{workspace_id}/team/email/{email}", request); var httpRequest = new HttpRequestMessage(HttpMethod.Put, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("grantUserAccessToWorkspace", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "grantUserAccessToWorkspace", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -1118,21 +1111,21 @@ public async Task RevokeAccessAsync(RevokeU var urlString = URLBuilder.Build(baseUrl, "/v1/workspace/{workspace_id}/team/{userId}", request); var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("revokeUserAccessToWorkspace", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "revokeUserAccessToWorkspace", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -1195,7 +1188,7 @@ public async Task SetFeatureFlagsAsync(Workspa var urlString = baseUrl + "/v1/workspace/feature_flags"; var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); var serializedBody = RequestBodySerializer.Serialize(request, "Request", "json", false, false); if (serializedBody != null) @@ -1203,19 +1196,19 @@ public async Task SetFeatureFlagsAsync(Workspa httpRequest.Content = serializedBody; } - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("setWorkspaceFeatureFlags", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "setWorkspaceFeatureFlags", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -1291,7 +1284,7 @@ public async Task UpdateAsync(UpdateWorkspaceDet var urlString = URLBuilder.Build(baseUrl, "/v1/workspace/{workspace_id}/details", request); var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); var serializedBody = RequestBodySerializer.Serialize(request, "Workspace", "json", false, false); if (serializedBody != null) @@ -1299,19 +1292,19 @@ public async Task UpdateAsync(UpdateWorkspaceDet httpRequest.Content = serializedBody; } - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("updateWorkspaceDetails", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "updateWorkspaceDetails", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) @@ -1379,7 +1372,7 @@ public async Task UpdateSettingsAsync(UpdateWor var urlString = URLBuilder.Build(baseUrl, "/v1/workspace/{workspace_id}/settings", request); var httpRequest = new HttpRequestMessage(HttpMethod.Put, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); var serializedBody = RequestBodySerializer.Serialize(request, "WorkspaceSettings", "json", false, false); if (serializedBody != null) @@ -1387,19 +1380,19 @@ public async Task UpdateSettingsAsync(UpdateWor httpRequest.Content = serializedBody; } - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("updateWorkspaceSettings", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "updateWorkspaceSettings", new List { }, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); HttpResponseMessage httpResponse; try { - httpResponse = await _client.SendAsync(httpRequest); + httpResponse = await SDKConfiguration.Client.SendAsync(httpRequest); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) From 2f5eea9373bdd26169cf25a70bfeb1092da390ee Mon Sep 17 00:00:00 2001 From: "speakeasy-github[bot]" <128539517+speakeasy-github[bot]@users.noreply.github.com> Date: Sun, 6 Jul 2025 00:27:34 +0000 Subject: [PATCH 2/2] empty commit to trigger [run-tests] workflow