fork of hey-api/openapi-ts because I need some additional things

Merge pull request #1512 from hey-api/fix/sdk-throw-on-error

fix: add sdk.throwOnError option

authored by

Lubos and committed by
GitHub
cc505ee2 dff8b812

+4776 -47
+5
.changeset/funny-donuts-call.md
··· 1 + --- 2 + '@hey-api/openapi-ts': patch 3 + --- 4 + 5 + fix: add `sdk.throwOnError` option
+1
packages/openapi-ts/src/compiler/index.ts
··· 16 16 anonymousFunction: types.createAnonymousFunction, 17 17 arrayLiteralExpression: types.createArrayLiteralExpression, 18 18 arrowFunction: types.createArrowFunction, 19 + asExpression: types.createAsExpression, 19 20 assignment: types.createAssignment, 20 21 awaitExpression: types.createAwaitExpression, 21 22 binaryExpression: transform.createBinaryExpression,
+7 -8
packages/openapi-ts/src/compiler/module.ts
··· 1 1 import ts from 'typescript'; 2 2 3 - import { createTypeReferenceNode } from './types'; 3 + import { createAsExpression, createTypeReferenceNode } from './types'; 4 4 import { 5 5 addLeadingComments, 6 6 type Comments, ··· 126 126 typeName?: string | ts.IndexedAccessTypeNode | ts.TypeNode; 127 127 }): ts.VariableStatement => { 128 128 const initializer = assertion 129 - ? ts.factory.createAsExpression( 129 + ? createAsExpression({ 130 130 expression, 131 - typeof assertion === 'string' 132 - ? createTypeReferenceNode({ 133 - typeName: assertion, 134 - }) 135 - : assertion, 136 - ) 131 + type: 132 + typeof assertion === 'string' 133 + ? createTypeReferenceNode({ typeName: assertion }) 134 + : assertion, 135 + }) 137 136 : expression; 138 137 const nameIdentifier = createIdentifier({ text: name }); 139 138 const declaration = ts.factory.createVariableDeclaration(
+16 -5
packages/openapi-ts/src/compiler/types.ts
··· 442 442 443 443 export type ObjectValue = 444 444 | { 445 - assertion?: 'any'; 445 + assertion?: 'any' | ts.TypeNode; 446 446 comments?: Comments; 447 447 spread: string; 448 448 } ··· 511 511 : createIdentifier({ text: value.spread }); 512 512 assignment = ts.factory.createSpreadAssignment( 513 513 value.assertion 514 - ? ts.factory.createAsExpression( 515 - nameIdentifier, 516 - createKeywordTypeNode({ keyword: value.assertion }), 517 - ) 514 + ? createAsExpression({ 515 + expression: nameIdentifier, 516 + type: 517 + typeof value.assertion === 'string' 518 + ? createKeywordTypeNode({ keyword: value.assertion }) 519 + : value.assertion, 520 + }) 518 521 : nameIdentifier, 519 522 ); 520 523 } else if (value.shorthand || (shorthand && canShorthand)) { ··· 902 905 flags?: ReadonlyArray<'g' | 'i' | 'm' | 's' | 'u' | 'y'>; 903 906 text: string; 904 907 }) => ts.factory.createRegularExpressionLiteral(`/${text}/${flags.join('')}`); 908 + 909 + export const createAsExpression = ({ 910 + expression, 911 + type, 912 + }: { 913 + expression: ts.Expression; 914 + type: ts.TypeNode; 915 + }) => ts.factory.createAsExpression(expression, type);
+4
packages/openapi-ts/src/plugins/@hey-api/sdk/__tests__/plugin.test.ts
··· 110 110 openApi, 111 111 plugin: { 112 112 exportFromIndex: false, 113 + name: '@hey-api/sdk', 113 114 output: '', 114 115 }, 115 116 }); ··· 222 223 openApi, 223 224 plugin: { 224 225 exportFromIndex: false, 226 + name: '@hey-api/sdk', 225 227 output: '', 226 228 }, 227 229 }); ··· 295 297 openApi, 296 298 plugin: { 297 299 exportFromIndex: false, 300 + name: '@hey-api/sdk', 298 301 output: '', 299 302 }, 300 303 }); ··· 370 373 openApi, 371 374 plugin: { 372 375 exportFromIndex: false, 376 + name: '@hey-api/sdk', 373 377 output: '', 374 378 }, 375 379 });
+1
packages/openapi-ts/src/plugins/@hey-api/sdk/config.ts
··· 36 36 output: 'sdk', 37 37 response: 'body', 38 38 serviceNameBuilder: '{{name}}Service', 39 + throwOnError: false, 39 40 }; 40 41 41 42 /**
+60 -25
packages/openapi-ts/src/plugins/@hey-api/sdk/plugin-legacy.ts
··· 20 20 OperationParameter, 21 21 Service, 22 22 } from '../../../types/client'; 23 - import type { Config } from '../../../types/config'; 23 + import type { Config as ClientConfig } from '../../../types/config'; 24 24 import { 25 25 getConfig, 26 26 isLegacyClient, ··· 33 33 import { setUniqueTypeName } from '../../../utils/type'; 34 34 import { unique } from '../../../utils/unique'; 35 35 import type { Plugin } from '../../types'; 36 + import type { Config } from './types'; 36 37 37 38 type OnNode = (node: Node) => void; 38 39 type OnImport = (name: string) => void; ··· 270 271 return comment; 271 272 }; 272 273 273 - const toRequestOptions = ( 274 - client: Client, 275 - operation: Operation, 276 - onImport: OnImport, 277 - onClientImport: OnImport | undefined, 278 - ) => { 274 + const toRequestOptions = ({ 275 + client, 276 + onClientImport, 277 + onImport, 278 + operation, 279 + }: { 280 + client: Client; 281 + onClientImport: OnImport | undefined; 282 + onImport: OnImport; 283 + operation: Operation; 284 + }) => { 279 285 const config = getConfig(); 280 286 281 287 const name = operationResponseTypeName(operation.name); ··· 488 494 id, 489 495 operation, 490 496 }: { 491 - config: Config; 497 + config: ClientConfig; 492 498 handleIllegal?: boolean; 493 499 id: string; 494 500 operation: IR.OperationObject | Operation; ··· 504 510 return id; 505 511 }; 506 512 507 - const toOperationStatements = ( 508 - client: Client, 509 - operation: Operation, 510 - onImport: OnImport, 511 - onClientImport?: OnImport, 512 - ) => { 513 + const toOperationStatements = ({ 514 + client, 515 + onClientImport, 516 + onImport, 517 + operation, 518 + }: { 519 + client: Client; 520 + onClientImport?: OnImport; 521 + onImport: OnImport; 522 + operation: Operation; 523 + }) => { 513 524 const config = getConfig(); 514 525 515 - const options = toRequestOptions(client, operation, onImport, onClientImport); 526 + const options = toRequestOptions({ 527 + client, 528 + onClientImport, 529 + onImport, 530 + operation, 531 + }); 516 532 517 533 if (!isLegacyClient(config)) { 518 534 const errorType = setUniqueTypeName({ ··· 587 603 onClientImport, 588 604 onImport, 589 605 onNode, 606 + plugin, 590 607 service, 591 608 }: { 592 609 client: Client; 593 610 onClientImport: OnImport; 594 611 onImport: OnImport; 595 612 onNode: OnNode; 613 + plugin: Plugin.Instance<Config>; 596 614 service: Service; 597 615 }) => { 598 616 const config = getConfig(); ··· 647 665 } 648 666 649 667 const throwOnErrorTypeGeneric: FunctionTypeParameter = { 650 - default: false, 668 + default: plugin.throwOnError, 651 669 extends: 'boolean', 652 670 name: 'ThrowOnError', 653 671 }; ··· 662 680 returnType: !isLegacy 663 681 ? undefined 664 682 : toOperationReturnType(client, operation), 665 - statements: toOperationStatements( 683 + statements: toOperationStatements({ 666 684 client, 685 + onClientImport, 686 + onImport, 667 687 operation, 668 - onImport, 669 - onClientImport, 670 - ), 688 + }), 671 689 types: !isLegacy ? [throwOnErrorTypeGeneric] : undefined, 672 690 }; 673 691 const expression = ··· 706 724 returnType: !isLegacy 707 725 ? undefined 708 726 : toOperationReturnType(client, operation), 709 - statements: toOperationStatements( 727 + statements: toOperationStatements({ 710 728 client, 711 - operation, 712 - onImport, 713 729 onClientImport, 714 - ), 730 + onImport, 731 + operation, 732 + }), 715 733 types: !isLegacy ? [throwOnErrorTypeGeneric] : undefined, 716 734 }); 717 735 return node; ··· 768 786 onNode(statement); 769 787 }; 770 788 771 - export const handlerLegacy: Plugin.LegacyHandler<any> = ({ client, files }) => { 789 + export const handlerLegacy: Plugin.LegacyHandler<Config> = ({ 790 + client, 791 + files, 792 + plugin, 793 + }) => { 772 794 const config = getConfig(); 773 795 774 796 if (!config.client.name) { ··· 863 885 parameters: [ 864 886 compiler.callExpression({ 865 887 functionName: 'createConfig', 888 + parameters: [ 889 + plugin.throwOnError 890 + ? compiler.objectExpression({ 891 + obj: [ 892 + { 893 + key: 'throwOnError', 894 + value: plugin.throwOnError, 895 + }, 896 + ], 897 + }) 898 + : undefined, 899 + ], 866 900 }), 867 901 ], 868 902 }), ··· 891 925 onNode: (node) => { 892 926 files.sdk!.add(node); 893 927 }, 928 + plugin, 894 929 service, 895 930 }); 896 931 }
+14 -2
packages/openapi-ts/src/plugins/@hey-api/sdk/plugin.ts
··· 439 439 }), 440 440 types: [ 441 441 { 442 - default: false, 442 + default: plugin.throwOnError, 443 443 extends: 'boolean', 444 444 name: 'ThrowOnError', 445 445 }, ··· 523 523 }), 524 524 types: [ 525 525 { 526 - default: false, 526 + default: plugin.throwOnError, 527 527 extends: 'boolean', 528 528 name: 'ThrowOnError', 529 529 }, ··· 585 585 parameters: [ 586 586 compiler.callExpression({ 587 587 functionName: 'createConfig', 588 + parameters: [ 589 + plugin.throwOnError 590 + ? compiler.objectExpression({ 591 + obj: [ 592 + { 593 + key: 'throwOnError', 594 + value: plugin.throwOnError, 595 + }, 596 + ], 597 + }) 598 + : undefined, 599 + ], 588 600 }), 589 601 ], 590 602 }),
+6
packages/openapi-ts/src/plugins/@hey-api/sdk/types.d.ts
··· 78 78 */ 79 79 serviceNameBuilder?: string; 80 80 /** 81 + * Throw an error instead of returning it in the response? 82 + * 83 + * @default false 84 + */ 85 + throwOnError?: boolean; 86 + /** 81 87 * Transform response data before returning. This is useful if you want to 82 88 * convert for example ISO strings into Date objects. However, transformation 83 89 * adds runtime overhead, so it's not recommended to use unless necessary.
+3
packages/openapi-ts/test/__snapshots__/3.0.x/plugins/@hey-api/sdk/throwOnError/index.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + export * from './types.gen'; 3 + export * from './sdk.gen';
+384
packages/openapi-ts/test/__snapshots__/3.0.x/plugins/@hey-api/sdk/throwOnError/sdk.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + import { createClient, createConfig, type Options, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; 4 + import type { ExportData, ImportData, ImportResponse, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationError, GetApiVbyApiVersionSimpleOperationResponse, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; 5 + 6 + export const client = createClient(createConfig({ 7 + throwOnError: true 8 + })); 9 + 10 + export const export_ = <ThrowOnError extends boolean = true>(options?: Options<ExportData, ThrowOnError>) => { 11 + return (options?.client ?? client).get<unknown, unknown, ThrowOnError>({ 12 + ...options, 13 + url: '/api/v{api-version}/no-tag' 14 + }); 15 + }; 16 + 17 + export const import_ = <ThrowOnError extends boolean = true>(options: Options<ImportData, ThrowOnError>) => { 18 + return (options?.client ?? client).post<ImportResponse, unknown, ThrowOnError>({ 19 + ...options, 20 + headers: { 21 + 'Content-Type': 'application/json', 22 + ...options?.headers 23 + }, 24 + url: '/api/v{api-version}/no-tag' 25 + }); 26 + }; 27 + 28 + export const apiVVersionODataControllerCount = <ThrowOnError extends boolean = true>(options?: Options<ApiVVersionODataControllerCountData, ThrowOnError>) => { 29 + return (options?.client ?? client).get<ApiVVersionODataControllerCountResponse, unknown, ThrowOnError>({ 30 + ...options, 31 + url: '/api/v{api-version}/simple/$count' 32 + }); 33 + }; 34 + 35 + export const getApiVbyApiVersionSimpleOperation = <ThrowOnError extends boolean = true>(options: Options<GetApiVbyApiVersionSimpleOperationData, ThrowOnError>) => { 36 + return (options?.client ?? client).get<GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, ThrowOnError>({ 37 + ...options, 38 + url: '/api/v{api-version}/simple:operation' 39 + }); 40 + }; 41 + 42 + export const deleteCallWithoutParametersAndResponse = <ThrowOnError extends boolean = true>(options?: Options<DeleteCallWithoutParametersAndResponseData, ThrowOnError>) => { 43 + return (options?.client ?? client).delete<unknown, unknown, ThrowOnError>({ 44 + ...options, 45 + url: '/api/v{api-version}/simple' 46 + }); 47 + }; 48 + 49 + export const getCallWithoutParametersAndResponse = <ThrowOnError extends boolean = true>(options?: Options<GetCallWithoutParametersAndResponseData, ThrowOnError>) => { 50 + return (options?.client ?? client).get<unknown, unknown, ThrowOnError>({ 51 + ...options, 52 + url: '/api/v{api-version}/simple' 53 + }); 54 + }; 55 + 56 + export const headCallWithoutParametersAndResponse = <ThrowOnError extends boolean = true>(options?: Options<HeadCallWithoutParametersAndResponseData, ThrowOnError>) => { 57 + return (options?.client ?? client).head<unknown, unknown, ThrowOnError>({ 58 + ...options, 59 + url: '/api/v{api-version}/simple' 60 + }); 61 + }; 62 + 63 + export const optionsCallWithoutParametersAndResponse = <ThrowOnError extends boolean = true>(options?: Options<OptionsCallWithoutParametersAndResponseData, ThrowOnError>) => { 64 + return (options?.client ?? client).options<unknown, unknown, ThrowOnError>({ 65 + ...options, 66 + url: '/api/v{api-version}/simple' 67 + }); 68 + }; 69 + 70 + export const patchCallWithoutParametersAndResponse = <ThrowOnError extends boolean = true>(options?: Options<PatchCallWithoutParametersAndResponseData, ThrowOnError>) => { 71 + return (options?.client ?? client).patch<unknown, unknown, ThrowOnError>({ 72 + ...options, 73 + url: '/api/v{api-version}/simple' 74 + }); 75 + }; 76 + 77 + export const postCallWithoutParametersAndResponse = <ThrowOnError extends boolean = true>(options?: Options<PostCallWithoutParametersAndResponseData, ThrowOnError>) => { 78 + return (options?.client ?? client).post<unknown, unknown, ThrowOnError>({ 79 + ...options, 80 + url: '/api/v{api-version}/simple' 81 + }); 82 + }; 83 + 84 + export const putCallWithoutParametersAndResponse = <ThrowOnError extends boolean = true>(options?: Options<PutCallWithoutParametersAndResponseData, ThrowOnError>) => { 85 + return (options?.client ?? client).put<unknown, unknown, ThrowOnError>({ 86 + ...options, 87 + url: '/api/v{api-version}/simple' 88 + }); 89 + }; 90 + 91 + export const deleteFoo = <ThrowOnError extends boolean = true>(options: Options<DeleteFooData3, ThrowOnError>) => { 92 + return (options?.client ?? client).delete<unknown, unknown, ThrowOnError>({ 93 + ...options, 94 + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}' 95 + }); 96 + }; 97 + 98 + export const callWithDescriptions = <ThrowOnError extends boolean = true>(options?: Options<CallWithDescriptionsData, ThrowOnError>) => { 99 + return (options?.client ?? client).post<unknown, unknown, ThrowOnError>({ 100 + ...options, 101 + url: '/api/v{api-version}/descriptions' 102 + }); 103 + }; 104 + 105 + /** 106 + * @deprecated 107 + */ 108 + export const deprecatedCall = <ThrowOnError extends boolean = true>(options: Options<DeprecatedCallData, ThrowOnError>) => { 109 + return (options?.client ?? client).post<unknown, unknown, ThrowOnError>({ 110 + ...options, 111 + url: '/api/v{api-version}/parameters/deprecated' 112 + }); 113 + }; 114 + 115 + export const callWithParameters = <ThrowOnError extends boolean = true>(options: Options<CallWithParametersData, ThrowOnError>) => { 116 + return (options?.client ?? client).post<unknown, unknown, ThrowOnError>({ 117 + ...options, 118 + headers: { 119 + 'Content-Type': 'application/json', 120 + ...options?.headers 121 + }, 122 + url: '/api/v{api-version}/parameters/{parameterPath}' 123 + }); 124 + }; 125 + 126 + export const callWithWeirdParameterNames = <ThrowOnError extends boolean = true>(options: Options<CallWithWeirdParameterNamesData, ThrowOnError>) => { 127 + return (options?.client ?? client).post<unknown, unknown, ThrowOnError>({ 128 + ...options, 129 + headers: { 130 + 'Content-Type': 'application/json', 131 + ...options?.headers 132 + }, 133 + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}' 134 + }); 135 + }; 136 + 137 + export const getCallWithOptionalParam = <ThrowOnError extends boolean = true>(options: Options<GetCallWithOptionalParamData, ThrowOnError>) => { 138 + return (options?.client ?? client).get<unknown, unknown, ThrowOnError>({ 139 + ...options, 140 + headers: { 141 + 'Content-Type': 'application/json', 142 + ...options?.headers 143 + }, 144 + url: '/api/v{api-version}/parameters' 145 + }); 146 + }; 147 + 148 + export const postCallWithOptionalParam = <ThrowOnError extends boolean = true>(options: Options<PostCallWithOptionalParamData, ThrowOnError>) => { 149 + return (options?.client ?? client).post<PostCallWithOptionalParamResponse, unknown, ThrowOnError>({ 150 + ...options, 151 + headers: { 152 + 'Content-Type': 'application/json', 153 + ...options?.headers 154 + }, 155 + url: '/api/v{api-version}/parameters' 156 + }); 157 + }; 158 + 159 + export const postApiVbyApiVersionRequestBody = <ThrowOnError extends boolean = true>(options?: Options<PostApiVbyApiVersionRequestBodyData, ThrowOnError>) => { 160 + return (options?.client ?? client).post<unknown, unknown, ThrowOnError>({ 161 + ...options, 162 + headers: { 163 + 'Content-Type': 'application/json', 164 + ...options?.headers 165 + }, 166 + url: '/api/v{api-version}/requestBody' 167 + }); 168 + }; 169 + 170 + export const postApiVbyApiVersionFormData = <ThrowOnError extends boolean = true>(options?: Options<PostApiVbyApiVersionFormDataData, ThrowOnError>) => { 171 + return (options?.client ?? client).post<unknown, unknown, ThrowOnError>({ 172 + ...options, 173 + ...formDataBodySerializer, 174 + headers: { 175 + 'Content-Type': null, 176 + ...options?.headers 177 + }, 178 + url: '/api/v{api-version}/formData' 179 + }); 180 + }; 181 + 182 + export const callWithDefaultParameters = <ThrowOnError extends boolean = true>(options?: Options<CallWithDefaultParametersData, ThrowOnError>) => { 183 + return (options?.client ?? client).get<unknown, unknown, ThrowOnError>({ 184 + ...options, 185 + url: '/api/v{api-version}/defaults' 186 + }); 187 + }; 188 + 189 + export const callWithDefaultOptionalParameters = <ThrowOnError extends boolean = true>(options?: Options<CallWithDefaultOptionalParametersData, ThrowOnError>) => { 190 + return (options?.client ?? client).post<unknown, unknown, ThrowOnError>({ 191 + ...options, 192 + url: '/api/v{api-version}/defaults' 193 + }); 194 + }; 195 + 196 + export const callToTestOrderOfParams = <ThrowOnError extends boolean = true>(options: Options<CallToTestOrderOfParamsData, ThrowOnError>) => { 197 + return (options?.client ?? client).put<unknown, unknown, ThrowOnError>({ 198 + ...options, 199 + url: '/api/v{api-version}/defaults' 200 + }); 201 + }; 202 + 203 + export const duplicateName = <ThrowOnError extends boolean = true>(options?: Options<DuplicateNameData, ThrowOnError>) => { 204 + return (options?.client ?? client).delete<unknown, unknown, ThrowOnError>({ 205 + ...options, 206 + url: '/api/v{api-version}/duplicate' 207 + }); 208 + }; 209 + 210 + export const duplicateName2 = <ThrowOnError extends boolean = true>(options?: Options<DuplicateName2Data, ThrowOnError>) => { 211 + return (options?.client ?? client).get<unknown, unknown, ThrowOnError>({ 212 + ...options, 213 + url: '/api/v{api-version}/duplicate' 214 + }); 215 + }; 216 + 217 + export const duplicateName3 = <ThrowOnError extends boolean = true>(options?: Options<DuplicateName3Data, ThrowOnError>) => { 218 + return (options?.client ?? client).post<unknown, unknown, ThrowOnError>({ 219 + ...options, 220 + url: '/api/v{api-version}/duplicate' 221 + }); 222 + }; 223 + 224 + export const duplicateName4 = <ThrowOnError extends boolean = true>(options?: Options<DuplicateName4Data, ThrowOnError>) => { 225 + return (options?.client ?? client).put<unknown, unknown, ThrowOnError>({ 226 + ...options, 227 + url: '/api/v{api-version}/duplicate' 228 + }); 229 + }; 230 + 231 + export const callWithNoContentResponse = <ThrowOnError extends boolean = true>(options?: Options<CallWithNoContentResponseData, ThrowOnError>) => { 232 + return (options?.client ?? client).get<CallWithNoContentResponseResponse, unknown, ThrowOnError>({ 233 + ...options, 234 + url: '/api/v{api-version}/no-content' 235 + }); 236 + }; 237 + 238 + export const callWithResponseAndNoContentResponse = <ThrowOnError extends boolean = true>(options?: Options<CallWithResponseAndNoContentResponseData, ThrowOnError>) => { 239 + return (options?.client ?? client).get<CallWithResponseAndNoContentResponseResponse, unknown, ThrowOnError>({ 240 + ...options, 241 + url: '/api/v{api-version}/multiple-tags/response-and-no-content' 242 + }); 243 + }; 244 + 245 + export const dummyA = <ThrowOnError extends boolean = true>(options?: Options<DummyAData, ThrowOnError>) => { 246 + return (options?.client ?? client).get<DummyAResponse, unknown, ThrowOnError>({ 247 + ...options, 248 + url: '/api/v{api-version}/multiple-tags/a' 249 + }); 250 + }; 251 + 252 + export const dummyB = <ThrowOnError extends boolean = true>(options?: Options<DummyBData, ThrowOnError>) => { 253 + return (options?.client ?? client).get<DummyBResponse, unknown, ThrowOnError>({ 254 + ...options, 255 + url: '/api/v{api-version}/multiple-tags/b' 256 + }); 257 + }; 258 + 259 + export const callWithResponse = <ThrowOnError extends boolean = true>(options?: Options<CallWithResponseData, ThrowOnError>) => { 260 + return (options?.client ?? client).get<CallWithResponseResponse, unknown, ThrowOnError>({ 261 + ...options, 262 + url: '/api/v{api-version}/response' 263 + }); 264 + }; 265 + 266 + export const callWithDuplicateResponses = <ThrowOnError extends boolean = true>(options?: Options<CallWithDuplicateResponsesData, ThrowOnError>) => { 267 + return (options?.client ?? client).post<CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, ThrowOnError>({ 268 + ...options, 269 + url: '/api/v{api-version}/response' 270 + }); 271 + }; 272 + 273 + export const callWithResponses = <ThrowOnError extends boolean = true>(options?: Options<CallWithResponsesData, ThrowOnError>) => { 274 + return (options?.client ?? client).put<CallWithResponsesResponse, CallWithResponsesError, ThrowOnError>({ 275 + ...options, 276 + url: '/api/v{api-version}/response' 277 + }); 278 + }; 279 + 280 + export const collectionFormat = <ThrowOnError extends boolean = true>(options: Options<CollectionFormatData, ThrowOnError>) => { 281 + return (options?.client ?? client).get<unknown, unknown, ThrowOnError>({ 282 + ...options, 283 + url: '/api/v{api-version}/collectionFormat' 284 + }); 285 + }; 286 + 287 + export const types = <ThrowOnError extends boolean = true>(options: Options<TypesData, ThrowOnError>) => { 288 + return (options?.client ?? client).get<TypesResponse, unknown, ThrowOnError>({ 289 + ...options, 290 + url: '/api/v{api-version}/types' 291 + }); 292 + }; 293 + 294 + export const uploadFile = <ThrowOnError extends boolean = true>(options: Options<UploadFileData, ThrowOnError>) => { 295 + return (options?.client ?? client).post<UploadFileResponse, unknown, ThrowOnError>({ 296 + ...options, 297 + ...urlSearchParamsBodySerializer, 298 + headers: { 299 + 'Content-Type': 'application/x-www-form-urlencoded', 300 + ...options?.headers 301 + }, 302 + url: '/api/v{api-version}/upload' 303 + }); 304 + }; 305 + 306 + export const fileResponse = <ThrowOnError extends boolean = true>(options: Options<FileResponseData, ThrowOnError>) => { 307 + return (options?.client ?? client).get<FileResponseResponse, unknown, ThrowOnError>({ 308 + ...options, 309 + url: '/api/v{api-version}/file/{id}' 310 + }); 311 + }; 312 + 313 + export const complexTypes = <ThrowOnError extends boolean = true>(options: Options<ComplexTypesData, ThrowOnError>) => { 314 + return (options?.client ?? client).get<ComplexTypesResponse, unknown, ThrowOnError>({ 315 + ...options, 316 + url: '/api/v{api-version}/complex' 317 + }); 318 + }; 319 + 320 + export const multipartResponse = <ThrowOnError extends boolean = true>(options?: Options<MultipartResponseData, ThrowOnError>) => { 321 + return (options?.client ?? client).get<MultipartResponseResponse, unknown, ThrowOnError>({ 322 + ...options, 323 + url: '/api/v{api-version}/multipart' 324 + }); 325 + }; 326 + 327 + export const multipartRequest = <ThrowOnError extends boolean = true>(options?: Options<MultipartRequestData, ThrowOnError>) => { 328 + return (options?.client ?? client).post<unknown, unknown, ThrowOnError>({ 329 + ...options, 330 + ...formDataBodySerializer, 331 + headers: { 332 + 'Content-Type': null, 333 + ...options?.headers 334 + }, 335 + url: '/api/v{api-version}/multipart' 336 + }); 337 + }; 338 + 339 + export const complexParams = <ThrowOnError extends boolean = true>(options: Options<ComplexParamsData, ThrowOnError>) => { 340 + return (options?.client ?? client).put<ComplexParamsResponse, unknown, ThrowOnError>({ 341 + ...options, 342 + headers: { 343 + 'Content-Type': 'application/json-patch+json', 344 + ...options?.headers 345 + }, 346 + url: '/api/v{api-version}/complex/{id}' 347 + }); 348 + }; 349 + 350 + export const callWithResultFromHeader = <ThrowOnError extends boolean = true>(options?: Options<CallWithResultFromHeaderData, ThrowOnError>) => { 351 + return (options?.client ?? client).post<unknown, unknown, ThrowOnError>({ 352 + ...options, 353 + url: '/api/v{api-version}/header' 354 + }); 355 + }; 356 + 357 + export const testErrorCode = <ThrowOnError extends boolean = true>(options: Options<TestErrorCodeData, ThrowOnError>) => { 358 + return (options?.client ?? client).post<unknown, unknown, ThrowOnError>({ 359 + ...options, 360 + url: '/api/v{api-version}/error' 361 + }); 362 + }; 363 + 364 + export const nonAsciiæøåÆøÅöôêÊ字符串 = <ThrowOnError extends boolean = true>(options: Options<NonAsciiæøåÆøÅöôêÊ字符串Data, ThrowOnError>) => { 365 + return (options?.client ?? client).post<NonAsciiæøåÆøÅöôêÊ字符串Response, unknown, ThrowOnError>({ 366 + ...options, 367 + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串' 368 + }); 369 + }; 370 + 371 + /** 372 + * Login User 373 + */ 374 + export const putWithFormUrlEncoded = <ThrowOnError extends boolean = true>(options: Options<PutWithFormUrlEncodedData, ThrowOnError>) => { 375 + return (options?.client ?? client).put<unknown, unknown, ThrowOnError>({ 376 + ...options, 377 + ...urlSearchParamsBodySerializer, 378 + headers: { 379 + 'Content-Type': 'application/x-www-form-urlencoded', 380 + ...options?.headers 381 + }, 382 + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串' 383 + }); 384 + };
+1929
packages/openapi-ts/test/__snapshots__/3.0.x/plugins/@hey-api/sdk/throwOnError/types.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + /** 4 + * Model with number-only name 5 + */ 6 + export type _400 = string; 7 + 8 + /** 9 + * Testing multiline comments in string: First line 10 + * Second line 11 + * 12 + * Fourth line 13 + */ 14 + export type CamelCaseCommentWithBreaks = number; 15 + 16 + /** 17 + * Testing multiline comments in string: First line 18 + * Second line 19 + * 20 + * Fourth line 21 + */ 22 + export type CommentWithBreaks = number; 23 + 24 + /** 25 + * Testing backticks in string: `backticks` and ```multiple backticks``` should work 26 + */ 27 + export type CommentWithBackticks = number; 28 + 29 + /** 30 + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work 31 + */ 32 + export type CommentWithBackticksAndQuotes = number; 33 + 34 + /** 35 + * Testing slashes in string: \backwards\\\ and /forwards/// should work 36 + */ 37 + export type CommentWithSlashes = number; 38 + 39 + /** 40 + * Testing expression placeholders in string: ${expression} should work 41 + */ 42 + export type CommentWithExpressionPlaceholders = number; 43 + 44 + /** 45 + * Testing quotes in string: 'single quote''' and "double quotes""" should work 46 + */ 47 + export type CommentWithQuotes = number; 48 + 49 + /** 50 + * Testing reserved characters in string: * inline * and ** inline ** should work 51 + */ 52 + export type CommentWithReservedCharacters = number; 53 + 54 + /** 55 + * This is a simple number 56 + */ 57 + export type SimpleInteger = number; 58 + 59 + /** 60 + * This is a simple boolean 61 + */ 62 + export type SimpleBoolean = boolean; 63 + 64 + /** 65 + * This is a simple string 66 + */ 67 + export type SimpleString = string; 68 + 69 + /** 70 + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) 71 + */ 72 + export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; 73 + 74 + /** 75 + * This is a simple file 76 + */ 77 + export type SimpleFile = Blob | File; 78 + 79 + /** 80 + * This is a simple reference 81 + */ 82 + export type SimpleReference = ModelWithString; 83 + 84 + /** 85 + * This is a simple string 86 + */ 87 + export type SimpleStringWithPattern = string | null; 88 + 89 + /** 90 + * This is a simple enum with strings 91 + */ 92 + export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; 93 + 94 + export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; 95 + 96 + /** 97 + * This is a simple enum with numbers 98 + */ 99 + export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; 100 + 101 + /** 102 + * Success=1,Warning=2,Error=3 103 + */ 104 + export type EnumFromDescription = number; 105 + 106 + /** 107 + * This is a simple enum with numbers 108 + */ 109 + export type EnumWithExtensions = 200 | 400 | 500; 110 + 111 + export type EnumWithXEnumNames = 0 | 1 | 2; 112 + 113 + /** 114 + * This is a simple array with numbers 115 + */ 116 + export type ArrayWithNumbers = Array<number>; 117 + 118 + /** 119 + * This is a simple array with booleans 120 + */ 121 + export type ArrayWithBooleans = Array<boolean>; 122 + 123 + /** 124 + * This is a simple array with strings 125 + */ 126 + export type ArrayWithStrings = Array<string>; 127 + 128 + /** 129 + * This is a simple array with references 130 + */ 131 + export type ArrayWithReferences = Array<ModelWithString>; 132 + 133 + /** 134 + * This is a simple array containing an array 135 + */ 136 + export type ArrayWithArray = Array<Array<ModelWithString>>; 137 + 138 + /** 139 + * This is a simple array with properties 140 + */ 141 + export type ArrayWithProperties = Array<{ 142 + '16x16'?: CamelCaseCommentWithBreaks; 143 + bar?: string; 144 + }>; 145 + 146 + /** 147 + * This is a simple array with any of properties 148 + */ 149 + export type ArrayWithAnyOfProperties = Array<{ 150 + foo?: string; 151 + } | { 152 + bar?: string; 153 + }>; 154 + 155 + export type AnyOfAnyAndNull = { 156 + data?: unknown; 157 + }; 158 + 159 + /** 160 + * This is a simple array with any of properties 161 + */ 162 + export type AnyOfArrays = { 163 + results?: Array<{ 164 + foo?: string; 165 + } | { 166 + bar?: string; 167 + }>; 168 + }; 169 + 170 + /** 171 + * This is a string dictionary 172 + */ 173 + export type DictionaryWithString = { 174 + [key: string]: string; 175 + }; 176 + 177 + export type DictionaryWithPropertiesAndAdditionalProperties = { 178 + foo?: number; 179 + bar?: boolean; 180 + [key: string]: string | number | boolean | undefined; 181 + }; 182 + 183 + /** 184 + * This is a string reference 185 + */ 186 + export type DictionaryWithReference = { 187 + [key: string]: ModelWithString; 188 + }; 189 + 190 + /** 191 + * This is a complex dictionary 192 + */ 193 + export type DictionaryWithArray = { 194 + [key: string]: Array<ModelWithString>; 195 + }; 196 + 197 + /** 198 + * This is a string dictionary 199 + */ 200 + export type DictionaryWithDictionary = { 201 + [key: string]: { 202 + [key: string]: string; 203 + }; 204 + }; 205 + 206 + /** 207 + * This is a complex dictionary 208 + */ 209 + export type DictionaryWithProperties = { 210 + [key: string]: { 211 + foo?: string; 212 + bar?: string; 213 + }; 214 + }; 215 + 216 + /** 217 + * This is a model with one number property 218 + */ 219 + export type ModelWithInteger = { 220 + /** 221 + * This is a simple number property 222 + */ 223 + prop?: number; 224 + }; 225 + 226 + /** 227 + * This is a model with one boolean property 228 + */ 229 + export type ModelWithBoolean = { 230 + /** 231 + * This is a simple boolean property 232 + */ 233 + prop?: boolean; 234 + }; 235 + 236 + /** 237 + * This is a model with one string property 238 + */ 239 + export type ModelWithString = { 240 + /** 241 + * This is a simple string property 242 + */ 243 + prop?: string; 244 + }; 245 + 246 + /** 247 + * This is a model with one string property 248 + */ 249 + export type ModelWithStringError = { 250 + /** 251 + * This is a simple string property 252 + */ 253 + prop?: string; 254 + }; 255 + 256 + /** 257 + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) 258 + */ 259 + export type ModelFromZendesk = string; 260 + 261 + /** 262 + * This is a model with one string property 263 + */ 264 + export type ModelWithNullableString = { 265 + /** 266 + * This is a simple string property 267 + */ 268 + nullableProp1?: string | null; 269 + /** 270 + * This is a simple string property 271 + */ 272 + nullableRequiredProp1: string | null; 273 + /** 274 + * This is a simple string property 275 + */ 276 + nullableProp2?: string | null; 277 + /** 278 + * This is a simple string property 279 + */ 280 + nullableRequiredProp2: string | null; 281 + /** 282 + * This is a simple enum with strings 283 + */ 284 + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; 285 + }; 286 + 287 + /** 288 + * This is a model with one enum 289 + */ 290 + export type ModelWithEnum = { 291 + /** 292 + * This is a simple enum with strings 293 + */ 294 + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; 295 + /** 296 + * These are the HTTP error code enums 297 + */ 298 + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; 299 + /** 300 + * Simple boolean enum 301 + */ 302 + bool?: true; 303 + }; 304 + 305 + /** 306 + * This is a model with one enum with escaped name 307 + */ 308 + export type ModelWithEnumWithHyphen = { 309 + 'foo-bar-baz-qux'?: '3.0'; 310 + }; 311 + 312 + /** 313 + * This is a model with one enum 314 + */ 315 + export type ModelWithEnumFromDescription = { 316 + /** 317 + * Success=1,Warning=2,Error=3 318 + */ 319 + test?: number; 320 + }; 321 + 322 + /** 323 + * This is a model with nested enums 324 + */ 325 + export type ModelWithNestedEnums = { 326 + dictionaryWithEnum?: { 327 + [key: string]: 'Success' | 'Warning' | 'Error'; 328 + }; 329 + dictionaryWithEnumFromDescription?: { 330 + [key: string]: number; 331 + }; 332 + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; 333 + arrayWithDescription?: Array<number>; 334 + /** 335 + * This is a simple enum with strings 336 + */ 337 + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; 338 + }; 339 + 340 + /** 341 + * This is a model with one property containing a reference 342 + */ 343 + export type ModelWithReference = { 344 + prop?: ModelWithProperties; 345 + }; 346 + 347 + /** 348 + * This is a model with one property containing an array 349 + */ 350 + export type ModelWithArrayReadOnlyAndWriteOnly = { 351 + prop?: Array<ModelWithReadOnlyAndWriteOnly>; 352 + propWithFile?: Array<Blob | File>; 353 + propWithNumber?: Array<number>; 354 + }; 355 + 356 + /** 357 + * This is a model with one property containing an array 358 + */ 359 + export type ModelWithArray = { 360 + prop?: Array<ModelWithString>; 361 + propWithFile?: Array<Blob | File>; 362 + propWithNumber?: Array<number>; 363 + }; 364 + 365 + /** 366 + * This is a model with one property containing a dictionary 367 + */ 368 + export type ModelWithDictionary = { 369 + prop?: { 370 + [key: string]: string; 371 + }; 372 + }; 373 + 374 + /** 375 + * This is a deprecated model with a deprecated property 376 + * @deprecated 377 + */ 378 + export type DeprecatedModel = { 379 + /** 380 + * This is a deprecated property 381 + * @deprecated 382 + */ 383 + prop?: string; 384 + }; 385 + 386 + /** 387 + * This is a model with one property containing a circular reference 388 + */ 389 + export type ModelWithCircularReference = { 390 + prop?: ModelWithCircularReference; 391 + }; 392 + 393 + /** 394 + * This is a model with one property with a 'one of' relationship 395 + */ 396 + export type CompositionWithOneOf = { 397 + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; 398 + }; 399 + 400 + /** 401 + * This is a model with one property with a 'one of' relationship where the options are not $ref 402 + */ 403 + export type CompositionWithOneOfAnonymous = { 404 + propA?: { 405 + propA?: string; 406 + } | string | number; 407 + }; 408 + 409 + /** 410 + * Circle 411 + */ 412 + export type ModelCircle = { 413 + kind: string; 414 + radius?: number; 415 + }; 416 + 417 + /** 418 + * Square 419 + */ 420 + export type ModelSquare = { 421 + kind: string; 422 + sideLength?: number; 423 + }; 424 + 425 + /** 426 + * This is a model with one property with a 'one of' relationship where the options are not $ref 427 + */ 428 + export type CompositionWithOneOfDiscriminator = ({ 429 + kind?: 'circle'; 430 + } & ModelCircle) | ({ 431 + kind?: 'square'; 432 + } & ModelSquare); 433 + 434 + /** 435 + * This is a model with one property with a 'any of' relationship 436 + */ 437 + export type CompositionWithAnyOf = { 438 + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; 439 + }; 440 + 441 + /** 442 + * This is a model with one property with a 'any of' relationship where the options are not $ref 443 + */ 444 + export type CompositionWithAnyOfAnonymous = { 445 + propA?: { 446 + propA?: string; 447 + } | string | number; 448 + }; 449 + 450 + /** 451 + * This is a model with nested 'any of' property with a type null 452 + */ 453 + export type CompositionWithNestedAnyAndTypeNull = { 454 + propA?: Array<ModelWithDictionary | null> | Array<ModelWithArray | null>; 455 + }; 456 + 457 + export type _3eNum1Период = 'Bird' | 'Dog'; 458 + 459 + export type ConstValue = 'ConstValue'; 460 + 461 + /** 462 + * This is a model with one property with a 'any of' relationship where the options are not $ref 463 + */ 464 + export type CompositionWithNestedAnyOfAndNull = { 465 + propA?: Array<_3eNum1Период | ConstValue> | null; 466 + }; 467 + 468 + /** 469 + * This is a model with one property with a 'one of' relationship 470 + */ 471 + export type CompositionWithOneOfAndNullable = { 472 + propA?: { 473 + boolean?: boolean; 474 + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; 475 + }; 476 + 477 + /** 478 + * This is a model that contains a simple dictionary within composition 479 + */ 480 + export type CompositionWithOneOfAndSimpleDictionary = { 481 + propA?: boolean | { 482 + [key: string]: number; 483 + }; 484 + }; 485 + 486 + /** 487 + * This is a model that contains a dictionary of simple arrays within composition 488 + */ 489 + export type CompositionWithOneOfAndSimpleArrayDictionary = { 490 + propA?: boolean | { 491 + [key: string]: Array<boolean>; 492 + }; 493 + }; 494 + 495 + /** 496 + * This is a model that contains a dictionary of complex arrays (composited) within composition 497 + */ 498 + export type CompositionWithOneOfAndComplexArrayDictionary = { 499 + propA?: boolean | { 500 + [key: string]: Array<number | string>; 501 + }; 502 + }; 503 + 504 + /** 505 + * This is a model with one property with a 'all of' relationship 506 + */ 507 + export type CompositionWithAllOfAndNullable = { 508 + propA?: ({ 509 + boolean?: boolean; 510 + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; 511 + }; 512 + 513 + /** 514 + * This is a model with one property with a 'any of' relationship 515 + */ 516 + export type CompositionWithAnyOfAndNullable = { 517 + propA?: { 518 + boolean?: boolean; 519 + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; 520 + }; 521 + 522 + /** 523 + * This is a base model with two simple optional properties 524 + */ 525 + export type CompositionBaseModel = { 526 + firstName?: string; 527 + lastname?: string; 528 + }; 529 + 530 + /** 531 + * This is a model that extends the base model 532 + */ 533 + export type CompositionExtendedModel = CompositionBaseModel & { 534 + age: number; 535 + firstName: string; 536 + lastname: string; 537 + }; 538 + 539 + /** 540 + * This is a model with one nested property 541 + */ 542 + export type ModelWithProperties = { 543 + required: string; 544 + readonly requiredAndReadOnly: string; 545 + requiredAndNullable: string | null; 546 + string?: string; 547 + number?: number; 548 + boolean?: boolean; 549 + reference?: ModelWithString; 550 + 'property with space'?: string; 551 + default?: string; 552 + try?: string; 553 + readonly '@namespace.string'?: string; 554 + readonly '@namespace.integer'?: number; 555 + }; 556 + 557 + /** 558 + * This is a model with one nested property 559 + */ 560 + export type ModelWithNestedProperties = { 561 + readonly first: { 562 + readonly second: { 563 + readonly third: string | null; 564 + } | null; 565 + } | null; 566 + }; 567 + 568 + /** 569 + * This is a model with duplicated properties 570 + */ 571 + export type ModelWithDuplicateProperties = { 572 + prop?: ModelWithString; 573 + }; 574 + 575 + /** 576 + * This is a model with ordered properties 577 + */ 578 + export type ModelWithOrderedProperties = { 579 + zebra?: string; 580 + apple?: string; 581 + hawaii?: string; 582 + }; 583 + 584 + /** 585 + * This is a model with duplicated imports 586 + */ 587 + export type ModelWithDuplicateImports = { 588 + propA?: ModelWithString; 589 + propB?: ModelWithString; 590 + propC?: ModelWithString; 591 + }; 592 + 593 + /** 594 + * This is a model that extends another model 595 + */ 596 + export type ModelThatExtends = ModelWithString & { 597 + propExtendsA?: string; 598 + propExtendsB?: ModelWithString; 599 + }; 600 + 601 + /** 602 + * This is a model that extends another model 603 + */ 604 + export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { 605 + propExtendsC?: string; 606 + propExtendsD?: ModelWithString; 607 + }; 608 + 609 + /** 610 + * This is a model that contains a some patterns 611 + */ 612 + export type ModelWithPattern = { 613 + key: string; 614 + name: string; 615 + readonly enabled?: boolean; 616 + readonly modified?: string; 617 + id?: string; 618 + text?: string; 619 + patternWithSingleQuotes?: string; 620 + patternWithNewline?: string; 621 + patternWithBacktick?: string; 622 + }; 623 + 624 + export type File = { 625 + readonly id?: string; 626 + readonly updated_at?: string; 627 + readonly created_at?: string; 628 + mime: string; 629 + readonly file?: string; 630 + }; 631 + 632 + export type Default = { 633 + name?: string; 634 + }; 635 + 636 + export type Pageable = { 637 + page?: number; 638 + size?: number; 639 + sort?: Array<string>; 640 + }; 641 + 642 + /** 643 + * This is a free-form object without additionalProperties. 644 + */ 645 + export type FreeFormObjectWithoutAdditionalProperties = { 646 + [key: string]: unknown; 647 + }; 648 + 649 + /** 650 + * This is a free-form object with additionalProperties: true. 651 + */ 652 + export type FreeFormObjectWithAdditionalPropertiesEqTrue = { 653 + [key: string]: unknown; 654 + }; 655 + 656 + /** 657 + * This is a free-form object with additionalProperties: {}. 658 + */ 659 + export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; 660 + 661 + export type ModelWithConst = { 662 + String?: 'String'; 663 + number?: 0; 664 + null?: unknown; 665 + withType?: 'Some string'; 666 + }; 667 + 668 + /** 669 + * This is a model with one property and additionalProperties: true 670 + */ 671 + export type ModelWithAdditionalPropertiesEqTrue = { 672 + /** 673 + * This is a simple string property 674 + */ 675 + prop?: string; 676 + [key: string]: unknown | string | undefined; 677 + }; 678 + 679 + export type NestedAnyOfArraysNullable = { 680 + nullableArray?: Array<string | boolean> | null; 681 + }; 682 + 683 + export type CompositionWithOneOfAndProperties = ({ 684 + foo: SimpleParameter; 685 + } | { 686 + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; 687 + }) & { 688 + baz: number | null; 689 + qux: number; 690 + }; 691 + 692 + /** 693 + * An object that can be null 694 + */ 695 + export type NullableObject = { 696 + foo?: string; 697 + } | null; 698 + 699 + /** 700 + * Some % character 701 + */ 702 + export type CharactersInDescription = string; 703 + 704 + export type ModelWithNullableObject = { 705 + data?: NullableObject; 706 + }; 707 + 708 + export type ModelWithOneOfEnum = { 709 + foo: 'Bar'; 710 + } | { 711 + foo: 'Baz'; 712 + } | { 713 + foo: 'Qux'; 714 + } | { 715 + content: string; 716 + foo: 'Quux'; 717 + } | { 718 + content: [ 719 + string, 720 + string 721 + ]; 722 + foo: 'Corge'; 723 + }; 724 + 725 + export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; 726 + 727 + export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; 728 + 729 + export type ModelWithNestedArrayEnumsData = { 730 + foo?: Array<ModelWithNestedArrayEnumsDataFoo>; 731 + bar?: Array<ModelWithNestedArrayEnumsDataBar>; 732 + }; 733 + 734 + export type ModelWithNestedArrayEnums = { 735 + array_strings?: Array<string>; 736 + data?: ModelWithNestedArrayEnumsData; 737 + }; 738 + 739 + export type ModelWithNestedCompositionEnums = { 740 + foo?: ModelWithNestedArrayEnumsDataFoo; 741 + }; 742 + 743 + export type ModelWithReadOnlyAndWriteOnly = { 744 + foo: string; 745 + readonly bar: string; 746 + baz: string; 747 + }; 748 + 749 + export type ModelWithConstantSizeArray = [ 750 + number, 751 + number 752 + ]; 753 + 754 + export type ModelWithAnyOfConstantSizeArray = [ 755 + number | string, 756 + number | string, 757 + number | string 758 + ]; 759 + 760 + export type ModelWithPrefixItemsConstantSizeArray = Array<ModelWithInteger | number | string>; 761 + 762 + export type ModelWithAnyOfConstantSizeArrayNullable = [ 763 + number | null | string, 764 + number | null | string, 765 + number | null | string 766 + ]; 767 + 768 + export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ 769 + number | Import, 770 + number | Import 771 + ]; 772 + 773 + export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ 774 + number & string, 775 + number & string 776 + ]; 777 + 778 + export type ModelWithNumericEnumUnion = { 779 + /** 780 + * Период 781 + */ 782 + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; 783 + }; 784 + 785 + /** 786 + * Some description with `back ticks` 787 + */ 788 + export type ModelWithBackticksInDescription = { 789 + /** 790 + * The template `that` should be used for parsing and importing the contents of the CSV file. 791 + * 792 + * <br/><p>There is one placeholder currently supported:<ul> <li><b>${x}</b> - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)</li></ul><p>Example of a correct JSON template:</p> 793 + * <pre> 794 + * [ 795 + * { 796 + * "resourceType": "Asset", 797 + * "identifier": { 798 + * "name": "${1}", 799 + * "domain": { 800 + * "name": "${2}", 801 + * "community": { 802 + * "name": "Some Community" 803 + * } 804 + * } 805 + * }, 806 + * "attributes" : { 807 + * "00000000-0000-0000-0000-000000003115" : [ { 808 + * "value" : "${3}" 809 + * } ], 810 + * "00000000-0000-0000-0000-000000000222" : [ { 811 + * "value" : "${4}" 812 + * } ] 813 + * } 814 + * } 815 + * ] 816 + * </pre> 817 + */ 818 + template?: string; 819 + }; 820 + 821 + export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { 822 + baz: number | null; 823 + qux: number; 824 + }; 825 + 826 + /** 827 + * Model used to test deduplication strategy (unused) 828 + */ 829 + export type ParameterSimpleParameterUnused = string; 830 + 831 + /** 832 + * Model used to test deduplication strategy 833 + */ 834 + export type PostServiceWithEmptyTagResponse = string; 835 + 836 + /** 837 + * Model used to test deduplication strategy 838 + */ 839 + export type PostServiceWithEmptyTagResponse2 = string; 840 + 841 + /** 842 + * Model used to test deduplication strategy 843 + */ 844 + export type DeleteFooData = string; 845 + 846 + /** 847 + * Model used to test deduplication strategy 848 + */ 849 + export type DeleteFooData2 = string; 850 + 851 + /** 852 + * Model with restricted keyword name 853 + */ 854 + export type Import = string; 855 + 856 + export type SchemaWithFormRestrictedKeys = { 857 + description?: string; 858 + 'x-enum-descriptions'?: string; 859 + 'x-enum-varnames'?: string; 860 + 'x-enumNames'?: string; 861 + title?: string; 862 + object?: { 863 + description?: string; 864 + 'x-enum-descriptions'?: string; 865 + 'x-enum-varnames'?: string; 866 + 'x-enumNames'?: string; 867 + title?: string; 868 + }; 869 + array?: Array<{ 870 + description?: string; 871 + 'x-enum-descriptions'?: string; 872 + 'x-enum-varnames'?: string; 873 + 'x-enumNames'?: string; 874 + title?: string; 875 + }>; 876 + }; 877 + 878 + /** 879 + * This schema was giving PascalCase transformations a hard time 880 + */ 881 + export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { 882 + /** 883 + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. 884 + */ 885 + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; 886 + }; 887 + 888 + /** 889 + * This schema was giving PascalCase transformations a hard time 890 + */ 891 + export type IoK8sApimachineryPkgApisMetaV1Preconditions = { 892 + /** 893 + * Specifies the target ResourceVersion 894 + */ 895 + resourceVersion?: string; 896 + /** 897 + * Specifies the target UID. 898 + */ 899 + uid?: string; 900 + }; 901 + 902 + export type AdditionalPropertiesUnknownIssue = { 903 + [key: string]: string | number; 904 + }; 905 + 906 + export type AdditionalPropertiesUnknownIssue2 = { 907 + [key: string]: string | number; 908 + }; 909 + 910 + export type AdditionalPropertiesUnknownIssue3 = string & { 911 + entries: { 912 + [key: string]: AdditionalPropertiesUnknownIssue; 913 + }; 914 + }; 915 + 916 + export type AdditionalPropertiesIntegerIssue = { 917 + value: number; 918 + [key: string]: number; 919 + }; 920 + 921 + export type OneOfAllOfIssue = ((ConstValue | GenericSchemaDuplicateIssue1SystemBoolean) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemString; 922 + 923 + export type GenericSchemaDuplicateIssue1SystemBoolean = { 924 + item?: boolean; 925 + error?: string | null; 926 + readonly hasError?: boolean; 927 + data?: { 928 + [key: string]: never; 929 + }; 930 + }; 931 + 932 + export type GenericSchemaDuplicateIssue1SystemString = { 933 + item?: string | null; 934 + error?: string | null; 935 + readonly hasError?: boolean; 936 + }; 937 + 938 + /** 939 + * This is a reusable parameter 940 + */ 941 + export type SimpleParameter = string; 942 + 943 + /** 944 + * Parameter with illegal characters 945 + */ 946 + export type XFooBar = ModelWithString; 947 + 948 + export type SimpleRequestBody = ModelWithString; 949 + 950 + export type SimpleFormData = ModelWithString; 951 + 952 + export type ExportData = { 953 + body?: never; 954 + path?: never; 955 + query?: never; 956 + url: '/api/v{api-version}/no-tag'; 957 + }; 958 + 959 + export type ImportData = { 960 + body: ModelWithReadOnlyAndWriteOnly | ModelWithArrayReadOnlyAndWriteOnly; 961 + path?: never; 962 + query?: never; 963 + url: '/api/v{api-version}/no-tag'; 964 + }; 965 + 966 + export type ImportResponses = { 967 + /** 968 + * Success 969 + */ 970 + 200: ModelFromZendesk; 971 + /** 972 + * Default success response 973 + */ 974 + default: ModelWithReadOnlyAndWriteOnly; 975 + }; 976 + 977 + export type ImportResponse = ImportResponses[keyof ImportResponses]; 978 + 979 + export type ApiVVersionODataControllerCountData = { 980 + body?: never; 981 + path?: never; 982 + query?: never; 983 + url: '/api/v{api-version}/simple/$count'; 984 + }; 985 + 986 + export type ApiVVersionODataControllerCountResponses = { 987 + /** 988 + * Success 989 + */ 990 + 200: ModelFromZendesk; 991 + }; 992 + 993 + export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; 994 + 995 + export type GetApiVbyApiVersionSimpleOperationData = { 996 + body?: never; 997 + path: { 998 + /** 999 + * foo in method 1000 + */ 1001 + foo_param: string; 1002 + }; 1003 + query?: never; 1004 + url: '/api/v{api-version}/simple:operation'; 1005 + }; 1006 + 1007 + export type GetApiVbyApiVersionSimpleOperationErrors = { 1008 + /** 1009 + * Default error response 1010 + */ 1011 + default: ModelWithBoolean; 1012 + }; 1013 + 1014 + export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; 1015 + 1016 + export type GetApiVbyApiVersionSimpleOperationResponses = { 1017 + /** 1018 + * Response is a simple number 1019 + */ 1020 + 200: number; 1021 + }; 1022 + 1023 + export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; 1024 + 1025 + export type DeleteCallWithoutParametersAndResponseData = { 1026 + body?: never; 1027 + path?: never; 1028 + query?: never; 1029 + url: '/api/v{api-version}/simple'; 1030 + }; 1031 + 1032 + export type GetCallWithoutParametersAndResponseData = { 1033 + body?: never; 1034 + path?: never; 1035 + query?: never; 1036 + url: '/api/v{api-version}/simple'; 1037 + }; 1038 + 1039 + export type HeadCallWithoutParametersAndResponseData = { 1040 + body?: never; 1041 + path?: never; 1042 + query?: never; 1043 + url: '/api/v{api-version}/simple'; 1044 + }; 1045 + 1046 + export type OptionsCallWithoutParametersAndResponseData = { 1047 + body?: never; 1048 + path?: never; 1049 + query?: never; 1050 + url: '/api/v{api-version}/simple'; 1051 + }; 1052 + 1053 + export type PatchCallWithoutParametersAndResponseData = { 1054 + body?: never; 1055 + path?: never; 1056 + query?: never; 1057 + url: '/api/v{api-version}/simple'; 1058 + }; 1059 + 1060 + export type PostCallWithoutParametersAndResponseData = { 1061 + body?: never; 1062 + path?: never; 1063 + query?: never; 1064 + url: '/api/v{api-version}/simple'; 1065 + }; 1066 + 1067 + export type PutCallWithoutParametersAndResponseData = { 1068 + body?: never; 1069 + path?: never; 1070 + query?: never; 1071 + url: '/api/v{api-version}/simple'; 1072 + }; 1073 + 1074 + export type DeleteFooData3 = { 1075 + body?: never; 1076 + headers: { 1077 + /** 1078 + * Parameter with illegal characters 1079 + */ 1080 + 'x-Foo-Bar': ModelWithString; 1081 + }; 1082 + path: { 1083 + /** 1084 + * foo in method 1085 + */ 1086 + foo_param: string; 1087 + /** 1088 + * bar in method 1089 + */ 1090 + BarParam: string; 1091 + }; 1092 + query?: never; 1093 + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; 1094 + }; 1095 + 1096 + export type CallWithDescriptionsData = { 1097 + body?: never; 1098 + path?: never; 1099 + query?: { 1100 + /** 1101 + * Testing multiline comments in string: First line 1102 + * Second line 1103 + * 1104 + * Fourth line 1105 + */ 1106 + parameterWithBreaks?: string; 1107 + /** 1108 + * Testing backticks in string: `backticks` and ```multiple backticks``` should work 1109 + */ 1110 + parameterWithBackticks?: string; 1111 + /** 1112 + * Testing slashes in string: \backwards\\\ and /forwards/// should work 1113 + */ 1114 + parameterWithSlashes?: string; 1115 + /** 1116 + * Testing expression placeholders in string: ${expression} should work 1117 + */ 1118 + parameterWithExpressionPlaceholders?: string; 1119 + /** 1120 + * Testing quotes in string: 'single quote''' and "double quotes""" should work 1121 + */ 1122 + parameterWithQuotes?: string; 1123 + /** 1124 + * Testing reserved characters in string: * inline * and ** inline ** should work 1125 + */ 1126 + parameterWithReservedCharacters?: string; 1127 + }; 1128 + url: '/api/v{api-version}/descriptions'; 1129 + }; 1130 + 1131 + export type DeprecatedCallData = { 1132 + body?: never; 1133 + headers: { 1134 + /** 1135 + * This parameter is deprecated 1136 + * @deprecated 1137 + */ 1138 + parameter: DeprecatedModel | null; 1139 + }; 1140 + path?: never; 1141 + query?: never; 1142 + url: '/api/v{api-version}/parameters/deprecated'; 1143 + }; 1144 + 1145 + export type CallWithParametersData = { 1146 + /** 1147 + * This is the parameter that goes into the body 1148 + */ 1149 + body: { 1150 + [key: string]: unknown; 1151 + } | null; 1152 + headers: { 1153 + /** 1154 + * This is the parameter that goes into the header 1155 + */ 1156 + parameterHeader: string | null; 1157 + }; 1158 + path: { 1159 + /** 1160 + * This is the parameter that goes into the path 1161 + */ 1162 + parameterPath: string | null; 1163 + /** 1164 + * api-version should be required in standalone clients 1165 + */ 1166 + 'api-version': string | null; 1167 + }; 1168 + query: { 1169 + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; 1170 + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; 1171 + /** 1172 + * This is the parameter that goes into the query params 1173 + */ 1174 + cursor: string | null; 1175 + }; 1176 + url: '/api/v{api-version}/parameters/{parameterPath}'; 1177 + }; 1178 + 1179 + export type CallWithWeirdParameterNamesData = { 1180 + /** 1181 + * This is the parameter that goes into the body 1182 + */ 1183 + body: ModelWithString | null; 1184 + headers: { 1185 + /** 1186 + * This is the parameter that goes into the request header 1187 + */ 1188 + 'parameter.header': string | null; 1189 + }; 1190 + path: { 1191 + /** 1192 + * This is the parameter that goes into the path 1193 + */ 1194 + 'parameter.path.1'?: string; 1195 + /** 1196 + * This is the parameter that goes into the path 1197 + */ 1198 + 'parameter-path-2'?: string; 1199 + /** 1200 + * This is the parameter that goes into the path 1201 + */ 1202 + 'PARAMETER-PATH-3'?: string; 1203 + /** 1204 + * api-version should be required in standalone clients 1205 + */ 1206 + 'api-version': string | null; 1207 + }; 1208 + query: { 1209 + /** 1210 + * This is the parameter with a reserved keyword 1211 + */ 1212 + default?: string; 1213 + /** 1214 + * This is the parameter that goes into the request query params 1215 + */ 1216 + 'parameter-query': string | null; 1217 + }; 1218 + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; 1219 + }; 1220 + 1221 + export type GetCallWithOptionalParamData = { 1222 + /** 1223 + * This is a required parameter 1224 + */ 1225 + body: ModelWithOneOfEnum; 1226 + path?: never; 1227 + query?: { 1228 + /** 1229 + * This is an optional parameter 1230 + */ 1231 + page?: number; 1232 + }; 1233 + url: '/api/v{api-version}/parameters'; 1234 + }; 1235 + 1236 + export type PostCallWithOptionalParamData = { 1237 + /** 1238 + * This is an optional parameter 1239 + */ 1240 + body?: { 1241 + offset?: number | null; 1242 + }; 1243 + path?: never; 1244 + query: { 1245 + /** 1246 + * This is a required parameter 1247 + */ 1248 + parameter: Pageable; 1249 + }; 1250 + url: '/api/v{api-version}/parameters'; 1251 + }; 1252 + 1253 + export type PostCallWithOptionalParamResponses = { 1254 + /** 1255 + * Response is a simple number 1256 + */ 1257 + 200: number; 1258 + /** 1259 + * Success 1260 + */ 1261 + 204: void; 1262 + }; 1263 + 1264 + export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; 1265 + 1266 + export type PostApiVbyApiVersionRequestBodyData = { 1267 + /** 1268 + * A reusable request body 1269 + */ 1270 + body?: SimpleRequestBody; 1271 + path?: never; 1272 + query?: { 1273 + /** 1274 + * This is a reusable parameter 1275 + */ 1276 + parameter?: string; 1277 + }; 1278 + url: '/api/v{api-version}/requestBody'; 1279 + }; 1280 + 1281 + export type PostApiVbyApiVersionFormDataData = { 1282 + /** 1283 + * A reusable request body 1284 + */ 1285 + body?: SimpleFormData; 1286 + path?: never; 1287 + query?: { 1288 + /** 1289 + * This is a reusable parameter 1290 + */ 1291 + parameter?: string; 1292 + }; 1293 + url: '/api/v{api-version}/formData'; 1294 + }; 1295 + 1296 + export type CallWithDefaultParametersData = { 1297 + body?: never; 1298 + path?: never; 1299 + query?: { 1300 + /** 1301 + * This is a simple string with default value 1302 + */ 1303 + parameterString?: string | null; 1304 + /** 1305 + * This is a simple number with default value 1306 + */ 1307 + parameterNumber?: number | null; 1308 + /** 1309 + * This is a simple boolean with default value 1310 + */ 1311 + parameterBoolean?: boolean | null; 1312 + /** 1313 + * This is a simple enum with default value 1314 + */ 1315 + parameterEnum?: 'Success' | 'Warning' | 'Error'; 1316 + /** 1317 + * This is a simple model with default value 1318 + */ 1319 + parameterModel?: ModelWithString | null; 1320 + }; 1321 + url: '/api/v{api-version}/defaults'; 1322 + }; 1323 + 1324 + export type CallWithDefaultOptionalParametersData = { 1325 + body?: never; 1326 + path?: never; 1327 + query?: { 1328 + /** 1329 + * This is a simple string that is optional with default value 1330 + */ 1331 + parameterString?: string; 1332 + /** 1333 + * This is a simple number that is optional with default value 1334 + */ 1335 + parameterNumber?: number; 1336 + /** 1337 + * This is a simple boolean that is optional with default value 1338 + */ 1339 + parameterBoolean?: boolean; 1340 + /** 1341 + * This is a simple enum that is optional with default value 1342 + */ 1343 + parameterEnum?: 'Success' | 'Warning' | 'Error'; 1344 + /** 1345 + * This is a simple model that is optional with default value 1346 + */ 1347 + parameterModel?: ModelWithString; 1348 + }; 1349 + url: '/api/v{api-version}/defaults'; 1350 + }; 1351 + 1352 + export type CallToTestOrderOfParamsData = { 1353 + body?: never; 1354 + path?: never; 1355 + query: { 1356 + /** 1357 + * This is a optional string with default 1358 + */ 1359 + parameterOptionalStringWithDefault?: string; 1360 + /** 1361 + * This is a optional string with empty default 1362 + */ 1363 + parameterOptionalStringWithEmptyDefault?: string; 1364 + /** 1365 + * This is a optional string with no default 1366 + */ 1367 + parameterOptionalStringWithNoDefault?: string; 1368 + /** 1369 + * This is a string with default 1370 + */ 1371 + parameterStringWithDefault: string; 1372 + /** 1373 + * This is a string with empty default 1374 + */ 1375 + parameterStringWithEmptyDefault: string; 1376 + /** 1377 + * This is a string with no default 1378 + */ 1379 + parameterStringWithNoDefault: string; 1380 + /** 1381 + * This is a string that can be null with no default 1382 + */ 1383 + parameterStringNullableWithNoDefault?: string | null; 1384 + /** 1385 + * This is a string that can be null with default 1386 + */ 1387 + parameterStringNullableWithDefault?: string | null; 1388 + }; 1389 + url: '/api/v{api-version}/defaults'; 1390 + }; 1391 + 1392 + export type DuplicateNameData = { 1393 + body?: never; 1394 + path?: never; 1395 + query?: never; 1396 + url: '/api/v{api-version}/duplicate'; 1397 + }; 1398 + 1399 + export type DuplicateName2Data = { 1400 + body?: never; 1401 + path?: never; 1402 + query?: never; 1403 + url: '/api/v{api-version}/duplicate'; 1404 + }; 1405 + 1406 + export type DuplicateName3Data = { 1407 + body?: never; 1408 + path?: never; 1409 + query?: never; 1410 + url: '/api/v{api-version}/duplicate'; 1411 + }; 1412 + 1413 + export type DuplicateName4Data = { 1414 + body?: never; 1415 + path?: never; 1416 + query?: never; 1417 + url: '/api/v{api-version}/duplicate'; 1418 + }; 1419 + 1420 + export type CallWithNoContentResponseData = { 1421 + body?: never; 1422 + path?: never; 1423 + query?: never; 1424 + url: '/api/v{api-version}/no-content'; 1425 + }; 1426 + 1427 + export type CallWithNoContentResponseResponses = { 1428 + /** 1429 + * Success 1430 + */ 1431 + 204: void; 1432 + }; 1433 + 1434 + export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; 1435 + 1436 + export type CallWithResponseAndNoContentResponseData = { 1437 + body?: never; 1438 + path?: never; 1439 + query?: never; 1440 + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; 1441 + }; 1442 + 1443 + export type CallWithResponseAndNoContentResponseResponses = { 1444 + /** 1445 + * Response is a simple number 1446 + */ 1447 + 200: number; 1448 + /** 1449 + * Success 1450 + */ 1451 + 204: void; 1452 + }; 1453 + 1454 + export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; 1455 + 1456 + export type DummyAData = { 1457 + body?: never; 1458 + path?: never; 1459 + query?: never; 1460 + url: '/api/v{api-version}/multiple-tags/a'; 1461 + }; 1462 + 1463 + export type DummyAResponses = { 1464 + 200: _400; 1465 + }; 1466 + 1467 + export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; 1468 + 1469 + export type DummyBData = { 1470 + body?: never; 1471 + path?: never; 1472 + query?: never; 1473 + url: '/api/v{api-version}/multiple-tags/b'; 1474 + }; 1475 + 1476 + export type DummyBResponses = { 1477 + /** 1478 + * Success 1479 + */ 1480 + 204: void; 1481 + }; 1482 + 1483 + export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; 1484 + 1485 + export type CallWithResponseData = { 1486 + body?: never; 1487 + path?: never; 1488 + query?: never; 1489 + url: '/api/v{api-version}/response'; 1490 + }; 1491 + 1492 + export type CallWithResponseResponses = { 1493 + default: Import; 1494 + }; 1495 + 1496 + export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; 1497 + 1498 + export type CallWithDuplicateResponsesData = { 1499 + body?: never; 1500 + path?: never; 1501 + query?: never; 1502 + url: '/api/v{api-version}/response'; 1503 + }; 1504 + 1505 + export type CallWithDuplicateResponsesErrors = { 1506 + /** 1507 + * Message for 500 error 1508 + */ 1509 + 500: ModelWithStringError; 1510 + /** 1511 + * Message for 501 error 1512 + */ 1513 + 501: ModelWithStringError; 1514 + /** 1515 + * Message for 502 error 1516 + */ 1517 + 502: ModelWithStringError; 1518 + /** 1519 + * Message for 4XX errors 1520 + */ 1521 + '4XX': DictionaryWithArray; 1522 + /** 1523 + * Default error response 1524 + */ 1525 + default: ModelWithBoolean; 1526 + }; 1527 + 1528 + export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; 1529 + 1530 + export type CallWithDuplicateResponsesResponses = { 1531 + /** 1532 + * Message for 200 response 1533 + */ 1534 + 200: ModelWithBoolean & ModelWithInteger; 1535 + /** 1536 + * Message for 201 response 1537 + */ 1538 + 201: ModelWithString; 1539 + /** 1540 + * Message for 202 response 1541 + */ 1542 + 202: ModelWithString; 1543 + }; 1544 + 1545 + export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; 1546 + 1547 + export type CallWithResponsesData = { 1548 + body?: never; 1549 + path?: never; 1550 + query?: never; 1551 + url: '/api/v{api-version}/response'; 1552 + }; 1553 + 1554 + export type CallWithResponsesErrors = { 1555 + /** 1556 + * Message for 500 error 1557 + */ 1558 + 500: ModelWithStringError; 1559 + /** 1560 + * Message for 501 error 1561 + */ 1562 + 501: ModelWithStringError; 1563 + /** 1564 + * Message for 502 error 1565 + */ 1566 + 502: ModelWithStringError; 1567 + /** 1568 + * Message for default response 1569 + */ 1570 + default: ModelWithStringError; 1571 + }; 1572 + 1573 + export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; 1574 + 1575 + export type CallWithResponsesResponses = { 1576 + /** 1577 + * Message for 200 response 1578 + */ 1579 + 200: { 1580 + readonly '@namespace.string'?: string; 1581 + readonly '@namespace.integer'?: number; 1582 + readonly value?: Array<ModelWithString>; 1583 + }; 1584 + /** 1585 + * Message for 201 response 1586 + */ 1587 + 201: ModelThatExtends; 1588 + /** 1589 + * Message for 202 response 1590 + */ 1591 + 202: ModelThatExtendsExtends; 1592 + }; 1593 + 1594 + export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; 1595 + 1596 + export type CollectionFormatData = { 1597 + body?: never; 1598 + path?: never; 1599 + query: { 1600 + /** 1601 + * This is an array parameter that is sent as csv format (comma-separated values) 1602 + */ 1603 + parameterArrayCSV: Array<string> | null; 1604 + /** 1605 + * This is an array parameter that is sent as ssv format (space-separated values) 1606 + */ 1607 + parameterArraySSV: Array<string> | null; 1608 + /** 1609 + * This is an array parameter that is sent as tsv format (tab-separated values) 1610 + */ 1611 + parameterArrayTSV: Array<string> | null; 1612 + /** 1613 + * This is an array parameter that is sent as pipes format (pipe-separated values) 1614 + */ 1615 + parameterArrayPipes: Array<string> | null; 1616 + /** 1617 + * This is an array parameter that is sent as multi format (multiple parameter instances) 1618 + */ 1619 + parameterArrayMulti: Array<string> | null; 1620 + }; 1621 + url: '/api/v{api-version}/collectionFormat'; 1622 + }; 1623 + 1624 + export type TypesData = { 1625 + body?: never; 1626 + path?: { 1627 + /** 1628 + * This is a number parameter 1629 + */ 1630 + id?: number; 1631 + }; 1632 + query: { 1633 + /** 1634 + * This is a number parameter 1635 + */ 1636 + parameterNumber: number; 1637 + /** 1638 + * This is a string parameter 1639 + */ 1640 + parameterString: string | null; 1641 + /** 1642 + * This is a boolean parameter 1643 + */ 1644 + parameterBoolean: boolean | null; 1645 + /** 1646 + * This is an object parameter 1647 + */ 1648 + parameterObject: { 1649 + [key: string]: unknown; 1650 + } | null; 1651 + /** 1652 + * This is an array parameter 1653 + */ 1654 + parameterArray: Array<string> | null; 1655 + /** 1656 + * This is a dictionary parameter 1657 + */ 1658 + parameterDictionary: { 1659 + [key: string]: unknown; 1660 + } | null; 1661 + /** 1662 + * This is an enum parameter 1663 + */ 1664 + parameterEnum: 'Success' | 'Warning' | 'Error'; 1665 + }; 1666 + url: '/api/v{api-version}/types'; 1667 + }; 1668 + 1669 + export type TypesResponses = { 1670 + /** 1671 + * Response is a simple number 1672 + */ 1673 + 200: number; 1674 + /** 1675 + * Response is a simple string 1676 + */ 1677 + 201: string; 1678 + /** 1679 + * Response is a simple boolean 1680 + */ 1681 + 202: boolean; 1682 + /** 1683 + * Response is a simple object 1684 + */ 1685 + 203: { 1686 + [key: string]: unknown; 1687 + }; 1688 + }; 1689 + 1690 + export type TypesResponse = TypesResponses[keyof TypesResponses]; 1691 + 1692 + export type UploadFileData = { 1693 + body: Blob | File; 1694 + path: { 1695 + /** 1696 + * api-version should be required in standalone clients 1697 + */ 1698 + 'api-version': string | null; 1699 + }; 1700 + query?: never; 1701 + url: '/api/v{api-version}/upload'; 1702 + }; 1703 + 1704 + export type UploadFileResponses = { 1705 + 200: boolean; 1706 + }; 1707 + 1708 + export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; 1709 + 1710 + export type FileResponseData = { 1711 + body?: never; 1712 + path: { 1713 + id: string; 1714 + /** 1715 + * api-version should be required in standalone clients 1716 + */ 1717 + 'api-version': string; 1718 + }; 1719 + query?: never; 1720 + url: '/api/v{api-version}/file/{id}'; 1721 + }; 1722 + 1723 + export type FileResponseResponses = { 1724 + /** 1725 + * Success 1726 + */ 1727 + 200: Blob | File; 1728 + }; 1729 + 1730 + export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; 1731 + 1732 + export type ComplexTypesData = { 1733 + body?: never; 1734 + path?: never; 1735 + query: { 1736 + /** 1737 + * Parameter containing object 1738 + */ 1739 + parameterObject: { 1740 + first?: { 1741 + second?: { 1742 + third?: string; 1743 + }; 1744 + }; 1745 + }; 1746 + /** 1747 + * Parameter containing reference 1748 + */ 1749 + parameterReference: ModelWithString; 1750 + }; 1751 + url: '/api/v{api-version}/complex'; 1752 + }; 1753 + 1754 + export type ComplexTypesErrors = { 1755 + /** 1756 + * 400 `server` error 1757 + */ 1758 + 400: unknown; 1759 + /** 1760 + * 500 server error 1761 + */ 1762 + 500: unknown; 1763 + }; 1764 + 1765 + export type ComplexTypesResponses = { 1766 + /** 1767 + * Successful response 1768 + */ 1769 + 200: Array<ModelWithString>; 1770 + }; 1771 + 1772 + export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; 1773 + 1774 + export type MultipartResponseData = { 1775 + body?: never; 1776 + path?: never; 1777 + query?: never; 1778 + url: '/api/v{api-version}/multipart'; 1779 + }; 1780 + 1781 + export type MultipartResponseResponses = { 1782 + /** 1783 + * OK 1784 + */ 1785 + 200: { 1786 + file?: Blob | File; 1787 + metadata?: { 1788 + foo?: string; 1789 + bar?: string; 1790 + }; 1791 + }; 1792 + }; 1793 + 1794 + export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; 1795 + 1796 + export type MultipartRequestData = { 1797 + body?: { 1798 + content?: Blob | File; 1799 + data?: ModelWithString | null; 1800 + }; 1801 + path?: never; 1802 + query?: never; 1803 + url: '/api/v{api-version}/multipart'; 1804 + }; 1805 + 1806 + export type ComplexParamsData = { 1807 + body?: { 1808 + readonly key: string | null; 1809 + name: string | null; 1810 + enabled?: boolean; 1811 + type: 'Monkey' | 'Horse' | 'Bird'; 1812 + listOfModels?: Array<ModelWithString> | null; 1813 + listOfStrings?: Array<string> | null; 1814 + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; 1815 + readonly user?: { 1816 + readonly id?: number; 1817 + readonly name?: string | null; 1818 + }; 1819 + }; 1820 + path: { 1821 + id: number; 1822 + /** 1823 + * api-version should be required in standalone clients 1824 + */ 1825 + 'api-version': string; 1826 + }; 1827 + query?: never; 1828 + url: '/api/v{api-version}/complex/{id}'; 1829 + }; 1830 + 1831 + export type ComplexParamsResponses = { 1832 + /** 1833 + * Success 1834 + */ 1835 + 200: ModelWithString; 1836 + }; 1837 + 1838 + export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; 1839 + 1840 + export type CallWithResultFromHeaderData = { 1841 + body?: never; 1842 + path?: never; 1843 + query?: never; 1844 + url: '/api/v{api-version}/header'; 1845 + }; 1846 + 1847 + export type CallWithResultFromHeaderErrors = { 1848 + /** 1849 + * 400 server error 1850 + */ 1851 + 400: unknown; 1852 + /** 1853 + * 500 server error 1854 + */ 1855 + 500: unknown; 1856 + }; 1857 + 1858 + export type CallWithResultFromHeaderResponses = { 1859 + /** 1860 + * Successful response 1861 + */ 1862 + 200: unknown; 1863 + }; 1864 + 1865 + export type TestErrorCodeData = { 1866 + body?: never; 1867 + path?: never; 1868 + query: { 1869 + /** 1870 + * Status code to return 1871 + */ 1872 + status: number; 1873 + }; 1874 + url: '/api/v{api-version}/error'; 1875 + }; 1876 + 1877 + export type TestErrorCodeErrors = { 1878 + /** 1879 + * Custom message: Internal Server Error 1880 + */ 1881 + 500: unknown; 1882 + /** 1883 + * Custom message: Not Implemented 1884 + */ 1885 + 501: unknown; 1886 + /** 1887 + * Custom message: Bad Gateway 1888 + */ 1889 + 502: unknown; 1890 + /** 1891 + * Custom message: Service Unavailable 1892 + */ 1893 + 503: unknown; 1894 + }; 1895 + 1896 + export type TestErrorCodeResponses = { 1897 + /** 1898 + * Custom message: Successful response 1899 + */ 1900 + 200: unknown; 1901 + }; 1902 + 1903 + export type NonAsciiæøåÆøÅöôêÊ字符串Data = { 1904 + body?: never; 1905 + path?: never; 1906 + query: { 1907 + /** 1908 + * Dummy input param 1909 + */ 1910 + nonAsciiParamæøåÆØÅöôêÊ: number; 1911 + }; 1912 + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; 1913 + }; 1914 + 1915 + export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { 1916 + /** 1917 + * Successful response 1918 + */ 1919 + 200: Array<NonAsciiStringæøåÆøÅöôêÊ字符串>; 1920 + }; 1921 + 1922 + export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; 1923 + 1924 + export type PutWithFormUrlEncodedData = { 1925 + body: ArrayWithStrings; 1926 + path?: never; 1927 + query?: never; 1928 + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; 1929 + };
+3
packages/openapi-ts/test/__snapshots__/3.1.x/plugins/@hey-api/sdk/throwOnError/index.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + export * from './types.gen'; 3 + export * from './sdk.gen';
+384
packages/openapi-ts/test/__snapshots__/3.1.x/plugins/@hey-api/sdk/throwOnError/sdk.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + import { createClient, createConfig, type Options, formDataBodySerializer, urlSearchParamsBodySerializer } from '@hey-api/client-fetch'; 4 + import type { ExportData, ImportData, ImportResponse, ApiVVersionODataControllerCountData, ApiVVersionODataControllerCountResponse, GetApiVbyApiVersionSimpleOperationData, GetApiVbyApiVersionSimpleOperationError, GetApiVbyApiVersionSimpleOperationResponse, DeleteCallWithoutParametersAndResponseData, GetCallWithoutParametersAndResponseData, HeadCallWithoutParametersAndResponseData, OptionsCallWithoutParametersAndResponseData, PatchCallWithoutParametersAndResponseData, PostCallWithoutParametersAndResponseData, PutCallWithoutParametersAndResponseData, DeleteFooData3, CallWithDescriptionsData, DeprecatedCallData, CallWithParametersData, CallWithWeirdParameterNamesData, GetCallWithOptionalParamData, PostCallWithOptionalParamData, PostCallWithOptionalParamResponse, PostApiVbyApiVersionRequestBodyData, PostApiVbyApiVersionFormDataData, CallWithDefaultParametersData, CallWithDefaultOptionalParametersData, CallToTestOrderOfParamsData, DuplicateNameData, DuplicateName2Data, DuplicateName3Data, DuplicateName4Data, CallWithNoContentResponseData, CallWithNoContentResponseResponse, CallWithResponseAndNoContentResponseData, CallWithResponseAndNoContentResponseResponse, DummyAData, DummyAResponse, DummyBData, DummyBResponse, CallWithResponseData, CallWithResponseResponse, CallWithDuplicateResponsesData, CallWithDuplicateResponsesError, CallWithDuplicateResponsesResponse, CallWithResponsesData, CallWithResponsesError, CallWithResponsesResponse, CollectionFormatData, TypesData, TypesResponse, UploadFileData, UploadFileResponse, FileResponseData, FileResponseResponse, ComplexTypesData, ComplexTypesResponse, MultipartResponseData, MultipartResponseResponse, MultipartRequestData, ComplexParamsData, ComplexParamsResponse, CallWithResultFromHeaderData, TestErrorCodeData, NonAsciiæøåÆøÅöôêÊ字符串Data, NonAsciiæøåÆøÅöôêÊ字符串Response, PutWithFormUrlEncodedData } from './types.gen'; 5 + 6 + export const client = createClient(createConfig({ 7 + throwOnError: true 8 + })); 9 + 10 + export const export_ = <ThrowOnError extends boolean = true>(options?: Options<ExportData, ThrowOnError>) => { 11 + return (options?.client ?? client).get<unknown, unknown, ThrowOnError>({ 12 + ...options, 13 + url: '/api/v{api-version}/no-tag' 14 + }); 15 + }; 16 + 17 + export const import_ = <ThrowOnError extends boolean = true>(options: Options<ImportData, ThrowOnError>) => { 18 + return (options?.client ?? client).post<ImportResponse, unknown, ThrowOnError>({ 19 + ...options, 20 + headers: { 21 + 'Content-Type': 'application/json', 22 + ...options?.headers 23 + }, 24 + url: '/api/v{api-version}/no-tag' 25 + }); 26 + }; 27 + 28 + export const apiVVersionODataControllerCount = <ThrowOnError extends boolean = true>(options?: Options<ApiVVersionODataControllerCountData, ThrowOnError>) => { 29 + return (options?.client ?? client).get<ApiVVersionODataControllerCountResponse, unknown, ThrowOnError>({ 30 + ...options, 31 + url: '/api/v{api-version}/simple/$count' 32 + }); 33 + }; 34 + 35 + export const getApiVbyApiVersionSimpleOperation = <ThrowOnError extends boolean = true>(options: Options<GetApiVbyApiVersionSimpleOperationData, ThrowOnError>) => { 36 + return (options?.client ?? client).get<GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, ThrowOnError>({ 37 + ...options, 38 + url: '/api/v{api-version}/simple:operation' 39 + }); 40 + }; 41 + 42 + export const deleteCallWithoutParametersAndResponse = <ThrowOnError extends boolean = true>(options?: Options<DeleteCallWithoutParametersAndResponseData, ThrowOnError>) => { 43 + return (options?.client ?? client).delete<unknown, unknown, ThrowOnError>({ 44 + ...options, 45 + url: '/api/v{api-version}/simple' 46 + }); 47 + }; 48 + 49 + export const getCallWithoutParametersAndResponse = <ThrowOnError extends boolean = true>(options?: Options<GetCallWithoutParametersAndResponseData, ThrowOnError>) => { 50 + return (options?.client ?? client).get<unknown, unknown, ThrowOnError>({ 51 + ...options, 52 + url: '/api/v{api-version}/simple' 53 + }); 54 + }; 55 + 56 + export const headCallWithoutParametersAndResponse = <ThrowOnError extends boolean = true>(options?: Options<HeadCallWithoutParametersAndResponseData, ThrowOnError>) => { 57 + return (options?.client ?? client).head<unknown, unknown, ThrowOnError>({ 58 + ...options, 59 + url: '/api/v{api-version}/simple' 60 + }); 61 + }; 62 + 63 + export const optionsCallWithoutParametersAndResponse = <ThrowOnError extends boolean = true>(options?: Options<OptionsCallWithoutParametersAndResponseData, ThrowOnError>) => { 64 + return (options?.client ?? client).options<unknown, unknown, ThrowOnError>({ 65 + ...options, 66 + url: '/api/v{api-version}/simple' 67 + }); 68 + }; 69 + 70 + export const patchCallWithoutParametersAndResponse = <ThrowOnError extends boolean = true>(options?: Options<PatchCallWithoutParametersAndResponseData, ThrowOnError>) => { 71 + return (options?.client ?? client).patch<unknown, unknown, ThrowOnError>({ 72 + ...options, 73 + url: '/api/v{api-version}/simple' 74 + }); 75 + }; 76 + 77 + export const postCallWithoutParametersAndResponse = <ThrowOnError extends boolean = true>(options?: Options<PostCallWithoutParametersAndResponseData, ThrowOnError>) => { 78 + return (options?.client ?? client).post<unknown, unknown, ThrowOnError>({ 79 + ...options, 80 + url: '/api/v{api-version}/simple' 81 + }); 82 + }; 83 + 84 + export const putCallWithoutParametersAndResponse = <ThrowOnError extends boolean = true>(options?: Options<PutCallWithoutParametersAndResponseData, ThrowOnError>) => { 85 + return (options?.client ?? client).put<unknown, unknown, ThrowOnError>({ 86 + ...options, 87 + url: '/api/v{api-version}/simple' 88 + }); 89 + }; 90 + 91 + export const deleteFoo = <ThrowOnError extends boolean = true>(options: Options<DeleteFooData3, ThrowOnError>) => { 92 + return (options?.client ?? client).delete<unknown, unknown, ThrowOnError>({ 93 + ...options, 94 + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}' 95 + }); 96 + }; 97 + 98 + export const callWithDescriptions = <ThrowOnError extends boolean = true>(options?: Options<CallWithDescriptionsData, ThrowOnError>) => { 99 + return (options?.client ?? client).post<unknown, unknown, ThrowOnError>({ 100 + ...options, 101 + url: '/api/v{api-version}/descriptions' 102 + }); 103 + }; 104 + 105 + /** 106 + * @deprecated 107 + */ 108 + export const deprecatedCall = <ThrowOnError extends boolean = true>(options: Options<DeprecatedCallData, ThrowOnError>) => { 109 + return (options?.client ?? client).post<unknown, unknown, ThrowOnError>({ 110 + ...options, 111 + url: '/api/v{api-version}/parameters/deprecated' 112 + }); 113 + }; 114 + 115 + export const callWithParameters = <ThrowOnError extends boolean = true>(options: Options<CallWithParametersData, ThrowOnError>) => { 116 + return (options?.client ?? client).post<unknown, unknown, ThrowOnError>({ 117 + ...options, 118 + headers: { 119 + 'Content-Type': 'application/json', 120 + ...options?.headers 121 + }, 122 + url: '/api/v{api-version}/parameters/{parameterPath}' 123 + }); 124 + }; 125 + 126 + export const callWithWeirdParameterNames = <ThrowOnError extends boolean = true>(options: Options<CallWithWeirdParameterNamesData, ThrowOnError>) => { 127 + return (options?.client ?? client).post<unknown, unknown, ThrowOnError>({ 128 + ...options, 129 + headers: { 130 + 'Content-Type': 'application/json', 131 + ...options?.headers 132 + }, 133 + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}' 134 + }); 135 + }; 136 + 137 + export const getCallWithOptionalParam = <ThrowOnError extends boolean = true>(options: Options<GetCallWithOptionalParamData, ThrowOnError>) => { 138 + return (options?.client ?? client).get<unknown, unknown, ThrowOnError>({ 139 + ...options, 140 + headers: { 141 + 'Content-Type': 'application/json', 142 + ...options?.headers 143 + }, 144 + url: '/api/v{api-version}/parameters' 145 + }); 146 + }; 147 + 148 + export const postCallWithOptionalParam = <ThrowOnError extends boolean = true>(options: Options<PostCallWithOptionalParamData, ThrowOnError>) => { 149 + return (options?.client ?? client).post<PostCallWithOptionalParamResponse, unknown, ThrowOnError>({ 150 + ...options, 151 + headers: { 152 + 'Content-Type': 'application/json', 153 + ...options?.headers 154 + }, 155 + url: '/api/v{api-version}/parameters' 156 + }); 157 + }; 158 + 159 + export const postApiVbyApiVersionRequestBody = <ThrowOnError extends boolean = true>(options?: Options<PostApiVbyApiVersionRequestBodyData, ThrowOnError>) => { 160 + return (options?.client ?? client).post<unknown, unknown, ThrowOnError>({ 161 + ...options, 162 + headers: { 163 + 'Content-Type': 'application/json', 164 + ...options?.headers 165 + }, 166 + url: '/api/v{api-version}/requestBody' 167 + }); 168 + }; 169 + 170 + export const postApiVbyApiVersionFormData = <ThrowOnError extends boolean = true>(options?: Options<PostApiVbyApiVersionFormDataData, ThrowOnError>) => { 171 + return (options?.client ?? client).post<unknown, unknown, ThrowOnError>({ 172 + ...options, 173 + ...formDataBodySerializer, 174 + headers: { 175 + 'Content-Type': null, 176 + ...options?.headers 177 + }, 178 + url: '/api/v{api-version}/formData' 179 + }); 180 + }; 181 + 182 + export const callWithDefaultParameters = <ThrowOnError extends boolean = true>(options?: Options<CallWithDefaultParametersData, ThrowOnError>) => { 183 + return (options?.client ?? client).get<unknown, unknown, ThrowOnError>({ 184 + ...options, 185 + url: '/api/v{api-version}/defaults' 186 + }); 187 + }; 188 + 189 + export const callWithDefaultOptionalParameters = <ThrowOnError extends boolean = true>(options?: Options<CallWithDefaultOptionalParametersData, ThrowOnError>) => { 190 + return (options?.client ?? client).post<unknown, unknown, ThrowOnError>({ 191 + ...options, 192 + url: '/api/v{api-version}/defaults' 193 + }); 194 + }; 195 + 196 + export const callToTestOrderOfParams = <ThrowOnError extends boolean = true>(options: Options<CallToTestOrderOfParamsData, ThrowOnError>) => { 197 + return (options?.client ?? client).put<unknown, unknown, ThrowOnError>({ 198 + ...options, 199 + url: '/api/v{api-version}/defaults' 200 + }); 201 + }; 202 + 203 + export const duplicateName = <ThrowOnError extends boolean = true>(options?: Options<DuplicateNameData, ThrowOnError>) => { 204 + return (options?.client ?? client).delete<unknown, unknown, ThrowOnError>({ 205 + ...options, 206 + url: '/api/v{api-version}/duplicate' 207 + }); 208 + }; 209 + 210 + export const duplicateName2 = <ThrowOnError extends boolean = true>(options?: Options<DuplicateName2Data, ThrowOnError>) => { 211 + return (options?.client ?? client).get<unknown, unknown, ThrowOnError>({ 212 + ...options, 213 + url: '/api/v{api-version}/duplicate' 214 + }); 215 + }; 216 + 217 + export const duplicateName3 = <ThrowOnError extends boolean = true>(options?: Options<DuplicateName3Data, ThrowOnError>) => { 218 + return (options?.client ?? client).post<unknown, unknown, ThrowOnError>({ 219 + ...options, 220 + url: '/api/v{api-version}/duplicate' 221 + }); 222 + }; 223 + 224 + export const duplicateName4 = <ThrowOnError extends boolean = true>(options?: Options<DuplicateName4Data, ThrowOnError>) => { 225 + return (options?.client ?? client).put<unknown, unknown, ThrowOnError>({ 226 + ...options, 227 + url: '/api/v{api-version}/duplicate' 228 + }); 229 + }; 230 + 231 + export const callWithNoContentResponse = <ThrowOnError extends boolean = true>(options?: Options<CallWithNoContentResponseData, ThrowOnError>) => { 232 + return (options?.client ?? client).get<CallWithNoContentResponseResponse, unknown, ThrowOnError>({ 233 + ...options, 234 + url: '/api/v{api-version}/no-content' 235 + }); 236 + }; 237 + 238 + export const callWithResponseAndNoContentResponse = <ThrowOnError extends boolean = true>(options?: Options<CallWithResponseAndNoContentResponseData, ThrowOnError>) => { 239 + return (options?.client ?? client).get<CallWithResponseAndNoContentResponseResponse, unknown, ThrowOnError>({ 240 + ...options, 241 + url: '/api/v{api-version}/multiple-tags/response-and-no-content' 242 + }); 243 + }; 244 + 245 + export const dummyA = <ThrowOnError extends boolean = true>(options?: Options<DummyAData, ThrowOnError>) => { 246 + return (options?.client ?? client).get<DummyAResponse, unknown, ThrowOnError>({ 247 + ...options, 248 + url: '/api/v{api-version}/multiple-tags/a' 249 + }); 250 + }; 251 + 252 + export const dummyB = <ThrowOnError extends boolean = true>(options?: Options<DummyBData, ThrowOnError>) => { 253 + return (options?.client ?? client).get<DummyBResponse, unknown, ThrowOnError>({ 254 + ...options, 255 + url: '/api/v{api-version}/multiple-tags/b' 256 + }); 257 + }; 258 + 259 + export const callWithResponse = <ThrowOnError extends boolean = true>(options?: Options<CallWithResponseData, ThrowOnError>) => { 260 + return (options?.client ?? client).get<CallWithResponseResponse, unknown, ThrowOnError>({ 261 + ...options, 262 + url: '/api/v{api-version}/response' 263 + }); 264 + }; 265 + 266 + export const callWithDuplicateResponses = <ThrowOnError extends boolean = true>(options?: Options<CallWithDuplicateResponsesData, ThrowOnError>) => { 267 + return (options?.client ?? client).post<CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, ThrowOnError>({ 268 + ...options, 269 + url: '/api/v{api-version}/response' 270 + }); 271 + }; 272 + 273 + export const callWithResponses = <ThrowOnError extends boolean = true>(options?: Options<CallWithResponsesData, ThrowOnError>) => { 274 + return (options?.client ?? client).put<CallWithResponsesResponse, CallWithResponsesError, ThrowOnError>({ 275 + ...options, 276 + url: '/api/v{api-version}/response' 277 + }); 278 + }; 279 + 280 + export const collectionFormat = <ThrowOnError extends boolean = true>(options: Options<CollectionFormatData, ThrowOnError>) => { 281 + return (options?.client ?? client).get<unknown, unknown, ThrowOnError>({ 282 + ...options, 283 + url: '/api/v{api-version}/collectionFormat' 284 + }); 285 + }; 286 + 287 + export const types = <ThrowOnError extends boolean = true>(options: Options<TypesData, ThrowOnError>) => { 288 + return (options?.client ?? client).get<TypesResponse, unknown, ThrowOnError>({ 289 + ...options, 290 + url: '/api/v{api-version}/types' 291 + }); 292 + }; 293 + 294 + export const uploadFile = <ThrowOnError extends boolean = true>(options: Options<UploadFileData, ThrowOnError>) => { 295 + return (options?.client ?? client).post<UploadFileResponse, unknown, ThrowOnError>({ 296 + ...options, 297 + ...urlSearchParamsBodySerializer, 298 + headers: { 299 + 'Content-Type': 'application/x-www-form-urlencoded', 300 + ...options?.headers 301 + }, 302 + url: '/api/v{api-version}/upload' 303 + }); 304 + }; 305 + 306 + export const fileResponse = <ThrowOnError extends boolean = true>(options: Options<FileResponseData, ThrowOnError>) => { 307 + return (options?.client ?? client).get<FileResponseResponse, unknown, ThrowOnError>({ 308 + ...options, 309 + url: '/api/v{api-version}/file/{id}' 310 + }); 311 + }; 312 + 313 + export const complexTypes = <ThrowOnError extends boolean = true>(options: Options<ComplexTypesData, ThrowOnError>) => { 314 + return (options?.client ?? client).get<ComplexTypesResponse, unknown, ThrowOnError>({ 315 + ...options, 316 + url: '/api/v{api-version}/complex' 317 + }); 318 + }; 319 + 320 + export const multipartResponse = <ThrowOnError extends boolean = true>(options?: Options<MultipartResponseData, ThrowOnError>) => { 321 + return (options?.client ?? client).get<MultipartResponseResponse, unknown, ThrowOnError>({ 322 + ...options, 323 + url: '/api/v{api-version}/multipart' 324 + }); 325 + }; 326 + 327 + export const multipartRequest = <ThrowOnError extends boolean = true>(options?: Options<MultipartRequestData, ThrowOnError>) => { 328 + return (options?.client ?? client).post<unknown, unknown, ThrowOnError>({ 329 + ...options, 330 + ...formDataBodySerializer, 331 + headers: { 332 + 'Content-Type': null, 333 + ...options?.headers 334 + }, 335 + url: '/api/v{api-version}/multipart' 336 + }); 337 + }; 338 + 339 + export const complexParams = <ThrowOnError extends boolean = true>(options: Options<ComplexParamsData, ThrowOnError>) => { 340 + return (options?.client ?? client).put<ComplexParamsResponse, unknown, ThrowOnError>({ 341 + ...options, 342 + headers: { 343 + 'Content-Type': 'application/json-patch+json', 344 + ...options?.headers 345 + }, 346 + url: '/api/v{api-version}/complex/{id}' 347 + }); 348 + }; 349 + 350 + export const callWithResultFromHeader = <ThrowOnError extends boolean = true>(options?: Options<CallWithResultFromHeaderData, ThrowOnError>) => { 351 + return (options?.client ?? client).post<unknown, unknown, ThrowOnError>({ 352 + ...options, 353 + url: '/api/v{api-version}/header' 354 + }); 355 + }; 356 + 357 + export const testErrorCode = <ThrowOnError extends boolean = true>(options: Options<TestErrorCodeData, ThrowOnError>) => { 358 + return (options?.client ?? client).post<unknown, unknown, ThrowOnError>({ 359 + ...options, 360 + url: '/api/v{api-version}/error' 361 + }); 362 + }; 363 + 364 + export const nonAsciiæøåÆøÅöôêÊ字符串 = <ThrowOnError extends boolean = true>(options: Options<NonAsciiæøåÆøÅöôêÊ字符串Data, ThrowOnError>) => { 365 + return (options?.client ?? client).post<NonAsciiæøåÆøÅöôêÊ字符串Response, unknown, ThrowOnError>({ 366 + ...options, 367 + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串' 368 + }); 369 + }; 370 + 371 + /** 372 + * Login User 373 + */ 374 + export const putWithFormUrlEncoded = <ThrowOnError extends boolean = true>(options: Options<PutWithFormUrlEncodedData, ThrowOnError>) => { 375 + return (options?.client ?? client).put<unknown, unknown, ThrowOnError>({ 376 + ...options, 377 + ...urlSearchParamsBodySerializer, 378 + headers: { 379 + 'Content-Type': 'application/x-www-form-urlencoded', 380 + ...options?.headers 381 + }, 382 + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串' 383 + }); 384 + };
+1939
packages/openapi-ts/test/__snapshots__/3.1.x/plugins/@hey-api/sdk/throwOnError/types.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + /** 4 + * Model with number-only name 5 + */ 6 + export type _400 = string; 7 + 8 + /** 9 + * Testing multiline comments in string: First line 10 + * Second line 11 + * 12 + * Fourth line 13 + */ 14 + export type CamelCaseCommentWithBreaks = number; 15 + 16 + /** 17 + * Testing multiline comments in string: First line 18 + * Second line 19 + * 20 + * Fourth line 21 + */ 22 + export type CommentWithBreaks = number; 23 + 24 + /** 25 + * Testing backticks in string: `backticks` and ```multiple backticks``` should work 26 + */ 27 + export type CommentWithBackticks = number; 28 + 29 + /** 30 + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work 31 + */ 32 + export type CommentWithBackticksAndQuotes = number; 33 + 34 + /** 35 + * Testing slashes in string: \backwards\\\ and /forwards/// should work 36 + */ 37 + export type CommentWithSlashes = number; 38 + 39 + /** 40 + * Testing expression placeholders in string: ${expression} should work 41 + */ 42 + export type CommentWithExpressionPlaceholders = number; 43 + 44 + /** 45 + * Testing quotes in string: 'single quote''' and "double quotes""" should work 46 + */ 47 + export type CommentWithQuotes = number; 48 + 49 + /** 50 + * Testing reserved characters in string: * inline * and ** inline ** should work 51 + */ 52 + export type CommentWithReservedCharacters = number; 53 + 54 + /** 55 + * This is a simple number 56 + */ 57 + export type SimpleInteger = number; 58 + 59 + /** 60 + * This is a simple boolean 61 + */ 62 + export type SimpleBoolean = boolean; 63 + 64 + /** 65 + * This is a simple string 66 + */ 67 + export type SimpleString = string; 68 + 69 + /** 70 + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) 71 + */ 72 + export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; 73 + 74 + /** 75 + * This is a simple file 76 + */ 77 + export type SimpleFile = Blob | File; 78 + 79 + /** 80 + * This is a simple reference 81 + */ 82 + export type SimpleReference = ModelWithString; 83 + 84 + /** 85 + * This is a simple string 86 + */ 87 + export type SimpleStringWithPattern = string | null; 88 + 89 + /** 90 + * This is a simple enum with strings 91 + */ 92 + export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; 93 + 94 + export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; 95 + 96 + /** 97 + * This is a simple enum with numbers 98 + */ 99 + export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; 100 + 101 + /** 102 + * Success=1,Warning=2,Error=3 103 + */ 104 + export type EnumFromDescription = number; 105 + 106 + /** 107 + * This is a simple enum with numbers 108 + */ 109 + export type EnumWithExtensions = 200 | 400 | 500; 110 + 111 + export type EnumWithXEnumNames = 0 | 1 | 2; 112 + 113 + /** 114 + * This is a simple array with numbers 115 + */ 116 + export type ArrayWithNumbers = Array<number>; 117 + 118 + /** 119 + * This is a simple array with booleans 120 + */ 121 + export type ArrayWithBooleans = Array<boolean>; 122 + 123 + /** 124 + * This is a simple array with strings 125 + */ 126 + export type ArrayWithStrings = Array<string>; 127 + 128 + /** 129 + * This is a simple array with references 130 + */ 131 + export type ArrayWithReferences = Array<ModelWithString>; 132 + 133 + /** 134 + * This is a simple array containing an array 135 + */ 136 + export type ArrayWithArray = Array<Array<ModelWithString>>; 137 + 138 + /** 139 + * This is a simple array with properties 140 + */ 141 + export type ArrayWithProperties = Array<{ 142 + '16x16'?: CamelCaseCommentWithBreaks; 143 + bar?: string; 144 + }>; 145 + 146 + /** 147 + * This is a simple array with any of properties 148 + */ 149 + export type ArrayWithAnyOfProperties = Array<{ 150 + foo?: string; 151 + } | { 152 + bar?: string; 153 + }>; 154 + 155 + export type AnyOfAnyAndNull = { 156 + data?: unknown | null; 157 + }; 158 + 159 + /** 160 + * This is a simple array with any of properties 161 + */ 162 + export type AnyOfArrays = { 163 + results?: Array<{ 164 + foo?: string; 165 + } | { 166 + bar?: string; 167 + }>; 168 + }; 169 + 170 + /** 171 + * This is a string dictionary 172 + */ 173 + export type DictionaryWithString = { 174 + [key: string]: string; 175 + }; 176 + 177 + export type DictionaryWithPropertiesAndAdditionalProperties = { 178 + foo?: number; 179 + bar?: boolean; 180 + [key: string]: string | number | boolean | undefined; 181 + }; 182 + 183 + /** 184 + * This is a string reference 185 + */ 186 + export type DictionaryWithReference = { 187 + [key: string]: ModelWithString; 188 + }; 189 + 190 + /** 191 + * This is a complex dictionary 192 + */ 193 + export type DictionaryWithArray = { 194 + [key: string]: Array<ModelWithString>; 195 + }; 196 + 197 + /** 198 + * This is a string dictionary 199 + */ 200 + export type DictionaryWithDictionary = { 201 + [key: string]: { 202 + [key: string]: string; 203 + }; 204 + }; 205 + 206 + /** 207 + * This is a complex dictionary 208 + */ 209 + export type DictionaryWithProperties = { 210 + [key: string]: { 211 + foo?: string; 212 + bar?: string; 213 + }; 214 + }; 215 + 216 + /** 217 + * This is a model with one number property 218 + */ 219 + export type ModelWithInteger = { 220 + /** 221 + * This is a simple number property 222 + */ 223 + prop?: number; 224 + }; 225 + 226 + /** 227 + * This is a model with one boolean property 228 + */ 229 + export type ModelWithBoolean = { 230 + /** 231 + * This is a simple boolean property 232 + */ 233 + prop?: boolean; 234 + }; 235 + 236 + /** 237 + * This is a model with one string property 238 + */ 239 + export type ModelWithString = { 240 + /** 241 + * This is a simple string property 242 + */ 243 + prop?: string; 244 + }; 245 + 246 + /** 247 + * This is a model with one string property 248 + */ 249 + export type ModelWithStringError = { 250 + /** 251 + * This is a simple string property 252 + */ 253 + prop?: string; 254 + }; 255 + 256 + /** 257 + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) 258 + */ 259 + export type ModelFromZendesk = string; 260 + 261 + /** 262 + * This is a model with one string property 263 + */ 264 + export type ModelWithNullableString = { 265 + /** 266 + * This is a simple string property 267 + */ 268 + nullableProp1?: string | null; 269 + /** 270 + * This is a simple string property 271 + */ 272 + nullableRequiredProp1: string | null; 273 + /** 274 + * This is a simple string property 275 + */ 276 + nullableProp2?: string | null; 277 + /** 278 + * This is a simple string property 279 + */ 280 + nullableRequiredProp2: string | null; 281 + /** 282 + * This is a simple enum with strings 283 + */ 284 + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; 285 + }; 286 + 287 + /** 288 + * This is a model with one enum 289 + */ 290 + export type ModelWithEnum = { 291 + /** 292 + * This is a simple enum with strings 293 + */ 294 + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; 295 + /** 296 + * These are the HTTP error code enums 297 + */ 298 + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; 299 + /** 300 + * Simple boolean enum 301 + */ 302 + bool?: true; 303 + }; 304 + 305 + /** 306 + * This is a model with one enum with escaped name 307 + */ 308 + export type ModelWithEnumWithHyphen = { 309 + 'foo-bar-baz-qux'?: '3.0'; 310 + }; 311 + 312 + /** 313 + * This is a model with one enum 314 + */ 315 + export type ModelWithEnumFromDescription = { 316 + /** 317 + * Success=1,Warning=2,Error=3 318 + */ 319 + test?: number; 320 + }; 321 + 322 + /** 323 + * This is a model with nested enums 324 + */ 325 + export type ModelWithNestedEnums = { 326 + dictionaryWithEnum?: { 327 + [key: string]: 'Success' | 'Warning' | 'Error'; 328 + }; 329 + dictionaryWithEnumFromDescription?: { 330 + [key: string]: number; 331 + }; 332 + arrayWithEnum?: Array<'Success' | 'Warning' | 'Error'>; 333 + arrayWithDescription?: Array<number>; 334 + /** 335 + * This is a simple enum with strings 336 + */ 337 + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; 338 + }; 339 + 340 + /** 341 + * This is a model with one property containing a reference 342 + */ 343 + export type ModelWithReference = { 344 + prop?: ModelWithProperties; 345 + }; 346 + 347 + /** 348 + * This is a model with one property containing an array 349 + */ 350 + export type ModelWithArrayReadOnlyAndWriteOnly = { 351 + prop?: Array<ModelWithReadOnlyAndWriteOnly>; 352 + propWithFile?: Array<Blob | File>; 353 + propWithNumber?: Array<number>; 354 + }; 355 + 356 + /** 357 + * This is a model with one property containing an array 358 + */ 359 + export type ModelWithArray = { 360 + prop?: Array<ModelWithString>; 361 + propWithFile?: Array<Blob | File>; 362 + propWithNumber?: Array<number>; 363 + }; 364 + 365 + /** 366 + * This is a model with one property containing a dictionary 367 + */ 368 + export type ModelWithDictionary = { 369 + prop?: { 370 + [key: string]: string; 371 + }; 372 + }; 373 + 374 + /** 375 + * This is a deprecated model with a deprecated property 376 + * @deprecated 377 + */ 378 + export type DeprecatedModel = { 379 + /** 380 + * This is a deprecated property 381 + * @deprecated 382 + */ 383 + prop?: string; 384 + }; 385 + 386 + /** 387 + * This is a model with one property containing a circular reference 388 + */ 389 + export type ModelWithCircularReference = { 390 + prop?: ModelWithCircularReference; 391 + }; 392 + 393 + /** 394 + * This is a model with one property with a 'one of' relationship 395 + */ 396 + export type CompositionWithOneOf = { 397 + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; 398 + }; 399 + 400 + /** 401 + * This is a model with one property with a 'one of' relationship where the options are not $ref 402 + */ 403 + export type CompositionWithOneOfAnonymous = { 404 + propA?: { 405 + propA?: string; 406 + } | string | number; 407 + }; 408 + 409 + /** 410 + * Circle 411 + */ 412 + export type ModelCircle = { 413 + kind: string; 414 + radius?: number; 415 + }; 416 + 417 + /** 418 + * Square 419 + */ 420 + export type ModelSquare = { 421 + kind: string; 422 + sideLength?: number; 423 + }; 424 + 425 + /** 426 + * This is a model with one property with a 'one of' relationship where the options are not $ref 427 + */ 428 + export type CompositionWithOneOfDiscriminator = ({ 429 + kind?: 'circle'; 430 + } & ModelCircle) | ({ 431 + kind?: 'square'; 432 + } & ModelSquare); 433 + 434 + /** 435 + * This is a model with one property with a 'any of' relationship 436 + */ 437 + export type CompositionWithAnyOf = { 438 + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; 439 + }; 440 + 441 + /** 442 + * This is a model with one property with a 'any of' relationship where the options are not $ref 443 + */ 444 + export type CompositionWithAnyOfAnonymous = { 445 + propA?: { 446 + propA?: string; 447 + } | string | number; 448 + }; 449 + 450 + /** 451 + * This is a model with nested 'any of' property with a type null 452 + */ 453 + export type CompositionWithNestedAnyAndTypeNull = { 454 + propA?: Array<ModelWithDictionary | null> | Array<ModelWithArray | null>; 455 + }; 456 + 457 + export type _3eNum1Период = 'Bird' | 'Dog'; 458 + 459 + export type ConstValue = 'ConstValue'; 460 + 461 + /** 462 + * This is a model with one property with a 'any of' relationship where the options are not $ref 463 + */ 464 + export type CompositionWithNestedAnyOfAndNull = { 465 + propA?: Array<_3eNum1Период | ConstValue> | null; 466 + }; 467 + 468 + /** 469 + * This is a model with one property with a 'one of' relationship 470 + */ 471 + export type CompositionWithOneOfAndNullable = { 472 + propA?: { 473 + boolean?: boolean; 474 + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; 475 + }; 476 + 477 + /** 478 + * This is a model that contains a simple dictionary within composition 479 + */ 480 + export type CompositionWithOneOfAndSimpleDictionary = { 481 + propA?: boolean | { 482 + [key: string]: number; 483 + }; 484 + }; 485 + 486 + /** 487 + * This is a model that contains a dictionary of simple arrays within composition 488 + */ 489 + export type CompositionWithOneOfAndSimpleArrayDictionary = { 490 + propA?: boolean | { 491 + [key: string]: Array<boolean>; 492 + }; 493 + }; 494 + 495 + /** 496 + * This is a model that contains a dictionary of complex arrays (composited) within composition 497 + */ 498 + export type CompositionWithOneOfAndComplexArrayDictionary = { 499 + propA?: boolean | { 500 + [key: string]: Array<number | string>; 501 + }; 502 + }; 503 + 504 + /** 505 + * This is a model with one property with a 'all of' relationship 506 + */ 507 + export type CompositionWithAllOfAndNullable = { 508 + propA?: ({ 509 + boolean?: boolean; 510 + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; 511 + }; 512 + 513 + /** 514 + * This is a model with one property with a 'any of' relationship 515 + */ 516 + export type CompositionWithAnyOfAndNullable = { 517 + propA?: { 518 + boolean?: boolean; 519 + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; 520 + }; 521 + 522 + /** 523 + * This is a base model with two simple optional properties 524 + */ 525 + export type CompositionBaseModel = { 526 + firstName?: string; 527 + lastname?: string; 528 + }; 529 + 530 + /** 531 + * This is a model that extends the base model 532 + */ 533 + export type CompositionExtendedModel = CompositionBaseModel & { 534 + age: number; 535 + firstName: string; 536 + lastname: string; 537 + }; 538 + 539 + /** 540 + * This is a model with one nested property 541 + */ 542 + export type ModelWithProperties = { 543 + required: string; 544 + readonly requiredAndReadOnly: string; 545 + requiredAndNullable: string | null; 546 + string?: string; 547 + number?: number; 548 + boolean?: boolean; 549 + reference?: ModelWithString; 550 + 'property with space'?: string; 551 + default?: string; 552 + try?: string; 553 + readonly '@namespace.string'?: string; 554 + readonly '@namespace.integer'?: number; 555 + }; 556 + 557 + /** 558 + * This is a model with one nested property 559 + */ 560 + export type ModelWithNestedProperties = { 561 + readonly first: { 562 + readonly second: { 563 + readonly third: string | null; 564 + } | null; 565 + } | null; 566 + }; 567 + 568 + /** 569 + * This is a model with duplicated properties 570 + */ 571 + export type ModelWithDuplicateProperties = { 572 + prop?: ModelWithString; 573 + }; 574 + 575 + /** 576 + * This is a model with ordered properties 577 + */ 578 + export type ModelWithOrderedProperties = { 579 + zebra?: string; 580 + apple?: string; 581 + hawaii?: string; 582 + }; 583 + 584 + /** 585 + * This is a model with duplicated imports 586 + */ 587 + export type ModelWithDuplicateImports = { 588 + propA?: ModelWithString; 589 + propB?: ModelWithString; 590 + propC?: ModelWithString; 591 + }; 592 + 593 + /** 594 + * This is a model that extends another model 595 + */ 596 + export type ModelThatExtends = ModelWithString & { 597 + propExtendsA?: string; 598 + propExtendsB?: ModelWithString; 599 + }; 600 + 601 + /** 602 + * This is a model that extends another model 603 + */ 604 + export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { 605 + propExtendsC?: string; 606 + propExtendsD?: ModelWithString; 607 + }; 608 + 609 + /** 610 + * This is a model that contains a some patterns 611 + */ 612 + export type ModelWithPattern = { 613 + key: string; 614 + name: string; 615 + readonly enabled?: boolean; 616 + readonly modified?: string; 617 + id?: string; 618 + text?: string; 619 + patternWithSingleQuotes?: string; 620 + patternWithNewline?: string; 621 + patternWithBacktick?: string; 622 + }; 623 + 624 + export type File = { 625 + readonly id?: string; 626 + readonly updated_at?: string; 627 + readonly created_at?: string; 628 + mime: string; 629 + readonly file?: string; 630 + }; 631 + 632 + export type Default = { 633 + name?: string; 634 + }; 635 + 636 + export type Pageable = { 637 + page?: number; 638 + size?: number; 639 + sort?: Array<string>; 640 + }; 641 + 642 + /** 643 + * This is a free-form object without additionalProperties. 644 + */ 645 + export type FreeFormObjectWithoutAdditionalProperties = { 646 + [key: string]: unknown; 647 + }; 648 + 649 + /** 650 + * This is a free-form object with additionalProperties: true. 651 + */ 652 + export type FreeFormObjectWithAdditionalPropertiesEqTrue = { 653 + [key: string]: unknown; 654 + }; 655 + 656 + /** 657 + * This is a free-form object with additionalProperties: {}. 658 + */ 659 + export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = {}; 660 + 661 + export type ModelWithConst = { 662 + String?: 'String'; 663 + number?: 0; 664 + null?: null; 665 + withType?: 'Some string'; 666 + }; 667 + 668 + /** 669 + * This is a model with one property and additionalProperties: true 670 + */ 671 + export type ModelWithAdditionalPropertiesEqTrue = { 672 + /** 673 + * This is a simple string property 674 + */ 675 + prop?: string; 676 + [key: string]: unknown | string | undefined; 677 + }; 678 + 679 + export type NestedAnyOfArraysNullable = { 680 + nullableArray?: Array<string | boolean> | null; 681 + }; 682 + 683 + export type CompositionWithOneOfAndProperties = ({ 684 + foo: SimpleParameter; 685 + } | { 686 + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; 687 + }) & { 688 + baz: number | null; 689 + qux: number; 690 + }; 691 + 692 + /** 693 + * An object that can be null 694 + */ 695 + export type NullableObject = { 696 + foo?: string; 697 + } | null; 698 + 699 + /** 700 + * Some % character 701 + */ 702 + export type CharactersInDescription = string; 703 + 704 + export type ModelWithNullableObject = { 705 + data?: NullableObject; 706 + }; 707 + 708 + export type ModelWithOneOfEnum = { 709 + foo: 'Bar'; 710 + } | { 711 + foo: 'Baz'; 712 + } | { 713 + foo: 'Qux'; 714 + } | { 715 + content: string; 716 + foo: 'Quux'; 717 + } | { 718 + content: [ 719 + string, 720 + string 721 + ]; 722 + foo: 'Corge'; 723 + }; 724 + 725 + export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; 726 + 727 + export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; 728 + 729 + export type ModelWithNestedArrayEnumsData = { 730 + foo?: Array<ModelWithNestedArrayEnumsDataFoo>; 731 + bar?: Array<ModelWithNestedArrayEnumsDataBar>; 732 + }; 733 + 734 + export type ModelWithNestedArrayEnums = { 735 + array_strings?: Array<string>; 736 + data?: ModelWithNestedArrayEnumsData; 737 + }; 738 + 739 + export type ModelWithNestedCompositionEnums = { 740 + foo?: ModelWithNestedArrayEnumsDataFoo; 741 + }; 742 + 743 + export type ModelWithReadOnlyAndWriteOnly = { 744 + foo: string; 745 + readonly bar: string; 746 + baz: string; 747 + }; 748 + 749 + export type ModelWithConstantSizeArray = [ 750 + number, 751 + number 752 + ]; 753 + 754 + export type ModelWithAnyOfConstantSizeArray = [ 755 + number | string, 756 + number | string, 757 + number | string 758 + ]; 759 + 760 + export type ModelWithPrefixItemsConstantSizeArray = [ 761 + ModelWithInteger, 762 + number | string, 763 + string 764 + ]; 765 + 766 + export type ModelWithAnyOfConstantSizeArrayNullable = [ 767 + number | null | string, 768 + number | null | string, 769 + number | null | string 770 + ]; 771 + 772 + export type ModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = [ 773 + number | Import, 774 + number | Import 775 + ]; 776 + 777 + export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ 778 + number & string, 779 + number & string 780 + ]; 781 + 782 + export type ModelWithNumericEnumUnion = { 783 + /** 784 + * Период 785 + */ 786 + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; 787 + }; 788 + 789 + /** 790 + * Some description with `back ticks` 791 + */ 792 + export type ModelWithBackticksInDescription = { 793 + /** 794 + * The template `that` should be used for parsing and importing the contents of the CSV file. 795 + * 796 + * <br/><p>There is one placeholder currently supported:<ul> <li><b>${x}</b> - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)</li></ul><p>Example of a correct JSON template:</p> 797 + * <pre> 798 + * [ 799 + * { 800 + * "resourceType": "Asset", 801 + * "identifier": { 802 + * "name": "${1}", 803 + * "domain": { 804 + * "name": "${2}", 805 + * "community": { 806 + * "name": "Some Community" 807 + * } 808 + * } 809 + * }, 810 + * "attributes" : { 811 + * "00000000-0000-0000-0000-000000003115" : [ { 812 + * "value" : "${3}" 813 + * } ], 814 + * "00000000-0000-0000-0000-000000000222" : [ { 815 + * "value" : "${4}" 816 + * } ] 817 + * } 818 + * } 819 + * ] 820 + * </pre> 821 + */ 822 + template?: string; 823 + }; 824 + 825 + export type ModelWithOneOfAndProperties = (SimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串) & { 826 + baz: number | null; 827 + qux: number; 828 + }; 829 + 830 + /** 831 + * Model used to test deduplication strategy (unused) 832 + */ 833 + export type ParameterSimpleParameterUnused = string; 834 + 835 + /** 836 + * Model used to test deduplication strategy 837 + */ 838 + export type PostServiceWithEmptyTagResponse = string; 839 + 840 + /** 841 + * Model used to test deduplication strategy 842 + */ 843 + export type PostServiceWithEmptyTagResponse2 = string; 844 + 845 + /** 846 + * Model used to test deduplication strategy 847 + */ 848 + export type DeleteFooData = string; 849 + 850 + /** 851 + * Model used to test deduplication strategy 852 + */ 853 + export type DeleteFooData2 = string; 854 + 855 + /** 856 + * Model with restricted keyword name 857 + */ 858 + export type Import = string; 859 + 860 + export type SchemaWithFormRestrictedKeys = { 861 + description?: string; 862 + 'x-enum-descriptions'?: string; 863 + 'x-enum-varnames'?: string; 864 + 'x-enumNames'?: string; 865 + title?: string; 866 + object?: { 867 + description?: string; 868 + 'x-enum-descriptions'?: string; 869 + 'x-enum-varnames'?: string; 870 + 'x-enumNames'?: string; 871 + title?: string; 872 + }; 873 + array?: Array<{ 874 + description?: string; 875 + 'x-enum-descriptions'?: string; 876 + 'x-enum-varnames'?: string; 877 + 'x-enumNames'?: string; 878 + title?: string; 879 + }>; 880 + }; 881 + 882 + /** 883 + * This schema was giving PascalCase transformations a hard time 884 + */ 885 + export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { 886 + /** 887 + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. 888 + */ 889 + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; 890 + }; 891 + 892 + /** 893 + * This schema was giving PascalCase transformations a hard time 894 + */ 895 + export type IoK8sApimachineryPkgApisMetaV1Preconditions = { 896 + /** 897 + * Specifies the target ResourceVersion 898 + */ 899 + resourceVersion?: string; 900 + /** 901 + * Specifies the target UID. 902 + */ 903 + uid?: string; 904 + }; 905 + 906 + export type AdditionalPropertiesUnknownIssue = { 907 + [key: string]: string | number; 908 + }; 909 + 910 + export type AdditionalPropertiesUnknownIssue2 = { 911 + [key: string]: string | number; 912 + }; 913 + 914 + export type AdditionalPropertiesUnknownIssue3 = string & { 915 + entries: { 916 + [key: string]: AdditionalPropertiesUnknownIssue; 917 + }; 918 + }; 919 + 920 + export type AdditionalPropertiesIntegerIssue = { 921 + value: number; 922 + [key: string]: number; 923 + }; 924 + 925 + export type OneOfAllOfIssue = ((ConstValue | GenericSchemaDuplicateIssue1SystemBoolean) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemString; 926 + 927 + export type GenericSchemaDuplicateIssue1SystemBoolean = { 928 + item?: boolean; 929 + error?: string | null; 930 + readonly hasError?: boolean; 931 + data?: { 932 + [key: string]: never; 933 + }; 934 + }; 935 + 936 + export type GenericSchemaDuplicateIssue1SystemString = { 937 + item?: string | null; 938 + error?: string | null; 939 + readonly hasError?: boolean; 940 + }; 941 + 942 + /** 943 + * This is a reusable parameter 944 + */ 945 + export type SimpleParameter = string; 946 + 947 + /** 948 + * Parameter with illegal characters 949 + */ 950 + export type XFooBar = ModelWithString; 951 + 952 + /** 953 + * A reusable request body 954 + */ 955 + export type SimpleRequestBody = ModelWithString; 956 + 957 + /** 958 + * A reusable request body 959 + */ 960 + export type SimpleFormData = ModelWithString; 961 + 962 + export type ExportData = { 963 + body?: never; 964 + path?: never; 965 + query?: never; 966 + url: '/api/v{api-version}/no-tag'; 967 + }; 968 + 969 + export type ImportData = { 970 + body: ModelWithReadOnlyAndWriteOnly | ModelWithArrayReadOnlyAndWriteOnly; 971 + path?: never; 972 + query?: never; 973 + url: '/api/v{api-version}/no-tag'; 974 + }; 975 + 976 + export type ImportResponses = { 977 + /** 978 + * Success 979 + */ 980 + 200: ModelFromZendesk; 981 + /** 982 + * Default success response 983 + */ 984 + default: ModelWithReadOnlyAndWriteOnly; 985 + }; 986 + 987 + export type ImportResponse = ImportResponses[keyof ImportResponses]; 988 + 989 + export type ApiVVersionODataControllerCountData = { 990 + body?: never; 991 + path?: never; 992 + query?: never; 993 + url: '/api/v{api-version}/simple/$count'; 994 + }; 995 + 996 + export type ApiVVersionODataControllerCountResponses = { 997 + /** 998 + * Success 999 + */ 1000 + 200: ModelFromZendesk; 1001 + }; 1002 + 1003 + export type ApiVVersionODataControllerCountResponse = ApiVVersionODataControllerCountResponses[keyof ApiVVersionODataControllerCountResponses]; 1004 + 1005 + export type GetApiVbyApiVersionSimpleOperationData = { 1006 + body?: never; 1007 + path: { 1008 + /** 1009 + * foo in method 1010 + */ 1011 + foo_param: string; 1012 + }; 1013 + query?: never; 1014 + url: '/api/v{api-version}/simple:operation'; 1015 + }; 1016 + 1017 + export type GetApiVbyApiVersionSimpleOperationErrors = { 1018 + /** 1019 + * Default error response 1020 + */ 1021 + default: ModelWithBoolean; 1022 + }; 1023 + 1024 + export type GetApiVbyApiVersionSimpleOperationError = GetApiVbyApiVersionSimpleOperationErrors[keyof GetApiVbyApiVersionSimpleOperationErrors]; 1025 + 1026 + export type GetApiVbyApiVersionSimpleOperationResponses = { 1027 + /** 1028 + * Response is a simple number 1029 + */ 1030 + 200: number; 1031 + }; 1032 + 1033 + export type GetApiVbyApiVersionSimpleOperationResponse = GetApiVbyApiVersionSimpleOperationResponses[keyof GetApiVbyApiVersionSimpleOperationResponses]; 1034 + 1035 + export type DeleteCallWithoutParametersAndResponseData = { 1036 + body?: never; 1037 + path?: never; 1038 + query?: never; 1039 + url: '/api/v{api-version}/simple'; 1040 + }; 1041 + 1042 + export type GetCallWithoutParametersAndResponseData = { 1043 + body?: never; 1044 + path?: never; 1045 + query?: never; 1046 + url: '/api/v{api-version}/simple'; 1047 + }; 1048 + 1049 + export type HeadCallWithoutParametersAndResponseData = { 1050 + body?: never; 1051 + path?: never; 1052 + query?: never; 1053 + url: '/api/v{api-version}/simple'; 1054 + }; 1055 + 1056 + export type OptionsCallWithoutParametersAndResponseData = { 1057 + body?: never; 1058 + path?: never; 1059 + query?: never; 1060 + url: '/api/v{api-version}/simple'; 1061 + }; 1062 + 1063 + export type PatchCallWithoutParametersAndResponseData = { 1064 + body?: never; 1065 + path?: never; 1066 + query?: never; 1067 + url: '/api/v{api-version}/simple'; 1068 + }; 1069 + 1070 + export type PostCallWithoutParametersAndResponseData = { 1071 + body?: never; 1072 + path?: never; 1073 + query?: never; 1074 + url: '/api/v{api-version}/simple'; 1075 + }; 1076 + 1077 + export type PutCallWithoutParametersAndResponseData = { 1078 + body?: never; 1079 + path?: never; 1080 + query?: never; 1081 + url: '/api/v{api-version}/simple'; 1082 + }; 1083 + 1084 + export type DeleteFooData3 = { 1085 + body?: never; 1086 + headers: { 1087 + /** 1088 + * Parameter with illegal characters 1089 + */ 1090 + 'x-Foo-Bar': ModelWithString; 1091 + }; 1092 + path: { 1093 + /** 1094 + * foo in method 1095 + */ 1096 + foo_param: string; 1097 + /** 1098 + * bar in method 1099 + */ 1100 + BarParam: string; 1101 + }; 1102 + query?: never; 1103 + url: '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}'; 1104 + }; 1105 + 1106 + export type CallWithDescriptionsData = { 1107 + body?: never; 1108 + path?: never; 1109 + query?: { 1110 + /** 1111 + * Testing multiline comments in string: First line 1112 + * Second line 1113 + * 1114 + * Fourth line 1115 + */ 1116 + parameterWithBreaks?: string; 1117 + /** 1118 + * Testing backticks in string: `backticks` and ```multiple backticks``` should work 1119 + */ 1120 + parameterWithBackticks?: string; 1121 + /** 1122 + * Testing slashes in string: \backwards\\\ and /forwards/// should work 1123 + */ 1124 + parameterWithSlashes?: string; 1125 + /** 1126 + * Testing expression placeholders in string: ${expression} should work 1127 + */ 1128 + parameterWithExpressionPlaceholders?: string; 1129 + /** 1130 + * Testing quotes in string: 'single quote''' and "double quotes""" should work 1131 + */ 1132 + parameterWithQuotes?: string; 1133 + /** 1134 + * Testing reserved characters in string: * inline * and ** inline ** should work 1135 + */ 1136 + parameterWithReservedCharacters?: string; 1137 + }; 1138 + url: '/api/v{api-version}/descriptions'; 1139 + }; 1140 + 1141 + export type DeprecatedCallData = { 1142 + body?: never; 1143 + headers: { 1144 + /** 1145 + * This parameter is deprecated 1146 + * @deprecated 1147 + */ 1148 + parameter: DeprecatedModel | null; 1149 + }; 1150 + path?: never; 1151 + query?: never; 1152 + url: '/api/v{api-version}/parameters/deprecated'; 1153 + }; 1154 + 1155 + export type CallWithParametersData = { 1156 + /** 1157 + * This is the parameter that goes into the body 1158 + */ 1159 + body: { 1160 + [key: string]: unknown; 1161 + } | null; 1162 + headers: { 1163 + /** 1164 + * This is the parameter that goes into the header 1165 + */ 1166 + parameterHeader: string | null; 1167 + }; 1168 + path: { 1169 + /** 1170 + * This is the parameter that goes into the path 1171 + */ 1172 + parameterPath: string | null; 1173 + /** 1174 + * api-version should be required in standalone clients 1175 + */ 1176 + 'api-version': string | null; 1177 + }; 1178 + query: { 1179 + foo_ref_enum?: ModelWithNestedArrayEnumsDataFoo; 1180 + foo_all_of_enum: ModelWithNestedArrayEnumsDataFoo; 1181 + /** 1182 + * This is the parameter that goes into the query params 1183 + */ 1184 + cursor: string | null; 1185 + }; 1186 + url: '/api/v{api-version}/parameters/{parameterPath}'; 1187 + }; 1188 + 1189 + export type CallWithWeirdParameterNamesData = { 1190 + /** 1191 + * This is the parameter that goes into the body 1192 + */ 1193 + body: ModelWithString | null; 1194 + headers: { 1195 + /** 1196 + * This is the parameter that goes into the request header 1197 + */ 1198 + 'parameter.header': string | null; 1199 + }; 1200 + path: { 1201 + /** 1202 + * This is the parameter that goes into the path 1203 + */ 1204 + 'parameter.path.1'?: string; 1205 + /** 1206 + * This is the parameter that goes into the path 1207 + */ 1208 + 'parameter-path-2'?: string; 1209 + /** 1210 + * This is the parameter that goes into the path 1211 + */ 1212 + 'PARAMETER-PATH-3'?: string; 1213 + /** 1214 + * api-version should be required in standalone clients 1215 + */ 1216 + 'api-version': string | null; 1217 + }; 1218 + query: { 1219 + /** 1220 + * This is the parameter with a reserved keyword 1221 + */ 1222 + default?: string; 1223 + /** 1224 + * This is the parameter that goes into the request query params 1225 + */ 1226 + 'parameter-query': string | null; 1227 + }; 1228 + url: '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}'; 1229 + }; 1230 + 1231 + export type GetCallWithOptionalParamData = { 1232 + /** 1233 + * This is a required parameter 1234 + */ 1235 + body: ModelWithOneOfEnum; 1236 + path?: never; 1237 + query?: { 1238 + /** 1239 + * This is an optional parameter 1240 + */ 1241 + page?: number; 1242 + }; 1243 + url: '/api/v{api-version}/parameters'; 1244 + }; 1245 + 1246 + export type PostCallWithOptionalParamData = { 1247 + /** 1248 + * This is an optional parameter 1249 + */ 1250 + body?: { 1251 + offset?: number | null; 1252 + }; 1253 + path?: never; 1254 + query: { 1255 + /** 1256 + * This is a required parameter 1257 + */ 1258 + parameter: Pageable; 1259 + }; 1260 + url: '/api/v{api-version}/parameters'; 1261 + }; 1262 + 1263 + export type PostCallWithOptionalParamResponses = { 1264 + /** 1265 + * Response is a simple number 1266 + */ 1267 + 200: number; 1268 + /** 1269 + * Success 1270 + */ 1271 + 204: void; 1272 + }; 1273 + 1274 + export type PostCallWithOptionalParamResponse = PostCallWithOptionalParamResponses[keyof PostCallWithOptionalParamResponses]; 1275 + 1276 + export type PostApiVbyApiVersionRequestBodyData = { 1277 + /** 1278 + * A reusable request body 1279 + */ 1280 + body?: SimpleRequestBody; 1281 + path?: never; 1282 + query?: { 1283 + /** 1284 + * This is a reusable parameter 1285 + */ 1286 + parameter?: string; 1287 + }; 1288 + url: '/api/v{api-version}/requestBody'; 1289 + }; 1290 + 1291 + export type PostApiVbyApiVersionFormDataData = { 1292 + /** 1293 + * A reusable request body 1294 + */ 1295 + body?: SimpleFormData; 1296 + path?: never; 1297 + query?: { 1298 + /** 1299 + * This is a reusable parameter 1300 + */ 1301 + parameter?: string; 1302 + }; 1303 + url: '/api/v{api-version}/formData'; 1304 + }; 1305 + 1306 + export type CallWithDefaultParametersData = { 1307 + body?: never; 1308 + path?: never; 1309 + query?: { 1310 + /** 1311 + * This is a simple string with default value 1312 + */ 1313 + parameterString?: string | null; 1314 + /** 1315 + * This is a simple number with default value 1316 + */ 1317 + parameterNumber?: number | null; 1318 + /** 1319 + * This is a simple boolean with default value 1320 + */ 1321 + parameterBoolean?: boolean | null; 1322 + /** 1323 + * This is a simple enum with default value 1324 + */ 1325 + parameterEnum?: 'Success' | 'Warning' | 'Error'; 1326 + /** 1327 + * This is a simple model with default value 1328 + */ 1329 + parameterModel?: ModelWithString | null; 1330 + }; 1331 + url: '/api/v{api-version}/defaults'; 1332 + }; 1333 + 1334 + export type CallWithDefaultOptionalParametersData = { 1335 + body?: never; 1336 + path?: never; 1337 + query?: { 1338 + /** 1339 + * This is a simple string that is optional with default value 1340 + */ 1341 + parameterString?: string; 1342 + /** 1343 + * This is a simple number that is optional with default value 1344 + */ 1345 + parameterNumber?: number; 1346 + /** 1347 + * This is a simple boolean that is optional with default value 1348 + */ 1349 + parameterBoolean?: boolean; 1350 + /** 1351 + * This is a simple enum that is optional with default value 1352 + */ 1353 + parameterEnum?: 'Success' | 'Warning' | 'Error'; 1354 + /** 1355 + * This is a simple model that is optional with default value 1356 + */ 1357 + parameterModel?: ModelWithString; 1358 + }; 1359 + url: '/api/v{api-version}/defaults'; 1360 + }; 1361 + 1362 + export type CallToTestOrderOfParamsData = { 1363 + body?: never; 1364 + path?: never; 1365 + query: { 1366 + /** 1367 + * This is a optional string with default 1368 + */ 1369 + parameterOptionalStringWithDefault?: string; 1370 + /** 1371 + * This is a optional string with empty default 1372 + */ 1373 + parameterOptionalStringWithEmptyDefault?: string; 1374 + /** 1375 + * This is a optional string with no default 1376 + */ 1377 + parameterOptionalStringWithNoDefault?: string; 1378 + /** 1379 + * This is a string with default 1380 + */ 1381 + parameterStringWithDefault: string; 1382 + /** 1383 + * This is a string with empty default 1384 + */ 1385 + parameterStringWithEmptyDefault: string; 1386 + /** 1387 + * This is a string with no default 1388 + */ 1389 + parameterStringWithNoDefault: string; 1390 + /** 1391 + * This is a string that can be null with no default 1392 + */ 1393 + parameterStringNullableWithNoDefault?: string | null; 1394 + /** 1395 + * This is a string that can be null with default 1396 + */ 1397 + parameterStringNullableWithDefault?: string | null; 1398 + }; 1399 + url: '/api/v{api-version}/defaults'; 1400 + }; 1401 + 1402 + export type DuplicateNameData = { 1403 + body?: never; 1404 + path?: never; 1405 + query?: never; 1406 + url: '/api/v{api-version}/duplicate'; 1407 + }; 1408 + 1409 + export type DuplicateName2Data = { 1410 + body?: never; 1411 + path?: never; 1412 + query?: never; 1413 + url: '/api/v{api-version}/duplicate'; 1414 + }; 1415 + 1416 + export type DuplicateName3Data = { 1417 + body?: never; 1418 + path?: never; 1419 + query?: never; 1420 + url: '/api/v{api-version}/duplicate'; 1421 + }; 1422 + 1423 + export type DuplicateName4Data = { 1424 + body?: never; 1425 + path?: never; 1426 + query?: never; 1427 + url: '/api/v{api-version}/duplicate'; 1428 + }; 1429 + 1430 + export type CallWithNoContentResponseData = { 1431 + body?: never; 1432 + path?: never; 1433 + query?: never; 1434 + url: '/api/v{api-version}/no-content'; 1435 + }; 1436 + 1437 + export type CallWithNoContentResponseResponses = { 1438 + /** 1439 + * Success 1440 + */ 1441 + 204: void; 1442 + }; 1443 + 1444 + export type CallWithNoContentResponseResponse = CallWithNoContentResponseResponses[keyof CallWithNoContentResponseResponses]; 1445 + 1446 + export type CallWithResponseAndNoContentResponseData = { 1447 + body?: never; 1448 + path?: never; 1449 + query?: never; 1450 + url: '/api/v{api-version}/multiple-tags/response-and-no-content'; 1451 + }; 1452 + 1453 + export type CallWithResponseAndNoContentResponseResponses = { 1454 + /** 1455 + * Response is a simple number 1456 + */ 1457 + 200: number; 1458 + /** 1459 + * Success 1460 + */ 1461 + 204: void; 1462 + }; 1463 + 1464 + export type CallWithResponseAndNoContentResponseResponse = CallWithResponseAndNoContentResponseResponses[keyof CallWithResponseAndNoContentResponseResponses]; 1465 + 1466 + export type DummyAData = { 1467 + body?: never; 1468 + path?: never; 1469 + query?: never; 1470 + url: '/api/v{api-version}/multiple-tags/a'; 1471 + }; 1472 + 1473 + export type DummyAResponses = { 1474 + 200: _400; 1475 + }; 1476 + 1477 + export type DummyAResponse = DummyAResponses[keyof DummyAResponses]; 1478 + 1479 + export type DummyBData = { 1480 + body?: never; 1481 + path?: never; 1482 + query?: never; 1483 + url: '/api/v{api-version}/multiple-tags/b'; 1484 + }; 1485 + 1486 + export type DummyBResponses = { 1487 + /** 1488 + * Success 1489 + */ 1490 + 204: void; 1491 + }; 1492 + 1493 + export type DummyBResponse = DummyBResponses[keyof DummyBResponses]; 1494 + 1495 + export type CallWithResponseData = { 1496 + body?: never; 1497 + path?: never; 1498 + query?: never; 1499 + url: '/api/v{api-version}/response'; 1500 + }; 1501 + 1502 + export type CallWithResponseResponses = { 1503 + default: Import; 1504 + }; 1505 + 1506 + export type CallWithResponseResponse = CallWithResponseResponses[keyof CallWithResponseResponses]; 1507 + 1508 + export type CallWithDuplicateResponsesData = { 1509 + body?: never; 1510 + path?: never; 1511 + query?: never; 1512 + url: '/api/v{api-version}/response'; 1513 + }; 1514 + 1515 + export type CallWithDuplicateResponsesErrors = { 1516 + /** 1517 + * Message for 500 error 1518 + */ 1519 + 500: ModelWithStringError; 1520 + /** 1521 + * Message for 501 error 1522 + */ 1523 + 501: ModelWithStringError; 1524 + /** 1525 + * Message for 502 error 1526 + */ 1527 + 502: ModelWithStringError; 1528 + /** 1529 + * Message for 4XX errors 1530 + */ 1531 + '4XX': DictionaryWithArray; 1532 + /** 1533 + * Default error response 1534 + */ 1535 + default: ModelWithBoolean; 1536 + }; 1537 + 1538 + export type CallWithDuplicateResponsesError = CallWithDuplicateResponsesErrors[keyof CallWithDuplicateResponsesErrors]; 1539 + 1540 + export type CallWithDuplicateResponsesResponses = { 1541 + /** 1542 + * Message for 200 response 1543 + */ 1544 + 200: ModelWithBoolean & ModelWithInteger; 1545 + /** 1546 + * Message for 201 response 1547 + */ 1548 + 201: ModelWithString; 1549 + /** 1550 + * Message for 202 response 1551 + */ 1552 + 202: ModelWithString; 1553 + }; 1554 + 1555 + export type CallWithDuplicateResponsesResponse = CallWithDuplicateResponsesResponses[keyof CallWithDuplicateResponsesResponses]; 1556 + 1557 + export type CallWithResponsesData = { 1558 + body?: never; 1559 + path?: never; 1560 + query?: never; 1561 + url: '/api/v{api-version}/response'; 1562 + }; 1563 + 1564 + export type CallWithResponsesErrors = { 1565 + /** 1566 + * Message for 500 error 1567 + */ 1568 + 500: ModelWithStringError; 1569 + /** 1570 + * Message for 501 error 1571 + */ 1572 + 501: ModelWithStringError; 1573 + /** 1574 + * Message for 502 error 1575 + */ 1576 + 502: ModelWithStringError; 1577 + /** 1578 + * Message for default response 1579 + */ 1580 + default: ModelWithStringError; 1581 + }; 1582 + 1583 + export type CallWithResponsesError = CallWithResponsesErrors[keyof CallWithResponsesErrors]; 1584 + 1585 + export type CallWithResponsesResponses = { 1586 + /** 1587 + * Message for 200 response 1588 + */ 1589 + 200: { 1590 + readonly '@namespace.string'?: string; 1591 + readonly '@namespace.integer'?: number; 1592 + readonly value?: Array<ModelWithString>; 1593 + }; 1594 + /** 1595 + * Message for 201 response 1596 + */ 1597 + 201: ModelThatExtends; 1598 + /** 1599 + * Message for 202 response 1600 + */ 1601 + 202: ModelThatExtendsExtends; 1602 + }; 1603 + 1604 + export type CallWithResponsesResponse = CallWithResponsesResponses[keyof CallWithResponsesResponses]; 1605 + 1606 + export type CollectionFormatData = { 1607 + body?: never; 1608 + path?: never; 1609 + query: { 1610 + /** 1611 + * This is an array parameter that is sent as csv format (comma-separated values) 1612 + */ 1613 + parameterArrayCSV: Array<string> | null; 1614 + /** 1615 + * This is an array parameter that is sent as ssv format (space-separated values) 1616 + */ 1617 + parameterArraySSV: Array<string> | null; 1618 + /** 1619 + * This is an array parameter that is sent as tsv format (tab-separated values) 1620 + */ 1621 + parameterArrayTSV: Array<string> | null; 1622 + /** 1623 + * This is an array parameter that is sent as pipes format (pipe-separated values) 1624 + */ 1625 + parameterArrayPipes: Array<string> | null; 1626 + /** 1627 + * This is an array parameter that is sent as multi format (multiple parameter instances) 1628 + */ 1629 + parameterArrayMulti: Array<string> | null; 1630 + }; 1631 + url: '/api/v{api-version}/collectionFormat'; 1632 + }; 1633 + 1634 + export type TypesData = { 1635 + body?: never; 1636 + path?: { 1637 + /** 1638 + * This is a number parameter 1639 + */ 1640 + id?: number; 1641 + }; 1642 + query: { 1643 + /** 1644 + * This is a number parameter 1645 + */ 1646 + parameterNumber: number; 1647 + /** 1648 + * This is a string parameter 1649 + */ 1650 + parameterString: string | null; 1651 + /** 1652 + * This is a boolean parameter 1653 + */ 1654 + parameterBoolean: boolean | null; 1655 + /** 1656 + * This is an object parameter 1657 + */ 1658 + parameterObject: { 1659 + [key: string]: unknown; 1660 + } | null; 1661 + /** 1662 + * This is an array parameter 1663 + */ 1664 + parameterArray: Array<string> | null; 1665 + /** 1666 + * This is a dictionary parameter 1667 + */ 1668 + parameterDictionary: { 1669 + [key: string]: unknown; 1670 + } | null; 1671 + /** 1672 + * This is an enum parameter 1673 + */ 1674 + parameterEnum: 'Success' | 'Warning' | 'Error' | null; 1675 + }; 1676 + url: '/api/v{api-version}/types'; 1677 + }; 1678 + 1679 + export type TypesResponses = { 1680 + /** 1681 + * Response is a simple number 1682 + */ 1683 + 200: number; 1684 + /** 1685 + * Response is a simple string 1686 + */ 1687 + 201: string; 1688 + /** 1689 + * Response is a simple boolean 1690 + */ 1691 + 202: boolean; 1692 + /** 1693 + * Response is a simple object 1694 + */ 1695 + 203: { 1696 + [key: string]: unknown; 1697 + }; 1698 + }; 1699 + 1700 + export type TypesResponse = TypesResponses[keyof TypesResponses]; 1701 + 1702 + export type UploadFileData = { 1703 + body: Blob | File; 1704 + path: { 1705 + /** 1706 + * api-version should be required in standalone clients 1707 + */ 1708 + 'api-version': string | null; 1709 + }; 1710 + query?: never; 1711 + url: '/api/v{api-version}/upload'; 1712 + }; 1713 + 1714 + export type UploadFileResponses = { 1715 + 200: boolean; 1716 + }; 1717 + 1718 + export type UploadFileResponse = UploadFileResponses[keyof UploadFileResponses]; 1719 + 1720 + export type FileResponseData = { 1721 + body?: never; 1722 + path: { 1723 + id: string; 1724 + /** 1725 + * api-version should be required in standalone clients 1726 + */ 1727 + 'api-version': string; 1728 + }; 1729 + query?: never; 1730 + url: '/api/v{api-version}/file/{id}'; 1731 + }; 1732 + 1733 + export type FileResponseResponses = { 1734 + /** 1735 + * Success 1736 + */ 1737 + 200: Blob | File; 1738 + }; 1739 + 1740 + export type FileResponseResponse = FileResponseResponses[keyof FileResponseResponses]; 1741 + 1742 + export type ComplexTypesData = { 1743 + body?: never; 1744 + path?: never; 1745 + query: { 1746 + /** 1747 + * Parameter containing object 1748 + */ 1749 + parameterObject: { 1750 + first?: { 1751 + second?: { 1752 + third?: string; 1753 + }; 1754 + }; 1755 + }; 1756 + /** 1757 + * Parameter containing reference 1758 + */ 1759 + parameterReference: ModelWithString; 1760 + }; 1761 + url: '/api/v{api-version}/complex'; 1762 + }; 1763 + 1764 + export type ComplexTypesErrors = { 1765 + /** 1766 + * 400 `server` error 1767 + */ 1768 + 400: unknown; 1769 + /** 1770 + * 500 server error 1771 + */ 1772 + 500: unknown; 1773 + }; 1774 + 1775 + export type ComplexTypesResponses = { 1776 + /** 1777 + * Successful response 1778 + */ 1779 + 200: Array<ModelWithString>; 1780 + }; 1781 + 1782 + export type ComplexTypesResponse = ComplexTypesResponses[keyof ComplexTypesResponses]; 1783 + 1784 + export type MultipartResponseData = { 1785 + body?: never; 1786 + path?: never; 1787 + query?: never; 1788 + url: '/api/v{api-version}/multipart'; 1789 + }; 1790 + 1791 + export type MultipartResponseResponses = { 1792 + /** 1793 + * OK 1794 + */ 1795 + 200: { 1796 + file?: Blob | File; 1797 + metadata?: { 1798 + foo?: string; 1799 + bar?: string; 1800 + }; 1801 + }; 1802 + }; 1803 + 1804 + export type MultipartResponseResponse = MultipartResponseResponses[keyof MultipartResponseResponses]; 1805 + 1806 + export type MultipartRequestData = { 1807 + body?: { 1808 + content?: Blob | File; 1809 + data?: ModelWithString | null; 1810 + }; 1811 + path?: never; 1812 + query?: never; 1813 + url: '/api/v{api-version}/multipart'; 1814 + }; 1815 + 1816 + export type ComplexParamsData = { 1817 + body?: { 1818 + readonly key: string | null; 1819 + name: string | null; 1820 + enabled?: boolean; 1821 + type: 'Monkey' | 'Horse' | 'Bird'; 1822 + listOfModels?: Array<ModelWithString> | null; 1823 + listOfStrings?: Array<string> | null; 1824 + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; 1825 + readonly user?: { 1826 + readonly id?: number; 1827 + readonly name?: string | null; 1828 + }; 1829 + }; 1830 + path: { 1831 + id: number; 1832 + /** 1833 + * api-version should be required in standalone clients 1834 + */ 1835 + 'api-version': string; 1836 + }; 1837 + query?: never; 1838 + url: '/api/v{api-version}/complex/{id}'; 1839 + }; 1840 + 1841 + export type ComplexParamsResponses = { 1842 + /** 1843 + * Success 1844 + */ 1845 + 200: ModelWithString; 1846 + }; 1847 + 1848 + export type ComplexParamsResponse = ComplexParamsResponses[keyof ComplexParamsResponses]; 1849 + 1850 + export type CallWithResultFromHeaderData = { 1851 + body?: never; 1852 + path?: never; 1853 + query?: never; 1854 + url: '/api/v{api-version}/header'; 1855 + }; 1856 + 1857 + export type CallWithResultFromHeaderErrors = { 1858 + /** 1859 + * 400 server error 1860 + */ 1861 + 400: unknown; 1862 + /** 1863 + * 500 server error 1864 + */ 1865 + 500: unknown; 1866 + }; 1867 + 1868 + export type CallWithResultFromHeaderResponses = { 1869 + /** 1870 + * Successful response 1871 + */ 1872 + 200: unknown; 1873 + }; 1874 + 1875 + export type TestErrorCodeData = { 1876 + body?: never; 1877 + path?: never; 1878 + query: { 1879 + /** 1880 + * Status code to return 1881 + */ 1882 + status: number; 1883 + }; 1884 + url: '/api/v{api-version}/error'; 1885 + }; 1886 + 1887 + export type TestErrorCodeErrors = { 1888 + /** 1889 + * Custom message: Internal Server Error 1890 + */ 1891 + 500: unknown; 1892 + /** 1893 + * Custom message: Not Implemented 1894 + */ 1895 + 501: unknown; 1896 + /** 1897 + * Custom message: Bad Gateway 1898 + */ 1899 + 502: unknown; 1900 + /** 1901 + * Custom message: Service Unavailable 1902 + */ 1903 + 503: unknown; 1904 + }; 1905 + 1906 + export type TestErrorCodeResponses = { 1907 + /** 1908 + * Custom message: Successful response 1909 + */ 1910 + 200: unknown; 1911 + }; 1912 + 1913 + export type NonAsciiæøåÆøÅöôêÊ字符串Data = { 1914 + body?: never; 1915 + path?: never; 1916 + query: { 1917 + /** 1918 + * Dummy input param 1919 + */ 1920 + nonAsciiParamæøåÆØÅöôêÊ: number; 1921 + }; 1922 + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; 1923 + }; 1924 + 1925 + export type NonAsciiæøåÆøÅöôêÊ字符串Responses = { 1926 + /** 1927 + * Successful response 1928 + */ 1929 + 200: Array<NonAsciiStringæøåÆøÅöôêÊ字符串>; 1930 + }; 1931 + 1932 + export type NonAsciiæøåÆøÅöôêÊ字符串Response = NonAsciiæøåÆøÅöôêÊ字符串Responses[keyof NonAsciiæøåÆøÅöôêÊ字符串Responses]; 1933 + 1934 + export type PutWithFormUrlEncodedData = { 1935 + body: ArrayWithStrings; 1936 + path?: never; 1937 + query?: never; 1938 + url: '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串'; 1939 + };
+8 -7
packages/openapi-ts/test/openapi-ts.config.ts
··· 7 7 name: '@hey-api/client-fetch', 8 8 // name: 'legacy/xhr', 9 9 }, 10 - // experimentalParser: true, 10 + experimentalParser: true, 11 11 input: { 12 12 // exclude: '^#/components/schemas/ModelWithCircularReference$', 13 13 // include: 14 14 // '^(#/components/schemas/import|#/paths/api/v{api-version}/simple/options)$', 15 - // path: './test/spec/3.0.x/validators.json', 16 - path: './test/spec/v3-transforms.json', 15 + path: './packages/openapi-ts/test/spec/3.0.x/full.json', 16 + // path: './test/spec/v3-transforms.json', 17 17 // path: 'https://mongodb-mms-prod-build-server.s3.amazonaws.com/openapi/2caffd88277a4e27c95dcefc7e3b6a63a3b03297-v2-2023-11-15.json', 18 18 // path: 'https://raw.githubusercontent.com/swagger-api/swagger-petstore/master/src/main/resources/openapi.yaml', 19 19 }, ··· 42 42 name: '@hey-api/sdk', 43 43 // operationId: false, 44 44 // serviceNameBuilder: '^Parameters', 45 + throwOnError: true, 45 46 // transformer: '@hey-api/transformers', 46 47 transformer: true, 47 48 // validator: 'zod', ··· 75 76 }, 76 77 ], 77 78 // useOptions: false, 78 - watch: { 79 - enabled: true, 80 - interval: 1_000, 81 - }, 79 + // watch: { 80 + // enabled: true, 81 + // interval: 1_000, 82 + // }, 82 83 });
+12
packages/openapi-ts/test/plugins.test.ts
··· 205 205 }, 206 206 { 207 207 config: createConfig({ 208 + output: 'throwOnError', 209 + plugins: [ 210 + { 211 + name: '@hey-api/sdk', 212 + throwOnError: true, 213 + }, 214 + ], 215 + }), 216 + description: 'generate SDK that throws on error', 217 + }, 218 + { 219 + config: createConfig({ 208 220 output: 'default', 209 221 plugins: ['fastify'], 210 222 }),